2008-03-14 Martin Baulig <martin@ximian.com>
[mono.git] / mcs / mcs / ChangeLog
1 2008-03-14  Martin Baulig  <martin@ximian.com>
2
3         * symbolwriter.cs
4         (SymbolWriter): Make this a public static class.
5
6         * codegen.cs
7         (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
8         class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
9
10 2008-03-14  Marek Safar  <marek.safar@gmail.com>
11
12         A fix for bug #370577
13         * statement.cs, lambda.cs: Added extra limitations when dealing with void
14         return type.
15         
16 2008-03-14  Marek Safar  <marek.safar@gmail.com>
17
18         * typemanager.cs (CSharpName): Made 250 times faster.
19
20 2008-03-13  Marek Safar  <marek.safar@gmail.com>
21
22         * ecore.cs, expression.cs: Emit conversion for ET shift argument.
23         
24 2008-03-12  Marek Safar  <marek.safar@gmail.com>
25
26         * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
27         crash when predefined field does not exist.
28         
29 2008-03-12  Marek Safar  <marek.safar@gmail.com>
30
31         * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
32         
33 2008-03-12  Marek Safar  <marek.safar@gmail.com>
34
35         * class.cs (FixedField): Don't crash when contructors are missing.
36
37 2008-03-11  Marek Safar  <marek.safar@gmail.com>
38
39         * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
40         convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
41         check internal types accessibility for internal and external types.
42         Replaced EnumToUnderlying by GetEnumUnderlyingType.
43
44 2008-03-11  Marek Safar  <marek.safar@gmail.com>
45
46         * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
47         convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
48         attribute.cs, statement: Use corect instance of predefined types (work
49         related to #364674).
50
51 2008-03-07  Marek Safar  <marek.safar@gmail.com>
52
53         * expression.cs (TypeOfVoid): Fixed predefined method initialization.
54         
55 2008-03-07  Marek Safar  <marek.safar@gmail.com>
56
57         * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, 
58         class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
59         expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
60         predefined types clean up, delayed predefined types members initialization
61         (work related to #364674).
62
63 2008-03-05  Marek Safar  <marek.safar@gmail.com>
64
65         * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
66         
67 2008-03-05  Marek Safar  <marek.safar@gmail.com>
68
69         * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
70         delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
71         predefined types clean up (work related to #364674).
72
73 2008-03-04  Marek Safar  <marek.safar@gmail.com>
74
75         * ecore.cs: Print an error message instead of throwing exception.
76         
77 2008-03-04  Marek Safar  <marek.safar@gmail.com>
78
79         * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
80         expression.cs, statement.cs: Unififed null literal representation.
81
82 2008-03-03  Marek Safar  <marek.safar@gmail.com>
83
84         * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
85         expression.cs: Refactored binary operators resolve phase and improved speed.
86         The nullable code is still missing and won't work correctly, more fixes
87         required.
88
89         It also fixes #323726, #324312, #324248, and many other unreported issues.
90
91 2008-02-29  Zoltan Varga  <vargaz@gmail.com>
92
93         * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs' 
94         instead of 'gmcs'.
95
96 2008-02-27  Marek Safar  <marek.safar@gmail.com>
97
98         * ecore.cs: Clean-up and split BetterConversion.
99         
100 2008-02-25  Raja R Harinath  <harinath@hurrynot.org>
101
102         Fix #363791
103         * enum.cs (EnumMember.Value): Only access 'value' if
104         ResolveValue says it's ok.
105         (EnumMember.DoResolveValue): Don't set prev_member.value.
106         (Enum.GetDefinition): Reverse arguments of Equals --
107         EnumMember.Value can return 'null'.
108
109         * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
110
111 2008-02-22  Marek Safar  <marek.safar@gmail.com>
112
113         * generic.cs, expression.cs: More ongoing work on expression trees.
114         
115 2008-02-21  Marek Safar  <marek.safar@gmail.com>
116
117         * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
118         handle missing matches when mutiple operators exist.
119         
120 2008-02-20  Marek Safar  <marek.safar@gmail.com>
121
122         A fix for bug #363218
123         * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
124         initializers.
125         
126 2008-02-20  Marek Safar  <marek.safar@gmail.com>
127
128         * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
129         update. This time to deal correctly with SideEffectConstant expression used
130         as an argument for another constant folding.
131
132 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
133
134         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
135         MethodBuilder.
136
137 2008-02-19  Marek Safar  <marek.safar@gmail.com>
138
139         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
140
141 2008-02-19  Marek Safar  <marek.safar@gmail.com>
142
143         A fix for bug #328136
144         * expression.cs: Do not fold immediately LogicalAnd operators when the left
145         side is a false constant, because we still need to evaluate the right-hand
146         side.
147
148         * statement.cs (If): Emit two types of boolean constants (simple constant,
149         side-effect constant).
150
151 2008-02-19  Marek Safar  <marek.safar@gmail.com>
152
153         * constant.cs (SideEffectConstant): Don't emit boolean constant.
154
155         * expression.cs: Fold immediately LogicalAnd operators when both sides are
156         constants.
157
158 2008-02-18  Marek Safar  <marek.safar@gmail.com>
159
160         A fix for bug #361457
161         * ecore.cs (IsApplicable): Params methods have lower priority.
162
163         * support.cs: Return correct parameter modifier for params types.
164
165 2008-02-18  Marek Safar  <marek.safar@gmail.com>
166
167         * generic.cs (TypeParameter): Cache attribute target name.
168
169         * support.cs: Removed unused variable.
170
171         * typemanager.cs: Removed debugging leftover.
172
173         * ecore.cs: Use local type instead of a property;
174
175         * class.cs (VerifyMembers): Consider also parent to test whether type member
176         is local or public.
177
178         * expression.cs (FullMethodDesc): Removed.
179
180         * attribute.cs (IsValidArgumentType): Made static.
181
182 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
183
184         Cleanup to be more readable.
185         * Makefile (GMCS_PROFILE): Remove.
186         (COMPILER_NAME): New helper.
187
188 2008-02-15  Miguel de Icaza  <miguel@novell.com>
189
190         * cs-tokenizer.cs: if a conditional expression happens inside a
191         (...) this also means that we do not need to de-ambiguate between
192         an parenthesized expression and a cast.
193
194         Fixes 346484.
195
196         * constant.cs (SideEffectConstant): a constant value that happens
197         to have a side effect.
198
199         Fixes the build regressions introduced by the fix for #359789
200
201 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
202
203         * expression.cs (Conditional.Emit): when emitting the ternary
204         operator, use local variables to generate code verifiable code.
205
206         The verifier cannot infer that the type on stack before the
207         stloc.0 is executed is of type ParentB. This happens because the
208         stack merge algorithm uses only parent types when deciding which
209         is the common type.  This is described in Part III 1.8.1.3 of ECMA
210         335.
211
212         This code compiled with mcs is not verifiable under MS. The MS
213         verifier picks the first common interface of Foo and Bar, which is
214         wrong, but doesn't use a full join type of the 2 interfaces.
215
216         CSC uses a clever hack to compile such code in a verifiable
217         way. It stores the intermediate values in a local variable with
218         the expected type.
219
220         Fixes: #358102
221
222 2008-02-14  Miguel de Icaza  <miguel@novell.com>
223
224         * expression.cs: Do not fold BitwiseAnd operators when the left
225         side is a false constant, because we still need to evaluate the
226         right-hand side.
227
228         Fixes #359789
229
230         * support.cs: Instead of throwing an InternalErrorException when
231         the position of the stream is outside the boundary of our buffer,
232         reset the state of the reader, and restart the reading from the
233         beginning of the file.
234
235 2008-02-14  Marek Safar  <marek.safar@gmail.com>
236
237         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
238
239 2008-02-14  Marek Safar  <marek.safar@gmail.com>
240
241         A fix for bug #361686
242         * decl.cs: A protected types used inside a private class which parents
243         derives from the protected class are accessible.
244
245 2008-02-13  Marek Safar  <marek.safar@gmail.com>
246
247         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
248         the parameterless constructor.
249
250 2008-02-13  Marek Safar  <marek.safar@gmail.com>
251
252         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
253         lookup methods to use standard member cache when doing member lookup.
254
255 2008-02-12  Marek Safar  <marek.safar@gmail.com>
256
257         * driver.cs: Don't report full path for referenced module as assembly error.
258
259 2008-02-12  Marek Safar  <marek.safar@gmail.com>
260
261         * Makefile: Fixed `qh' target to work on all machines.
262
263         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
264         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
265         and HasElementType with TypeManager implementation.
266
267 2008-02-08  Marek Safar  <marek.safar@gmail.com>
268
269         A fix for bugs #325134, #359749
270         * expression.cs, ecore.cs: Try to resolve an extension method even if the
271         first binds point to non-method member expression.
272
273 2008-02-08  Marek Safar  <marek.safar@gmail.com>
274
275         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
276
277 2008-02-08  Marek Safar  <marek.safar@gmail.com>
278
279         A fix for bugs #321394, #323028
280         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
281         Reworked naive IsAccessibleAs implementation to handle nested types.
282
283 2008-02-05  Jb Evain  <jbevain@novell.com>
284
285         * class.cs: use generic type comparison for parameters
286         as well.
287
288 2008-02-05  Marek Safar  <marek.safar@gmail.com>
289
290         A fix for bug #325372
291         * class.cs: Use generic type comparison when testing method signatures.
292
293 2008-02-05  Marek Safar  <marek.safar@gmail.com>
294
295         A fix for bug #357047
296         * ecore.cs: Applied C# 3.0 changes to better conversion.
297
298 2008-02-05  Marek Safar  <marek.safar@gmail.com>
299
300         A fix for bug #358374
301         * cs-parser.jay: Correctly set modifiers for all constructor types.
302
303 2008-02-04  Marek Safar  <marek.safar@gmail.com>
304
305         A fix for bug #355251
306         * generic.cs: Added base class constraint based type inference.
307
308 2008-02-01  Marek Safar  <marek.safar@gmail.com>
309
310         A fix for bug #357255
311         * decl.cs: One more missing visibility check.
312
313 2008-02-01  Marek Safar  <marek.safar@gmail.com>
314
315         * support.cs: Fixed broken return.
316
317 2008-01-25  Marek Safar  <marek.safar@gmail.com>
318
319         * report.cs: Correctly reset warnings count after probing.
320
321 2008-01-25  Martin Baulig  <martin@ximian.com>
322
323         * namespace.cs
324         (NamespaceEntry.SymbolFileID): Make this work again after
325         MemberName.ToString() is gone.
326
327 2008-01-25  Marek Safar  <marek.safar@gmail.com>
328
329         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
330         expressions.
331
332 2008-01-25  Marek Safar  <marek.safar@gmail.com>
333
334         * generic.cs: Use full implicit conversion for type inference fixing.
335
336 2008-01-24  Marek Safar  <marek.safar@gmail.com>
337
338         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
339         Fixed user operator conversions.
340
341 2008-01-24  Marek Safar  <marek.safar@gmail.com>
342
343         * generic.cs: Do nullable type to null comparison optimization during
344         resolve phase.
345
346 2008-01-24  Marek Safar  <marek.safar@gmail.com>
347
348         A fix for bug #355163
349         * generic.cs: Enabled l-value resolve on nullable expressions.
350
351 2008-01-24  Marek Safar  <marek.safar@gmail.com>
352
353         A fix for bug #353986
354         * class.cs: Ingore static ctors with parameters for any further checks.
355
356 2008-01-24  Marek Safar  <marek.safar@gmail.com>
357
358         A fix for bug #354310
359         * namespace.cs: Removed redundant check.
360
361 2008-01-24  Marek Safar  <marek.safar@gmail.com>
362
363         A fix for bug #354928
364         * expression.cs: ElementInitializers can be resolved only once.
365
366 2008-01-24  Marek Safar  <marek.safar@gmail.com>
367
368         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
369         Condition expressions.
370
371 2008-01-23  Marek Safar  <marek.safar@gmail.com>
372
373         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
374
375 2008-01-22  Marek Safar  <marek.safar@gmail.com>
376
377         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
378         not allowed.
379
380         * generic.cs: Implemented coalesce expression.
381
382 2008-01-22  Marek Safar  <marek.safar@gmail.com>
383
384         A fix for bug #355145
385         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
386         expression tree type inference.
387
388 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
389
390         Fix #354663
391         * expression.cs (Binary.IsUnsignedType): Fix typo.
392
393 2008-01-22  Marek Safar  <marek.safar@gmail.com>
394
395         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
396
397 2008-01-22  Marek Safar  <marek.safar@gmail.com>
398
399         A fix for bug #355161
400         * ecore.cs, expression.cs: Wider range of extension method supported
401         expressions.
402
403 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
404
405         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
406         AssemblyBuilder to operate in compiler context. Fixes mcs part of
407         bug #354970.
408
409 2008-01-22  Marek Safar  <marek.safar@gmail.com>
410
411         A fix for bug #355148
412         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
413
414 2008-01-22  Miguel de Icaza  <miguel@novell.com>
415
416         * expression.cs (CreateExpressionTree): Add support for or and
417         logical or, and indent following the coding conventions.
418
419         * typemanager.cs (LinqExpression): renamed from
420         ExpressionTreeManager, for a shorter name.
421
422         Use TypeManager.CoreLookupType to lookup types from our core
423         assemblies and turn those into "Type" variables.
424
425         Consumers that previously used "Namespace" and "Type" from this
426         class should instead use the TypeExpression which is a type that
427         is fully resolved (without involving the regular C# resolution
428         rules). 
429
430         This typically looks like this:
431
432         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
433         new MemberAccess (texpr, name, type_arguments, loc)
434
435         This avoids the problem in: #355178
436
437 2008-01-21  Marek Safar  <marek.safar@gmail.com>
438
439         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
440         feature in parser only as we do in other cases.
441         
442 2008-01-21  Marek Safar  <marek.safar@gmail.com>
443
444         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
445         typemanager.cs: A refactoring of params arguments to reuse existing
446         expressions (params -> array initializer) to emit params argument instead
447         of specialized handling.
448         It was required by expression tree implementation and it has other benefits
449         as well, we now apply same optimization for params arguments as we do for
450         array initializers.
451         
452 2008-01-18  Marek Safar  <marek.safar@gmail.com>
453
454         A fix for bug #353526
455         * generic.cs: A type inference of params arguments may not required any
456         temporary array creation.
457         
458 2008-01-18  Marek Safar  <marek.safar@gmail.com>
459
460         A fix for bug #353534
461         * generic.cs, ecore.cs, expression.cs: A method group type inference is
462         supported for delegates only.
463         
464 2008-01-18  Marek Safar  <marek.safar@gmail.com>
465
466         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
467         type for more than 1 candidates.
468         
469 2008-01-18  Marek Safar  <marek.safar@gmail.com>
470
471         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
472         expressions.
473         
474 2008-01-16  Marek Safar  <marek.safar@gmail.com>
475
476         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
477         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
478         operator) expressions. 
479                 
480 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
481
482         * statement.cs: Avoid declaring an IL variable for this_variable since it is
483         not accessed from the generated IL.
484
485 2008-01-14  Marek Safar  <marek.safar@gmail.com>
486
487         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
488         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
489         statement.cs: The first expression tree implementation drop, mostly
490         infrastructure work.
491
492 2008-01-14  Marek Safar  <marek.safar@gmail.com>
493
494         * ecore.cs (IsNestedChild): Refactored.
495
496 2008-01-11  Marek Safar  <marek.safar@gmail.com>
497
498         * lambda.cs: Don't use a cast on unknown expression statement.
499
500 2008-01-10  Geoff Norton  <gnorton@novell.com>
501
502         * cs-tokenizer.cs: One more token to distinguish between method and lambda
503         arguments
504
505 2008-01-09  Marek Safar  <marek.safar@gmail.com>
506
507         * doc.cs: Report better /doc crash details.
508         
509 2008-01-09  Marek Safar  <marek.safar@gmail.com>
510
511         A fix for bug #352536
512         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
513
514 2008-01-08  Marek Safar  <marek.safar@gmail.com>
515
516         A fix for bug #352287
517         * ecore.cs, expression.cs: Do `this' access checking in all member access
518         expressions.
519         
520 2008-01-08  Marek Safar  <marek.safar@gmail.com>
521
522         * rootcontext.cs, driver.cs: Switch to linq mode by default.
523         
524         * report.cs: Reset message stacks.
525         
526 2008-01-08  Marek Safar  <marek.safar@gmail.com>
527
528         * generic.cs (InferInPhases): Correctly calculate params position.
529         
530 2008-01-08  Marek Safar  <marek.safar@gmail.com>
531
532         * cs-tokenizer.cs: No need to parse full string when parsing lambda
533         arguments.
534
535 2008-01-07  Marek Safar  <marek.safar@gmail.com>
536
537         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
538         
539         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
540         
541         * driver.cs: Updated --help option.
542         
543 2008-01-07  Marek Safar  <marek.safar@gmail.com>
544
545         * generic.cs (InferParamsTypeArguments): Removed.
546         (InferInPhases): Add params type inference.
547         (LowerBoundInference): Fixed scoring mechanism.
548         
549         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
550         
551 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
552
553         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
554         byte array for unsigned "baked" assemblies.
555
556 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
557
558         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
559         array for assemblies that are not strongnamed.
560
561 2008-01-04  Marek Safar  <marek.safar@gmail.com>
562
563         A fix for bug #351481
564         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
565         declaring type for nested generic types.
566         
567 2008-01-04  Marek Safar  <marek.safar@gmail.com>
568
569         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
570         instead of ToString.
571         
572 2008-01-03  Marek Safar  <marek.safar@gmail.com>
573
574         A fix for bug #351047
575         * expression.cs (Binary.ResolveOperator): Allow equality operators between
576         null and structs only when equality and inequality operators are defined
577         either as an user-operators or predefined operators.
578         
579 2008-01-03  Marek Safar  <marek.safar@gmail.com>
580
581         A fix for bug #351047
582         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
583         
584 2008-01-03  Marek Safar  <marek.safar@gmail.com>
585
586         A fix for bug #351257
587         * cs-tokenizer.cs: Advance line number for '\r' correctly.
588         
589 2008-01-03  Marek Safar  <marek.safar@gmail.com>
590
591         A fix for bug #351157
592         * class.cs (Using): Fixed yet another broken cloning.
593         
594         (Block): Put back more sensible default value for statements.
595         
596 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
597
598         * codegen.cs: Allow AssemblyVersion with only major version component.
599         Fixes bug #351055.
600
601 2007-12-29  Marek Safar  <marek.safar@gmail.com>
602
603         A fix for bug #324654
604         * class.cs: Use FullName property as member name.
605
606 2007-12-28  Marek Safar  <marek.safar@gmail.com>
607
608         A fix for bug #342117
609         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
610         constructor constraint.
611
612 2007-12-28  Marek Safar  <marek.safar@gmail.com>
613
614         A fix for bug #338273
615         * class.cs (ProbertyBase): Access modifier checks are required for overrides
616         only.
617
618 2007-12-28  Marek Safar  <marek.safar@gmail.com>
619
620         A fix for bug #350839
621         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
622
623 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
624
625         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
626         GHOP:
627         
628         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
629
630         * statement.cs: Changed some Hashtables to use HybridDictionaries
631         instead. It was observed that some HashTables only contained a few
632         items in the vast majority of cases. Since HybridDictionary is
633         more efficient on small sets (<10 elements), "known_variables"
634         from class ExplicitBlock as well as "labels" and "constants " from
635         class Block were changed to HybridDictionaries. 
636
637         Atsai results: (56216kb->54987kb)
638
639         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
640
641
642 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
643
644         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
645         GHOP:
646         
647         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
648         
649         * expression.cs: foreach loop to for loop, saved on allocation of
650         enumerator (59333kb->59141kb)
651
652         * statement.cs. Changed foreach loops to for loops, saved on
653         allocation of enumerator (59141kb->59006kb)
654
655         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
656         when constructed with no specified capacity. This was causing a
657         few ArrayLists to allocate more memory than they would potentially
658         need in the Block class and MemberCache class. Setting the
659         ArrayLists to construct with a capacity of 1 saves some
660         memory. (56216kb->55585kb)
661
662 2007-12-27  Marek Safar  <marek.safar@gmail.com>
663
664         A fix for bug #347189 (2nd issue)
665         * expression.cs (MemberAccess): Nested type can be found in base non-generic
666         type.
667
668 2007-12-27  Miguel de Icaza  <miguel@novell.com>
669         
670         * report.cs: Do not use colors if stdout and stderr are not a
671         terminal.
672
673 2007-12-27  Marek Safar  <marek.safar@gmail.com>
674
675         A fix for bug #346998
676         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
677         overloads.
678
679 2007-12-27  Marek Safar  <marek.safar@gmail.com>
680
681         A fix for bug #343465
682         * class.cs: Explicit method name for nested types uses dots only.
683
684 2007-12-27  Marek Safar  <marek.safar@gmail.com>
685
686         A fix for bug #343707
687         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
688
689 2007-12-27  Marek Safar  <marek.safar@gmail.com>
690
691         * ecore.cs: Report type inference errors only when arguments count matches
692         parameter count.
693         
694         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
695         
696         * expression.cs, report.cs: New warning.
697         
698         * typemanager.cs: Catch anonymous method type too.
699
700 2007-12-23  Marek Safar  <marek.safar@gmail.com>
701
702         A fix for bug #346379
703         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
704
705 2007-12-23  Marek Safar  <marek.safar@gmail.com>
706
707         A fix for bug #347359
708         * expression.cs (Invocation): Don't resolve already resolved expression.
709
710 2007-12-23  Marek Safar  <marek.safar@gmail.com>
711
712         A fix for bug #347189
713         * class.cs (FixedField): Use non-dependent code only in the define phase.
714
715 2007-12-23  Marek Safar  <marek.safar@gmail.com>
716
717         A fix for bug #348076
718         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
719
720 2007-12-22  Marek Safar  <marek.safar@gmail.com>
721
722         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
723         discovered extension methods.
724
725 2007-12-22  Marek Safar  <marek.safar@gmail.com>
726
727         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
728         method.
729
730 2007-12-21  Miguel de Icaza  <miguel@novell.com>
731
732         * report.cs (ErrorMessage): Add support for using colors on
733         terminals that support it. 
734
735 2007-12-21  Marek Safar  <marek.safar@gmail.com>
736
737         * ecore.cs: Use information about expanded params for error reporting.
738
739 2007-12-21  Marek Safar  <marek.safar@gmail.com>
740
741         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
742         and logic for params overloads.
743         
744 2007-12-15  Miguel de Icaza  <miguel@novell.com>
745
746         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
747         as this is also created from the parser.  Fixes #349034
748
749 2007-12-12  Miguel de Icaza  <miguel@novell.com>
750
751         * statement.cs (Throw.CloneTo): it is valid to have empty
752         expressions for throw. 
753
754 2007-12-03  Marek Safar  <marek.safar@gmail.com>
755
756         * cs-parser.jay: Set delegate constraint parsing region correctly.
757
758 2007-12-03  Marek Safar  <marek.safar@gmail.com>
759
760         A fix for bug #345467
761         * typemanager.cs (IsEqual): Compare generic parameters position only.
762         
763 2007-11-28  Marek Safar  <marek.safar@gmail.com>
764
765         * expression.cs (BaseAccess): Type arguments can be null.
766
767 2007-11-27  Raja R Harinath  <harinath@gmail.com>
768
769         * statement.cs (Block.Resolve): Ensure flow-branching tree is
770         consistent even when an error has occured.
771         (Switch.Resolve): Likewise.
772
773 2007-11-22  Marek Safar  <marek.safar@gmail.com>
774
775         A fix for bug #334505
776         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
777         overrides.
778         
779 2007-11-22  Marek Safar  <marek.safar@gmail.com>
780
781         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
782         refactorings required to resolve extension methods correctly when mixing
783         generics and non-generics members.
784         
785 2007-11-20  Marek Safar  <marek.safar@gmail.com>
786
787         A fix for bug #342584
788         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
789         conversion.
790         
791 2007-11-19  Marek Safar  <marek.safar@gmail.com>
792
793         A fix for bug #342512
794         * delegate.cs: Use delegate argument expression when is available. Don't
795         emit virtual call when class is sealed.
796         
797 2007-11-16  Marek Safar  <marek.safar@gmail.com>
798
799         A fix for bug #325423
800         * assign.cs (FieldInitializer): Use resolved expression for emit.
801         
802         * class.cs: Print less confusing error message.
803         
804 2007-11-16  Marek Safar  <marek.safar@gmail.com>
805
806         * cs-tokenizer.cs: Removed GMCS ifdefs.
807         
808         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
809         mcs.
810         
811         * cs-parser.jay: Disabled nullable check.
812         
813         * generic-mcs: Copied more generic stuff.
814                 
815 2007-11-16  Marek Safar  <marek.safar@gmail.com>
816
817         * gcs-parser.jay: Merged to cs-parser.jay.
818         
819         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
820         * *.csproj, *.sources: Updated to use only jay parser file.
821
822 2007-11-16  Marek Safar  <marek.safar@gmail.com>
823
824         * gcs-parser.jay: Added nullable and default expression feature checks.
825         
826 2007-11-16  Marek Safar  <marek.safar@gmail.com>
827
828         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
829         it fixes many TODOs and hidden bugs.
830         
831         * expression: Removed duplicate error check.
832
833 2007-11-15  Marek Safar  <marek.safar@gmail.com>
834
835         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
836         implicitly type local variable only when it is used in a declaration.
837
838 2007-11-15  Marek Safar  <marek.safar@gmail.com>
839
840         * attribute.cs: Use CS0612 for empty strings.
841
842 2007-11-14  Marek Safar  <marek.safar@gmail.com>
843
844         * lambda.cs, statement.cs: Contextual return may act as a statement.
845
846 2007-11-14  Marek Safar  <marek.safar@gmail.com>
847
848         A fix for a regression cause by #324222
849         * class.cs: Don't report unused even when it implements an interface.
850         
851 2007-11-13  Marek Safar  <marek.safar@gmail.com>
852
853         A fix for bug #341205
854         * ecore.cs, expression.cs: Method group expression cannot do static
855         method access with an instance reference check before overloading takes
856         a place.
857         
858 2007-11-13  Marek Safar  <marek.safar@gmail.com>
859
860         A fix for bug #325359
861         * class.cs: Use predictable name for automatically generated property.
862         
863 2007-11-12  Marek Safar  <marek.safar@gmail.com>
864
865         A fix for bug #324996
866         * expression.cs (Is): Handle case where D is nullable and T is not
867         correctly.
868         
869         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
870         
871 2007-11-12  Marek Safar  <marek.safar@gmail.com>
872
873         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
874         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
875         Flush small error reporting changes.
876         
877 2007-11-09  Marek Safar  <marek.safar@gmail.com>
878
879         A fix for bug #324996
880         * expression.cs: Rewrote Is expression implementation to work with
881         generics, nullable types, anonymous method. A const result expression 
882         uses existing infrastructure instead of custom not fully-featured one.
883         
884 2007-11-08  Marek Safar  <marek.safar@gmail.com>
885
886         A fix for bug #340202
887         * class.cs: Consider generics for volatile field.
888
889 2007-11-08  Marek Safar  <marek.safar@gmail.com>
890
891         A fix for bug #335594
892         * expression.cs: Use conversion rules when handling string addition.
893         
894 2007-11-07  Marek Safar  <marek.safar@gmail.com>
895
896         A fix for bug #336651
897         * expression.cs: Fixed a crash when probing is on.
898         
899 2007-11-07  Marek Safar  <marek.safar@gmail.com>
900
901         A fix for bug #324242
902         * covert.cs: Added a conversion from any nullable-type with an 
903         underlying enum-type to the type System.Enum.
904         
905 2007-11-07  Marek Safar  <marek.safar@gmail.com>
906
907         A fix for bug #324222
908         * class.cs: Report all non-used event fields.
909         
910 2007-11-07  Marek Safar  <marek.safar@gmail.com>
911
912         A fix for bug #325161
913         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
914         qualifier for generic types.
915         
916 2007-11-07  Marek Safar  <marek.safar@gmail.com>
917
918         A fix for bug #322971
919         * expression.cs, ecore.cs: Added intermediate result value check for
920         indexers. 
921         
922 2007-11-07  Marek Safar  <marek.safar@gmail.com>
923
924         A fix for bug #324754
925         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
926         when it was requested.
927
928 2007-11-07  Marek Safar  <marek.safar@gmail.com>
929
930         A fix for bug #325101
931         * expression.cs: Do type not value comparison for `is' expression.
932
933 2007-11-07  Marek Safar  <marek.safar@gmail.com>
934
935         A fix for bug #320236
936         * convert.cs: Don't apply user conversion on underlying target type.
937
938 2007-11-06  Marek Safar  <marek.safar@gmail.com>
939
940         * expression.cs: Don't use unresolved expression for error reporting.
941  
942 2007-11-06  Marek Safar  <marek.safar@gmail.com>
943
944         A fix for bugs #337712, #324490
945         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
946         overloading resolution too.
947         
948         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
949         the process consistent and more robust.
950         
951         * expression.cs, linq.cs, report.cs: Update.
952
953 2007-11-02  Marek Safar  <marek.safar@gmail.com>
954
955         A fix for bug #332909
956         * attribute.cs: Resolve attributes in correct context using error
957         handling procedure.
958         
959         * rootcontext.cs: Define Obsolete attribute members as core members.
960         
961 2007-11-02  Marek Safar  <marek.safar@gmail.com>
962
963         * statement.cs: Removed unused methods.
964         
965 2007-10-31  Wade Berrier  <wberrier@novell.com>
966
967         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
968         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
969         during 'make dist')
970
971 2007-10-31  Marek Safar  <marek.safar@gmail.com>
972
973         A fix for bug #338102
974         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
975         methods registered as non-generics.
976         
977 2007-10-31  Marek Safar  <marek.safar@gmail.com>
978
979         A fix for bugs #337712, #324490
980         * delegate.cs: Delegate covariance and contravariance is not allowed for
981         value types.
982         
983 2007-10-31  Marek Safar  <marek.safar@gmail.com>
984
985         A fix for bug #337719 
986         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
987         `from' keyword.
988         
989 2007-10-30  Marek Safar  <marek.safar@gmail.com>
990  
991         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
992
993 2007-10-29  Marek Safar  <marek.safar@gmail.com>
994  
995         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
996         query expressions.
997
998 2007-10-29  Raja R Harinath  <rharinath@novell.com>
999
1000         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
1001
1002 2007-10-29  Marek Safar  <marek.safar@gmail.com>
1003  
1004         A fix for bug #334652
1005         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
1006         extension methods when we have not found the best candidate in normal
1007         container.
1008
1009 2007-10-27  Marek Safar  <marek.safar@gmail.com>
1010
1011         * AssemblyInfo.cs: Keep up-to-date.
1012
1013 2007-10-27  Marek Safar  <marek.safar@gmail.com>
1014
1015         * Makefile: Fixed generics compiler name.
1016         
1017 2007-10-27  Marek Safar  <marek.safar@gmail.com>
1018
1019         * lambda.test: removed, lambda parsing is done differently.
1020         
1021         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
1022
1023 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
1024
1025         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
1026
1027 2007-10-27  Marek Safar  <marek.safar@gmail.com>
1028
1029         * Makefile, *.sources : All C# compilers are in mcs folder.
1030         
1031         * *.cs: Use existing 2_1 define for smcs.
1032
1033 2007-10-26  Marek Safar  <marek.safar@gmail.com>
1034
1035         A fix for bug #335847
1036         * assign.cs, expression.cs: Couple of changes to avoid creating a
1037         temporary variable for each object initializer assignment statement. It
1038         simplifies struct initialization too, otherwise two temporary variables
1039         would be required.
1040         Implemented optimization of redundant default element initializers.
1041         
1042 2007-10-25  Marek Safar  <marek.safar@gmail.com>
1043
1044         A fix for bug #336766
1045         * expression.cs (Class.CheckBase): Use generic name when method is
1046         generic.
1047         
1048 2007-10-25  Marek Safar  <marek.safar@gmail.com>
1049
1050         A fix for bug #334737
1051         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
1052         variable and not variable argument for prepared copies.
1053
1054 2007-10-24  Marek Safar  <marek.safar@gmail.com>
1055
1056         A fix for bug #325110
1057         * class.cs, expression.cs, attribute.cs: Use open generic method when
1058         checking conditional attribute.
1059         
1060 2007-10-24  Marek Safar  <marek.safar@gmail.com>
1061
1062         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
1063         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
1064         FeatureIsNotAvailable.
1065
1066 2007-10-24  Marek Safar  <marek.safar@gmail.com>
1067
1068         ** C# 3.0 Partial methods
1069         
1070         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
1071         methods support. Because of member cache issue with generics only
1072         non-generics partial methods are fully supported.
1073         
1074 2007-10-23  Marek Safar  <marek.safar@gmail.com>
1075         
1076         * class.cs, decl.cs: Rewrote member overloads check to cope with 
1077         generics and to use member cache for member checking. It also improves
1078         performance and fixes remaining overloads issues.
1079         
1080 2007-10-20  Marek Safar  <marek.safar@gmail.com>
1081         
1082         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
1083         roottypes.cs, typemanager.cs:
1084                 
1085         A member cache creation logic changed to add members immediately and
1086         not rely on fallback. The member cache is now only prefered way
1087         how to access and find type declaration members. It saves 5 MB of memory
1088         during MWF compilation and makes code ready for more optimizations and
1089         clean-ups, it's also a pre-requirement for partial methods.
1090         
1091 2007-10-18  Raja R Harinath  <harinath@gmail.com>
1092
1093         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
1094         handling for generic parameters.
1095
1096 2007-10-15  Marek Safar  <marek.safar@gmail.com>
1097         
1098         * class.cs (FixedField): Removed redundant volatile check.
1099         
1100 2007-10-15  Marek Safar  <marek.safar@gmail.com>
1101         
1102         * class.cs, decl.cs: Fixed overload members verification to do only one
1103         check per possible collision.
1104         
1105 2007-10-13  Marek Safar  <marek.safar@gmail.com>
1106         
1107         A fix for bug #325478
1108         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
1109         and create only one disposable flags container.
1110         
1111 2007-10-12  Marek Safar  <marek.safar@gmail.com>
1112         
1113         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
1114         * statement.cs (Fixed): Fixed variables cloning.
1115         
1116 2007-10-12  Marek Safar  <marek.safar@gmail.com>
1117         
1118         A fix for bug #333342
1119         * class.cs (EventField): Don't mark value type event as synchronized. 
1120         
1121 2007-10-12  Marek Safar  <marek.safar@gmail.com>
1122         
1123         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
1124         inference to identify best candidate method correctly.
1125         (ProperyExpr): A range variable is read only and cannot be modified.
1126         
1127 2007-10-11  Marek Safar  <marek.safar@gmail.com>
1128         
1129         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
1130         logic to identify best candidate method correctly.
1131         
1132 2007-10-11  Marek Safar  <marek.safar@gmail.com>
1133         
1134         * location.cs (Equals, GetHashCode): Removed.
1135         
1136 2007-10-11  Marek Safar  <marek.safar@gmail.com>
1137         
1138         * report.cs: Implemented message recorder. It is used mainly for lambda
1139         expressions to capture otherwise swallowed error messages.
1140         
1141         * anonymous.cs, lambda.cs.cs: Do full parameters check.
1142
1143         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
1144         and not at the top.
1145         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
1146                 
1147         * expression.cs (MemberAccess): Always report lookup failure.
1148         
1149         * location.cs: Implemented Equals, GetHashCode.
1150         
1151         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
1152         
1153 2007-10-10  Jb Evain  <jbevain@novell.com>
1154
1155         * codegen.cs: re-enable assembly version check.
1156
1157 2007-10-09  Marek Safar  <marek.safar@gmail.com>
1158         
1159         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
1160         checks.
1161         
1162         * namespace.cs (UsingAlias): Do correct version check.
1163         
1164 2007-10-08  Marek Safar  <marek.safar@gmail.com>
1165         
1166         * expresison.cs, ecore.cs: Issue extension method error message when
1167         appropriate.
1168         
1169         * rootcontext.cs: Added ISO_2 compiler mode option.
1170
1171 2007-10-08  Marek Safar  <marek.safar@gmail.com>
1172         
1173         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
1174          message.
1175         
1176 2007-10-08  Marek Safar  <marek.safar@gmail.com>
1177         
1178         * attribute.cs (GetString, GetBoolean): Work with both literal and
1179         constant.
1180         
1181         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
1182         Moved method overload specific methods to MethodGroupExpr.
1183         
1184         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
1185         it should be less memory consuming.
1186         
1187 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
1188
1189         * codegen.cs: remove the assembly version check until the buildbot is
1190         fixed.
1191
1192 2007-10-07  Jb Evain  <jbevain@novell.com>
1193
1194         * attribute.cs (Attribute.GetString): if the value
1195         expression is a StringConstant, return its string value.
1196
1197 2007-10-07  Jb Evain  <jbevain@novell.com>
1198
1199         * typemanager.cs: add `assembly_version_attribute_type`.
1200         * codegen.cs: on attribute emission, check that the
1201         AssemblyVersionAttribute doesn't overflow.
1202
1203 2007-10-05  Marek Safar  <marek.safar@gmail.com>
1204         
1205         A fix for bug #324677
1206         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
1207         parent container of a scope container with currently resolved one. 
1208         
1209 2007-10-05  Marek Safar  <marek.safar@gmail.com>
1210         
1211         A fix for bug #325534
1212         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
1213         only.
1214         
1215 2007-10-05  Marek Safar  <marek.safar@gmail.com>
1216         
1217         A fix for bug #327504
1218         * class.cs (Operator.Define): Refactored implicit and explicit user
1219         operator conversion rules.
1220         
1221 2007-10-05  Marek Safar  <marek.safar@gmail.com>
1222         
1223         A fix for bug #327520
1224         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
1225         
1226 2007-10-04  Marek Safar  <marek.safar@gmail.com>
1227         
1228         A fix for bug #328022
1229         * class.cs (MethodData.Define): Use correct method to check whether
1230         a method implementents an accessor.
1231         
1232 2007-10-04  Marek Safar  <marek.safar@gmail.com>
1233         
1234         A fix for bug #330069
1235         * statement.cs (Fixed.Resolve): Read the first array element only when
1236         an array is instantiated. 
1237         
1238 2007-10-04  Marek Safar  <marek.safar@gmail.com>
1239         
1240         * expression.cs, assign.cs, generics.cs: Print correct operator when
1241         compound assignment is used.
1242         
1243 2007-10-04  Marek Safar  <marek.safar@gmail.com>
1244         
1245         A fix for bug #325841
1246         * expression.cs (ArrayAccess): Use full argument cloning only for
1247         string compound concatenation.
1248         
1249 2007-10-03  Marek Safar  <marek.safar@gmail.com>
1250         
1251         A fix for bug #328774
1252         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
1253         assignment.
1254         (PropertyExpr.EmitAssign): Fixed string concatenation compound
1255         assignment.
1256
1257 2007-10-03  Raja R Harinath  <rharinath@novell.com>
1258
1259         Fix #328490
1260         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
1261         Event accessibility checks here.  Remove some bogus code that
1262         accidently made GenericMethods work.
1263         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
1264
1265 2007-09-25  Marek Safar  <marek.safar@gmail.com>
1266         
1267         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
1268         
1269         * statement.cs (Block): Refactored AddVariable to allow error handling
1270         customization.
1271         
1272         * generic.cs: New stub.
1273         
1274 2007-09-23  Marek Safar  <marek.safar@gmail.com>
1275         
1276         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
1277         flag.
1278         
1279 2007-09-17  Marek Safar  <marek.safar@gmail.com>
1280
1281         * class.cs: Use partial container to record whether any partial part
1282         contains static field initializer and therefore default contructor has
1283         to be defined.
1284         
1285 2007-09-14  Marek Safar  <marek.safar@gmail.com>
1286
1287         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
1288         mono-list when only one of two partial parts has defined accessibility
1289         modifier.
1290         
1291 2007-09-14  Marek Safar  <marek.safar@gmail.com>
1292
1293         A fix for bug #82845
1294         
1295         * class.cs (TypeContainer): Set correct resolve context for all field
1296         initializers.
1297         
1298 2007-09-13  Marek Safar  <marek.safar@gmail.com>
1299
1300         * assign.cs: Fixed a crash when field is resolved twice with an error.
1301         
1302         * codegen.cs: Changed InFieldInitializer to be flag.
1303         
1304         * anonymous.cs, ecore.cs, expression.cs: Update after
1305         IsInFieldInitializer rename.
1306         
1307         * const.cs: Removed unused parameter.
1308         
1309         * class.cs: Changed the way how we resolve and emit field initializers.
1310         The field initilizers have to have access to contructor block to emit
1311         compiler generated code.
1312
1313 2007-09-13  Marek Safar  <marek.safar@gmail.com>
1314
1315         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
1316         generics use TypeContainer instead.
1317         
1318 2007-09-12  Marek Safar  <marek.safar@gmail.com>
1319         
1320         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
1321
1322         * lambda.cs (ResolveParameters): Use more powerful
1323         InflateGenericArgument.
1324         
1325         * parameters.cs: Better exception message.
1326                 
1327 2007-09-10  Marek Safar  <marek.safar@gmail.com>
1328
1329         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
1330         correct expression block type. 
1331         
1332         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
1333         
1334         * expression.cs (Invocation): Extracted method group resolve to
1335         DoResolveOverload.
1336         
1337 2007-09-07  Marek Safar  <marek.safar@gmail.com>
1338
1339         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
1340         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
1341         
1342         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
1343         generic extension methods.
1344
1345 2007-09-06  Marek Safar  <marek.safar@gmail.com>
1346
1347         A fix for bug #82676 (Do I get it right now?)
1348         * convert.cs (Binary.ResolveOperator): An interface is converted to the
1349         object before a standard conversion is applied.
1350         
1351 2007-09-06  Marek Safar  <marek.safar@gmail.com>
1352
1353         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
1354         #82676.
1355         
1356 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1357
1358         A fix for bug #82676
1359         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
1360         non-generic interface types.
1361         
1362 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1363
1364         A fix for bug #82690
1365         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
1366         
1367 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1368
1369         A fix for bug #82571
1370         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
1371         modifier for container based methods.
1372         
1373 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1374
1375         A fix for bug #82676
1376         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
1377         any interface-type T means to any of interface type T.
1378
1379 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1380
1381         * namespace.cs: We have 2 versions of System.Core assembly.
1382
1383 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1384
1385         A fix for bug #82652
1386         * class.cs (Class.GetClassBases): Compare types and not expressions.
1387
1388 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1389
1390         A fix for bug #82620
1391         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
1392         actually never worked before.
1393         (IndexerAccess): Emit prepared arguments before they are modified.
1394         
1395 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1396
1397         A fix for bug #82563
1398         * assign.cs: Revert wrong fix.
1399         
1400         * expression.cs (VariableReference.EmitAssign): Handle ref reference
1401         correctly.
1402         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
1403         Instead of ldelema/stdind we have to use temporary variables to handle
1404         cases like String.Concat (params string[]).
1405         
1406 2007-08-31  Marek Safar  <marek.safar@gmail.com>
1407
1408         * class.cs: EmitAttributes to Emit rename.
1409         
1410         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
1411         null.
1412         (MemberCore.HasClsCompliantAttribute): Don't depend on 
1413         GetClsCompliantAttributeValue execution.
1414         
1415 2007-08-31  Marek Safar  <marek.safar@gmail.com>
1416
1417         * anonymous.cs: Use shorter type prefix.
1418         
1419         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
1420         when exist.
1421         
1422         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
1423         variables when probing is on.
1424         
1425         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
1426         unresolved variables.
1427         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
1428         handle transparent identifiers.
1429         
1430 2007-08-26  Marek Safar  <marek.safar@gmail.com>
1431
1432         * attribute.cs (IsClsCompliant): Add nullable types test.
1433         
1434 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
1435
1436         * doc.cs : catch other types of exception than XmlException to
1437           report CS1570. Fixed bug #82565.
1438
1439 2007-08-23  Marek Safar  <marek.safar@gmail.com>
1440
1441         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
1442         The number of delegate parameters has to match.
1443         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
1444         arrays.
1445
1446 2007-08-21  Marek Safar  <marek.safar@gmail.com>
1447
1448         * anonymous.cs (AnonymousMethod): Generate private anonymous method
1449         to fix problem with private arguments.
1450
1451 2007-08-20  Marek Safar  <marek.safar@gmail.com>
1452
1453         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
1454         
1455         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
1456         
1457         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
1458         empty. Add cloning suport.
1459         
1460         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
1461
1462 2007-08-20  Marek Safar  <marek.safar@gmail.com>
1463
1464         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
1465         to create EmptyCast. It handles EmptyConstantCast specialization for
1466         constants.
1467         
1468 2007-08-18  Marek Safar  <marek.safar@gmail.com>
1469
1470         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
1471         (EmitArrayArgument): One routine for array arguments.
1472         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
1473         
1474 2007-08-17  Marek Safar  <marek.safar@gmail.com>
1475
1476         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
1477
1478 2007-08-17  Marek Safar  <marek.safar@gmail.com>
1479
1480         * anonymous.cs: MemberLookupFinal update.
1481
1482         * class.cs (ConstructorInitializer): Is expression based.
1483         
1484         * delegate.cs: MethodGroupExpr update.
1485         
1486         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
1487         messages.
1488         (Error_MemberLookupFailed): Customizable error override.
1489         (MethodGroupExpr): Keep queried type for later usage.
1490         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
1491         resolve.
1492         
1493         * expression.cs: Error_MemberLookupFailed refactoring.
1494         (New.DoResolve): Resolve as much as possible.
1495         (ElementInitializer.Error_MemberLookupFailed): Object initializer
1496         customization for invalid member types.
1497
1498         * statement.cs: MethodGroupExpr update.
1499         
1500 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1501
1502         * modifier.cs (Check): Check all modifiers and not only accessibility
1503         ones.
1504
1505 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1506
1507         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
1508         type and not an expression.
1509
1510 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1511
1512         * statement.cs (Catch.Clone): Type and variable can be null.
1513
1514 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1515
1516         A fix for bug #81979
1517         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
1518         I am really not sure whether this is the best fix.
1519         
1520         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
1521         only once.
1522         
1523 2007-08-14  Marek Safar  <marek.safar@gmail.com>
1524
1525         ** C# 3.0 Object and collection initializers (major re-write)
1526         
1527         * assign.cs (DoResolve): Initializers are not assign related.
1528         
1529         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
1530         used during collection or object initialization.
1531         
1532         * expression.cs (Error_InvalidArguments): Add initializers specific
1533         messages. More will come later because it requires some general
1534         refactoring.
1535         (New.DoResolve): Better error handling for unsafe types.
1536         (EmptyExpressionStatement): New class.
1537         (ElementInitializer): An object initializer expression.
1538         (CollectionElementInitializer): A collection initializer expression.
1539         (CollectionOrObjectInitializers): A block of object or collection
1540         initializers.
1541         (NewInitialize): New expression with element/object initializers.
1542         
1543         * statement.cs: Reverted object/collection initializer hacks.
1544         
1545         * typemanager.cs (CSharpName): Filter __arglist type.
1546         
1547 2007-08-09  Marek Safar  <marek.safar@gmail.com>
1548
1549         ** C# 3.0 Anonymous Types (update to the latest standard)
1550         
1551         * expression.cs (Binary.ResolveOperator): Threat all null based types
1552         same.
1553         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
1554         (AnonymousTypeParameter): Updated.
1555         
1556         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
1557         (AnonymousTypeClass): New anonymous type container.
1558         
1559         * class.cs (AddField): Return operation result.
1560         
1561         * generic.cs: Another empty TypeArguments overload.
1562         
1563         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
1564         are stored at top of normal hierarchy.
1565         
1566         * typemanager.cs (CSharpName): Filter anonymous types.
1567         
1568 2007-08-09  Marek Safar  <marek.safar@gmail.com>
1569
1570         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
1571         as single Concat call. How could we miss that :-(
1572         
1573 2007-08-08  Marek Safar  <marek.safar@gmail.com>
1574
1575         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
1576         
1577 2007-08-07  Miguel de Icaza  <miguel@novell.com>
1578
1579         * expression.cs: Fix the previous commit, the creation of the
1580         arguments array list needs also to be conditional on the arguments
1581         not being null.
1582
1583         * class.cs: Add a little bit of help to help narrow down problems.
1584
1585         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
1586         not try to copy in that case. 
1587
1588         * driver.cs: When building SMCS, include a new different set of
1589         default assemblies here.   Do this here so we can control whether
1590         to include the default assemblies with /noconfig.
1591
1592 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1593
1594         A fix for bug #81979
1595         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
1596         only.
1597
1598 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1599
1600         A fix for bug #82300
1601
1602         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
1603         we are in probing scope.
1604
1605 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1606
1607         A fix for bug #82301
1608
1609         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
1610         (Statement.CloneTo): Clone and not map children blocks.
1611
1612 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1613
1614         A fix for bug #82299
1615
1616         * expression.cs (LocalVariableReference.CloneTo): Remap local info
1617         variable too.
1618         
1619         * statement.cs (Statement.CloneTo): Clone variables before statements
1620         to allow remaping of local variables.
1621
1622 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1623
1624         A fix for bug #82296
1625
1626         * anonymous.cs,
1627         * report.cs: Log crash details for future clone problems.
1628         
1629         * statement.cs (Return.Clone): Don't clone non-existent expression.
1630
1631 2007-08-03  Raja R Harinath  <harinath@gmail.com>
1632
1633         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
1634         (Class.AddBasesForPart): Move CS0537 check here from ...
1635         * cs-parser.jay (class_declaration): ... here.  Move calling of
1636         'AddBasesForPart' to ...
1637         (class_bases): ... here.
1638         (struct_declaration, interface_declaration): Update to changes.
1639
1640 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1641
1642         A fix for bug #81923
1643
1644         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
1645         conversion is allowed.
1646
1647 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1648
1649         A fix for bug #81564
1650
1651         * ecore.cs (EventExpr): Add IsBase handling.
1652
1653         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
1654         too.    
1655         
1656 2007-08-02  Raja R Harinath  <harinath@gmail.com>
1657
1658         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
1659         * cs-parser.jay: Some whitespace cleanups.
1660         (current_delegate): New.
1661         (type_name): New.
1662         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
1663         a dummy code block, and use 'type_name' instead of 'member_name'.
1664         (interface_declaration, class_declaration): Likewise.
1665         (delegate_declaration): Likewise.  Rearrange slightly and use
1666         'current_delegate'.
1667         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
1668         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
1669
1670 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1671
1672         A fix for bug #82039
1673
1674         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
1675         available.
1676
1677         * typemanager.cs (CSharpName): Split to string overload.
1678
1679 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1680
1681         * expression.cs,
1682         * report.cs: Updated warning CS0472.
1683
1684 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1685
1686         A fix for bug #82181
1687         * cs-parser.jay,
1688         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
1689
1690 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1691
1692         A fix for bug #82277
1693         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
1694
1695 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1696
1697         ** C# 3.0 Type Inference (major bits are working)
1698         
1699         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
1700         (.ImplicitStandardConversionExists): Uses compatible.
1701         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
1702         (.InferReturnType): New method.
1703         (.Compatible): Refactored.
1704         (.ResolveParameters): Uses factory to create resolved parameters.
1705         (.CompatibleMethod): Add probing mode support.
1706         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
1707         clearly distinguish between 2 different operations.
1708         (LambdaMethod): Moved to lambda.cs.
1709         (AnonymousMethod): Removed unused fields and methods.
1710         (AnonymousDelegate): Simplified.
1711         
1712         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
1713         
1714         * convert. cs (ImplicitConversionStandard): Compatible works differently.
1715         
1716         * delegate.cs (Delegate): New mehods to reduce code duplication.
1717         (.GetConstructor): New method.
1718         (.GetInvokeMethod): New method.
1719         (DelegateCreation): Updated.
1720         
1721         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
1722         does not exist.
1723         (OverloadResolve): Made probing little bit faster.
1724         
1725         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
1726         when probing is on.
1727         
1728         * generic.cs (TypeInferenceContext): Dummy implementation.
1729         
1730         * iterators.cs: Updated after Resolve/Define rename.
1731         
1732         * lambda.cs (LambdaExpression)
1733         (.ResolveParameters): Handles both type of arguments and type inference too.
1734         
1735         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
1736         (InflateTypes): Updated.
1737         
1738         * support.cs (InflateTypes): Changed signature and updated.
1739         
1740         * typemanager.cs (LookupMemberCache): Better dynamic type check.
1741         (MemberLookup_FindMembers): More MS tricks.
1742         (GetParameterData): Ditto.
1743         (GetDelegateParameters): Uses quick path for dynamic types.
1744         
1745 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1746
1747         * class.cs (MethodData.Define): EmitContext is required for generic stuff
1748         only.
1749
1750 2007-07-31  Marek Safar  <marek.safar@gmail.com>
1751
1752         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
1753         syntax.
1754         
1755 2007-07-26  Jb Evain  <jbevain@novell.com>
1756
1757         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
1758         which takes a boolean 'report_errors', similar to the GetMethod.
1759         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
1760         in .net 2.1, do not report errors here.
1761
1762         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
1763         System.Runtime.CompilerServices.RequiredAttributeAttribute and
1764         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
1765         in .net 2.1.
1766
1767         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
1768         of the type InternalsVisibleToAttribute before the first call
1769         to CoreLookupType which is allowed to fail (third boolean parameter
1770         to true). Because, during the resolution for a type that is not
1771         immediately found, we try to check if the type is not defined in
1772         a friend assembly, and to do so, we need the
1773         InternalVisibleToAttribute.
1774
1775 2007-07-23  Miguel de Icaza  <miguel@novell.com>
1776
1777         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
1778         feature that allows structs to be compared against null and inline
1779         the result as true or false.
1780
1781         Notice that the same code is not permitted inside a generic block
1782         of code that would do:
1783
1784         class Foo<T> where T : struct {
1785             bool Eval (T x)
1786             {
1787                  return x == null;
1788             }
1789         }
1790
1791         It is only allowed if the type of T is not bound (no where
1792         clause).   In my opinion, this CSC 2 behavior is broken but people
1793         seem to be using it (IronRuby does, a few bug reports on bugzilla
1794         have it and some people have complained about it).
1795
1796         All of the users that depend on this behavior have code that is
1797         very likely broken. 
1798         
1799         * report.cs (Warning, Error): make these take object arguments,
1800         not strings, as that allows us to take advantage of Format.
1801
1802 2007-07-20  William Holmes  <billholmes54@gmail.com>
1803
1804         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
1805           Left member variable for the Count.
1806         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
1807           MemberName.CountTypeArguments to avoid a NRE. 
1808
1809         This code is contributed under the MIT X11 license
1810
1811 2007-07-18  Marek Safar  <marek.safar@gmail.com>
1812
1813         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
1814
1815 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
1816
1817         * doc.cs : generic method arguments are written as ``x while generic
1818           type arguments are `x. Combined with the previous change, fixed bug
1819           #79706.
1820
1821 2007-07-18  Raja R Harinath  <rharinath@novell.com>
1822
1823         Fix #82120
1824         * expression.cs (Binary.ResolveOperator): When converting
1825         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
1826
1827 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
1828
1829         * doc.cs : when T: or whatever x: is specified, it does not really
1830           check the doc comment's syntax correctness. Fixed bug #82006.
1831
1832 2007-07-18  Marek Safar  <marek.safar@gmail.com>
1833
1834         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
1835         LambdaExpression better.
1836         
1837         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
1838         
1839         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
1840         
1841         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
1842         as it can be generated.
1843         
1844         * expression.cs (Invocation.Error_InvalidArguments): Show correct
1845         modifiers.
1846         
1847         * lambda.cs (LambdaExpression): Refactored to share same code with
1848         AnonymousMethodExpression.
1849         
1850 2007-07-17  Marek Safar  <marek.safar@gmail.com>
1851
1852         * anonymous.cs (MakeName): Include host name for easier debugging.
1853         (LambdaMethod): New class for lambda spcecific stuff.
1854         
1855         * attribute.cs: Set EmitContext return type.
1856
1857         * class.cs: Set EmitContext return type.
1858         
1859         * codegen.cs (EmitContext): Return type cannot be null to stop messing
1860         with null/void meaning.
1861         
1862         * iterators.cs (ContainerType): Implemented.
1863         
1864         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
1865         
1866         * statement.cs (Return): Updated to lambda expressions.
1867         (Block.CloneTo): Parent can be null.
1868                 
1869 2007-07-13  Marek Safar  <marek.safar@gmail.com>
1870
1871         A fix for bug #81917
1872         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
1873         
1874         * class.cs (FixedField): Check whether field is in unsafe scope.
1875
1876         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
1877         (FieldExpr.Emit): Fixed buffers cannot be volatile.
1878
1879         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
1880         FieldExpr.
1881         
1882         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
1883                 
1884 2007-07-13  Marek Safar  <marek.safar@gmail.com>
1885
1886         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
1887         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
1888         from Report class.
1889
1890 2007-07-13  Marek Safar  <marek.safar@gmail.com>
1891
1892         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
1893         
1894 2007-07-13  Marek Safar  <marek.safar@gmail.com>
1895
1896         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
1897         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
1898         
1899         * codegen.cs(EmitContext): Add ProbingMode flag.
1900         
1901         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
1902         
1903         * driver.cs: For now set both warning values.
1904         
1905         * ecore.cs (SimpleName): Name is readonly.
1906         (MethodGroup.OverloadResolve): One quick path for probing.
1907         
1908         * expression.cs (Unary): Set Oper r/o.
1909         (Binary): Set Oper r/o.
1910         (ParameterReference): Set few instance variables as r/o.
1911         (ParameterReference.DoResolveBase): Don't capture aruments when 
1912         the probing is on.
1913         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
1914         (Arglist): arguments are private.
1915         (SizeOf): type is private and r/o.
1916         (MemberAccess): arguments are private.
1917
1918         * report.cs: Enhanced reporting on/off capabilities.
1919         
1920         * lambda.cs: Uses ec.IsInProbingMode.
1921         (ContextualReturn): Derives from return.
1922         
1923         * rootcontext.cs: For now set both warning values.
1924         
1925         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
1926         copy if one exists.
1927         (Return.Resolve): Don't die immediately.
1928         (Block.Resolve): Speed-up probing.
1929         (Block.CloneTo): Clone only child blocks.
1930
1931 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
1932
1933         * iterators.cs: reverted Miguel's latest change (r81925) as it
1934         breaks the build in System.
1935
1936 2007-07-13  Miguel de Icaza  <miguel@novell.com>
1937
1938         * iterators.cs (Yield.CheckContext): Check for the iterator type
1939         also here as we can call into Yield even in codepaths that are not
1940         directly checked by
1941         (MethodOrOperator is the only path that was checked).
1942
1943         In addition to the standard check, use a more specific check for
1944         constructors to report a more verbose error. 
1945
1946 2007-07-12  Miguel de Icaza  <miguel@novell.com>
1947
1948         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
1949         report the warning and continue 
1950
1951         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
1952         values on the stack on the call to Emit.   Use EmitStatement if
1953         possible, or using Emit + Pop if not possible.   Fixes #82064
1954
1955 2007-07-12  Raja R Harinath  <rharinath@novell.com>
1956
1957         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
1958         avoid try...finally in some cases.
1959
1960 2007-07-10  Marek Safar  <marek.safar@gmail.com>
1961
1962         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
1963         
1964         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
1965         instead of method. Re-use standard error handling.
1966         (ConstructorInitializer.Emit): Simplified.
1967         
1968         * delegate.cs: Updated after Invocation.EmitCall change.
1969         
1970         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
1971         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
1972         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
1973         method and don't permanently changing input arguments.
1974         (MethodGroupExpr): Introduced resolved best_candidate, when method group
1975         is resolved it has one of the candidates is the best one which is later
1976         used to emit. Removed a few unused method.
1977         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
1978
1979         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
1980         (Binary.ResolveOperator): Ditto.
1981         (ConditionalLogicalOperator.DoResolve): Ditto.
1982         (Invocation): Uses method group.
1983         (Invocation.DoResolve): Simplified.
1984         (Invocation.EmitCall): Removed useless is_static.
1985         (Invocation.Emit): Delegate to method group.
1986         (Invocation.EmitStatement): Simplified.
1987         (New): Uses method group.
1988         (MemberAccess.DoResolve): Don't destroy original expression.
1989         
1990         * statement.cs (ForEach.Resolve): Use null for no method arguments.
1991         
1992 2007-07-04  Marek Safar  <marek.safar@gmail.com>
1993
1994         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
1995         
1996         * anonymous.cs,
1997         * lambda.cs: Add custom error message type.
1998
1999 2007-07-03  Marek Safar  <marek.safar@gmail.com>
2000
2001         * lambda.cs: Simplified little bit.
2002         
2003         * parameter.cs: Introduced ImplicitLambdaParameter.
2004         (Parameters.CreateFullyResolved): New factory instead of ctor.
2005         
2006         * anonymous.cs,
2007         * class.cs,
2008         * delegate.cs: Updated parameter creation.
2009         
2010 2007-07-03  Marek Safar  <marek.safar@gmail.com>
2011
2012         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
2013         arguments.
2014         
2015         * generic.cs: Synchronized with gmcs.
2016         
2017 2007-07-03  Marek Safar  <marek.safar@gmail.com>
2018
2019         * class.cs (Indexer): Check return type as soon as possible.
2020         
2021         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
2022         members too.
2023         
2024         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
2025         
2026         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
2027         
2028         * parameter.cs (Parameter): Use expression type when it is available.
2029         
2030         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
2031         method modifier for the first parameter only.
2032
2033 2007-06-24  Marek Safar  <marek.safar@gmail.com>
2034
2035         A fix for bug #81938
2036         * typemanager.cs (ChangeType): Fixed couple of char conversions.
2037         
2038         * constant.cs: Tide up an exception message.
2039
2040 2007-06-22  Marek Safar  <marek.safar@gmail.com>
2041
2042         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
2043         an uninitialized variable is used.
2044         
2045         * expression.cs (LocalVariableReference.DoResolve): Ditto.
2046
2047 2007-06-22  Marek Safar  <marek.safar@gmail.com>
2048
2049         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
2050         not found error handling.
2051
2052         * expression.cs (ArrayCreation): Removed redundant fields and little bit
2053         simplified.
2054         (ArrayCreation.ResolveArrayElement): To be ready to customization.
2055         (ArrayCreation.DoResolve): Simplified.
2056         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
2057         its own resolve process.
2058         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
2059
2060 2007-06-20  Marek Safar  <marek.safar@gmail.com>
2061
2062         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
2063         more error details.
2064         
2065 2007-06-20  Marek Safar  <marek.safar@gmail.com>
2066
2067         * cs-tokenizer.cs: Removed var related stuff.
2068         
2069         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
2070         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
2071         a type and a keyword at same time.
2072         
2073         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
2074         matches to "var".
2075         
2076         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
2077         implicitly typed arrays, more changes will follow.
2078         
2079         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
2080         
2081 2007-06-19  Marek Safar  <marek.safar@gmail.com>
2082
2083         * ecore.cs (VarExpr): Removed Handled field.
2084         
2085         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
2086         build-in assign functionality.
2087         (ForEach.Resolve): Removed all implicitly typed local variable code and
2088         simplified.
2089         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
2090         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
2091
2092 2007-06-18  Marek Safar  <marek.safar@gmail.com>
2093
2094         * assign.cs: Removed implicitly typed local variable check.
2095         
2096         * expression.cs (LocalVariableReference.DoResolve): Add check for self
2097         referencing implicitly typed local variable.
2098         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
2099         variable here.
2100         
2101         * statement.cs (Fixed): Removed unsupported implicitly typed local
2102         variable code.
2103
2104 2007-06-15  Marek Safar  <marek.safar@gmail.com>
2105
2106         * decl.cs (MemberName): Moved all Unbound stuff to parser.
2107
2108 2007-06-14  Marek Safar  <marek.safar@gmail.com>
2109
2110         A fix for bugs #81855 and #76274
2111         * attribute.cs (AttachTo): Always set owner for global attributes to
2112         prefined owner.
2113         
2114         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
2115         usefull too.
2116         
2117         * cs-parser.jay: Assembly and module attributes must precede all other
2118         elements except using clauses and extern alias declarations.
2119
2120 2007-06-13  Marek Safar  <marek.safar@gmail.com>
2121
2122         A fix for bug #81748
2123         * cs-tokenizer.cs,
2124         * expression.cs: More checks for non ISO-1 features.
2125
2126 2007-06-12  Marek Safar  <marek.safar@gmail.com>
2127
2128         A fix for bug #81807
2129         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
2130         present inside switch statement and it is required by nullable check.
2131
2132 2007-06-12  Marek Safar  <marek.safar@gmail.com>
2133
2134         A fix for bug #81840
2135         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
2136         when type matching fails.
2137         
2138         * namespace.cs: Tiny error message change.
2139
2140 2007-06-12  Marek Safar  <marek.safar@gmail.com>
2141
2142         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
2143         reporting. Added automatic property check.
2144         
2145         * class.cs: Updated after CheckAbstractAndExtern relocation.
2146         (AEventPropertyAccessor.GetSignatureForError): Customized.
2147         
2148 2007-06-11  Marek Safar  <marek.safar@gmail.com>
2149
2150         * class.cs (DefineBaseTypes): Base type can be undefined.
2151         
2152         * ecore.cs (TypeLookup): Minor refactoring.
2153         (DoResolveAsTypeStep): Removed redundant check.
2154
2155         * namespace.cs (Lookup): Removed redundant check.
2156                 
2157         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
2158         ResolveAsTypeTerminal step.
2159         (BootstrapCorlib_*): Simplified.
2160         (PopulateCoreType): Core types can be now external.
2161
2162 2007-06-07  Marek Safar  <marek.safar@gmail.com>
2163
2164         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
2165          verification only.
2166          (InferTypeArguments): Infers anonymous expression type arguments.
2167          (Compatible): Split to Compatible and InferTypeArguments. 
2168         
2169         * lambda.cs: Updated.
2170
2171 2007-06-08  Marek Safar  <marek.safar@gmail.com>
2172
2173         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
2174
2175 2007-06-07  Raja R Harinath  <harinath@gmail.com>
2176
2177         Fix #80477, cs0135-2.cs, cs0135-3.cs
2178         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
2179         names to the "known" variables list.
2180         (Block.CheckInvariantMeaningInBlock): Handle the fact the
2181         parameter names are also "known".
2182         (Block.CheckError136): Remove.
2183         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
2184         null.
2185
2186 2007-06-07  Marek Safar  <marek.safar@gmail.com>
2187
2188         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
2189
2190 2007-06-06  Marek Safar  <marek.safar@gmail.com>
2191
2192         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
2193         internal error not an user error.
2194          
2195         * expression.cs (IsApplicable): Refactored to make debugging easier.
2196
2197         * support.cs: More tricks for non-mono runtimes.
2198         
2199         * typemanager.cs (CoreLookupType): Made public.
2200         (InitSystemCore): All linq specific stuff moved to linq.cs
2201
2202 2007-06-05  Marek Safar  <marek.safar@gmail.com>
2203
2204         * typemanager.cs (CSharpSignature): One more missing build-in types
2205         replacement.
2206         More tricks for non-mono runtime.
2207
2208 2007-06-05  Raja R Harinath  <harinath@gmail.com>
2209
2210         * statement.cs (Block.CheckError136_InParents): Remove.
2211         (Block.AddVariable): Use GetParameterInfo instead.
2212         (ToplevelBlock.ProcessArguments): Likewise.
2213
2214 2007-06-04  Raja R Harinath  <rharinath@novell.com>
2215
2216         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
2217         information too.
2218         (ToplevelBlock.GetParameterInfo): Split out of ...
2219         (ToplevelBlock.GetParameterRefernce): ... this.
2220         (ToplevelBlock.ParameterMap): Remove.
2221         * expression.cs (ParameterReference): Update to use
2222         ToplevelParameterInfo.
2223
2224         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
2225         regression.
2226
2227         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
2228         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
2229
2230         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
2231         (ToplevelBlock.ProcessParameters) ... here.
2232         (ToplevelBlock..ctor): Invoke it.
2233
2234         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
2235         new parameters.
2236
2237         * statement.cs (IKnownVariable): New interface.
2238         (LocalInfo): Implement it.
2239         (ToplevelParameterInfo): New class.
2240         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
2241         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
2242         GetKnownVariableInfo.
2243
2244 2007-06-03  Raja R Harinath  <harinath@gmail.com>
2245
2246         Partly speed up CS0136 error checks.
2247         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
2248         'recurse' parameter.
2249         (Block.DoCheckError136): Only check errors in parameters.  Move
2250         local variable checks ...
2251         (Block.AddVariable): ... here, and ...
2252         (ToplevelBlock.ResolveMeta): ... here.
2253
2254 2007-06-02  Raja R Harinath  <harinath@gmail.com>
2255
2256         * statement.cs (Block.IsChildOf): Remove.
2257
2258         * statement.cs (Statement.Clone): Move special case code ...
2259         (Block.CloneTo): ... here.
2260
2261 2007-05-29  Raja R Harinath  <rharinath@novell.com>
2262
2263         * statement.cs (ToplevelBlock.container): Remove field.  It's
2264         redundant with 'Parent'.
2265         (ToplevelBlock.ContainerBlock): Remove accessor.
2266         (ToplevelBlock..ctor): Update to changes.  Register anonymous
2267         child with parent here, ...
2268         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
2269         current_block.
2270         (start_anonymous): Don't save current_block.
2271         (top_current_block): Remove.
2272
2273         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
2274         (Block.Resolve): Update to changes.
2275         (Block..ctor): Move setting of "correct" 'Toplevel'
2276         and 'Explicit' fields to ...
2277         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
2278
2279 2007-05-27  Raja R Harinath  <harinath@gmail.com>
2280
2281         Kill Block.Implicit
2282         * statement.cs (Block.Implicit): Remove.
2283         (Block): Update to changes.
2284         * flowanalysis.cs: Likewise.
2285
2286         Mildly speed up CheckInvariantMeaningInBlock
2287         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
2288         Recursively call AddKnownVariable to all enclosing blocks.
2289         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
2290         Remove recursive calls.
2291         (Block): Update to changes.
2292
2293         New ExplicitBlock invariants
2294         * statement.cs (Block.Explicit): New field.  It points to the
2295         immediately enclosing non-implicit block.
2296         (Block..ctor): Maintain the invariant.
2297         * cs-parser.jay: Take advantage of invariant.
2298
2299         Introduce ExplicitBlock
2300         * statement.cs (ExplicitBlock): New.
2301         (ToplevelBlock): Derive from it.
2302         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
2303         sense of flag.
2304         (Block.Implicit): Update to changes.
2305         * cs-parser.jay: Update to changes.
2306
2307         Remove unused field
2308         * codegen.cs (EmitContext.IsLastStatement): Remove.
2309         * statement.cs (Block.DoEmit): Update to changes.
2310
2311 2007-05-25  Raja R Harinath  <rharinath@novell.com>
2312
2313         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
2314         modifying current_block directly.
2315
2316 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
2317         
2318         * class.cs: Implemented automatic properties (C# 3.0)
2319           Thanks to Marek for the help.
2320
2321 2007-05-23  Raja R Harinath  <rharinath@novell.com>
2322
2323         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
2324         variable as assigned, note also that all its components are
2325         assigned too.
2326         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
2327
2328 2007-05-19  Marek Safar  <marek.safar@gmail.com>
2329
2330         * anonymous.cs, class.cs: Emit Compiler generated attribute when
2331         member is marked as compiler generated.
2332         
2333         * decl.cs (MemberCore): Refactored ModFlags into property.
2334
2335         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
2336         (Check): Check only accessibility modifiers.
2337
2338 2007-05-18  Raja R Harinath  <rharinath@novell.com>
2339
2340         Track all assignable slots in one bit array
2341         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
2342         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
2343         logic from VariableMap constructor here.  Use the same 'offset'
2344         variable that's later used for computing offsets of local
2345         variables.
2346         * flowanalysis.cs (UsageVector.parameters): Remove.
2347         (UsageVector): Update to changes.
2348         (VariableMap): Remove.
2349
2350         Avoid creating ParameterMap in every block
2351         * statement.cs (Block.ParameterMap): Move ...
2352         (ToplevelBlock.ParameterMap): ... here.
2353         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
2354         only once.
2355         * flowanalysis.cs (FlowBranching.param_map): Remove.
2356         (FlowBranching.UsageVector): Update to changes.
2357         (FlowBranchingToplevel.CheckOutParameters): Likewise.
2358
2359         * statement.cs (Block.CloneTo): Clone Toplevel field too.
2360
2361         * expression.cs (ParameterReference): Distinguish between block
2362         where parameter was referenced and declared.
2363
2364 2007-05-18  Marek Safar  <marek.safar@gmail.com>
2365
2366         * flowanalysis.cs, statement.cs: Put back improved error handling.
2367
2368 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
2369         
2370         * assign.cs:
2371         * expression.cs:
2372           Imporved object and collection initialization (C# 3.0).
2373
2374 2007-05-15  Marek Safar  <marek.safar@gmail.com>
2375
2376         A fix for bug #81380
2377         * expression.cs (Is.DoResolve): Only value types have constant `is'
2378         behaviour.
2379
2380 2007-05-15  Raja R Harinath  <rharinath@novell.com>
2381
2382         * statement.cs (ToplevelBlock.child): Remove.
2383
2384 2007-05-15  Raja R Harinath  <harinath@gmail.com>
2385
2386         Rationalize ResolveMeta: refactoring
2387         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
2388         out constant handling code into ...
2389         (Block.DoResolveConstants): ... this.
2390
2391         Rationalize ResolveMeta: kill local_map
2392         * statement.cs (Block.local_map, Block.LocalMap): Remove.
2393         (Block.AssignableSlots): New.
2394         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
2395         for locals -- move code from VariableMap here.  Avoid unnecessary
2396         allocations.
2397         * flowanalysis.cs (FlowBranching.local_map): Remove.
2398         (FlowBranching..ctor): Use Block.AssignableSlots.
2399         (VariableMap): Remove unused constructors.
2400
2401 2007-05-11  Raja R Harinath  <rharinath@novell.com>
2402
2403         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
2404
2405 2007-05-11  Marek Safar  <marek.safar@gmail.com>
2406
2407         * typemanager.cs (IsFriendAssembly): Should not be called for building
2408         assembly.
2409
2410 2007-05-09  Marek Safar  <marek.safar@gmail.com>
2411
2412         * literal.cs (NullConstant): Print null in all cases.
2413         
2414         * expression.cs (Binary.ResolveOperator): Implemented delegate
2415          comparison based on C# 2.0 changes.
2416
2417 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
2418
2419         This code is contributed under the MIT X11 license
2420         
2421         The following enables support for several C# 3.0 language features:
2422         
2423         * cs-tokenizer.cs: Added support for the "var" keyword.
2424         
2425         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
2426           Added VarExpr class to facilitate type inferencing.
2427         
2428         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
2429           to support anonymous types.
2430         
2431         * assign.cs: Added support for type inferencing and initialization.
2432         
2433         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
2434         
2435         * expression.cs: Added implicit array support to ArrayCreation.
2436           Added 5 types and 1 interface:
2437           
2438           IInitializable                Implementing classes can inject initializing
2439                                         statements after object instantiation.
2440           
2441           Initializer                   Stores data for object initialization.
2442           
2443           AnonymousType                 An expression for anonymous types.
2444           
2445           AnonymousTypeParameter        Stores data about an anonymous type's field.
2446           
2447           NewInitialize                 An expression for object initialization.
2448           
2449           CollectionInitialize          An expression for collection initialization.
2450         
2451         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
2452           statements.
2453
2454 2007-05-06  Marek Safar  <marek.safar@gmail.com>
2455
2456         A fix for bug #81500
2457         * cs-tokenizer.cs: Add special handling for coalescing operator.
2458
2459 2007-05-06  Marek Safar  <marek.safar@gmail.com>
2460
2461         A fix for bug #81529
2462         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
2463         its value from base class until it is redefined.
2464
2465 2007-05-02  Raja R Harinath  <rharinath@novell.com>
2466
2467         Fix regression in cs0631-3.cs
2468         * cs-parser.jay (operator_declarator): Add opt_attributes to error
2469         fallback.  Make error fallback catch more cases.
2470
2471 2007-05-01  Miguel de Icaza  <miguel@novell.com>
2472
2473         * cs-parser.jay: Allow parameters in operator declarations to have
2474         attributes. 
2475
2476 2007-04-27  Miguel de Icaza  <miguel@novell.com>
2477
2478         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
2479         exists. 
2480
2481         * lambda.cs (ContextualReturn.Resolve): An expression is valid
2482         inside the ContextualReturn, it does not have to be an
2483         ExpressionStatement. 
2484
2485 2007-04-24  Miguel de Icaza  <miguel@novell.com>
2486
2487         * lambda.cs (ContextualReturn.Resolve): if the return type is not
2488         set, set it.
2489
2490 2007-04-23  Miguel de Icaza  <miguel@novell.com>
2491
2492         * anonymous.cs (AnonymousContainer): split the virtual Resolve
2493         method in two methods: ResolveNoDefine and Resolve.
2494
2495         ResolveNoDefine will stop just after ResolveTopBlock has been
2496         called.   
2497
2498         Resolve will then continue by creating a method and issuing the
2499         call to method.Define ().
2500
2501         (AnonymousMethod): Split and implement the new Resolve and
2502         ResolveNoDefine as well.
2503
2504         * lambda.cs (LambdaExpression): Split the anonymous method
2505         resolution code into a separate routine (CoreCompatibilityTest)
2506         from DoCompatibleTest.
2507
2508         (LambdaExpression.TryBuild): New method, this method tries to
2509         build the LambdaExpression with the given set of types to be used
2510         as the types for the various parameters of the lambda expression. 
2511
2512         If the compilation succeed with the given types, the infered type
2513         of the Anonymous method is returned, otherwise null is returned.
2514
2515 2007-04-23  Marek Safar  <marek.safar@gmail.com>
2516
2517         A fix for bug #81414
2518         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
2519
2520 2007-04-22  Miguel de Icaza  <miguel@novell.com>
2521
2522         * cs-tokenizer.cs: Change various identifiers here from the
2523         camelCasing to the recommended Linux-like style for instance
2524         variables from the Coding Guidelines. 
2525
2526 2007-04-19  Martin Baulig  <martin@ximian.com>
2527
2528         * convert.cs
2529         (Convert.ImplicitReferenceConversionCore): Allow conversions from
2530         System.Enum to System.ValueType.
2531
2532 2007-04-13  Martin Baulig  <martin@ximian.com>
2533
2534         Rewrote implicit reference conversions.  We need to distinguish
2535         between implicit reference conversions (13.1.4) and implicit
2536         boxing conversions (13.1.5).
2537
2538         According to the spec, there's an an implicit conversion
2539         "From a one-dimensional array-type S[] to IList<T> and base
2540         interfaces of this interface, provided there is an implicit
2541         reference conversion from S to T."  Note that this does not
2542         include boxing conversions.
2543
2544         * convert.cs
2545         (Convert.ImplicitTypeParameterBoxingConversion): New method.
2546         (Convert.ImplicitReferenceConversion): Split into
2547         ImplicitReferenceConversionCore() and
2548         ImplicitBoxingConversionExist().
2549         (Convert.ImplicitReferenceConversionExists): Use the new
2550         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
2551
2552 2007-04-12  Martin Baulig  <martin@ximian.com>
2553
2554         * convert.cs (Convert.ImplicitReferenceConversion): Move the
2555         `TypeManager.null_type' checks up to the top of the method.
2556
2557 2007-04-11  Marek Safar  <marek.safar@gmail.com>
2558
2559         A fix for bug #81350
2560         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
2561         extension methods.
2562
2563 2007-04-11  Martin Baulig  <martin@ximian.com>
2564
2565         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
2566         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
2567         to make this work for generic classes; fixes #79561.
2568
2569 2007-04-11  Martin Baulig  <martin@ximian.com>
2570
2571         * expression.cs (As): Add support for nullable types; fixes #79371.
2572
2573 2007-04-11  Martin Baulig  <martin@ximian.com>
2574
2575         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
2576         `type.FullName' is null; fixes #80243.
2577
2578 2007-04-11  Martin Baulig  <martin@ximian.com>
2579
2580         * expression.cs (Invocation.IsApplicable): Don't modify the method
2581         if type inference succeeded, but the method was not applicable.
2582         Fixes #81250.
2583
2584 2007-04-10  Marek Safar  <marek.safar@gmail.com>
2585
2586         A fix for bug #81324
2587         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
2588         internal and external namespaces containers.
2589
2590 2007-04-10  Martin Baulig  <martin@ximian.com>
2591
2592         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
2593         TypeManager.DropGenericMethodArguments() so we also call
2594         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
2595
2596 2007-04-10  Martin Baulig  <martin@ximian.com>
2597
2598         * iterators.cs (Iterator.CreateIterator): Don't crash if
2599         `method.ReturnType' is null.  This happens if something went wrong
2600         while resolving that typ (we already reported an error in this case).
2601
2602 2007-04-10  Martin Baulig  <martin@ximian.com>
2603
2604         * expression.cs (New.DoResolve): Don't call CheckComImport() on
2605         generic interfaces; report the CS0144 directly.
2606
2607 2007-04-10  Martin Baulig  <martin@ximian.com>
2608
2609         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
2610         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
2611
2612 2007-04-10  Martin Baulig  <martin@ximian.com>
2613
2614         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
2615
2616 2007-04-09  Raja R Harinath  <rharinath@novell.com>
2617
2618         A better fix
2619         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
2620         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
2621
2622         Fix #81338
2623         * statement.cs (For.Resolve): If resolution fails, use
2624         KillFlowBranching.
2625
2626 2007-04-08  Marek Safar  <marek.safar@gmail.com>
2627
2628         * anonymous.cs (MakeName): Make faster and zero-based.
2629         (VerifyExplicitParameterCompatibility): Back to mode where generic
2630         parameter is ignored.
2631         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
2632
2633         * class.cs (EmitType): Method can emit another new method.
2634
2635         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
2636
2637         * driver.cs: Updated.
2638
2639         * lambda.cs: Reuse predefined empty parameters.
2640
2641         * parameter.cs: Updated
2642
2643         * support.cs: Implemented InflateTypes.
2644
2645         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
2646         (InitSystemCore): Introduced to isolate 3.0 dependencies.
2647
2648 2007-04-03  Martin Baulig  <martin@ximian.com>
2649
2650         Fix #80632.
2651
2652         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
2653         version of TypeManager.IsOverride() which also works with generic
2654         types.  
2655
2656 2007-04-03  Martin Baulig  <martin@ximian.com>
2657
2658         Fix #81044.
2659
2660         * convert.cs
2661         (Convert.ExplicitReferenceConversion): We need to cast when
2662         converting from IList<T> to S[].
2663
2664 2007-04-01  Marek Safar  <marek.safar@gmail.com>
2665
2666         * decl.cs (FindExtensionMethods): Consider all candidates with same name
2667         at this level.
2668         
2669         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
2670
2671 2007-03-31  Marek Safar  <marek.safar@gmail.com>
2672
2673         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
2674         argument and return type inferring.
2675
2676         * codegen.cs (InferReturnType): Flag whether return can be inferred.
2677         (ReturnType): Turned to property.
2678
2679         * statement.cs (Return): Implemented return type inferring.
2680
2681         * support.cs (ReflectionParameters): Use local types if possible.
2682
2683 2007-03-30  Raja R Harinath  <rharinath@novell.com>
2684
2685         * flowanalysis.cs (FlowBranching.Reachability): Remove.
2686         (FlowBranching.UsageVector): Update to changes.
2687
2688         Prepare to kill 'Reachability'
2689         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
2690         argument of constructor.
2691
2692 2007-03-29  Raja R Harinath  <rharinath@novell.com>
2693
2694         Prepare to kill 'Reachability'
2695         * flowanalysis.cs (UsageVector.is_unreachable): New.
2696         (UsageVector): Update to maintain 'is_unreachable' in parallel to
2697         'reachability', and verify they're consistent.
2698
2699         Fix #81121
2700         * expression.cs (New.EmitStatement): Handle type parameters here too.
2701
2702 2007-03-29  Martin Baulig  <martin@ximian.com>
2703
2704         Fix #79148.
2705
2706         * anonymous.cs
2707         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
2708         CompilerGeneratedClass.
2709         (ScopeInfo.EmitScopeInstance): Make this protected.
2710         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
2711         `ec.CurrentAnonymousMethod.Scope == Scope'.
2712
2713         * statement.cs (Block.ScopeInfo): Make this a property.
2714
2715 2007-03-27  Raja R Harinath  <harinath@gmail.com>
2716
2717         Prepare to kill 'Reachability'
2718         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
2719         (FlowBranching.UsageVector.Reachability): Remove property.
2720         (FlowBranching.UsageVector.IsUnreachable): New property.
2721         (FlowBranching.UsageVector.ResetBarrier): New.
2722         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
2723         * codegen.cs, statement.cs: Update to changes.
2724
2725 2007-03-27  Martin Baulig  <martin@ximian.com>
2726
2727         Fix #81209.
2728
2729         * decl.cs
2730         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
2731         generic types.
2732
2733 2007-03-26  Raja R Harinath  <rharinath@novell.com>
2734
2735         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
2736         instead of TriState.  Remove all mention of TriState.
2737
2738         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
2739         replaced by a boolean.  Add boolean 'is_unreachable' field, check
2740         and maintain invariants.
2741
2742 2007-03-25  Marek Safar  <marek.safar@gmail.com>
2743
2744         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
2745
2746 2007-03-25  Marek Safar  <marek.safar@gmail.com>
2747
2748         * expression.cs: Stop using obsolete 2.0 opcodes.
2749
2750 2007-03-25  Marek Safar  <marek.safar@gmail.com>
2751
2752         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
2753         one of the latests Martin's fixes.
2754
2755 2007-03-23  Miguel de Icaza  <miguel@novell.com>
2756
2757         * expression.cs: On BigEndian systems, swap the bytes, temporary
2758         solution until we get a new bitconverter class.
2759
2760 2007-03-23  Martin Baulig  <martin@ximian.com>
2761
2762         Fix #81158.
2763
2764         * decl.cs (MemberCache.AddMembers): Add generic methods both as
2765         "Method" and "Method`1".  Normally, a cache lookup is done on the
2766         "Method" form (ie. without the generic arity), but this one makes
2767         lookups on the full form work as well.
2768
2769 2007-03-22  Raja R Harinath  <rharinath@novell.com>
2770
2771         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
2772         unused properties.
2773
2774 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
2775         * class.cs: 
2776         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
2777         ordered_member_list, to TypeBuilder to store members to be defined
2778         in the order they were parsed in.
2779         - ordered_explicit_member_list contains all properties indexers
2780           and methods that are defined as explicit implementation of an
2781           interface or base class.
2782         - ordered_member_list contains all properties indexers and methods
2783           that are not defined as explicit implementation of an interface
2784           or base class.
2785
2786         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
2787         functionality in these removed classes has been replaced with 
2788         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
2789         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
2790
2791         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
2792         to CheckForDuplications inside GetMethod and SetMethod Define Method
2793         to handle method property and indexer name conflicts.
2794
2795         Fixes #79434
2796
2797         All code is contributed under the MIT/X11 license.
2798
2799 2007-03-20  Martin Baulig  <martin@ximian.com>
2800
2801         * class.cs (TypeContainer.Interfaces): Removed; they're now
2802         included in `TypeContainer.Types'.
2803
2804 2007-03-20  Martin Baulig  <martin@ximian.com>
2805
2806         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
2807
2808         * class.cs (TypeContainer.CreateType): New public method.  This is
2809         now called before DefineType() to create the TypeBuilders.
2810         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
2811         has already been created by CreateType().
2812         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
2813         don't resolve our base classes here; this has been moved into
2814         DefineBaseTypes().  We're now called from CreateType().
2815         (TypeContainer.DefineBaseTypes): New private method; resolve our
2816         base classes here.  We're now called from DefineType().
2817
2818         * rootcontext.cs
2819         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
2820         our types first to create all the TypeBuilders.  After that, call
2821         TypeContainer.DefineType() on all the types which'll resolve their
2822         base classes and setup the resolve order.
2823
2824 2007-03-20  Martin Baulig  <martin@ximian.com>
2825
2826         * class.cs (TypeContainer.Enums): Removed; they're now included in
2827         `TypeContainer.Types'.  
2828
2829 2007-03-20  Martin Baulig  <martin@ximian.com>
2830
2831         * class.cs
2832         (TypeContainer.DefineType): Don't call ResolveMembers() here.
2833         (TypeContainer.DoResolveMembers): Call DefineType() on our
2834         `compiler_generated' classes; moved here from DefineNestedTypes().
2835
2836         * rootcontext.cs
2837         (RootContext.ResolveTree): Call ResolveMembers() on all
2838         TypeContainer's in the `type_container_resolve_order'.
2839
2840 2007-03-19  Marek Safar  <marek.safar@gmail.com>
2841
2842         * class.cs: Use corlib to handle InternalMethodImplAttribute.
2843
2844 2007-03-17  Marek Safar  <marek.safar@gmail.com>
2845
2846         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
2847         implementation flags.
2848
2849 2007-03-17  Marek Safar  <marek.safar@gmail.com>
2850
2851         * class.cs: More optimizations for type parameters.
2852
2853 2007-03-15  Marek Safar  <marek.safar@gmail.com>
2854
2855         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
2856
2857         * ecore.cs, parameter.cs: More common code for both corlibs.
2858
2859         * typemanager.cs (IsGenericMethod): Simplified.
2860
2861 2007-03-15  Raja R Harinath  <rharinath@novell.com>
2862
2863         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2864         'returns'.
2865         * statement.cs, iterators.cs, lambda.cs: Update to changes.
2866
2867         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
2868         unconditionally.  Simplify explanation.
2869         (Try.Resolve, Using.Resolve): Likewise.
2870
2871 2007-03-15  Martin Baulig  <martin@ximian.com>
2872
2873         Fix #80731.
2874
2875         * decl.cs (DeclSpace): If we're a partial class, use our
2876         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
2877
2878 2007-03-15  Raja R Harinath  <rharinath@novell.com>
2879
2880         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2881         'throws'.
2882         (FlowBranching.UsageVector): Update to changes.
2883         (FlowBranching.MergeSiblings): Likewise.
2884         * statement.cs: Likewise.
2885
2886 2007-03-15  Martin Baulig  <martin@ximian.com>
2887
2888         Fix #79302.
2889
2890         * decl.cs
2891         (MemberCache): Added a special .ctor for type parameters.
2892
2893         * typemanager.cs
2894         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
2895         `MemberCache'.  
2896
2897 2007-03-09  Martin Baulig  <martin@ximian.com>
2898
2899         * enum.cs (Enum): Make this a TypeContainer.
2900         (EnumMember): Derive from `Const'.
2901
2902         * const.cs
2903         (Const.DoResolveValue): New protected virtual method; move most of
2904         the functionality of ResolveValue() here so we can override it in
2905         `EnumMember'.
2906         (Const.CreateConstantReference): Make this virtual.
2907
2908         * class.cs (Kind): Add `Kind.Enum'.
2909         (TypeContainer.Emit): Don't emit the enums here; they're already
2910         in the `RootContext.typecontainer_resolve_order'.
2911
2912         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
2913         here; they're already in the `typecontainer_resolve_order'.
2914
2915         * ecore.cs (EnumConstant.ConvertImplicitly): Add
2916         TypeManager.DropGenericTypeArguments().
2917
2918         * typemanager.cs
2919         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
2920         (TypeManager.IsEnumType): Likewise.
2921         (TypeManager.EnumToUnderlying): Likewise.
2922         (TypeManager.IsEqual): Add support for enums.
2923
2924 2007-03-12  Raja R Harinath  <rharinath@novell.com>
2925
2926         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
2927         DefaultParameterValueAttribute to be undefined, say if System.dll
2928         is not referenced.
2929
2930 2007-03-11  Marek Safar  <marek.safar@gmail.com>
2931
2932         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
2933         any mscorlib.
2934
2935 2007-03-10  Marek Safar  <marek.safar@gmail.com>
2936
2937         * class.cs, parameter.cs: Unified parameters verification.
2938
2939 2007-03-08  Martin Baulig  <martin@ximian.com>
2940
2941         * cs-parser.jay (constructor_header): Pass the location to the
2942         newly created TopLevelBlock.
2943
2944 2007-03-07  Martin Baulig  <martin@ximian.com>
2945
2946         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
2947
2948 2007-03-06  Miguel de Icaza  <miguel@novell.com>
2949
2950         * convert.cs (ExplicitReferenceConversionExists): Sync this method
2951         with the changes from David, fixes the build.
2952
2953 2007-03-05  David Mitchell  <dmitchell@logos.com>
2954
2955         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
2956         and its base interfaces to a one-dimensional array type S[],
2957         provided there is an implicit or explicit reference conversion
2958         from S to T.
2959
2960 2007-03-03  Marek Safar  <marek.safar@gmail.com>
2961
2962         * cs-tokenizer.cs: Implemented basic linq grammar.
2963
2964         * driver.cs: Set linq lang version on demand.
2965
2966 2007-02-26  Marek Safar  <marek.safar@gmail.com>
2967
2968         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
2969
2970 2007-02-25  Marek Safar  <marek.safar@gmail.com>
2971
2972         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
2973         (Fixes #80455)
2974
2975         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
2976         here.
2977         Check property and event extern attributes.
2978
2979         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
2980         charset.
2981
2982 2007-02-24  Marek Safar  <marek.safar@gmail.com>
2983
2984         A fix for bug #80407
2985         * ecore.cs: Don't report ambiguity error when methods have same parent.
2986
2987 2007-02-23  Marek Safar  <marek.safar@gmail.com>
2988
2989         A fix for bug #80878
2990         * class.cs, cs-parser.jay: Event property can host anonymous methods.
2991
2992 2007-02-22  Marek Safar  <marek.safar@gmail.com>
2993
2994         * attribute.cs: Enable ExtensionAttribute presence test.
2995
2996 2007-02-22  Marek Safar  <marek.safar@gmail.com>
2997
2998         * class.cs: Warn about missing GetHashCode only when Equals is override.
2999
3000         * decl.cs: Check accessibility of type arguments.
3001
3002         * typemanager.cs: Correctly report nullable array.
3003
3004 2007-02-20  Marek Safar  <marek.safar@gmail.com>
3005
3006         * class.cs, report.cs: Capture more details when things go wrong.
3007
3008 2007-02-20  Marek Safar  <marek.safar@gmail.com>
3009
3010         A fix for bug #80650
3011         * cs-parser.jay: Anonymous container starts at constructor declaration
3012         and not at block beginning because it has to be usable in constructor
3013         initializer.
3014
3015         * statement.cs: Use context location and not block one for error reporting.
3016
3017 2007-02-18  Marek Safar  <marek.safar@gmail.com>
3018
3019         A fix for bug #78712
3020         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
3021         too.
3022
3023 2007-02-18  Marek Safar  <marek.safar@gmail.com>
3024
3025         A fix for bug #80493 by Atsushi Enomoto
3026         * cs-parser.jay: Ignore invalid attribute target.
3027
3028 2007-02-18  Marek Safar  <marek.safar@gmail.com>
3029  
3030         * cs-tokenizer.cs: Ignore '\0' as white space character.
3031
3032 2007-02-17  Miguel de Icaza  <miguel@novell.com>
3033
3034         * cs-parser.jay: Add support for lambda expressions to the mcs
3035         compiler as well.
3036
3037         * lambda.cs: Only clone when we are probing, not on the final call
3038         (Compatible is the final call). 
3039
3040         * statement.cs (CloneContext): Introduce class to provide block
3041         remapping during clone.
3042
3043         All statements Clone themselves now.
3044
3045         (Clone): special handling for blocks, when we clone a block, we
3046         register the block inside this routine, as children of the block
3047         might trigger a lookup. 
3048         
3049         * expression.cs: Add support for CloneContext in all expressions. 
3050         
3051 2007-02-17  Marek Safar  <marek.safar@gmail.com>
3052  
3053         A fix for bug #80493
3054         * statement.cs: Report ambiguous warning when interfaces are not related.
3055
3056 2007-02-15  Marek Safar  <marek.safar@gmail.com>
3057
3058         C# 3.0 extension methods.
3059
3060         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
3061         cannot be used directly.
3062
3063         * class.cs (Class.Emit): Emit extension attribute if any class method
3064         is extension method.
3065         (Method.Define): Add basic extension method validation conditions.
3066         (Method.Emit): Emit extension attribute for method.
3067
3068         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
3069         extension method exists. Currently we follow same approach as Microsoft
3070         does, emit even if a method or a class are private but this can change
3071         later.
3072
3073         * cs-parser.jay: Add handling of `this' keyword in method parameters
3074         context.
3075
3076         * decl.cs (DeclSpace.IsStaticClass): New property.
3077         (MemberCache.FindExtensionMethods): Looks for extension methods with
3078         defined name and extension type.
3079
3080         * doc.cs: Updated after OverloadResolve changes.
3081
3082         * driver.cs: Add new soft reference to System.Core.dll.
3083
3084         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
3085         (ExtensionMethodGroupExpr): Represents group of extension methods.
3086
3087         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
3088         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
3089         to MethodGroupExpr and made non-static for easier customization.
3090         (Invocation.DoResolve): Add extension method lookup when no standard
3091         method was found.
3092         (MemberAccess.DoResolve): Try extension methods if no member exists.
3093
3094         * modifiers.cs: Add METHOD_EXTENSION modifier.
3095
3096         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
3097         as well as candidate extension type.
3098         (ComputeNamespaces): When assembly constains extension methods registers
3099         them.
3100         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
3101         extension method lookup.
3102         (Namespace.LookupExtensionMethod): Looks for extension method in this
3103         namespace.
3104         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
3105         find a method which matches name and extensionType.
3106
3107         * parameter.cs (Parameter): Add This modifer.
3108         (HasExtensionMethodModifier): New property.
3109         (Resolve): Add extension parameter check.
3110         (ModFlags): turned to property to exclude this modifier as it is not real
3111         parameter modifier.
3112         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
3113
3114         * support.cs (ParameterData): Add ExtensionMethodType.
3115         (ReflectionParameters): Implemented ExtensionMethodType interface property.
3116
3117         * typemanager.cs: Add type and ctor extension attribute type.
3118
3119 2007-02-15  Miguel de Icaza  <miguel@novell.com>
3120
3121         * report.cs (DisableErrors, EnableErrors): used to prevent error
3122         output when we are "trying" to compile various methods with
3123         different types. 
3124
3125         * ecore.cs (Expression): Add Clone method that calls the virtual
3126         CloneTo method.  The current CloneTo method in Expression throws
3127         an exception so we can track down all the places where this must
3128         be implemented (not using abstract, because that would be a lot of
3129         up-front-work before we can start testing the implementation
3130         idea). 
3131
3132         Important: we only need Clone capabilities for expressions created
3133         by the parser, as the expressions we will be cloning are
3134         expressions in the pre-resolved state.   This vastly simplifies
3135         the work required. 
3136         
3137         (SimpleName): Add CloneTo that does nothing.
3138         (EmptyCast): Add CloneTo.
3139         
3140         * expression.cs (Binary): Implement CloneTo.
3141         (Invocation.IsApplicable): Store the current ec in
3142         EmitContext.TempEc and restore it on return.  This is used so we
3143         do not have to sprinkle hundres of methods with an extra
3144         EmitContext, we know that the only user is the lambda expression
3145         ImplicitConversionExists code. 
3146         
3147         (Argument): Add Cloning capabilities.
3148         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
3149         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
3150         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
3151         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
3152         IndexerAccess): Add Clone capability.
3153
3154         (LocalVariableReference, This): TODO: needs cloned Block mapping.
3155
3156         (Argument): Add cloning capability.
3157
3158         * assign.cs (Assign): Implement CloneTo.
3159
3160         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
3161         
3162         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
3163         version by calling Convert with the EmitContext (that we are
3164         currently storing in ec, this is not great, but will do for now,
3165         to avoid passing EmitContext parameters to hundreds of functions
3166         that do not need them now).
3167
3168         (SetExpression): Remove, it is not needed.
3169         
3170         (ContextualReturn): Implement CloneTo.
3171
3172         * statement.cs (Statement): Implement cloning infrastructure,
3173         similar to expressions.
3174
3175         (Block): Partial implementation of Clone for statements.
3176
3177         (Return): Implement clone.
3178         
3179         * constant.cs (Constant.CloneTo): New method, does nothing.
3180
3181         * codegen.cs (TempEc): Add a static EmitContext as a temporary
3182         solution, until we decide how to exactly do this.  
3183         
3184 2007-02-14  Marek Safar  <marek.safar@gmail.com>
3185  
3186         A fix for bug #80493
3187         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
3188         a property is override we need to use second accessor.
3189
3190 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3191  
3192         A fix for bug #80418
3193         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
3194         methods.
3195
3196 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3197
3198         Another fix for bug #80749
3199         * pending.cs: Abstract class has priority over interfaces.
3200
3201 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3202
3203         Another fix for bug #80749
3204         * pending.cs: Abstract class has priority over interfaces.
3205
3206 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3207
3208         Another fix for bug #80749
3209         * pending.cs: Abstract class has priority over interfaces.
3210
3211 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3212
3213         Another fix for bug #80749
3214         * pending.cs: Abstract class has priority over interfaces.
3215
3216 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3217
3218         * class.cs Better error message.
3219
3220         * driver.cs: Add shorter versions of -optimize option.
3221
3222 2007-02-13  Martin Baulig  <martin@ximian.com>
3223
3224         * class.cs (Constructor.Emit): Check the return value of
3225         ec.ResolveTopBlock() and return on error.
3226
3227 2007-02-13  Raja R Harinath  <rharinath@novell.com>
3228
3229         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
3230         message to fix error message regression.
3231
3232 2007-02-12  Marek Safar  <marek.safar@gmail.com>
3233
3234         * delegate.cs: Delegate creation expression cannot be of Nullable type.
3235
3236 2007-02-12  Marek Safar  <marek.safar@gmail.com>
3237
3238         A fix for bug #80749
3239         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
3240         its parent container.
3241
3242         * class.cs (DefineFieldInitializers): Each initializer can has different
3243         resolve context.
3244
3245         * const.cs: Updated.
3246
3247 2007-02-11  Miguel de Icaza  <miguel@novell.com>
3248
3249         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
3250         now all the heavy lifting to check that embedded statements or
3251         expressions have the right form is done in the ContextualReturn.
3252
3253         (ContextualReturn): New class.  
3254
3255         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
3256         method that can be invoked to report 201, so we do not replicate
3257         this everywhere.
3258
3259         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
3260         
3261         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
3262         treating tabs as spaces. 
3263
3264 2007-02-09  Marek Safar  <marek.safar@gmail.com>
3265
3266         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
3267         * assign.cs: Use full implicit conversion for right side check.
3268
3269 2007-02-09  Marek Safar  <marek.safar@gmail.com>
3270
3271         * statement.cs (Switch): Switch over boolean type is not standardized.
3272
3273 2007-02-08  Marek Safar  <marek.safar@gmail.com>
3274
3275         A fix for bug #80755
3276         * decl.cs (FindBaseEvent): Don't use method cache for events.
3277
3278 2007-02-07  Marek Safar  <marek.safar@gmail.com>
3279
3280         * cs-parser.jay: Better syntax error handling.
3281
3282         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
3283         instead of underlying type value.
3284
3285 2007-02-06  Marek Safar  <marek.safar@gmail.com>
3286
3287         * driver.cs: Check define identifier before is registered.
3288
3289         * namespace.cs: Use existing error message.
3290
3291         * report.cs: New warning.
3292
3293 2007-02-06  Marek Safar  <marek.safar@gmail.com>
3294
3295         A fix for bug #80742
3296         * expression.cs: Delegate Invoke method can be called directly.
3297
3298 2007-02-06  Marek Safar  <marek.safar@gmail.com>
3299
3300         A fix for bug #80676
3301         * class.cs (IsEntryPoint): The Main method can have params modifier.
3302
3303 2007-02-04  Miguel de Icaza  <miguel@novell.com>
3304
3305         * parameter.cs (Parameter, Parameters): Add Clone method.
3306
3307         * anonymous.cs (Compatible): Turn method into virtual method, so
3308         LambdaExpression can implement a different behavior.
3309
3310         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
3311         out the basic checking here, so it can be used by
3312         LambdaExpressions.
3313         
3314         * lambda.cs: Introduce "Compatible" function that will do the
3315         heavy lifting.
3316
3317 2007-02-02  Marek Safar  <marek.safar@gmail.com>
3318
3319         * attribute.cs: Unified one error message.
3320
3321         * class.cs (Class): Use type attributes and not properties to test static
3322         class.
3323         (IsEntryPoint): Don's pass local variable.
3324
3325         * convert.cs: Removed duplicate check.
3326
3327         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
3328
3329         * driver.cs: Don't crash when soft reference does not exist.
3330
3331         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
3332         (UsingEntry): Removed redundant allocation.
3333
3334         * parameter.cs: Add fast path for type parameters.
3335
3336         * support.cs: Don't allocate attribute when it's not used.
3337
3338 2007-01-30  Miguel de Icaza  <miguel@novell.com>
3339
3340         * anonymous.cs
3341         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
3342         this into a virtual method, so we can override it in LambdaExpression.
3343
3344         * driver.cs: Improve diagnostics in case of failure. 
3345
3346         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
3347         write a function that is slightly more complex and that parses:
3348
3349         type identifier [, type identifier]* )
3350
3351         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
3352         this expression:
3353
3354                 (canEmpty ? i >= 0 : i > 0)
3355
3356 2007-01-30  Raja R Harinath  <rharinath@novell.com>
3357
3358         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
3359         exception on possibly valid code.
3360
3361 2007-01-29  Raja R Harinath  <rharinath@novell.com>
3362
3363         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
3364         Push/PopPosition.
3365         (parse_opt_type_arguments): Remove.  It's almost the same as
3366         parse_less_than.
3367         (parse_namespace_or_typename): Use parse_less_than.
3368
3369 2007-01-28  Miguel de Icaza  <miguel@novell.com>
3370
3371         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
3372         this bug took a few hours to find, because the state saved and
3373         restored by PushPosition and PopPosition was ignoring the state of
3374         parse_generic_less_than.
3375
3376         I can also now remove the handling of OP_LT and OP_GT, this solves
3377         the big mistery.
3378         
3379         * cs-tokenizer.cs: store the location for the ARROW token, we use
3380         that in the parser.
3381
3382         (PushPosition, PopPosition): save/restore also `current_token',
3383         restore `parse_generic_less_than' (was missing).
3384
3385         (parse_opt_type_arguments): use parse_type, not
3386         parse_namespace_or_typename to parse types.
3387
3388         * lambda.cs: Empty new file, will eventually have the lambda
3389         expression implementation.
3390
3391         * lambda.test: used to test the internal tokenizer. 
3392
3393         * report.cs (FeatureIsNotISO1): Rename from
3394         FeatureIsNotStandardized, because it was about the language level
3395         (1 vs 2) it was not about standarization.
3396
3397         (FeatureRequiresLINQ): New.
3398
3399         * support.cs (SeekableStreamReader): Only require that the reader
3400         is a TextReader, not a StreamReader, so we can plug StringReader. 
3401
3402         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
3403         given position in the input stream the following tokens can be
3404         parsed as a type followed by an identifier.
3405
3406         (is_punct): after a '(' if parse_type_and_parameter returns true,
3407         then return a special token OPEN_PARENS_LAMBDA which is used to
3408         avoid reduce/reduce errors in the grammar for the
3409         lambda_expression rules.
3410
3411         (parse_type): implement a type parser inside the
3412         tokenizer, the parser only returns true or false depending on
3413         whether the input at a given position can be parsed as a type.
3414
3415         (peek_token): new method used during type parsing.
3416
3417 2007-01-28  Raja R Harinath  <rharinath@novell.com>
3418
3419         Fix #80531
3420         * anonymous.cs (ScopeInfo.InflateParameters): New.
3421         (AnonymousContainer.Resolve): Use it to redirect types of
3422         delegate parameters.
3423
3424 2007-01-27  Raja R Harinath  <rharinath@novell.com>
3425
3426         Fix #80530
3427         * expression.cs (Error_InvalidArguments): Don't use two different
3428         messages for CS1503.  Use ExtraInformation and
3429         SymbolRelatedToPreviousError instead.
3430
3431         Fix #80358
3432         * decl.cs (DeclSpace.initialize_type_params): Don't access
3433         'type_params' of a partial class directly.
3434
3435 2007-01-26  Miguel de Icaza  <miguel@novell.com>
3436
3437         * constant.cs: Removed a handful of out-of-range checks that were
3438         not necessary. 
3439
3440 2007-01-25  Marek Safar  <marek.safar@gmail.com>
3441
3442         * expression.cs (CheckUselessComparison): Add additional check for char
3443         constants.
3444
3445         * namespace.cs: Fixed typo.
3446
3447 2007-01-23  Miguel de Icaza  <miguel@novell.com>
3448
3449         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
3450         gone, instead we inline the test, preventing the needless casts to
3451         longs, ulongs and doubles for the parameters, avoiding calls to
3452         methods that overchecked stuff, and instead inlined things
3453         nicely. 
3454
3455 2007-01-20  Marek Safar  <marek.safar@gmail.com>
3456
3457         * cs-parser.jay: Better parameter error handling.
3458
3459 2007-01-17  Marek Safar  <marek.safar@gmail.com>
3460
3461         A fix for bug #80368, #80522
3462         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
3463         whether array initializer contains constants only.
3464         (ArrayCreation.Emit): Use better formula to decide when
3465         are array initializers for static initialization.
3466         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
3467         have to emit even constants otherwise they are pre-initialized.
3468
3469 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
3470             Raja R Harinath  <rharinath@novell.com>
3471
3472         Fix emit order of 'get' vs. 'set'.
3473         * support.cs (Accessors): New.
3474         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
3475         Note the order in which accessors are declared in the source.
3476         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
3477         Refactored from Property.Define and Indexer.Define.
3478         (PropertyBase.DefineAccessors): New helper that calls the above in
3479         appropriate order as noted by the parser.
3480         (Property.Define, Indexer.Define): Update to changes.
3481         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
3482
3483 2007-01-17  Raja R Harinath  <rharinath@novell.com>
3484
3485         Fix cs0029-6.cs and gcs0029-2.cs (regression)
3486         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
3487         there's an implicit conversion from the current type to the target
3488         type before converting the underlying constant.
3489
3490 2007-01-16  Marek Safar  <marek.safar@gmail.com>
3491
3492         * const.cs (ResolveValue): Updated after constant conversion was made more
3493         generic.
3494
3495         * constant.cs (GetAttributableValue): constant to object conversion is
3496         used for attributes only.
3497         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
3498         constant conversions.
3499         (LongConstant.ConvertImplicitly): Ditto.
3500
3501         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
3502         (ImplicitConversionStandard): Handle constant conversion as extra step.
3503         It solves the issue when constant conversion was called indirectly like
3504         inside array initializer and constant folding was skipped.
3505
3506         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
3507         this change.
3508
3509         * statement.cs(ImplicitConversionStandard): Updated after constant
3510         conversion was made more generic.
3511
3512 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
3513
3514         * expression.cs (As.DoResolve): Use GenericConstraints instead of
3515         Constraints, solves the problem where the compiler incorrectly
3516         reported that a type parameter was not constrained to a class (Bug
3517         80518)
3518
3519 2007-01-14  Marek Habersack  <grendello@gmail.com>
3520
3521         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
3522
3523 2007-01-14  Marek Safar  <marek.safar@gmail.com>
3524
3525         A fix for bug #80368
3526         * assign.cs (FieldInitializer): New class implements field
3527         initializer statement.
3528
3529         * attribute.cs: Update after FieldMember rename.
3530
3531         * class.cs (PropertyBasedMember): New common class for property based
3532         types.
3533         (InterfaceMemberBase): New base class for all members which can be used as
3534         an interface members.
3535         (MethodCore): Moved really common code to InterfaceMemberBase.
3536         (Method.Define): Equal and GetHasCode detection is relevant for methods
3537         only.
3538         (MethodData.Define): Don't assume that public event implements an
3539         interface automatically.
3540         (MethodData.DefineMethodBuilder): Issue an error even if only extern
3541         modifier is used.
3542         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
3543         (FieldMember): Merged with FieldBase.
3544         (EventProperty.AEventPropertyAccessor): New specialization to check whether
3545         event extern modifier can be used.
3546         (EventField.EventFieldAccessor): Moved event field specific code here.
3547         (Event.AllowedModifiers): Even event can be extern.
3548         (Event.FindOutBaseMethod): New override specific to events.
3549         (Indexer.parameters): Reintroduce parameters because base class holds
3550         only properties common data.
3551         (Indexer.CheckForDuplications): Indexers are threated as methods so we
3552         need do extra parameters check.
3553
3554         * const.cs: Update after FieldMember rename.
3555
3556         * decl.cs (MemberCache.FindBaseEvent): New method.
3557
3558         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
3559         to reflect that indexer is now derived from PropertyBased.
3560
3561         * ecore.cs (GetMemberType): Made public.
3562         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
3563         obsolete event.
3564
3565         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
3566         
3567         * typemanager.cs (CSharpSignature): Correctly print event accessors.
3568         (RegisterEvent): Removed.
3569         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
3570         (GetPrivateFieldOfEvent): Renamed to GetEventField.
3571
3572 2007-01-11  Raja R Harinath  <rharinath@novell.com>
3573
3574         Fix #80249
3575         * statement.cs (CollectionForeach.TryType): Prefer generic
3576         GetEnumerator over non-generic variant.  Fix code to follow comments.
3577
3578 2007-01-09  Raja R Harinath  <rharinath@novell.com>
3579
3580         Fix #80446
3581         * support.cs (ReflectionParameter): Don't use an invalid index on
3582         the generic parameter data.
3583
3584 2007-01-08  Miguel de Icaza  <miguel@novell.com>
3585
3586         * driver.cs: Just add a tiny bit of infrastructure.
3587
3588 2007-01-02  Marek Safar  <marek.safar@gmail.com>
3589
3590         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
3591         where field type is struct from current assembly.
3592         
3593         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
3594         it is possible.
3595
3596 2007-01-02  Marek Safar  <marek.safar@gmail.com>
3597
3598         A fix for bug #80381
3599         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
3600         the core types.
3601
3602         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
3603         messages.
3604         (Namespace.LookupType): Always use core types from corlib when speficied.
3605
3606         * report.cs: A new warning.
3607
3608         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
3609         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
3610         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
3611
3612         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
3613         (InitCoreTypes): Set expression type of object_type and value_type
3614         immediately after lookup.
3615
3616 2007-01-01  Miguel de Icaza  <miguel@novell.com>
3617
3618         * cs-tokenizer.cs: Accept Pc class characters (Connector
3619         Punctuation) as valid identifiers.  Fixes #78259
3620
3621         * expression.cs (Invocation.DoResolve): Moved the check for the
3622         use of `this' for doing method calls to the Invocation resolution
3623         step, after overload resolution has taken place instead of doing
3624         the check at the low-level `This.DoResolve' level.
3625
3626         The `This.DoResolve'(appens before overload resolution, so it has
3627         no way of knowing if the method that will be called will be
3628         instace or static, triggering an erroneous report for cs0188 (Bug
3629         78113).
3630
3631         We now do the check for instance method invocations after we know
3632         what method will be called.
3633
3634         (This.CheckThisUsage): Move the actual use of this structure
3635         checking into its own method and expose it. 
3636
3637         * Everywhere that called Error_ValueCannotBeConverted: pass a new
3638         EmitContext.
3639
3640         Exceptions: Null.ConvertImplicitly,
3641         Constant.ImplicitConversionRequired as there are too many call
3642         sites for passing the ec. 
3643
3644         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
3645         EmitContext, if the value is null, then we do not try to provide
3646         the extra information from the error (If a userdefined conversion
3647         exists, as UserDefinedConversion requires a non null-EmitContext).
3648
3649         Fixes: #80347
3650
3651 2006-12-30  Raja R Harinath  <rharinath@novell.com>
3652
3653         * flowanalysis.cs (MyBitVector): Document some invariants.
3654         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
3655         introduced below, and add a couple of others, 
3656
3657 2006-12-30  Marek Safar  <marek.safar@gmail.com>
3658
3659         * attribute.cs (GetMethodObsoleteAttribute): Uses new
3660         GetPropertyFromAccessor and GetEventFromAccessor.
3661         
3662         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
3663         overrides non-obsolete one.
3664         (Indexer.Define): Error message has been moved to the parser.
3665
3666         * cs-parser.jay: Better syntax errors handling.
3667
3668         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
3669         when an invocation has no arguments.
3670
3671         * ecore.cs: Removed not used caching.
3672
3673         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
3674         implementation.
3675
3676         * report.cs: Add a new warning.
3677
3678         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
3679
3680         * typemanager.cs (enumeration_type): Removed.
3681         (CSharpSignature): Reuses IsSpecialMethod.
3682         (IsEqual): Hack for MS BCL.
3683         (GetPropertyFromAccessor): New method.
3684         (GetEventFromAccessor): New method.
3685         (IsSpecialMethod): Fixed to handle more cases.
3686
3687 2006-12-30  Marek Safar  <marek.safar@gmail.com>
3688
3689         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
3690         Made white spaces array static.
3691
3692         * ecore.cs (RemoveGenericArity): Optimized.
3693
3694         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
3695         10 times faster).
3696         (MyBitVector.initialize_vector): Simplified.
3697
3698 2006-12-22  Miguel de Icaza  <miguel@novell.com>
3699
3700         * ecore.cs: Am not entirely happy with this hack, but it seems to
3701         address the issue in 80257 (a small test case for
3702         CreativeDocs.NET). 
3703
3704         I set the MethodGroupExpr.Type to an internal compiler type
3705         (itself in this case) to force the resolution to take place.   Why
3706         it does not take place with a null is beyond me.
3707
3708 2006-12-20  Marek Safar  <marek.safar@gmail.com>
3709
3710         A fix for bug #80288
3711         * expression.cs (ResolveOperator): Consider user defined conversion for
3712         logical and operator too.
3713         (EmitBranchable): Optimization for logical and when full constant folding
3714         could not be applied but one operand is constant.
3715
3716 2006-12-19  Marek Safar  <marek.safar@gmail.com>
3717
3718         * class.cs (GetClassBases): Write 5 times every day, will never use
3719         FullName for error reporting.
3720
3721         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
3722
3723 2006-12-19  Martin Baulig  <martin@ximian.com>
3724
3725         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
3726         the symbol file info here.
3727
3728 2006-12-18  Marek Safar  <marek.safar@gmail.com>
3729
3730         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
3731         of `elseif' is taking then following sections are not taking.
3732         Fixes an issue reported on mono mailing list.
3733
3734 2006-12-18  Marek Safar  <marek.safar@gmail.com>
3735
3736         A fix for bug #80300
3737         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
3738         a caller is not taking.
3739
3740 2006-12-18  Raja R Harinath  <rharinath@novell.com>
3741
3742         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
3743         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
3744         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
3745         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
3746         * class.cs: Update to changes.
3747
3748 2006-12-17  Marek Safar  <marek.safar@gmail.com>
3749
3750         A fix for bug #79934
3751         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
3752         partial container.
3753
3754         * class.cs (ResolveMembers): Register an iterator in current container and
3755         not in shared one.
3756
3757 2006-12-16  Raja R Harinath  <rharinath@novell.com>
3758
3759         Fix test-543.cs
3760         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
3761         satisfy a params annotated parameter.
3762
3763 2006-12-16  Marek Safar  <marek.safar@gmail.com>
3764
3765         A fix for bug #77014
3766         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
3767         paramters correctly and not rely on hacks in Parameters class.
3768         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
3769         at any possition.
3770         (Invocation.VerifyArgumentsCompat): Ditto.
3771         (Invocation.EmitArguments): Changed to correctly emit params arguments at
3772         any possition.
3773
3774         * parameter.cs (HasParams): Don't assume that params is the last one.
3775
3776         * support.cs (ReflectionParameters.ctor): Look for params attribute
3777         correctly.
3778         (ReflectionParameters.ParameterType): Removed hack when we returned last
3779         parameter for out of range parameters.
3780         (ParameterName, ParameterModifier): Ditto.
3781
3782 2006-12-14  Marek Safar  <marek.safar@gmail.com>
3783
3784         A fix for bug #79987
3785         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
3786         when assembly is not CLS compliant but type is. I have no idea why is this
3787         allowed.
3788
3789         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
3790
3791 2006-12-13  Miguel de Icaza  <miguel@novell.com>
3792
3793         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
3794         in struct constructors, they are basically no-ops.
3795
3796 2006-12-12  Marek Safar  <marek.safar@gmail.com>
3797
3798         * cs-tokenizer.cs (Position): Save preprocessor status too.
3799
3800 2006-12-12  Marek Safar  <marek.safar@gmail.com>
3801
3802         A fix for bug #77794
3803         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
3804
3805 2006-12-12  Marek Safar  <marek.safar@gmail.com>
3806
3807         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
3808         Fixes #69299.
3809         (pp_expr): Report error for an invalid expression.
3810         (handle_preprocessing_directive): Simplified; add more error checking.
3811
3812 2006-12-11  Marek Safar  <marek.safar@gmail.com>
3813
3814         A fix for bug #74939
3815         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
3816         directives handling.
3817
3818 2006-12-10  Marek Safar  <marek.safar@gmail.com>
3819
3820         A fix for bugs #80093, and #75984
3821         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
3822         logic, it seems to me as it worked before "by coincidence".
3823         (xtoken): Simplified to use reworked handle_preprocessing_directive.
3824         (cleanup): Enabled endif check.
3825
3826 2006-12-09  Marek Safar  <marek.safar@gmail.com>
3827
3828         A fix for bug #80162
3829         * statement.cs (CollectionForeach.TryType): Generics and non-generics
3830         enumerators are never ambiguous.
3831
3832 2006-12-08  Raja R Harinath  <rharinath@novell.com>
3833
3834         Fix #80060
3835         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
3836
3837 2006-12-06  Marek Safar  <marek.safar@gmail.com>
3838
3839         A fix for bug #80144
3840         * class.cs (EventProperty.Define): Explicit implementation means
3841         that an even is used.
3842
3843 2006-12-06  Marek Safar  <marek.safar@gmail.com>
3844
3845         Fixes the operators implementation (part II)
3846
3847         * cfold.cs (DoConstantNumericPromotions): Renamed to
3848         DoBinaryNumericPromotions and simplified.
3849         (BinaryFold): Couple of conversion fixes; simplified.
3850
3851         * constant.cs, ecore.cs, literal.cs
3852         (ToType): Renamed to ConvertImplicitly.
3853         (Reduce): Renamed to ConvertExplicitly.
3854
3855         * class.cs, convert.cs: Updated.
3856
3857         * expression.cs: TryReduce doesn't throw an exception.
3858
3859 2006-12-01  Marek Safar  <marek.safar@gmail.com>
3860
3861         A fix for bug #80108
3862         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
3863         compatible.
3864
3865 2006-11-30  Marek Safar  <marek.safar@gmail.com>
3866
3867         Fixes unary operators implementation (part I)
3868         Also fixes #80026
3869
3870         * cfold.cs (Error_CompileTimeOverflow): Made internal
3871
3872         * const.cs (IConstant): Changed to use reference to constant and
3873         not constant itself.
3874         Updated IConstant implementations.
3875
3876         * constant.cs (CreateConstant): New factory method.
3877         Updated IConstant implementation.
3878
3879         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
3880
3881         * ecore.cs: Updated to use CreateConstantReference.
3882
3883         * enum.cs: Reflects IConstant changes.
3884
3885         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
3886
3887         * literal.cs (NullConstant): Change to be independently usable.
3888
3889 2006-11-29  Martin Baulig  <martin@ximian.com>
3890
3891         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
3892         we need to emit the scope initializer before calling the base .ctor.
3893
3894         * anonymous.cs: Merged back from the new anonymous methods branch.
3895         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
3896
3897         * expression.cs (ParameterReference.DoResolveBase): Create a
3898         "normal" ScopeInfo when capturing parameters rather than using the
3899         root scope; this makes things work with anonymous methods having
3900         parameters.
3901
3902         * statement.cs
3903         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
3904
3905 2006-11-22  Marek Safar  <marek.safar@gmail.com>
3906
3907         A fix for bug #79987
3908         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
3909         check to a base class.
3910         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
3911         only when assembly has missing attribute.
3912         * report.cs: Update.
3913
3914 2006-11-21  Marek Safar  <marek.safar@gmail.com>
3915
3916         * cs-tokenizer.cs: Merged with gmcs version.
3917
3918 2006-11-20  Marek Safar  <marek.safar@gmail.com>
3919
3920         * cs-tokenizer.cs,
3921         * cs-parser.jay: Better error message when partial keyword is misplaced.
3922
3923 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
3924
3925         A fix for bug #79810
3926         report.cs: CS1058 only applies to 2.0 profile (gmcs).
3927         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
3928         a RuntimeWrappedException by default.
3929
3930 2006-11-18  Marek Safar  <marek.safar@gmail.com>
3931
3932         A fix for bug #79843
3933         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
3934         implementation.
3935         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
3936
3937 2006-11-18  Marek Safar  <marek.safar@gmail.com>
3938
3939         * driver.cs, namespace.cs: Uses faster IndexOf version.
3940
3941 2006-11-17  Marek Safar  <marek.safar@gmail.com>
3942
3943         A fix for bug #79941
3944         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
3945         operators.
3946         (Operator.Define): Implicit/Explicit operator of same type is duplicate
3947         even if internal name is different.
3948         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
3949         (UserDefinedConversion): Simplified as the operators cannot be internal.
3950         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
3951         conversions.
3952         (MethodLookup): Replaced EmitContext with parentType.
3953         * expression.cs: Updated.
3954
3955 2006-11-09  Raja R Harinath  <rharinath@novell.com>
3956
3957         * driver.cs (BadAssembly): Handle all the ugliness of
3958         DefineDynamicAssembly.
3959
3960 2006-11-08  Raja R Harinath  <rharinath@novell.com>
3961
3962         Address parts of #58244 -- most of what's left is in the runtime
3963         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
3964         CS1509 error checks, and handle them for all assembly loads, not
3965         just the first invocation.
3966         (LoadModule): Likewise.  Move handling of 'adder_method' ...
3967         * codegen.cs (AssemblyClass.AddModule): ... here.
3968
3969 2006-11-02  Marek Safar  <marek.safar@gmail.com>
3970
3971         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
3972         IEnumerable<T> is ambiguous.
3973
3974 2006-10-31  Marek Safar  <marek.safar@gmail.com>
3975
3976         A fix for bug #67689
3977         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
3978         GetEnumerator is ambiguous.
3979
3980         * report.cs: Add new warning.
3981
3982 2006-10-29  Marek Safar  <marek.safar@gmail.com>
3983
3984         A fix for bug #78602
3985         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
3986         to protected member can be nested type.
3987
3988 2006-10-28  Marek Safar  <marek.safar@gmail.com>
3989
3990         A fix for bug #78965
3991         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
3992         to protected member must derive from current type.
3993
3994 2006-10-27  Marek Safar  <marek.safar@gmail.com>
3995
3996         assign.cs: Reuses error method.
3997
3998         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
3999         instead of type for constants.
4000         (Expression.Error_ValueAssignment): Common error method.
4001
4002         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
4003         for any assignment.
4004
4005 2006-10-27  Marek Safar  <marek.safar@gmail.com>
4006
4007         A fix for bug #79081
4008         * expression.cs (MemberAccess.DoResolve): Check nested type
4009         accessibility.
4010
4011 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
4012
4013         * doc.cs : nested delegates were not handled. Fixed bug #79754.
4014
4015 2006-10-26  Marek Safar  <marek.safar@gmail.com>
4016
4017         A fix for bug #76591
4018         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
4019
4020 2006-10-26  Marek Safar  <marek.safar@gmail.com>
4021
4022         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
4023         type forwarder of the same type multiple times.
4024
4025 2006-10-26  Raja R Harinath  <rharinath@novell.com>
4026
4027         Fix #78820
4028         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
4029         instance as an rvalue, even when we later resolve as an lvalue.
4030
4031 2006-10-25  Martin Baulig  <martin@ximian.com>
4032
4033         * anonymous.cs: Fix #79673.
4034
4035 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
4036
4037         A fix for bug #79666
4038         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
4039         ignored when is optimized (= default value) as its value is already set.
4040
4041 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
4042
4043         A fix for bug #79724
4044         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
4045         TypeContainer for type lookup.
4046
4047 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
4048
4049         A fix for bug #79231
4050         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
4051         * expression.cs (OverloadResolve): Always convert type name for
4052         an error message.
4053         (ResolveNamespaceOrType): Don't confuse a nested type with any 
4054         other member.
4055
4056 2006-10-18  Martin Baulig <martin@ximian.com>
4057
4058         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
4059
4060 2006-10-17  Miguel de Icaza  <miguel@novell.com>
4061
4062         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
4063         an int32, but requesting an int64 from the conversion
4064
4065 2006-10-12  Martin Baulig  <martin@ximian.com>
4066
4067         * anonymous.cs
4068         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
4069         
4070 2006-10-12  Martin Baulig  <martin@ximian.com>
4071
4072         * statement.cs
4073         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
4074
4075 2006-10-11  Miguel de Icaza  <miguel@novell.com>
4076
4077         * convert.cs: Remove broken code: I was doing the "Existance"
4078         tests for Implicit conversions.
4079
4080 2006-10-10  Miguel de Icaza  <miguel@novell.com>
4081
4082         * convert.cs: Added one missing case in
4083         ImplicitStandardConversionExists uint64 to intptr.
4084
4085         Fixes #59800
4086         
4087         * typemanager.cs (uintptr_type): another core known type.   
4088
4089         * ecore.cs (OperatorCast): routine used to do cast operations that
4090         depend on op_Explicit.  We could change some of the Decimal
4091         conversions to use this.
4092
4093         This one has a probe mechanism that checks both types for an op_
4094         which it coudl be used to eliminate two classes: CastToDecimal
4095         and CastFromDecimal.
4096
4097         * convert.cs: Implement the conversions documented in #59800
4098         
4099 2006-10-10  Martin Baulig  <martin@ximian.com>
4100
4101         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
4102         before RootScope.ResolveMembers().
4103
4104         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
4105         `CurrentType' if appropriate.
4106
4107 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
4108
4109         A fix for bug #78568
4110         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
4111         when contains binary operators.
4112         * cs-parser.jay: Updated.
4113
4114 2006-10-09  Martin Baulig  <martin@ximian.com>
4115
4116         * delegate.cs
4117         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
4118         moved that into Define() and also do the other type parameter
4119         checks there.  Fixes #79094.  Added gtest-292.cs.
4120
4121         * expression.cs
4122         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
4123         since that doesn't include type parameters; don't use `Ldelema'
4124         for type parameters.  Fixes #78980.  Added gtest-293.cs.
4125
4126 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
4127
4128         A fix for #77796
4129         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
4130         conversion is allowed.
4131
4132 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
4133
4134         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
4135         error reporting when no error occurs.
4136
4137 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
4138
4139         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
4140         does not exist.
4141
4142 2006-10-06  Raja R Harinath  <rharinath@novell.com>
4143
4144         Fix #79584
4145         * class.cs (DefineTypeBuilder): Check circular dependencies before
4146         setting the parent of the TypeBuilder.
4147         (CheckRecursiveDefinition): Don't use 'BaseType', since
4148         it may not be valid until after DefineTypeBuilder.  Use
4149         'base_type' instead.
4150
4151 2006-10-04  Martin Baulig  <martin@ximian.com>
4152
4153         Merged the Anonymous Methods patch.
4154
4155         * anonymous.cs, iterators.cs: The new anonymous methods code.
4156
4157         * statement.cs (Variable): New public abstract class.
4158         (LocalInfo.Variable): New public property.
4159         (LocalInfo.ResolveVariable): New public method.
4160         (Block.Flags): Add `IsIterator'.
4161         (Block.AddVariable): Improved the CS0136 check.
4162         (Block.AnonymousChildren): New public property.
4163         (Block.AddAnonymousChild): New public method.
4164         (ToplevelBlock): Update to use the new anonymous method framework.
4165         (ToplevelBlock.ctor): `container' is now a `Block' and not a
4166         `ToplevelBlock'; this is required to correctly implement the
4167         CS0136 check.
4168         (Fixed, Using): Use `TemporaryVariable' instead of directly
4169         creating the `LocalBuilder'.
4170
4171         * parameter.cs (Parameter.ResolveVariable): New public method.
4172         (Parameters.ResolveVariable): Likewise.
4173
4174         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
4175
4176         * class.cs (TypeContainer): Replaced the `iterators' list and
4177         corresponding methods with a list of `CompilerGeneratedClass'es.
4178         (TypeContainer.ResolveMembers): New public method.
4179         (Method): `IIteratorContainer' has been replaced by
4180         `IAnonymousHost'.
4181
4182         * expression.cs (VariableReference): New public abstract base
4183         class for `LocalVariableReference', `ParameterReference' and
4184         `This'.
4185
4186         * codegen.cs (EmitContext): Removed `capture_context',
4187         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
4188         (EmitContext.EmitThis): Removed.
4189
4190         * cs-parser.jay: Replace `iterator_container' with
4191         `anonymous_host'.       
4192
4193 2006-10-04  Martin Baulig  <martin@ximian.com>
4194
4195         * generic.cs (GenericMethod): Don't make this abstract.
4196         (Constraints.Clone): Added dummy implementation.
4197
4198 2006-10-04  Raja R Harinath  <harinath@gmail.com>
4199
4200         Fix #79577
4201         * namespace.cs (LookForAnyGenericType): Avoid nullref on
4202         'declspaces'.  Avoid allocating arrays willy-nilly.
4203
4204         Fix #79553
4205         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
4206         cases out of the switch.
4207
4208 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
4209
4210         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
4211         message when non-generic type is used with the type arguments.
4212         * expression.cs: Updated.
4213
4214 2006-09-28  Raja R Harinath  <rharinath@novell.com>
4215
4216         Fix #79013
4217         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
4218         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4219         Change semantics slightly.  Don't insist on having only one
4220         temporary EmptyExpression -- just throttle the creation of new ones.
4221
4222         Fix #79451
4223         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
4224         non-interfaces too.  If no methods are found, don't try to create
4225         a MethodGroupExpr.
4226
4227 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
4228
4229         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
4230         generic type.
4231
4232         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
4233         us produce better error message.
4234
4235 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
4236
4237         * expression.cs (Binary.ResolveOperator): Warn about a side effect
4238         of the `|' operator.
4239
4240         * report.cs: A new warning added.
4241
4242 2006-09-27  Martin Baulig  <martin@ximian.com>
4243
4244         * generic.cs (GenericMethod): Don't make this abstract.
4245
4246 2006-09-27  Martin Baulig  <martin@ximian.com>
4247
4248         * report.cs
4249         (InternalErrorException): Added overloaded ctor taking a params array.
4250
4251 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
4252
4253         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
4254         Fixed the cases when same error was reported twice.
4255
4256         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
4257         now report symbol information.
4258
4259 2006-09-25  Martin Baulig  <martin@ximian.com>
4260
4261         * class.cs: Completely unified with the gmcs version.
4262
4263 2006-09-25  Martin Baulig  <martin@ximian.com>
4264
4265         * typemanager.cs (TypeManager.IsNullableType): New public function.
4266         (TypeManager.IsNullableTypeOf): Likewise.
4267         (TypeManager.IsNullableValueType): Likewise.
4268
4269         * class.cs (MethodCore): Added the `GenericMethod' argument from
4270         gmcs and also unified all classes derived from `MethodCore' with gmcs.
4271
4272 2006-09-24  Raja R Harinath  <harinath@gmail.com>
4273
4274         * convert.cs: Unify with gmcs version.
4275
4276 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
4277
4278         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
4279         verify them as well.
4280
4281         * report.cs: New warning.
4282
4283 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
4284
4285         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
4286         for anonymous block with out argument.
4287
4288 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
4289
4290         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
4291         not used private events only.
4292
4293 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
4294
4295         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
4296
4297         * const.cs (Const.Define): Check for constant type.
4298         (Const.IsConstantTypeValid): Looks for valid constant types.
4299
4300         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
4301
4302         * ecore.cs (EmptyConstantCast): New common class for all constant based
4303         EmptyCast(s).
4304
4305         * expression.cs (Is.DoResolve): Handle null constant especially.
4306         (New.DoResolve): Check for new void().
4307         (MemberAccess.DoResolve): Cope with all kind of nulls.
4308
4309         * literal.cs (NullConstant): Uses EmptyConstantCast.
4310         (NullDefault): Based on EmptyConstantCast.
4311         (NullLiteral): Uses EmptyConstantCast.
4312
4313         * statement.cs (Block.ResolveMeta): Check for constant type.
4314
4315 2006-09-22  Martin Baulig  <martin@ximian.com>
4316
4317         * delegate.cs, attribute.cs: Merged with the gmcs versions.
4318
4319 2006-09-22  Raja R Harinath  <rharinath@novell.com>
4320
4321         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
4322         not the null type.
4323
4324         Fix part of #79451
4325         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
4326         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
4327         code slightly.
4328
4329 2006-09-22  Martin Baulig  <martin@ximian.com>
4330
4331         * ecore.cs: Merged with the gmcs version.
4332
4333         * generic.cs (ConstructedType): New dummy class.
4334         (TypeArguments): Don't make this abstract.
4335
4336         * typemanager.cs
4337         (TypeManager.IsGenericTypeDefinition): New method.
4338         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
4339
4340 2006-09-22  Raja R Harinath  <rharinath@novell.com>
4341
4342         * expression.cs (ComposedCast): Check for arrays of TypedReference
4343         before creating the type, not after.
4344
4345 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
4346
4347         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
4348         after ToType change.
4349
4350         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
4351         when constant must be implicitly convertible.
4352
4353         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
4354
4355         * ecore.cs (NullCast): Derives from NullConstant.
4356
4357         * expression.cs (Is.DoResolve): Removed useless variables.
4358         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
4359         (New.Constantify): Add enum support.
4360         (MemberAccess.DoResolve): Add warning when accessing null constant or
4361         variable.
4362
4363         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
4364         property.
4365
4366         * literal.cs (NullConstant): New abstract class with common
4367         functionality for all null specializations.
4368         (NullDefault): Represents default(X) when result can be
4369         reduced to null.
4370         (NullLiteral): Updated.
4371
4372         * report.cs: Add new warning.
4373
4374 2006-09-21  Martin Baulig  <martin@ximian.com>
4375
4376         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
4377
4378 2006-09-21  Martin Baulig  <martin@ximian.com>
4379
4380         * generic.cs (GenericConstraints): New dummy class.
4381         (Constraints): Likewise.
4382         (TypeParameter): Likewise.
4383         (TypeParameterName): Likewise.
4384         (GenericMethod): Likewise.
4385
4386         * typemanager.cs (TypeManager.GetGenericArguments): New method.
4387
4388         * decl.cs: Merged with the gmcs version.
4389
4390 2006-09-21  Raja R Harinath  <rharinath@novell.com>
4391
4392         * generic.cs (TypeParameter): Implement IMemberContainer.
4393         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
4394
4395         * rootcontext.cs: Unify with gmcs version.
4396
4397         * report.cs: Unify with gmcs version.
4398         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
4399         from gmcs/generics.cs.
4400         * generics.cs (TypeParameter): New dummy class.
4401
4402         * support.cs: Unify with gmcs version.
4403
4404 2006-09-20  Raja R Harinath  <rharinath@novell.com>
4405
4406         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
4407         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
4408
4409         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
4410         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
4411         * mcs.exe.sources: Add generic.cs.
4412
4413         * codegen.cs: Unify with gmcs version.
4414
4415         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
4416         (EmitContext): Add GenericDeclContainer implementation.
4417         * decl.cs (MemberCore, DeclSpace): Likewise.
4418         * namespace.cs: Remove #ifdef GMCS_SOURCE.
4419
4420         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
4421         MCS TypeManager has a corresponding dummy method.
4422
4423 2006-09-19  Martin Baulig  <martin@ximian.com>
4424
4425         * expression.cs: Completely merged with the gmcs version.
4426
4427 2006-09-19  Martin Baulig  <martin@ximian.com>
4428
4429         * expression.cs (Invocation): Merged with the gmcs version.
4430         (ArrayAccess.GetStoreOpcode): Likewise.
4431
4432 2006-09-19  Martin Baulig  <martin@ximian.com>
4433
4434         * typemanager.cs
4435         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
4436         (TypeManager.IsGenericMethodDefinition): Likewise.
4437
4438 2006-09-19  Martin Baulig  <martin@ximian.com>
4439
4440         * typemanager.cs
4441         (TypeManager.IsEqual): Moved the gmcs implementation here.
4442         (TypeManager.DropGenericTypeArguments): Likewise.
4443         (TypeManager.DropGenericMethodArguments): Likewise.
4444         (TypeManager.GetTypeArguments): Moved here from gmcs.
4445         (TypeManager.HasGenericArguments): Likewise.
4446
4447 2006-09-19  Martin Baulig  <martin@ximian.com>
4448
4449         * expression.cs (Binary): Merged with the gmcs version.
4450
4451 2006-09-19  Martin Baulig  <martin@ximian.com>
4452
4453         * expression.cs (Probe, As, Is): Merged with the gmcs version.
4454
4455 2006-09-19  Martin Baulig  <martin@ximian.com>
4456
4457         * typemanager.cs: Merged with the gmcs version.
4458
4459 2006-09-16  Raja R Harinath  <rharinath@novell.com>
4460
4461         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
4462         * driver.cs: Likewise.
4463
4464 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
4465
4466         A fix for #79401
4467         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
4468         only if parent type is class.
4469         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
4470         update.
4471
4472 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
4473
4474         * cs-parser.jay,
4475         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
4476         keywords are used.
4477         * typemanager.cs(CSharpName): Converts NullType to null.
4478
4479 2006-09-15  Martin Baulig  <martin@ximian.com>
4480
4481         * typemanager.cs
4482         (TypeManager.GetMethodName): Added mcs implementation.
4483         (TypeManager.IsEqual): Likewise.
4484
4485         * ecore.cs
4486         (SimpleName.RemoveGenericArity): Added dummy implementation.
4487
4488         * pending.cs: Merged with the gmcs version.     
4489
4490 2006-09-15  Martin Baulig  <martin@ximian.com>
4491
4492         * statement.cs: Merge with the gmcs version.
4493
4494 2006-09-15  Martin Baulig  <martin@ximian.com>
4495
4496         * statement.cs (Switch): Merge with the gmcs implementation
4497         (without nullables), which is newer.
4498
4499 2006-09-15  Martin Baulig  <martin@ximian.com>
4500
4501         * statement.cs (Block.Variables): Make this public.
4502         (ToplevelBlock.Parameters): Make this a property.
4503         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
4504
4505 2006-09-15  Martin Baulig  <martin@ximian.com>
4506
4507         * namespace.cs: Merge with the gmcs version.
4508
4509 2006-09-15  Martin Baulig  <martin@ximian.com>
4510
4511         * decl.cs (MemberName): Minor code cleanups.
4512
4513 2006-09-15  Martin Baulig  <martin@ximian.com>
4514
4515         * parameter.cs: Merge with the gmcs version.
4516
4517 2006-09-15  Martin Baulig  <martin@ximian.com>
4518
4519         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
4520         and an error in mcs.
4521
4522 2006-09-15  Martin Baulig  <martin@ximian.com>
4523
4524         * flowanalysis.cs: Merged from GMCS; added the generics code into
4525         a `GMCS_SOURCE' conditional so we can share this file.
4526
4527 2006-09-08  Martin Baulig  <martin@ximian.com>
4528
4529         * typemanager.cs (TypeManager.interlocked_type): New public field.
4530         (TypeManager.int_interlocked_compare-exchange): New public field.
4531         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
4532         enumerator types here and call InitGenericCoreTypes().
4533         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
4534         after calling InitEnumUnderlyingTypes().
4535
4536         * rootcontext.cs
4537         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
4538         `classes_second_stage'. 
4539
4540 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
4541
4542         * assign.cs, ecore.cs, expression.cs: Share error message text.
4543         * class.cs (FieldMember.Define): Check for varible of static type.
4544         * driver.cs (LoadAssembly): Uses error output for errors.
4545         * statement.cs: Updated.
4546
4547 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
4548
4549         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
4550         type instance.
4551
4552 2006-09-07  Martin Baulig  <martin@ximian.com>
4553
4554         * driver.cs
4555         (MainDriver): Revert r62663 from Marek; see #70506 for details.
4556
4557 2006-08-29  Miguel de Icaza  <miguel@novell.com>
4558
4559         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
4560         
4561 2006-08-17  Miguel de Icaza  <miguel@novell.com>
4562
4563         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
4564         #52019 and #79064, the use of the \uXXXX sequence in source code
4565         to represent unicode characters.
4566
4567 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
4568
4569         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
4570         support.
4571         * class.cs, ecore.cs, statement.cs: Merged to one error message.
4572
4573 2006-08-13  Miguel de Icaza  <miguel@novell.com>
4574
4575         * assign.cs: Catch attempts to assign to a method groups in += and
4576         report as 1656
4577
4578 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
4579
4580         A fix for #79056
4581         * cs-parser.jay: Don't destroy current array type by typeof of array's.
4582
4583 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
4584
4585         * class.cs (Method.Define): Issue a warning when generic method looks like
4586         an entry point.
4587         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
4588         as well.
4589
4590 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
4591  
4592         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
4593         looking for ctor.
4594         * decl.cs (MemberCache.FindMembers): When container is interface we need to
4595         search all base interfaces as a member can be ambiguous.
4596         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
4597         Constructor member type filter. 
4598         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
4599         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
4600         reporting for returned memberinfos.
4601         * report.cs: Updated.
4602         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
4603         version to work on all runtimes.
4604         (TypeManager.RealMemberLookup): Removed members filtering.
4605
4606 2006-08-08  Raja R Harinath  <rharinath@novell.com>
4607
4608         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
4609         (PropertyExpr.EmitAssign): Likewise.
4610         * expression.cs (Indirection.EmitAssign): Likewise.
4611         (LocalVariableReference.EmitAssign): Likewise.
4612         (ParameterReference.EmitAssign): Likewise.
4613         (Invocation.EmitArguments): Likewise.
4614         (ArrayAccess.EmitAssign): Likewise.
4615         (IndexerAccess.EmitAssign): Likewise.
4616         (This.EmitAssign): Likewise.
4617         (ConditionalLogicalOperator.Emit): Likewise.
4618
4619         Fix #79026
4620         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
4621         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
4622         leave it in after returning it.
4623         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
4624
4625 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
4626
4627         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
4628         message.
4629
4630 2006-08-03  Raja R Harinath  <rharinath@novell.com>
4631
4632         Fix cs0146-3.cs and cs0146-4.cs.
4633         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
4634         enclosing types don't depend on the current type.
4635
4636 2006-08-02  Raja R Harinath  <rharinath@novell.com>
4637
4638         Fix #77963
4639         * class.cs (TypeContainer.DoDefineMembers): Use
4640         FindBaseMemberWithSameName on Parent, since we're interested in
4641         whether we hide inherited members or not.
4642         (FindBaseMemberWithSameName): Make slightly more robust.
4643
4644         Fix the non-generic testcase from #77396
4645         * decl.cs (DeclSpace.DeclContainer): Remove override.
4646
4647         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
4648         declspaces for doppelgangers too.
4649         (UsingEntry): Implement IResolveContext.
4650         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
4651         'this' as the resolve context.
4652         (LocalAliasEntry): Likewise.
4653
4654         Implement parts of #77403
4655         * roottypes.cs (RootDeclSpace): New.  Used to represent the
4656         toplevel declaration space.  Each namespace declaration introduces
4657         a "partial" root declaretion space.
4658         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
4659         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
4660         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
4661         from 'current_namespace.SlaveDeclSpace'.
4662         (namespace_declaration): Likewise.
4663         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
4664         check.  It can't happen now.
4665         * decl.cs (DeclSpace.LookupType): Likewise.
4666         * driver.cs (MainDriver): Sanity check.
4667
4668 2006-08-01  Raja R Harinath  <rharinath@novell.com>
4669
4670         * decl.cs (DeclSpace.FindNestedType): Remove.
4671         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
4672         LookupTypeContainer to get the container of the nested type.
4673         * class.cs (TypeContainer.FindNestedType): Make non-override.
4674
4675 2006-07-31  Raja R Harinath  <rharinath@novell.com>
4676
4677         * decl.cs (DeclSpace.PartialContainer): Move field from ...
4678         * class.cs (TypeContainer.PartialContainer): ... here.
4679         (TypeContainer.AddBasesForPart): New helper.
4680         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
4681         instead.
4682         * cs-parser.jay (current_class): Convert to DeclSpace.
4683         (struct_declaration, interface_declaration, class_declaration):
4684         Use AddBasesForPart instead of .Bases directly.
4685         * const.cs, iterators.cs: Update to changes.
4686
4687 2006-07-28  Raja R Harinath  <rharinath@novell.com>
4688
4689         * class.cs (TypeContainer.AddMemberType): Rename from
4690         AddToTypeContainer.
4691         (TypeContainer.AddMember): Rename from AddToMemberContainer.
4692         (AddTypeContainer): New.  Combine AddClassOrStruct and
4693         AddInterface.
4694         (AddPartial): Update.  Add 'is_partial' argument.
4695         * roottypes.cs: Update to changes.
4696         * cs-parser.jay (push_current_class): New helper for handling
4697         current_container and current_class.
4698         (struct_declaration, interface_declaration, class_declaration):
4699         Use it.
4700
4701 2006-07-26  Raja R Harinath  <rharinath@novell.com>
4702
4703         * roottypes.cs: Rename from tree.cs.
4704
4705         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
4706         * tree.cs (Tree, ITreeDump): Remove types.
4707         * rootcontext.cs (tree, Tree): Remove fields.
4708         (root, ToplevelTypes): New.
4709         * *.cs: Update to rename.
4710
4711         * tree.cs (Tree.RecordDecl): Remove.
4712         (RootTypes.AddToTypeContainer): Record the toplevel type in its
4713         namespace here.
4714         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
4715
4716 2006-07-23  Raja R Harinath  <harinath@gmail.com>
4717
4718         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
4719         DoFlowAnalysis and OmitStructFlowAnalysis here.
4720         (ec.With): Rename from WithUnsafe and generalize.
4721         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
4722         (ec.WithFlowAnalyis): New.
4723         * ecore.cs, expression.cs, statement.cs: Update.
4724
4725 2006-07-22  Raja R Harinath  <harinath@gmail.com>
4726
4727         * statement.cs (Block.ResolveMeta): Simplify slightly.
4728
4729         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
4730         multiple boolean fields.  Convert InUnsafe, constant_check_state,
4731         check_state to flags.
4732         (CheckState, ConstantCheckState): Update.
4733         (InUnsafe): New read-only property.
4734         (FlagsHandle): Rename from CheckStateHandle and convert to handle
4735         arbitrary flags.
4736         (WithUnsafe): New helper similar to WithCheckState.
4737         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
4738         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
4739
4740 2006-07-21  Raja R Harinath  <rharinath@novell.com>
4741
4742         Make comparisons use the same IL irrespective of whether they're
4743         in a 'checked' or 'unchecked' context: one of the issues in #78899
4744         * codegen.cs (EmitContext.CheckState): Make read-only property.
4745         (EmitContext.ConstantCheckState): Likewise.
4746         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
4747         helper that implement a save/restore stack for CheckState
4748         values.  This is the only way to change check-state.
4749         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
4750         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
4751         (CheckedExpr.EmitBranchable): New forwarding method.
4752         (UnCheckedExpr): Likewise.
4753         * statement.cs (Block.ResolveMeta): Use WithCheckState.
4754         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
4755         (Checked.Resolve, checked.DoEmit): Likewise.
4756
4757 2006-07-20  Miguel de Icaza  <miguel@novell.com>
4758
4759         * anonymous.cs: Cache the resolved anonymous delegate, and return
4760         this so that the ResolveTopBlock is only triggered once, not
4761         twice.
4762
4763         Currently we trigger ResolvetopBlock twice due to a first pass of
4764         argument check compatibility, and a second pass that does the
4765         actual resolution.   
4766         
4767 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
4768
4769         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
4770         modifiers.
4771         * rootcontext.cs (Reset): Add helper_classes.
4772
4773 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
4774
4775         A fix for #78860
4776         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
4777         correctly.
4778
4779 2006-07-13  Miguel de Icaza  <miguel@novell.com>
4780
4781         * statement.cs (Lock): Handle expressions of type
4782         TypeManager.null_type specially.  Fixes #78770
4783
4784 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
4785
4786         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
4787         to an event.
4788
4789 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
4790
4791         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
4792         for accessors as well.
4793         * ecore.cs (EventExpr): Add AccessorTable.
4794
4795 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
4796
4797         A fix for #78738
4798         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
4799         for CS0122 where appropriate.
4800         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
4801         level attributes.
4802         (Filter): Assembly can be null in the case of top level attributes.
4803
4804 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
4805
4806         A fix for #78690
4807
4808         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
4809         is done at global level.
4810
4811 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
4812
4813         A fix for #77002, Implemented TypeForwarder support.
4814
4815         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
4816         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
4817         * typemanager.cs (): Add type_forwarder_attr_type.
4818
4819 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
4820
4821         * report.cs: Add CS0469 warning.
4822
4823 2006-06-21  Martin Baulig  <martin@ximian.com>
4824
4825         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
4826         the `try'-block, so we also report CS0016 etc. there.
4827
4828 2006-06-21  Martin Baulig  <martin@ximian.com>
4829
4830         * delegate.cs
4831         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
4832
4833 2006-06-21  Martin Baulig  <martin@ximian.com>
4834
4835         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
4836         also report CS1686 for parameters.
4837
4838 2006-06-21  Martin Baulig  <martin@ximian.com>
4839
4840         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
4841         instead of an error if the value is not implicitly convertible to
4842         the switch types; fixes #77964.
4843
4844 2006-06-21  Raja R Harinath  <rharinath@novell.com>
4845
4846         Fix #78673
4847         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
4848         FieldBuilder is null.
4849
4850         Fix #78662
4851         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
4852         'left' and 'right' before error-checking.
4853
4854 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
4855
4856         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
4857         Fixed bug #78601.
4858         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
4859         (FieldExpr.DoResolve): likewise.
4860         (PropertyExpr.InstanceResolve): likewise.
4861         (EventExpr.InstanceResolve): likewise. 
4862
4863 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
4864
4865         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
4866         attribute applicable tests for attribute argument.
4867
4868 2006-06-02  Raja R Harinath  <rharinath@novell.com>
4869
4870         Fix #78079
4871         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
4872         (Binary.OverloadResolve_PredefinedIntegral): New.
4873         (Binary.OverloadResolve_PredefinedFloating): New.
4874         (Binary.OverloadResolve_PredefinedString): New.
4875         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
4876         Follow the standard more closely, and treat numeric promotions in
4877         terms of overload resolution.
4878         (Binary.CheckShiftArguments): Simplify.
4879
4880 2006-06-01  Raja R Harinath  <rharinath@novell.com>
4881
4882         * flowanalysis.cs (MyBitVector): Simplify representation.
4883         (MyBitVector.Clone): Avoid allocating BitArray.
4884         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
4885         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
4886         (*): Update.  Change all references to MyBitVector.And and
4887         MyBitVector.Or to &= and |=.
4888
4889 2006-05-29  Raja R Harinath  <rharinath@novell.com>
4890
4891         Fix cs0231-[34].cs.
4892         * cs-parser.jay (formal_parameter_list): Extend the pattern below
4893         to param arguments too.
4894
4895 2006-05-26  Miguel de Icaza  <miguel@novell.com>
4896
4897         * cs-parser.jay: Catch another parsing form for arglist being
4898         followed by other arguments.  Fixes #78313.
4899
4900 2006-05-24  Raja R Harinath  <rharinath@novell.com>
4901
4902         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
4903         checking of out parameters to ...
4904         (FlowBranchingToplevel.Merge): ... here.
4905         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
4906         set, propagate the origin upward, and only complain if there was
4907         no other error.
4908         (FlowBranchingException.AddContinueOrigin): Likewise.
4909         (FlowBranchingException.AddReturnOrigin): Likewise.
4910         (FlowBranchingException.AddGotoOrigin): Likewise.       
4911
4912 2006-05-23  Raja R Harinath  <rharinath@novell.com>
4913
4914         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
4915         unreachable, skip it.
4916         (FlowBranchingException.Merge): Always propagate jumps, even if
4917         the finally block renders subsequent code unreachable.
4918
4919 2006-05-18  Raja R Harinath  <rharinath@novell.com>
4920
4921         Fix #77601
4922         * statement.cs (Goto.Resolve): Move responsibility for resolving
4923         'goto' to FlowBranching.AddGotoOrigin.
4924         (Goto.SetResolvedTarget): New.  Callback to set the
4925         LabeledStatement that's the target of the goto.
4926         (Goto.DoEmit): Use Leave instead of Br when crossing an
4927         unwind-protect boundary.
4928         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
4929         LookupLabel and adjust to new semantics.
4930         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
4931         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
4932         Goto.SetResolvedTarget to update target.
4933         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
4934         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
4935         AddBreakOrigin & co.  Delay propagation until ...
4936         (FlowBranchingException.Merge): ... this.
4937
4938         * statement.cs (Block.Resolve): Always depend on flow-branching to
4939         determine unreachability.  Kill workaround that originally emitted
4940         only one statement after an "unreachable" label (see infloop in
4941         test-515.cs).
4942
4943         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
4944         This is still "wrong", but anything better would probably need a
4945         multi-pass algorithm.
4946         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
4947         usage vector.  Force current usage vector to be reachable, to
4948         optimistically signify backward jumps.
4949         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
4950         detected.
4951         (FlowBranchingLabeled.Merge): New.  If no backward jump was
4952         detected, return the original salted-away usage vector instead,
4953         updated with appropriate changes.  Print unreachable warning if
4954         necessary.
4955         * statement.cs (Block.Resolve): Don't print unreachable warning on
4956         a labeled statement.
4957
4958 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
4959
4960         * driver.cs: Pass filename without path to AssemblyBuilder's 
4961         AddResourceFile. Fixes bug #78407.
4962
4963 2006-05-17  Raja R Harinath  <rharinath@novell.com>
4964
4965         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
4966         * flowanalysis.cs (FlowBranchingLabeled): ... here.
4967         (FlowBranching.MergeChild): Overwrite
4968         reachability information from Labeled branchings too.
4969
4970 2006-05-16  Raja R Harinath  <rharinath@novell.com>
4971
4972         * statement.cs (Goto.Resolve): Merge jump origins here ...
4973         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
4974
4975         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
4976         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
4977         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
4978         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
4979         here, ...
4980         * statement.cs (Goto.Resolve): ... not here.
4981         (Goto.Emit): Remove CS1632 check.
4982
4983 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
4984
4985         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
4986         error message.
4987
4988 2006-05-11  Raja R Harinath  <rharinath@novell.com>
4989
4990         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
4991         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
4992         (FlowBranchingException.Label): Likewise.
4993
4994         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
4995         given value.
4996         (MyBitVector.Or): Use it to avoid losing information (Count).
4997         (FlowBranching.MergeOrigins): Likewise.
4998
4999         * flowanalysis.cs (UsageVector.IsDirty): Remove.
5000         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
5001         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
5002         (UsageVector.ToString): Simplify.
5003         (UsageVector.MergeSiblings): Move here from ...
5004         (FlowBranching.Merge): ... here.
5005         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
5006         not a MyBitVector.
5007
5008 2006-05-10  Raja R Harinath  <rharinath@novell.com>
5009
5010         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
5011         null bitvector is treated as all-true.
5012
5013         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
5014         (MyBitVector): Rationalize invariants.  'vector != null' implies
5015         that we have our own copy of the bitvector.  Otherwise,
5016         'InheritsFrom == null' implies all inherited bits are true.
5017
5018 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
5019
5020         * statement.cs (LocalInfo): Add IsConstant.
5021         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
5022         local variable for constants.
5023
5024 2006-05-09  Raja R Harinath  <rharinath@novell.com>
5025
5026         * flowanalysis.cs (MyBitVector.Empty): New.
5027         (MyBitVector): Don't allow InheritedFrom to be null.
5028         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
5029         (UsageVector, FlowBranching): Update to changes.
5030
5031         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
5032         recursion.  The 'Parent == null' condition isn't sufficient for
5033         anonymous methods.
5034         (FlowBranching.AddBreakOrigin): Likewise.
5035         (FlowBranching.AddContinueOrigin): Likewise.
5036         (FlowBranching.AddReturnOrigin): Likewise.
5037         (FlowBranching.StealFinallyClauses): Likewise.
5038         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
5039         (FlowBranching.CheckOutParameters): Likewise.
5040         (FlowBranchingToplevel): Terminate all the above recursions here.
5041         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
5042         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
5043
5044         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
5045         toplevel block.
5046         (FlowBranchingToplevel): New.  Empty for now.
5047         (FlowBranching.MergeTopBlock): Update.
5048         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
5049         branching for the anonymous delegate.
5050         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
5051
5052         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
5053         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
5054         information at the start of the merge.  Reorganize.
5055
5056 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
5057
5058         * class.cs (MethodData.Define): Method cannot implement interface accessor.
5059
5060 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
5061
5062         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
5063         to newly introduced ctor.
5064
5065         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
5066         message to one place.
5067         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
5068         global namespace.
5069
5070 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
5071
5072         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
5073
5074         * ecore.cs (Expression.ResolveAsConstant): Updated.
5075
5076         * statement.cs (ResolveMeta): Updated.
5077
5078 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
5079
5080         * cs-parser.jay: __arglist cannot be used in initializer.
5081
5082 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
5083
5084         A fix for #77879
5085         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
5086         private types.
5087
5088 2006-05-05  Raja R Harinath  <rharinath@novell.com>
5089
5090         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
5091         (LabeledStatement): Add 'name' parameter.
5092         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
5093         (Block.AddLabel): Update to changes.
5094         * cs-parser.jay (labeled_statement): Likewise.
5095
5096         * flowanalysis.cs (BranchingType.Labeled): New.
5097         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
5098         (FlowBranchingLabeled): New.  Does nothing for now, but will
5099         eventually handle 'goto' flows.
5100         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
5101         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
5102         that's terminated ...
5103         (Block.Resolve): ... here.
5104
5105         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
5106         (UsageVector.MergeFinallyOrigins): Likewise.
5107         (FlowBranching.InTryOrCatch): Likewise.
5108         (FlowBranching.AddFinallyVector): Likewise.
5109         (FlowBranchingException): Update to changes.
5110
5111         Fix #78290
5112         * statement.cs (Return.Resolve): Move error checking to ...
5113         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
5114         (FlowBranchingException): Handle return origins like break and
5115         continue origins.
5116         (FlowBranching.UsageVector.CheckOutParameters): Remove.
5117
5118 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
5119
5120         A fix for #76122
5121         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
5122         filter.
5123
5124 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
5125
5126         A fix for #77543
5127         * class.cs (MethodData.Define): Do public accessor check only when method
5128         implements an interface.
5129
5130 2006-05-04  Raja R Harinath  <rharinath@novell.com>
5131
5132         Remove special handling of 'break'
5133         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
5134         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
5135         (UsageVector.Break): Remove.
5136         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
5137         reachability.
5138         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
5139
5140         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
5141         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
5142
5143 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
5144
5145         A fix for #75726
5146         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
5147         be the interface member.
5148
5149 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
5150
5151         A fix for #60069
5152         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
5153         for emitting small (int) values.
5154
5155 2006-05-03  Raja R Harinath  <rharinath@novell.com>
5156
5157         Fix #59427
5158         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
5159         control-flow passes through the 'finally' after merging-in all the
5160         control-flows from 'try' and the 'catch' clauses.
5161
5162         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
5163         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
5164         always true at the only non-recursive entry point.
5165         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
5166         FlowBranchingBreakable.
5167         (FlowBranchingLoop): Remove.
5168         * statement.cs (Return.DoResolve): Update to changes.
5169
5170         Fix #76471, #76665
5171         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
5172         (FlowBranching.CreateBranching): Handle it: create a
5173         FlowBranchingContinuable.
5174         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
5175         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
5176         except that it handles the 'continue' command.
5177         (FlowBranching.UsageVector.MergeOrigins): Rename from
5178         MergeBreakOrigins.
5179         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
5180         except that it overrides AddContinueOrigin.
5181         (FlowBranchingException): Override AddContinueOrigin, similar to
5182         AddBreakOrigin.
5183         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
5184         Create a new branching around the embedded statement.
5185         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
5186         control flow after the embedded statement.
5187         (Continue.Resolve): Move all error checking to AddContinueOrigin.
5188
5189         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
5190         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
5191         FlowBranchingBreakable.
5192         (FlowBranchingSwitch): Remove.
5193
5194         Fix test-503.cs
5195         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
5196         error reporting to ...
5197         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
5198         Rename from 'AddBreakVector'.  Add new location argument.  Return
5199         a bool indicating whether the 'break' crosses an unwind-protect.
5200         (FlowBranchingException.AddBreakOrigin): Add.
5201         (FlowBranchingException.Merge): Propagate 'break's to surrounding
5202         flowbranching after updating with the effects of the 'finally'
5203         clause.
5204         (FlowBranchingBreakable): New common base class for
5205         FlowBranchingLoop and FlowBranchingSwitch.
5206
5207         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
5208         embedded statement.
5209         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
5210
5211 2006-05-02  Raja R Harinath  <rharinath@novell.com>
5212
5213         * statement.cs (Do.Resolve): If the loop is infinite, set the
5214         barrier.
5215         (While.Resolve, For.Resolve): Set a barrier after the embedded
5216         statement.  There's no direct control flow that goes from the end
5217         of the embedded statement to the end of the loop.
5218         * flowanalysis.cs (FlowBranching.Infinite): Remove.
5219         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
5220         above ensure that the reachability is correctly computed.
5221
5222         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
5223         (UsageVector.MergeBreakOrigins): If the current path is
5224         unreachable, treat it as if all parameters/locals are initialized.
5225         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
5226         infinite loops before merging-in break origins.
5227
5228         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
5229         (Reachability.Reachable): Split part into ...
5230         (Reachability.Unreachable): ... this.  Simplify.
5231         (Reachability.IsUnreachable): Use 'Unreachable' instead.
5232
5233         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
5234         (Reachability.SetThrowsSometimes): Likewise.
5235         (FlowBranchingBlock.MergeTopBlock): Don't compare against
5236         TriState.Always, use corresponding property.
5237         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
5238         (Block.Resolve): Likewise.  Remove some redundant checks.
5239
5240 2006-05-02  Raja R Harinath  <harinath@gmail.com>
5241
5242         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
5243         (Reachability.Meet): Don't bother checking AlwaysThrows --
5244         barrier is always set.
5245         (FlowBranchingBlock.Merge): Likewise.
5246
5247 2006-05-01  Raja R Harinath  <harinath@gmail.com>
5248
5249         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
5250         checks for unreachable.
5251
5252 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
5253
5254         A fix for #77980
5255         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
5256
5257         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
5258         whether field is really assigned.
5259
5260 2006-04-30  Raja R Harinath  <harinath@gmail.com>
5261
5262         * flowanalysis.cs (Reachability): Make 4-argument constructor
5263         private.
5264         (Reachability.Meet): Rename from 'And'.  Remove static variant.
5265         (Reachability.Always): Rename from the highly misleading
5266         'Reachability.Never'.
5267         (FlowBranching.Merge): Update to changes.  Mark an impossible
5268         situation with a 'throw'.
5269         (*): Update to changes.
5270
5271 2006-04-29  Raja R Harinath  <harinath@gmail.com>
5272
5273         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
5274         Remove 'Undefined'.
5275         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
5276         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
5277         (*): Update to changes.
5278         * statement.cs: Update to changes.
5279
5280 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
5281
5282         A fix for #78049
5283         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
5284
5285 2006-04-28  Raja R Harinath  <harinath@gmail.com>
5286
5287         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
5288         dummy UsageVector.
5289
5290         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
5291         argument to two arguments: an usage-vector and a bool.  Move call
5292         to FlowBranching.Merge () ...
5293         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
5294
5295         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
5296         handling of loop and switch reachability to ...
5297         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
5298
5299 2006-04-27  Raja R Harinath  <harinath@gmail.com>
5300
5301         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
5302         handling to FlowBranchingLoop.InLoop.
5303         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
5304
5305 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
5306
5307         A fix for #78115
5308         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
5309         anonymous method is allowed from AnonymousContainer here.
5310
5311         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
5312
5313 2006-04-24  Raja R Harinath  <rharinath@novell.com>
5314
5315         Fix #78156
5316         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
5317
5318 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
5319
5320         A fix for #49011.
5321         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
5322         (DoubleConstant.Reduce): Ditto.
5323
5324 2006-04-23  Raja R Harinath  <rharinath@novell.com>
5325
5326         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
5327         Remove 'lvalue_right_side' argument.  Move parts to ...
5328         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
5329         (LocalVariable.DoResolveLValue): ... these.
5330
5331 2006-04-21  Raja R Harinath  <rharinath@novell.com>
5332
5333         Fix cs1655.cs
5334         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
5335         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
5336         (LocalVariableReference.DoResolveBase): Use it to implement new
5337         CS1655 check.
5338         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
5339         (Argument.Resolve): Simplify.  Move CS1510 check ...
5340         * ecore.cs (Expression.ResolveLValue): ... here.
5341         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
5342         (PropertyExpr.DoResolveLValue): Likewise.
5343         (FieldExpr.Report_AssignToReadonly): Likewise.
5344         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
5345         LValueMemberAccess or LValueMemberOutAccess on instance depending
5346         on it.
5347         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
5348         DoResolve as appropriate.
5349
5350 2006-04-20  Raja R Harinath  <rharinath@novell.com>
5351
5352         Fix #75800
5353         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
5354         implicit conversions on 'out' and 'ref' arguments.
5355
5356         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
5357         improve clarity.  Remove dead code.
5358
5359         Fix #66031
5360         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
5361         (Catch.Resolve): Resolve VarBlock if it exists.
5362
5363 2006-04-19  Miguel de Icaza  <miguel@novell.com>
5364
5365         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
5366         twice, this was some residual code, the enumerator was emitted
5367         properly in the two branche of if later.
5368
5369 2006-04-19  Raja R Harinath  <rharinath@novell.com>
5370
5371         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
5372         cast is never an lvalue.
5373         (Cast.DoResolve, Cast.ResolveRest): Combine.
5374         (Argument.Emit): Simplify slightly.  Move 'Expr is
5375         IMemoryLocation' check ...
5376         (Argument.Resolve): ... here.
5377         (Argument.Error_LValueRequired): Remove.  Inline into only user.
5378
5379         Simplifications.  Fix cs0191-2.cs
5380         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
5381         CS1649 and CS1651 to ...
5382         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
5383         the actual selection of the error code and message to a lookup
5384         table.  Add a dummy return value to simplify callsites.
5385         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
5386         readonly fields of other instances of the same type.  Move CS0197
5387         warning from ...
5388         * expression.cs (Argument.Resolve): ... here.  Simplify code.
5389         Ensure that ec.InRefOutArgumentResolving is only set during LValue
5390         resolution of an out or ref argument.  The code simplification
5391         above uses this invariant.
5392
5393 2006-04-18  Raja R Harinath  <rharinath@novell.com>
5394
5395         Possibly fix #77752.  Fix cs1690-[4-7].cs.
5396         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
5397         CheckMarshallByRefAccess.  Drop parameter.
5398         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
5399         warning.
5400         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
5401         InstanceExpression.
5402         * report.cs (AllWarnings): Add CS1690.
5403         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
5404         for ref access too.
5405         (LocalVariableReference.DoResolveBase): Update.
5406
5407 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5408
5409         * class.cs (MethodOrOperator): Moved common parts from method class.
5410         detect obsolete attributes.
5411         (Method.Define): Simplified as it reuses code from base.
5412         (Constructor.ValidAttributeTargets): Fixed issue found during
5413         refactoring.
5414         (Destructor.ValidAttributeTargets): Fixed issue found during
5415         refactoring.
5416         (Operator): Finished refactoring set off by #78020. Operator class is now
5417         ordinary method class.
5418
5419         * anonymous.cs: Updated.
5420
5421         * decl.cs (DeclSpace): Add IsGeneric
5422
5423 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5424
5425         * class.cs (Constructor.Emit): Don't emit the attributes twice.
5426
5427 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5428
5429         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
5430         detect obsolete attributes.
5431         (Method.CreateEmitContext): Moved to MethodOrOperator.
5432
5433 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5434
5435         A fix for #78048.
5436         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
5437         customized exception to make crash detection easier.
5438         (MethodOrOperator): Started to work on new base class for methods and
5439         operators.
5440         (Method): Derives from MethodOrOperator.
5441         (Constructor.Emit): Emits its own attributes.
5442         (AbstractPropertyEventMethod.Emit): Ditto.
5443         (Operator): Derives from MethodOrOperator, will refactor fully in extra
5444         patch.
5445         (Operator.Emit): It's temporary more tricky than should be.
5446         
5447         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
5448
5449         * report.cs (InternalErrorException): Add ctor with inner exception.
5450
5451 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
5452
5453         A fix for #76744.
5454         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
5455         only not visible.
5456
5457 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
5458
5459         A fix for #77916.
5460         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
5461         array.
5462
5463 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
5464
5465         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
5466         attribute is present and Guid not.
5467         (Interface.ApplyAttributeBuilder): Ditto.
5468
5469         * attribute.cs: Add error message.
5470
5471 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
5472
5473         A fix for #78020.
5474
5475         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
5476         sources (it's composite) so hold them in extra array as they are used in
5477         Emit phase only. It worked in the previous versions by mistake.
5478         (Attribute.Emit): Emit attribute for more owners when exist.
5479
5480         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
5481         it has now different behaviour.
5482
5483 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
5484
5485         * constant.cs (Constant.IsDefaultInitializer): New method.
5486
5487         * class.cs: Updated.
5488
5489         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
5490         re-initialize default values. It saves KBs almost for every assembly.
5491         Thanks Zoltan for the idea.
5492         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
5493         (ArrayCreation.DoResolve): Resolve only once.
5494         (ArrayCreation.Emit): Emit static initializer only when it is faster.
5495         (ArrayCreation.GetAttributableValue): Cope with optimized values.
5496
5497 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
5498
5499         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
5500         From #77961.
5501
5502 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
5503
5504         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
5505         in an embedded statement too.
5506
5507 2006-04-01  Raja R Harinath  <rharinath@novell.com>
5508
5509         Fix #77958
5510         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
5511
5512 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
5513
5514         A fix for #77966.
5515
5516         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
5517         was not specified.
5518
5519         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
5520
5521 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
5522
5523         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
5524         phase.
5525
5526         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
5527         LocalTemporary change.
5528
5529         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
5530         TypeContainer.
5531         (ClassOrStruct.DefineFieldInitializers): Implemented static field
5532         initializers optimization.
5533         (ClassOrStruct.TypeAttr): Moved from modifiers.
5534         (Constructor.CheckBase): Don't crash when static ctor has parameters.
5535         (FieldBase.ResolveInitializer): Resolves initializer.
5536         (FieldBase.HasDefaultInitializer): New property.
5537
5538         * cs-parser.jay: Removed message.
5539
5540         * expression.cs (CompilerGeneratedThis): New specialization.
5541
5542         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
5543
5544 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
5545
5546         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
5547
5548 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
5549
5550         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
5551         be now EnumConstants only.
5552
5553 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
5554
5555         * attribute.cs, driver.cs: Reset more caches.
5556
5557 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5558
5559         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
5560
5561 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5562
5563         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
5564         for easier reuse. Updated all overrides.
5565         (IntegralConstant): New base class for all integral constants.
5566         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
5567         of the constant range, report custom error.
5568         (UIntConstant.Reduce): Fixed uint conversion.
5569
5570         * ecore.cs, literal.cs: Reduce updates.
5571
5572 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5573
5574         A fix for #75813.
5575
5576         * class.cs (Constructor.Define): Removed extra if for default ctors.
5577         A patch from Atsushi Enomoto.
5578
5579 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5580
5581         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
5582         GetAttributableValue.
5583
5584         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
5585         when required.
5586
5587         * convert.cs (ImplicitConversionRequired): Error message moved to
5588         DoubleLiteral.
5589
5590         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
5591         automatic implicit conversion of an output value.
5592         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
5593
5594         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
5595         conversion.
5596         (TypeOf.GetAttributableValue): Add extra handling for object type.
5597
5598         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
5599         special error message.
5600
5601 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
5602
5603         * class.cs (Constructor.Emit): Don't crash when struct ctor is
5604         InternalCall.
5605         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
5606         compatible with MS runtime.
5607
5608 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
5609
5610         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
5611         attribute arguments here.
5612
5613         * class.cs (Indexer.Define): The check was moved to attribute class.
5614
5615 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
5616
5617         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
5618         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
5619         easier.
5620
5621 2006-03-22  Raja R Harinath  <rharinath@novell.com>
5622
5623         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
5624         mcs to keep code differences small.
5625         * attribute.cs (Attribute.GetParameterDefaultValue): New.
5626         * typemanager.cs (parameter_default_value_attribute_type): New.
5627         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
5628         CS1908 check.
5629
5630 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
5631
5632         * expression.cs (StringConcat.Append): Reverted back to no warning state.
5633
5634 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
5635
5636         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
5637
5638         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
5639         the blocks too.
5640
5641 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
5642
5643         * doc-bootstrap.cs : fix build.
5644
5645 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
5646
5647         * expression.cs (StringConcat.Append): Issue a warning when empty string
5648         is going to append.
5649
5650 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
5651
5652         * assign.cs (CompoundAssign.ResolveSource): Removed.
5653
5654         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
5655         clean up.
5656
5657         * class.cs (TypeContainer.FindMethods): Removed.
5658         (TypeContainer.CheckMemberUsage): Made static.
5659
5660         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
5661
5662         * constant.cs (CheckRange): Removed unused type argument.
5663         (CheckUnsigned): Removed unused type argument.
5664
5665         * cs-parser.jay: Updated after MemberAccess clean up.
5666         Uses Length for empty string test.
5667
5668         * cs-tokenizer.cs: Uses Length for empty string test.
5669         (IsCastToken): Made static.
5670         (is_hex): Made static.
5671         (real_type_suffix): Made static.
5672
5673         * decl.cs (SetupCache): Made static.
5674         (OnGenerateDocComment): Removed unused ds argument.
5675
5676         * delegate.cs (VerifyDelegate): Removed unused argument.
5677
5678         * doc.cs: Uses Length for empty string test.
5679
5680         * driver.cs: Uses Length for empty string test.
5681
5682         * enum.cs (IsValidEnumType): Made static
5683
5684         * expression.cs (EnumLiftUp): Removed unused argument.
5685         (ResolveMethodGroup): Ditto.
5686         (BetterConversion): Ditto.
5687         (GetVarargsTypes): Ditto.
5688         (UpdateIndices): Ditto.
5689         (ValidateInitializers): Ditto.
5690         (MemberAccess.ctor): Ditto.
5691         (GetIndexersForType): Ditto.
5692
5693         * flowanalysis.cs: (MergeFinally): Removed unused argument.
5694
5695         * iterators.cs: Updated after MemberAccess clean up.
5696
5697         * location.cs: Uses Length for empty string test.
5698
5699         * namespace.cs: Uses Length for empty string test.
5700
5701          * report.cs (CheckWarningCode): Made static.
5702
5703         * statement.cs (LabeledStatement): Removed unused argument.
5704
5705         * typemanager.cs (FilterNone): Removed.
5706
5707 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5708
5709         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
5710         obsolete.
5711
5712         * class.cs: Updated.
5713
5714 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5715
5716         * cs-parser.jay.cs: __arglist is not allowed for delegates.
5717
5718 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5719
5720         A fix for #77822.
5721
5722         * expression.cs (VerifyArgumentsCompat): Reverted to double error
5723         reporting, it's more tricky than I thought.
5724
5725 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5726
5727         A fix for #77816.
5728
5729         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
5730         host container.
5731         (AnonymousMethod.ImplicitStandardConversionExists): New method.
5732         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
5733         Add more error reporting; Fixed issue with params.
5734
5735         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
5736
5737         * cs-parser.jay: AnonymousMethod requires host container.
5738
5739         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
5740
5741 2006-03-18  Raja R Harinath  <harinath@gmail.com>
5742
5743         * class.cs: Change 'TypeContainer ds' constructor argument to
5744         'DeclSpace parent'.  Some classes were missed below due to
5745         different naming convention.
5746
5747         * class.cs (MemberCore.Parent): Delete.  This makes the
5748         ParentContainer changes below enforceable by the compiler.
5749
5750         Treat pointers to enclosing declaration space as 'DeclSpace', not
5751         'TypeContainer'.
5752         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
5753         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
5754
5755         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
5756         of TypeContainer.
5757         (Block.AddThisVariable): Likewise.
5758         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
5759         (AbstractPropertyEventMethod.Emit): Likewise.
5760         (AbstractPropertyEventMethod.EmitMethod): Likewise.
5761         (GetMethod.Define, SetMethod.Define): Likewise.
5762         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
5763         (DelegateMethod.EmitMethod): Likewise.
5764
5765         Fix regression test-partial-13.cs.
5766         Rationalize use of PartialContainer.  Ensure that the partial
5767         class semantics can be tied to type-correctness, i.e., any
5768         violation will cause a compile error.
5769         * class.cs, const.cs: Access all fields that belong to class
5770         TypeContainer via ParentContainer.  Arguments of EmitContexts and
5771         Resolve()-like functions still use 'Parent'.
5772
5773         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
5774         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
5775         (PropertyMethod.CheckModifiers): Remove unused argument.
5776         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
5777         DeclSpace.
5778
5779 2006-03-17  Raja R Harinath  <harinath@gmail.com>
5780
5781         Make semantics of PartialContainer simpler.
5782         * decl.cs (DeclSpace.IsPartial): Remove.
5783         * class.cs (TypeContainer.IsPartial): Likewise.
5784         (TypeContainer..ctor): Set PartialContainer to point to self.
5785         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
5786         (TypeContainer.FindNestedType): Likewise.
5787         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
5788
5789 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
5790
5791         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
5792
5793 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
5794
5795         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
5796         classes.
5797
5798 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
5799
5800         * class.cs (Operator.Define): An error for base conversion was not
5801         reported correctly.
5802
5803 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
5804
5805         * iterator.cs : yield break is allowed in try statement which has
5806           catch clauses. Fixed bug #77767.
5807
5808 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
5809
5810         A fix for #77593, #77574.
5811
5812         * class.cs (MethodCore.CheckBase): Another if for operator.
5813
5814 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
5815
5816         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
5817         were not resolved
5818
5819         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
5820         (DelegateCreation.ImplicitStandardConversionExists): New method for just
5821         conversion test.
5822         
5823         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
5824         not needed.
5825
5826         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
5827         Updated after another emitcontext usage was clean up. It should help us to
5828         synchronize with gmcs easier.
5829
5830 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
5831
5832         A fix for #77353.
5833
5834         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
5835         (Event.Define): ditto
5836         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
5837
5838         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
5839         Removed redundant code and set NewSlot for Invoke method too.
5840
5841         * parameter.cs (Parameters.ctor): Add custom, type ctor.
5842         (Parameters.MergeGenerated): New method. Use this method when you merge
5843         compiler generated argument with user arguments.
5844
5845 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
5846
5847         * attribute.cs (ResolveAsTypeTerminal): Removed.
5848
5849         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
5850         specialization for predefined types; 30% speed up.
5851         Finally placed obsolete check to right place.
5852         (Expression.ResolveType): Removed.
5853
5854         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
5855         Updated after ResolveType was removed.
5856
5857         * expression.cs (Cast.ctor): Check void cast.
5858         (Binary.ResolveAsTypeTerminal): Is never type.
5859         (Conditional.ResolveAsTypeTerminal): Is never type.
5860
5861         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
5862
5863 2006-03-01  Raja R Harinath  <rharinath@novell.com>
5864
5865         Fix #77679.
5866         * expression.cs (ParameterReference.DoResolveBase): Change return
5867         type to bool.
5868         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
5869         Update.
5870
5871         Fix #77628.
5872         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
5873
5874         Fix #77642.
5875         * typemanager.cs (GetFullNameSignature): Don't nullref on
5876         protected accessors.
5877
5878 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
5879
5880         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
5881         these two separated members to simplify the code.
5882         (Attribute.Resolve): Refactored to use new fields and methods.
5883         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
5884         implemented obsolete attribute checking.
5885         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
5886         implemented obsolete checking again. It look line never ending quest ;-)
5887         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
5888
5889         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
5890
5891         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
5892
5893         *class.cs (Property.Define): Add RegisterProperty call.
5894
5895         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
5896         argument groups (only 2).
5897
5898         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
5899         encoding expression to arguments.
5900         (Expression.ExprClassToResolveFlags): Just turned to property.
5901
5902         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
5903         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
5904         optimized as well as implemented support for zero-length attributes.
5905
5906         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
5907         Add caching of PropertyInfo's.
5908
5909 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
5910
5911         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
5912         error multiple times.
5913
5914 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
5915
5916         New partial class implementation.
5917         A fix for #77027, #77029, #77403
5918
5919         * attribute.cs (Attributable): Made attributes protected.
5920
5921         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
5922         the replacements of ClassPart and PartialContainer.
5923         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
5924         (TypeContainer.AddInterface): Ditto.
5925         (TypeContainer.AddPartial): The main method for partial classes. It checks
5926         for errors and merges ModFlags and attributes. At the end class is added to
5927         partial_parts list.
5928         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
5929         required here.
5930         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
5931         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
5932         from the rest of partial classes.
5933         (TypeContainer.GetClassBases): Simplified.
5934         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
5935         DefineType.
5936         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
5937         (TypeContainer.HasExplicitLayout): Uses Flags now.
5938         (PartialContainer): Removed.
5939         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
5940         (StaticClass): Was merged with Class.
5941         (Class.GetClassBases): class and static class bases are verified here.
5942         (Class.TypeAttr): Added static attributes when class is static.
5943         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
5944         (MemberBase): In some cases we need to call parent container for partial
5945         class. It should be eliminated but it's not easy now.
5946
5947         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
5948
5949         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
5950         partial classed to accumulate class comments.
5951         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
5952
5953         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
5954
5955         * driver.cs (MainDriver): Tree.GetDecl was removed.
5956
5957         * modifiers.cs (Modifiers): Add partial modifier.
5958
5959         * tree.cs (Tree.decl): Removed.
5960         (RootTypes): Started to use this class more often for root types
5961         specializations.
5962
5963 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
5964
5965         A fix for #77615
5966
5967         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
5968         external interface does not have an attribute.
5969
5970 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
5971
5972         Another prerequisites for new partial classs implementation.
5973         
5974         * attribute.cs (Attribute.Equal): Implemented.
5975         (Attribute.Emit): Changed as attributes can be applied more than twice.
5976         (Attributes.Emit): Check for duplicate attributes here.
5977
5978         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
5979         as a parameter, clean-up.
5980
5981 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
5982
5983         A fix for #77485
5984
5985         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
5986         contains obsolete attribute check which can in some cases look for base
5987         type of current class which is not initialized yet.
5988         (TypeContainer.BaseType): Replacement of ptype.
5989
5990         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
5991
5992 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
5993
5994         First of prerequisites for new partial classs implemention.
5995         
5996         * attribute.cs (Attributable): Extended by ResolveContext;
5997         Attributes finally have correct context for resolving in all cases.
5998         (AttachTo): Attribute owner is assigned here.
5999
6000         * codegen.cs (IResolveContext): Introduce new interface to hold
6001         all information needed in resolving phase.
6002         (EmitContext): Implements IResolveContext; more clean-up needed here.
6003         
6004         * decl.cs (MemberCore): Implemented IResolveContext.
6005
6006         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
6007         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
6008         parameter.cs, statement.cs, tree.cs, typemanager.cs:
6009         Refactored to use new IResolveContext instead of EmitContext; cleanup
6010
6011 2006-02-06  Miguel de Icaza  <miguel@novell.com>
6012
6013         * codegen.cs (EmitScopeInitFromBlock): check here the
6014         capture_context, there is no need to make two calls to the
6015         EmitContext. 
6016
6017         * anonymous.cs: Add some debugging messages that might help me
6018         track other instances of this problem in the future (the
6019         regression of test 467).
6020
6021         * cs-parser.jay: track the variable block, as we need to initalize
6022         any captured variables declared in this block for the "catch"
6023         portion of the "Try" statement.
6024
6025         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
6026         scope initialization for captured variables. 
6027
6028         Also, move the emit for the variables after the block location has
6029         been marked.
6030
6031 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
6032
6033         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
6034
6035 2006-02-02  Miguel de Icaza  <miguel@novell.com>
6036
6037         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
6038         commit yesterday, the initialization for the roots is necessary.
6039         What is not necessary is the scope activation.
6040
6041 2006-02-02  Raja R Harinath  <rharinath@novell.com>
6042
6043         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
6044         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
6045         CS0206 checks.
6046         (Argument.Resolve): Remove CS0206 checks.
6047
6048 2006-02-01  Miguel de Icaza  <miguel@novell.com>
6049
6050         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
6051         scopes for all the roots, the scopes will now be emitted when the
6052         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
6053
6054         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
6055         code.  This reduces a lot of existing cruft.
6056         
6057         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
6058         that the ScopeInfo is generated as we enter the scope, not at the
6059         time of use, which is what we used to do before.
6060
6061         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
6062         every time a Block is about to be emitted if we have a
6063         CaptureContext. 
6064
6065 2006-02-01  Raja R Harinath  <rharinath@novell.com>
6066
6067         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
6068         (Reset): Update.
6069         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
6070
6071         * typemanager.cs (cons_param_array_attribute): Make private.
6072         (Reset): Set it to null.
6073         (InitCoreHelpers): Don't initialize it.
6074         (ConsParamArrayAttribute): New.  Initialize it as needed.
6075         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
6076
6077 2006-01-31  Miguel de Icaza  <miguel@novell.com>
6078
6079         * expression.cs: There might be errors reported during the
6080         selection of applicable methods.  If there are errors, do not
6081         continue execution as it will lead the compiler to crash.
6082
6083 2006-01-30  Miguel de Icaza  <miguel@novell.com>
6084
6085         * expression.cs: Member access is not allowed on anonymous
6086         methods.  Fixes #77402.
6087
6088 2006-01-30  Raja R Harinath  <rharinath@novell.com>
6089
6090         Fix #77401
6091         * cs-parser.jay (VariableDeclaration): Don't set
6092         current_array_type to null.
6093         (field_declaration, event_declaration, declaration_statement):
6094         Set it to null here.
6095
6096 2006-01-28  Raja R Harinath  <harinath@gmail.com>
6097
6098         * typemanager.cs (GenericParameterPosition): New.
6099         * doc.cs: Use it.
6100
6101 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
6102
6103         * doc.cs : To process "include" elements, first we should create
6104           another list than XmlNodeList, because it could result in node
6105           removal, which could result in that the XmlNodeList gives up
6106           yielding next node.
6107
6108           (Also made code identical to gmcs again.)
6109
6110 2006-01-25  Miguel de Icaza  <miguel@novell.com>
6111
6112         * ecore.cs: Introduce an error report that we were not catching
6113         before, if not silent, we must report the error.  Gonzalo ran into
6114         it.
6115
6116 2006-01-23  Miguel de Icaza  <miguel@novell.com>
6117
6118         A fix for bug: #76957
6119         
6120         * iterators.cs (MoveNextMethod.CreateMethodHost): call
6121         ComputeMethodHost before creating the method, this is a new
6122         requirement. 
6123
6124         * anonymous.cs (AnonymousContainer): Now we track all the scopes
6125         that this method references (RegisterScope).  The actual scope
6126         where the method is hosted is computed with the ComputeMethodHost
6127         before we create the method.
6128
6129         Moved the Deepest routine here.
6130
6131         (AnonymousContainer.ComputeMethodHost): New routine used to
6132         compute the proper ScopeInfo that will host the anonymous method.
6133
6134         (ScopeInfo): Deal with multiple roots.  The problem was that we
6135         did not have a unique root where all ScopeInfos could be hanged
6136         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
6137         of roots.  
6138
6139         Remove AdjustMethodScope which is now computed at the end.  Remove
6140         LinkScope which did a partial link, instead link all ScopeInfos
6141         before code generation from the new "LinkScopes" routine. 
6142
6143         Simplify all the Add* routines as they no longer need to maintain
6144         the tree, they just need to record that they are using variables
6145         from a ScopeInfo.
6146
6147         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
6148         routines to produce the forest of ScopeInfo trees.
6149
6150         * class.cs (TypeContainer.AppendMethod): This is just like
6151         AddMethod, but ensures that an interface implementation method
6152         (IEnumerable.XXX) is not inserted at the beginning of the queue of
6153         methods, but at the end.
6154
6155         We use this functionality to ensure that the generated MoveNext
6156         method in the iterator class is resolved/emitted before the
6157         enumerator methods created.   
6158
6159         This is required because the MoveNext method computes the right
6160         ScopeInfo for the method.  And the other methods will eventually
6161         need to resolve and fetch information computed from the anonymous
6162         method. 
6163
6164 2006-01-21  Raja R Harinath  <harinath@gmail.com>
6165             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
6166
6167         Fix rest of #76995.
6168         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
6169         the 'aliases' hash.
6170         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
6171         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
6172
6173 2006-01-18  Raja R Harinath  <rharinath@novell.com>
6174
6175         Fix #76656, cs0231-2.cs.
6176         * cs-parser.jay (formal_parameter_list): Make error case catch
6177         more issues.
6178         (parenthesized_expression_0): Add CS1026 check.
6179         (invocation_expression): Remove unused { $$ = lexer.Location }.
6180
6181 2006-01-17  Raja R Harinath  <rharinath@novell.com>
6182
6183         Fix #76824.
6184         * cs-parser.jay (statement_expression): Don't list out the
6185         individual statement-expressions.  Convert syntax error into
6186         CS0201 check.
6187
6188 2006-01-16  Raja R Harinath  <rharinath@novell.com>
6189
6190         Fix #76874.
6191         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
6192         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
6193         CheckIntermediateModification.
6194         (FieldExpr.DoResolve): Add new two-argument version that
6195         allows us to resolve the InstanceExpression as an lvalue.
6196         The one-argument variant is now just a wrapper.
6197         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
6198         Resolve the lhs as an lvalue if the it has a value type.
6199         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
6200         from Assign.DoResolve.
6201         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
6202         resolved as an lvalue.
6203         (PropertyExpr.DoResolve): Update.
6204         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
6205         has a value type.  Move CS1612 check here from
6206         CheckIntermediateModification.
6207         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
6208         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
6209         'right_side' of a ResolveLValue on an 'out' argument.
6210         (EmptyExpression.LValueMemberAccess): New.  Used as the
6211         'right_side' of a propagated ResolveLValue on a value type.
6212         (LocalVariableReference.DoResolveBase): Recognize
6213         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
6214         Add CS1654 check.
6215         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
6216         EmptyExpression.Null.
6217
6218 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
6219
6220         * typemanager.cs : added IsGenericParameter(). In mcs it always
6221           return false.
6222         * doc.cs : for generic parameters, use GenericParameterPosition,
6223           not FullName.
6224
6225 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
6226
6227         * expression.cs: Fix Console.WriteLine ((this = x).foo);
6228
6229 2006-01-12  Miguel de Icaza  <miguel@novell.com>
6230
6231         This fixes the problem where we used ldfld instead of ldflda to
6232         load the "THIS" pointer on captured parameters, when THIS is a
6233         value type.  See bug #77205.
6234         
6235         * iterators.cs (CapturedThisReference.Emit): Pass false to
6236         EmitThis (we do not need the address).
6237
6238         * codegen.cs (EmitThis): it needs to know whether we need the
6239         address of `this' or not.  This is used by value types.  
6240
6241         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
6242         every other call passes false.
6243
6244 2006-01-12  Raja R Harinath  <rharinath@novell.com>
6245
6246         Fix #77221.
6247         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
6248         GetOverride.
6249         * expression.cs (Invocation.OverloadResolve): Update.
6250         (Invocation.DoResolve): Avoid double resolution of invocation.
6251
6252 2006-01-11  Raja R Harinath  <rharinath@novell.com>
6253
6254         Fix #77180.
6255         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
6256         unary negation of floating point types as 0-expr; negation cannot
6257         overflow in floating point types.
6258
6259         Fix #77204.
6260         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
6261         on operands of 'void' type.
6262
6263         Fix #77200.
6264         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
6265         and ExclusiveOr for boolean constants too.
6266
6267 2006-01-09  Raja R Harinath  <rharinath@novell.com>
6268
6269         Fix #75636.
6270         * expression.cs (Invocation.OverloadResolve): Replace reflected
6271         override methods with their base virtual methods, rather than
6272         skipping over them.
6273         * typemanager.cs (TypeManager.GetOverride): New.
6274
6275 2006-01-05  Jb Evain  <jbevain@gmail.com>
6276
6277         * class.cs (Property.Define, Indexer.Define): do not tag the
6278         properties as SpecialName | RTSpecialName.
6279
6280 2006-01-04  Miguel de Icaza  <miguel@novell.com>
6281
6282         * class.cs (MethodCore.IsDuplicateImplementation): This method was
6283         doing a low-level comparission of parameter types.  It was lacking
6284         a check for __argslist. 
6285
6286 2005-12-30  Miguel de Icaza  <miguel@novell.com>
6287
6288         * expression.cs (ParameterReference.DoResolveBase): Allow
6289         reference parameters if they are local to this block. 
6290
6291         This allows the ref and out parameters of a delegate to be used in
6292         an anonymous method, for example:
6293
6294         delegate void set (out int x);
6295
6296         set s = delegate (out int x){
6297                 x = 0;
6298         };
6299
6300         This is used by functionality introduced late in the C# language.
6301         
6302         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
6303         method that take ref and out parameters. 
6304
6305         Fixes #77119 which was a late change in the spec.
6306
6307 2005-12-23  Miguel de Icaza  <miguel@novell.com>
6308
6309         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
6310         parent if its the same scope.  Fixes #77060.
6311
6312 2005-12-21  Miguel de Icaza  <miguel@novell.com>
6313
6314         * driver.cs: Report the case of no source files and no -out:
6315         argument provided.
6316
6317 2005-12-20  Raja R Harinath  <rharinath@novell.com>
6318
6319         Fix #77035.
6320         * expression.cs (ComposedCast.GetSignatureForError): Define.
6321
6322 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6323
6324         Fix #76995
6325
6326         * namespace.cs (NamespaceEntry): Add extern_aliases as a
6327         ListDictionary, to contain the ExternAliasEntry entries (in
6328         addition to the NamespaceEntry.aliases hashtable). This field is
6329         shared between the original entry and its doppelganger (bodyless 
6330         copy of it).
6331         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
6332         extern_aliases field.
6333         (NamespaceEntry.Lookup): Move the IsImplicit check after the
6334         lookup in extern_aliases.
6335
6336 2005-12-16  Raja R Harinath  <rharinath@novell.com>
6337
6338         Fix #77006.
6339         * class.cs (TypeContainer.Mark_HasEquals): New.
6340         (TypeContainer.Mark_HasGetHashCode): New.
6341         (ClassPart): Override them.
6342         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
6343
6344         Fix #77008.
6345         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
6346         'parent' argument to the base constructor.
6347
6348         Remove all mention of TypeContainer from decl.cs.
6349         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
6350         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
6351         (DeclSpace.DeclSpace): Likewise.
6352         (DeclSpace.DefineMembers): Remove unused argument.
6353         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
6354         debugging check -- we don't care if the debug code throws an
6355         InvalidCastException instead of an InternalErrorException.
6356         * class.cs (TypeContainer.DefineMembers): Update to changes.
6357         (TypeContainer.DoDefineMembers): Likewise.
6358         (TypeContainer.GetMethods): Likewise.
6359         (PropertyMember.Define): Likewise.
6360         (MemberBase.Parent): New property that forwards to
6361         MemberCore.Parent, but ensures that we get a TypeContainer.
6362         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
6363         (RootContext.PopulateTypes): Likewise.  Remove special case code
6364         for !RootContext.StdLib: DefineMembers is idempotent.
6365
6366 2005-12-14  Miguel de Icaza  <miguel@novell.com>
6367
6368         * convert.cs (ExplicitConversionCore): Check the return value from
6369         ExplicitConversionCore which can return null on failure.  Fixes #76914
6370
6371 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
6372
6373         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
6374
6375 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
6376
6377         * doc.cs : The search for referenced namespace was insufficient to
6378           get global one as it used to do. Fixed bug #76965.
6379
6380 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
6381
6382         * doc.cs : check name in cref in the last phase that whether it is
6383           namespace or not.
6384
6385 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
6386
6387         * cs-tokenizer.cs : reverted the latest change: it somehow broke
6388           Mono.C5.
6389
6390 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
6391
6392         * doc.cs : so it turned out that we cannot skip override check for 
6393           interface members. Fixed bug #76954.
6394
6395 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
6396
6397         * cs-tokenizer.cs : fixed bug #75984:
6398           - #warning and #error should not be handled when the source line
6399             is disabled.
6400           - #line is not checked strictly when the source line is disabled.
6401           - #define and #undef is on the other hand checked strictly at any
6402             state.
6403
6404 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
6405
6406         * cs-tokenizer.cs : missing Location (actually, filename) in one of
6407           CS1027 report.
6408
6409 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
6410
6411         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
6412
6413         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
6414         event initializers.
6415         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
6416         (FieldBase.Initializer): Initializer is now optional.
6417         (EventField.Define): Only event field can have initializer.
6418
6419         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
6420
6421         * const.cs (Const): Reuse initializer.
6422
6423         * cs-parser.jay: Updated after FieldBase changes.
6424         Added current_array_type to simplify array initializers.
6425
6426         * ecore.cs (NullCast.IsDefaultValue): Implemented.
6427
6428         * expression.cs, iterators.cs: Updated.
6429
6430         * namespace.cs (NamespaceEntry): Made UsingFound private.
6431
6432 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
6433
6434         * parameterCollection.cs: Obsolete, removed.
6435         * parser.cs: Obsolete, removed.
6436
6437 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
6438
6439         Fix #76849.
6440         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
6441
6442         * enum.cs (Enum.Define): Set obsolete context here.
6443
6444 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
6445
6446         * doc.cs :
6447           - FindDocumentedMember() now expects 1) paramList as null
6448             when "we don't have to check the number of parameters" and
6449             2) Type.EmptyTypes when "there is no arguments".
6450           - Introduced FoundMember struct to hold the exact type which was
6451             used to find the documented member (the above change broke
6452             test-xml-044; it might be better just to use DeclaringType than
6453             what MS does, like this change does, but it depends on usage.)
6454
6455 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
6456
6457         * doc.cs : documented member might be from DeclaringType for nested
6458           types. Fixed bug #76782.
6459
6460 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
6461
6462         * anonymous.cs: Have the param code handle leaving copies on the
6463         stack etc. Allows anonymous params to take part in the assignment
6464         code (++, +=, etc). Fixes bug #76550
6465
6466         * expression.cs: Handle the prepare_for_load/leave_copy by passing
6467         it down to the anon code.
6468
6469         * iterators.cs: Use dummy var here
6470
6471         * codegen.cs: Handle new vars
6472
6473 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
6474
6475         Fix #76849.
6476         * class.cs (MethodData.Define): Set proper Obsolete context.
6477
6478         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
6479         obsolete context.
6480         (FieldExpr.DoResolve): Ditto.
6481
6482 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
6483
6484         Fix #76849.
6485         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
6486         parent is not obsolete.
6487
6488 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
6489
6490         * doc.cs : (FindDocumentedMember) find parameterless members first
6491           and get CS0419 in the early stage. Fixed first case of bug #76727.
6492
6493 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
6494
6495         Fix #76859.
6496         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
6497         no error was reported.
6498
6499         *expression.cs (Binary.DoResolve): left can be null.
6500
6501 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
6502
6503         Fix #76783.
6504         * class.cs (MethodData.Emit): Parameters should be labeled first.
6505
6506 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
6507
6508         Fix #76761.
6509         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
6510
6511 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
6512
6513         * attribute.cs (AreParametersCompliant): Moved to Parameter.
6514
6515         * class.cs (MethodCore): Parameter clean up.
6516         (IMethodData): Added ParameterInfo.
6517         (MethodData): Parameter clean up.
6518         (Indexer.Define): Parameter clean up.
6519
6520         * anonymous.cs,
6521         * codegen.cs,
6522         * cs-parser.jay,
6523         * decl.cs,
6524         * doc.cs,
6525         * ecore.cs,
6526         * flowanalysis.cs,
6527         * iterators.cs,
6528         * pending.cs,
6529         * statement.cs,
6530         * typemanager.cs: Parameter clean up.
6531
6532         * delegate.cs (Define): Get rid of duplicated code.
6533
6534         * expression.cs (ParameterReference): Removed useless parameters
6535         and simplified.
6536         (Invocation): Ditto.
6537
6538         * parameter.cs (ParamsParameter): New class, params specialization.
6539         (ArglistParameter): Attemp to separate arglist.
6540         (Parameter): Refactored to be reusable and faster.
6541         (Parameter.Modifier): Made understandable.
6542         (Parameters): Changed to be used as a class for `this' assembly
6543         parameters. Refactored to use new specialized classes.
6544
6545         * support.cs (ParameterData): Added Types property.
6546         (InternalParameters): Deleted.
6547
6548 2005-08-20  Martin Baulig  <martin@ximian.com>
6549
6550         Merging this patch from GMCS to fix #75867.
6551
6552         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
6553         scope if we don't already have it.
6554
6555 2005-11-17  Martin Baulig  <martin@ximian.com>
6556
6557         * anonymous.cs
6558         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
6559         inherit the scope from our parent.  Fixes #76653.
6560
6561 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
6562
6563         * doc.cs : the previous patch does not actually fix the bug.
6564           PropertyInfo override check is now implemented and really fixed it.
6565         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
6566
6567 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
6568
6569         * doc.cs : apply "override filter" also to properties.
6570           Fixed bug #76730.
6571
6572 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
6573
6574         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
6575           no need to check overrides. For classes, omit those results from 
6576           interfaces since they must exist in the class. Fixed bug #76726.
6577
6578 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
6579
6580         * typemanager.cs : (GetFullNameSignature) differentiate indexers
6581           with different parameters. Fixed the second problem in #76685.
6582
6583 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
6584
6585         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
6586           get expected 'protected' access in CheckValidFamilyAccess()).
6587           Fixed bug #76692.
6588
6589 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
6590
6591         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
6592           Fixed bug #76705.  CS1569 was incorrectly commented out.
6593
6594 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
6595
6596         * doc.cs : use Invocation.IsOverride() to do real override check.
6597         * expression.cs : made Invocation.IsOverride() internal.
6598
6599 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
6600
6601         * doc.cs : use TypeManager.FindMembers() instead of (possible)
6602           TypeBuilder.FindMembers() and filter overriden base members out.
6603           Fixed bug #76990.
6604
6605 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6606
6607         * doc.cs : ref/out parameters are represented as '@' (instead of
6608           '&' in type FullName). Fixed bug #76630 (additionally crefs).
6609
6610 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6611
6612         * doc.cs : when there was no '.' in cref to methods in doc comment,
6613           then parameters were missing in the output. Fixed bug #76691.
6614
6615 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6616
6617         * driver.cs : don't output docs when there is an error.
6618           Fixed bug #76693.
6619
6620 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6621
6622         * doc.cs :
6623           Now it should detect indexers. Fixed primary concern in bug #76685.
6624           Fixed CS0419 message to not show the identical member signature in
6625           the message.
6626
6627 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6628
6629         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
6630           instead of Type.FindMembers() since it does not handle events.
6631           Fixed bug #71604.
6632
6633 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
6634
6635         * codegen.cs: Fixed typo (speficied -> specified).
6636
6637 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
6638
6639         Fix #76369.
6640         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
6641
6642 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
6643
6644         * attribute.cs: Changed error message.
6645
6646         * cs-tokenizer.cs: One more check.
6647
6648 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
6649
6650         * statement.cs (Block.Resolve): Ignore empty statement.
6651
6652 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
6653
6654         * report.cs: Made error/warning methods more strict to avoid
6655         their misuse.
6656
6657         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
6658         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
6659         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
6660         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
6661
6662 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
6663
6664         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
6665         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
6666
6667         * class.cs (TypeContainer.IsComImport): New property.
6668         (Constructor.Define): Create proper ctor for ComImport types.
6669
6670         * expression.cs (New.CheckComImport): Fixed.
6671
6672 2005-11-07  Miguel de Icaza  <miguel@novell.com>
6673
6674         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
6675         that a parameter has been captured does not mean that we do not
6676         have to do the rest of the processing.  This fixes the second part
6677         of #76592.  If there was another anonymous method capturing
6678         values in the past, the Scope would never be set for the second
6679         method that captured the same parameter.
6680
6681         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
6682         properly manipulate the stack.   Second part of fix for #76592.
6683
6684         * expression.cs (New): Add support for invoking "new" on
6685         interfaces that have been flagged with the ComImport attribute and
6686         the CoClass.  Fixes #76637 
6687
6688         * statement.cs (Try.DoEmit): When a variable is captured, do not
6689         try to emit the vi.LocalBuilder variable as it has been captured.
6690         Create a temporary variable and store the results on the
6691         FieldBuilder.  Fixes #76642
6692
6693 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
6694
6695         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
6696
6697         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
6698
6699         * expression.cs (Binary.DoResolve): Added && optimalization.
6700     
6701         * typemanager.cs (AddUserType): Removed useless argument.
6702
6703 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
6704
6705         * statement.cs (Block.variables): Uses ListDictionary.
6706
6707 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
6708
6709         Fix #75969.
6710         * class.cs (PartialContainer.EmitType): Customized to emit
6711         security attributes.
6712         (ClassPart.ApplyAttributeBuilder): Transform security attribute
6713         for partial classes.
6714
6715 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
6716
6717         Fix #76599.
6718         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
6719         access has to be fixed.
6720         
6721         * typemanager.cs (IsUnmanagedType): Wrong common field type.
6722
6723 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
6724
6725         Fix #76590.
6726         * ecore.cs (NullCast.Reduce): Implemented.
6727
6728         * expression.cs (ArrayCreation.CheckIndices): Correcly check
6729         constant type.
6730         
6731         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
6732         properly.
6733         (Foreach.Resolve): Catch null properly.
6734
6735 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
6736  
6737         * cs-tokenizer.cs: Warning text fix.
6738
6739         * driver.cs: AllWarningNumbers exposed on public interface.
6740
6741         * report.cs (): Reviewed warning numbers.
6742         (IsValidWarning): Use binary search.
6743
6744 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
6745  
6746         * driver.cs: Implemeted resource visibility.
6747         (Resources): New class for code sharing between /res: and
6748         /linkres:
6749  
6750 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
6751
6752         Fix #76568.
6753         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
6754         folding.
6755         
6756         * convert (Convert.ImplicitReferenceConversion): NullCast holds
6757         contants only.
6758         
6759         * ecore.cs (NullCast): Child is contant only.
6760         
6761         * literal.cs (NullLiteral.Reduce): null can be converted to any
6762         reference type.
6763
6764 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
6765
6766         * driver.cs: Use Encoding.Default as default code page instead
6767           of ISO-28591.
6768
6769 2005-10-27  Raja R Harinath  <rharinath@novell.com>
6770
6771         Fix #76085.
6772         * expression.cs (Invocation.Error_InvalidArguments): Handle
6773         __arglist parameters.
6774         (Invocation.VerifyArgumentsCompat): Likewise.
6775         * support.cs (ReflectionParameters.GetSignatureForError): Print
6776         __arglist parameters.
6777         (InternalParamters.GetSignatureForError): Likewise.
6778         * parameter.cs (Parameters.GetSignatureForError): Likewise.
6779
6780 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
6781
6782         * attribute.cs (GetPropertyValue): Made public.
6783
6784         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
6785         Resolve.
6786         Add new property WrapNonExceptionThrows to handle 2.0 assembly
6787         attribute.
6788         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
6789         is not defined.
6790         
6791         * driver.cs: Reflect method name change.
6792         
6793         * statement.cs (Try.Resolve): Warn when try has both general
6794         exception handlers.
6795         
6796         * typemanager.cs: runtime_compatibility_attr_type new predefined
6797         type.
6798
6799 2005-10-26  Raja R Harinath  <harinath@gmail.com>
6800
6801         Fix #76419.
6802         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
6803         treat it as an empty parameter list.
6804
6805 2005-10-26  Raja R Harinath  <rharinath@novell.com>
6806
6807         Fix #76271.     
6808         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
6809         ResolveAsTypeStep silent.
6810         * statement.cs (Block.AddConstant): Mark block as used.
6811         (Block.ResolveMeta): Avoid piling on error messages
6812         if a constant initializer resolution fails.
6813
6814 2005-10-25  Raja R Harinath  <rharinath@novell.com>
6815
6816         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
6817         Remove.
6818         (NamespaceEntry.VerifyAllUsing): New.
6819         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
6820         behaviour.  Delegates actual resolution of alias to ...
6821         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
6822         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
6823         Update.
6824         * driver.cs (Driver.MainDriver): Update.
6825         
6826         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
6827         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
6828         property.
6829         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
6830         Remove.
6831         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
6832         RootNamespace.DefineNamespacesForAll.
6833
6834 2005-10-24  Raja R Harinath  <harinath@gmail.com>
6835
6836         * typemanager.cs (assemblies, external_aliases, modules)
6837         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
6838         (ComputeNamespaces, GetRootNamespace): Remove extra staging
6839         overhead.  Move resposibility ...
6840         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
6841         * driver.cs, attribute.cs, codegen.cs: Update to changes.
6842
6843 2005-10-23  Raja R Harinath  <harinath@gmail.com>
6844
6845         * namespace.cs (RootNamespace.all_namespaces): Renamed from
6846         cached_namespaces.  Improve usage.
6847         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
6848         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
6849         Move from GlobalRootNamespace and simplify.
6850         (RootNamespace.Global): Make instance variable.
6851         (RootNamespace.RootNamespace): Add "alias name" parameter.
6852         (GlobalRootNamespace): Simplify drastically.
6853         (Namespace.Lookup): Don't use GetNamespace.
6854         * typemanager.cs (GetRootNamespace): Rename from
6855         ComputeNamespaceForAlias.
6856         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
6857
6858 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
6859
6860         * anonymous.cs (AnonymousContainer): Don't crash when container
6861         doesn't exist.
6862
6863 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
6864
6865         * expression.cs (Binary.DoResolve): Warn when comparing same
6866         values.
6867
6868 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
6869
6870         Fix #76486.
6871         * expression.cs (Binary.DoResolve): It looks like there are no
6872         convetsion rules in enum context.
6873
6874 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6875
6876         Add support for extern alias qualifiers.
6877         * typemanager.cs: Move some LookupTypeReflection code
6878         to namespace.cs, to have cleaner code. Added some methods
6879         to help us keep track of the extern aliased references.
6880         * driver.cs: Add suport for extern alias assemblies on command
6881         line and check for their warnings/errors. Also keep track of the
6882         extern aliased assemblies.
6883         * namespace.cs: Move the global functionality of Namespace
6884         to GlobalRootNamespace/RootNamespace. Now the global namespace
6885         is GlobalRootNamespace.Globa. Also the code moved from 
6886         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
6887         Finally added LocalAliasEntry (AliasEntry before) and
6888         ExternAliasEntry, to handle alias statements.
6889         * cs-parser.jay: Add support in the grammar for extern alias
6890         statement.
6891         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
6892         Update callings to Namespace (now in GlobalRootNamespace).
6893
6894 2005-10-18  Raja R Harinath  <rharinath@novell.com>
6895
6896         Fix #76371.
6897         * class.cs (TypeContainer.DefineType): Move updating of
6898         topological sort earlier in the code.
6899         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
6900
6901 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
6902
6903         Fix #76273.
6904         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
6905         
6906         * constant.cs (Constant.TryReduce): Moved from Cast class.
6907         (Reduce): Made little bit more OO and fixed missing conversions.
6908         
6909         * ecore.cs (Reduce): Implemented.
6910         (Binary.EnumLiftUp): New method to upgrade values to enum values.
6911         
6912         * literal.cs (Reduce): Implemented.
6913         
6914         * class.cs: Reverted Miguel's wrong commit.
6915
6916 2005-10-14  Miguel de Icaza  <miguel@novell.com>
6917
6918         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
6919
6920 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
6921
6922         * cs-parser.jay, expression.cs : CS0214 was missing error location
6923           for constants. Fixed bug #76404.
6924
6925 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
6926
6927         Fix #76370.
6928         * convert.cs (ExplicitConversionCore): Fixed object->enum
6929         conversion.
6930
6931 2005-10-10  Raja R Harinath  <rharinath@novell.com>
6932
6933         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
6934         InstanceExpression.
6935         (PropertyExpr.EmitCall): Likewise.
6936         * expression.cs (Invocation.EmitArguments): Handle case where
6937         arguments == null.
6938         (Invocation.EmitCall): Avoid allocating temporary variable if
6939         there are no arguments.
6940
6941 2005-10-07  Raja R Harinath  <rharinath@novell.com>
6942
6943         Fix #76323.
6944         * convert.cs (ImplicitConversionStandard): Move conversion of
6945         void* to arbitrary pointer types ...
6946         (ExplicitConversionStandard): .. here.
6947         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
6948         error to always print typenames.
6949
6950 2005-10-07  Raja R Harinath  <rharinath@novell.com>
6951
6952         * convert.cs (GetConversionOperator): Rename from
6953         GetConversionOperators.  Move operator selection code from ...
6954         (UserDefinedConversion): ... here.
6955
6956 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
6957
6958         * convert.cs (ExplicitConversionCore): Removed duplicate enum
6959         conversion.
6960
6961 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
6962
6963         * assign.cs (Assign.DoResolve): Error method changed.
6964
6965         * cfold.cs (DoConstantNumericPromotions): Error method changed.
6966         
6967         * const.cs (ResolveValue): Reset in_transit immediately.
6968         
6969         * constant.cs: Error method changed.
6970         
6971         * convert.cs: Removed useless location parameter.
6972         (ExplicitNumericConversion): Don't do double enum check.
6973         (ExplicitConversionCore): Renamed from ExplicitConversion.
6974         (ExplicitUnsafe): Extracted from ExplicitConversion.
6975         (ExplicitConversion): Uses for error reporting.
6976         
6977         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
6978         error messages.
6979         (ResolveBoolean): Uses common error method.
6980         (CastToDecimal): Get rid of ec.
6981         (CastFromDecimal): Optimized.
6982         (ConvCast): Get rid of ec.
6983         
6984         * enum.cs (ResolveValue): Reset in_transit immediately.
6985         (Emit): Return after first error.
6986         
6987         * expression.cs: Convert changes.
6988         
6989         * literal.cs: Error method changed.
6990         
6991         * statement.cs: Error method changed.
6992
6993 2005-10-03  Raja R Harinath  <rharinath@novell.com>
6994
6995         * support.cs (SeekableStreamReader.Position): Don't error out when
6996         the requested position is just beyond the end of the current
6997         buffered data.
6998
6999 2005-09-28  Raja R Harinath  <rharinath@novell.com>
7000
7001         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
7002         try to keep in sync with the byte count of the underlying Stream.
7003         However, this limits us to a window size of 2048 characters: i.e.,
7004         the maximum lookahead of our lexer/parser can be 2048 characters.
7005
7006 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
7007
7008         Fix #76255.
7009         * driver.cs: Fix compilation files with full root path.
7010
7011 2005-09-25  Miguel de Icaza  <miguel@novell.com>
7012
7013         * report.cs (SymbolRelatedToPreviousError): Format the output so
7014         it does not use an open parenthesis that is never closed. 
7015
7016         * driver.cs: Follow coding guidelines
7017
7018 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
7019
7020         Fix #72930.
7021         * const.cs (Const.ResolveValue): Check for assigning non-null
7022         value to reference type.
7023
7024 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
7025
7026         * anonymous.cs: Implemented ExprClassName.
7027         
7028         * assign.cs (Assign.DoResolve): Don't chrash when type is not
7029         delegate.
7030         
7031         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
7032         check.
7033         
7034         * class.cs (StaticClass.DefineContainerMembers): Report protected
7035         members as error.
7036         
7037         * codegen.cs: if(ed) PRODUCTION.
7038         
7039         * convert.cs (Error_CannotImplicitConversion): Better error
7040         distinction.
7041         
7042         * cs-parser.jay: More error checks.
7043         
7044         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
7045         
7046         * driver.cs (CSCParseOption): Enabled wrong option check.
7047         
7048         * ecore.cs (Expression.ExprClassName): Turned to property.
7049         (MemberExpr.CheckIntermediateModification): For checking boxed
7050         value types     modification.
7051         
7052         * statement.cs (Fixed.Resolve): Expression type must be
7053         convertible to fixed type.
7054         (CollectionForeach.GetEnumeratorFilter,TryType):
7055         Small refactoring for easier error checking.
7056
7057 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
7058
7059         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
7060         attributes.
7061         
7062         * class.cs (GeneratedBaseInitializer): New class for customization
7063         compiler generated initializers.
7064         (MemberBase.DoDefine): Check Obsolete attribute here.
7065         (FieldMember.DoDefine): Ditto.
7066         
7067         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
7068         constants.
7069         
7070         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
7071         (MemberCore.GetObsoleteAttribute): Removed argument.
7072         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
7073         (MemberCore.CheckObsoleteType): New helper.
7074         
7075         * delegate.cs,
7076         * enum.cs,
7077         * statement.cs: Updates after MemberCore changes.
7078         
7079         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
7080         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
7081         
7082         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
7083         obsolete attribute for compiler construct.
7084         (As.DoResolve): Cache result.
7085         
7086         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
7087
7088 2005-09-26  Raja R Harinath  <rharinath@novell.com>
7089
7090         Fix #76133.
7091         * expression.cs (This.VerifyFixed): In a value type T, the type of
7092         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
7093         value type R, 'this' is treated as a value parameter.
7094
7095 2005-09-22  Miguel de Icaza  <miguel@novell.com>
7096
7097         * statement.cs (Lock): Use the TemporaryVariable class instead of
7098         manually using local variables as those do not work when variables
7099         are captured.
7100
7101         * ecore.cs: Moved the TemporaryVariable class from being a nested
7102         class inside Foreach to be a public class that can be employed in
7103         other places. 
7104
7105 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
7106
7107         * cs-parser.jay: interface_accessors replaced by
7108         accessor_declarations.
7109
7110         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
7111         location.
7112         
7113         * statement.cs (GotoCase.Resolve): Convert null constant to
7114         null case.
7115         (SwitchLabel.ResolveAndReduce): Ditto.
7116         (SwitchLabel.NullStringCase): Custom null stamp.
7117         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
7118         
7119         typemanager.cs (CSharpSignature): Don't skip first argument
7120         for full names.
7121
7122 2005-09-18  Miguel de Icaza  <miguel@novell.com>
7123
7124         * driver.cs: Set InEmacs based on the environment variable EMACS. 
7125
7126         * location.cs (InEmacs): in this mode, do not report column
7127         location as it confuses Emacs.
7128
7129 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
7130
7131         * cfold.cs, constant.cs, convert.cs, ecore.cs,
7132         expression.cs, iterators.cs, literal.cs: Store constants and
7133         literals location.
7134         
7135         * class.cs (MemberBase.ShortName): Pass location.
7136         
7137         * cs-parser.jay: Some location fixes.
7138         
7139         * ecore.cs (Expression.Location): Made virtual.
7140
7141 2005-09-05  Miguel de Icaza  <miguel@novell.com>
7142
7143         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
7144         if the underlying types are the same, otherwise we need to produce
7145         code that will do the proper cast.
7146
7147         This was exposed by Marek's constant rewrite which produced
7148         invalid code for the call site:
7149
7150         enum X : long { a }
7151         void Method (X v) {}
7152
7153         Method ((X) 5)
7154
7155         This fixes test-49.cs
7156
7157 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
7158
7159         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
7160           Type/Object should be allowed as well. Fixed bug #75968.
7161
7162 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
7163
7164         * expression.cs : (Binary.DoResolve): when one is enum constant and
7165           another is constant 0, then return enum one *as enum type*.
7166           Fixed bug 74846.
7167
7168 2005-09-02  Raja R Harinath  <rharinath@novell.com>
7169
7170         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
7171         internal.
7172
7173         Fix #75941.
7174         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
7175         flow-branching for LocalVariableReferences in case we were invoked
7176         from a MemberAccess.
7177         * expression.cs (LocalVariableReference.VerifyAssigned): New.
7178         Carved out of ...
7179         (LocalVariableReference.DoResolveBase): ... this.
7180         (MemberAccess.Resolve): Do the check that was disabled during
7181         SimpleNameResolve.
7182
7183 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
7184
7185         * class.cs :
7186           (PartialContainer.Create): check abstract/sealed/static strictly
7187           but abstract/sealed can exist only at one side. Fixed bug #75883.
7188
7189 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
7190
7191         Fix #75945.
7192         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
7193         specified, don't default to UnmanagedType.I4.
7194
7195 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
7196
7197         * expression.cs : conditional operator should check possibly
7198           incorrect assign expression. Fixed bug #75946.
7199
7200 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
7201
7202         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
7203           Reverting the change. gmcs is much complex than mcs on this matter.
7204
7205 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
7206
7207         * cs-tokenizer.cs : To read another token ahead of the actual 
7208           consumption, use new SavedToken and cache token instead of moving
7209           back the stream with SeekableStreamReader (it seemed problematic).
7210         * cs-parser.jay,
7211           driver.cs : Thus use StreamReader directly.
7212         * support.cs : Thus removed SeekableStreamReader.
7213
7214 2005-08-30  Raja R Harinath  <rharinath@novell.com>
7215
7216         Fix #75934.
7217         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
7218         (ScopeInfo.EmitScopeType): Use it to construct field names from
7219         names of captured locals.
7220
7221         Fix #75929.
7222         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
7223         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
7224         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
7225         (ExplicitConversion): Remove enum cases already handled by
7226         implicit conversion.  Move implicit conversion check to the beginning.
7227         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
7228         * expression.cs (ArrayCreation.EmitDynamicInitializers):
7229         Don't treat System.Enum as a struct.
7230
7231 2005-08-30  Jb Evain  <jbevain@gmail.com>
7232
7233         * attribute.cs: handles as expression in parameters.
7234
7235 2005-08-30  Raja R Harinath  <rharinath@novell.com>
7236
7237         Fix #75802.
7238         * class.cs (TypeContainer.VerifyClsName): Don't use a
7239         PartialContainer when verifying CLS compliance.
7240         (AbstractPropertyEventMethod): Set Parent here, ...
7241         (PropertyMethod): ... not here.
7242
7243 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
7244
7245         * attribute.cs : escaped attribute name should not be allowed to be
7246           resolved (e.g. @class as classAttribute). Fixed bug #75930.
7247
7248 2005-08-29  Raja R Harinath  <rharinath@novell.com>
7249
7250         Fix #75927.
7251         * convert.cs (ImplicitStandardConversionExists): Allow zero also
7252         when converting a long constant to unsigned long.
7253         * expression.cs (Invocation.OverloadResolve): Add sanity check to
7254         detect where IsApplicable and VerifyArgumentsCompat disagree.
7255
7256 2005-08-29  Raja R Harinath  <rharinath@novell.com>
7257         and Carlos Alberto Cortez  <carlos@unixmexico.org>
7258
7259         Fix #75848.
7260         * class.cs (TypeContainer.CanElideInitializer): New helper.
7261         (TypeContainer.EmitFieldInitializers): Use it to determine if we
7262         can safely emitting the initializer of a field.
7263
7264 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
7265
7266         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
7267           allowed inside a switch (without loop). Fixed bug #75433.
7268
7269 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
7270
7271         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
7272         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
7273
7274 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
7275
7276         * driver.cs : kinda reverting the default encoding changes (not exact 
7277           revert since I noticed that "codepage:reset" might not work fine).
7278
7279 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
7280
7281         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
7282           Location. Now getter and setter store location correctly.
7283           (errors/cs0111-12.cs now reports the expected location.)
7284
7285 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
7286
7287         * driver.cs : Use default encoding on the environment.
7288           Removed (now that) extra parameter for SeekableStreamReader.
7289         * support.cs : (SeekableStreamReader) third .ctor() argument for
7290           StreamReader is not required (always true). preamble size could
7291           be acquired in simpler and safe way.
7292
7293 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
7294
7295         * cs-parser.jay: report CS0642 at warning level 3
7296           and report CS0642 for an if else statement also
7297           fixes bug #74745. Patch by John Luke (and a bit
7298           modified by me).
7299           Removed extra CS0642 warning check for "while",
7300           "for" and "fixed".
7301         * statement.cs: In Block.Resolve(), CS0642 check
7302           is reimplemented to check a sequence of an empty
7303           statement and a block.
7304
7305           Both fix bug #66777.
7306
7307 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
7308
7309         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
7310         detection until I fix it.
7311         
7312         * cs-tokenizer.cs: Changed error message.
7313         
7314         * cs-parser.jay: Fixed 2 error locations.
7315         
7316         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
7317         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
7318         properties.
7319         
7320         * enum.cs (GetSignatureForError): Fixed.
7321         
7322         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
7323         method detection.
7324         
7325         * class.cs,
7326         * typemanager.cs (RegisterProperty): Removed.
7327         
7328         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
7329
7330 2005-08-24  Raja R Harinath  <rharinath@novell.com>
7331
7332         Fix #75874.
7333         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
7334         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
7335
7336 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7337
7338         * expression.cs : tiny fix is required for not warning positive ulong.
7339           See test-441.cs.
7340
7341 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7342
7343         * expression.cs : add CS0652 check for constant and integral
7344           expression. Fixed bug #53974.
7345
7346 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7347
7348         * expression.cs : in DoNumericPromotions(), check if there is implicit
7349           conversion overload for string (to check CS0034). Fixed bug #52492.
7350
7351 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7352
7353         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
7354
7355 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7356
7357         * ecore.cs : report location when it is *not* Null.
7358
7359 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7360
7361         * codegen.cs,
7362           ecore.cs,
7363           flowanalysis.cs,
7364           expression.cs:
7365           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
7366           correctly. Fixed bug #75721.
7367
7368 2005-08-23  Raja R Harinath  <rharinath@novell.com>
7369
7370         * support.cs (SeekableStreamReader.Position): Avoid an expensive
7371         loop that performs 'min (pos, char_count)'.
7372
7373         Fix #75862.
7374         * expression.cs (Unary.ResolveOperator): Don't discard implicit
7375         converted value in Operator.OnesComplement.
7376
7377 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
7378
7379         * anonymous.cs: If the anon method is pulled into a helper class,
7380         it needs to be `internal' not `private'. Fixes runtime behavior on
7381         msft. bug #75704
7382
7383 2005-08-20  Martin Baulig  <martin@ximian.com>
7384
7385         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7386         scope if we don't already have it.
7387
7388         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
7389         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
7390         fixes #75867.
7391
7392 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
7393
7394         Fix #75803
7395         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
7396         is a partial class.
7397
7398 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
7399
7400         The big constants rewrite
7401         Fix #75746, #75685 and more
7402         As a side effect saved 1MB for MWF ;-)
7403         
7404         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
7405         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
7406         enum based for corlib compilation.
7407         
7408         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
7409         subtractions.
7410         
7411         * class.cs (FixedField.Define): Use ResolveAsConstant.
7412         
7413         * const.cs (IConstant): Interface constants and enums.
7414         (Const.ResolveValue): New method for constant resolvning.
7415         (ExternalConstant): Constants from imported assemblies.
7416         
7417         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
7418         conversion; like enums.
7419         (Constant.ToType): Converts this constant to different type.
7420         (Constant.Increment): Adds 1.
7421         
7422         * convert.cs (ImplicitConversionRequired): Simplified.
7423         
7424         * cs-parser.jay: Create EnumMember directly.
7425         
7426         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
7427         
7428         * doc.cs (GenerateEnumDocComment): Removed.
7429         
7430         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
7431         (ConvertIntLiteral): Removed.
7432         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
7433         
7434         * enum.cs (EnumMember): Implement IConstant.
7435         (Enum.IsValidEnumConstant): Removed.
7436         (Enum.GetNextDefaultValue): Removed.
7437         (Enum.FindMembers): Updated.
7438         (Enum.GenerateDocComment): Iterate enum members.
7439         
7440         * expression.cs (Cast.TryReduce): Handle enums correctly.
7441         (New.Constantify): Made public.
7442         (MemberAccess.DoResolve): Removed contant specific if(s).
7443         
7444         * literal.cs (NullLiteral): Implement new abstract methods.
7445         
7446         * statement.cs (GotoCase.Resolve): Use new constant methods.
7447         (SwitchLabel.ResolveAndReduce): Use new constant methods.
7448         
7449         * typemanager.cs (LookupEnum): Removed.
7450         (IsEnumType): Fixed to work with corlib.
7451         (RegisterConstant): Removed.
7452         (LookupConstant): Removed.
7453         (GetConstant): Changed to work with IConstant.
7454
7455 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
7456
7457         * location.cs : Fixed overflown (>255) column number.
7458
7459 2005-08-03  Raja R Harinath  <rharinath@novell.com>
7460
7461         First cut of the qualified-alias-member feature.
7462         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
7463         token.
7464         * cs-parser.jay (DOUBLE_COLON): New token.
7465         (namespace_or_type_name): Add rule for recognizing
7466         qualified-alias-members.
7467         (primary_expression): Likewise.
7468         (element_access): Allow QualifiedAliasMember as a possible
7469         type-bearing expression.
7470         (local_variable_type, local_variable_pointer_type): Likewise.
7471         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
7472         aliases in the current and enclosing namespace declarations.
7473         (NamespaceEntry.UsingAlias): Add CS0440 warning.
7474         * decl.cs (MemberName.is_double_colon): New.
7475         (MemberName.MemberName): Add new constructor for alias-member.
7476         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
7477         * expression.cs (QualifiedAliasMember): New expression type.
7478
7479 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7480
7481         * location.cs : it borked when no argument was specified.
7482
7483 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7484
7485         * location.cs : tiny ToString() format fix.
7486
7487 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7488
7489         * statement.cs : oops, it was missing.
7490
7491 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7492
7493         A set of fixes for precise line/column location.
7494
7495         * location.cs :
7496           "token" field now holds a file/line "delta", a line number offset 
7497           from the segment, and a column number. See also:
7498           http://lists.ximian.com/pipermail/mono-devel-list/2004-
7499           December/009508.html
7500           Removed static IsNull. Use instance IsNull property instead.
7501         * cs-tokenizer.cs :
7502           For some tokens it stores Location. For Identifier it stores
7503           LocatedToken which is a pair of string name and location.
7504           Column numbers are adjusted only at getChar().
7505         * report.cs :
7506           Use Location.ToString() for reporting (it now contains column).
7507         * cs-parser.jay :
7508           Largely modified to use LocatedToken instead of
7509           string (IDENTIFIER), and to acquire Location from some tokens.
7510         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
7511           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
7512           codegen.cs :
7513           Now MemberName holds Location. DeclSpace.ctor() receives Location
7514           as a parameter. Removed extra parameters to all derived classes.
7515           Replaced Location.IsNull() with instance property.
7516         * assign.cs, expression.cs :
7517           Added .ctor() overload that omits Location.
7518         * attribute.cs :
7519           Added "nameEscaped" flag that indicates the identifier was escaped
7520           in the source file. This fixes bug #57047.
7521
7522 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
7523
7524         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
7525         New method, looking for lo-case imported cls type.
7526
7527         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
7528         here.
7529
7530         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
7531
7532         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
7533
7534         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
7535         all_imported_types.
7536         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
7537
7538         Optimized to save 3.5 MB for SWF compilation.
7539
7540 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
7541
7542         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
7543         (PartialContainer.Create): Moved logic AddToContainer.
7544         (PartialContainer.MarkForDuplicationCheck): Shares name.
7545         
7546         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
7547         place.
7548         
7549         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
7550         initialization.
7551         (Namespace.GetSignatureForError): New method.
7552         
7553         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
7554         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
7555
7556 2005-08-01  Raja R Harinath  <rharinath@novell.com>
7557
7558         Fix #75669.
7559         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
7560         member lookup rather than qualifier_type, since qualifier_type can
7561         be null.
7562
7563 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
7564
7565         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
7566         enum member.
7567
7568 2005-07-31  Miguel de Icaza  <miguel@novell.com>
7569
7570         * statement.cs: Copy the local exception into the exception
7571         captured local.  Fixes 75674
7572
7573 2005-07-31  Raja R Harinath  <harinath@gmail.com>
7574
7575         Fix #75658.
7576         * expression.cs (Invocation.OverloadResolve): Don't report error
7577         CS1501 if error CS1502 has been reported.
7578         (New.DoResolve): Delegate CS1501 reporting to
7579         Invocation.OverloadResolve.
7580
7581         Fix #75656.
7582         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
7583         invariant-meaning-in-block property in an enclosing block if
7584         necessary.
7585
7586 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
7587
7588         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
7589         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
7590         (Switch.CheckSwitch): Just save 50kb for SWF.
7591
7592 2005-07-27  Martin Baulig  <martin@ximian.com>
7593
7594         * anonymous.cs (CaptureContext.AddField): Added
7595         `AnonymousContainer am' argument; compute its toplevel scope if
7596         it's not already computed.  Fixes #75649.
7597
7598 2005-07-26  Raja R Harinath  <rharinath@novell.com>
7599
7600         Fix #75628.
7601         * class.cs (Constructor.Emit): Reset block to null if the block
7602         resolve fails.
7603
7604 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
7605
7606         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
7607
7608 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
7609
7610         * class.cs (MethodData.Define): Check whether accessor implementing
7611         interface is public.
7612
7613         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
7614
7615 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
7616
7617         Fix #57245
7618         * namespace.cs (LookupType): Moved same type check to...
7619         
7620         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
7621         with the same name.
7622
7623 2005-07-21  Raja R Harinath  <rharinath@novell.com>
7624
7625         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
7626         already found a typebuilder.
7627         * class.cs (MethodCore.IsDuplicateImplementation): Compare
7628         MemberNames, not strings.
7629
7630         * const.cs (Error_ExpressionMustBeConst): 
7631         Rename from Error_EpressionMustBeConst.
7632         * const.cs, class.cs, statement.cd: Update.
7633
7634 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
7635
7636         Fix #65573
7637
7638         * const.cs (Const.LookupConstantValue): Report missing contant expression
7639         everytime.
7640         (Error_EpressionMustBeConstant): Only one error method.
7641
7642         * class.cs, statement.c: Updated.
7643
7644 2005-07-20  Raja R Harinath  <rharinath@novell.com>
7645
7646         * statement.cs (Block.Flags): Add back HasVarargs.
7647         (Block.flags): Make protected.
7648         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
7649
7650         * typemanager.cs (types, typecontainers, user_types): Remove.
7651         (UserTypes, TypeContainers): Likewise.
7652         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
7653         (CleanUp, Reset): Update.
7654         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
7655         (GetNestedType): Use Type.GetNestedType.
7656         (CoreLookupType): Take two arguments, the namespace and the
7657         basename of the type.  Update to use the Namespace.Lookup
7658         mechanism.
7659         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
7660         (RealMemberLookup): Use IsNestedChildOf instead of playing with
7661         string concatenation and substring matches.
7662         * class.cs, enum.cs, delegate.cs: Update to changes.
7663
7664 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
7665
7666         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
7667         Expression and made virtual.
7668
7669         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
7670         (ImplicitStandardConversionExists): Fixed `byte' typo ?
7671
7672         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
7673
7674         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
7675         error message.
7676
7677         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
7678         change.
7679
7680 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
7681
7682         Fix #57707
7683         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
7684         AssemblyCultureAttribute is not used on executable.
7685
7686         * rootcontext.cs,
7687         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
7688
7689 2005-07-16  Raja R Harinath  <rharinath@novell.com>
7690
7691         Fix #60638.
7692         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
7693         New.  Reports CS0252/CS0253.
7694         Mostly taken from preliminary patch by Duncak Mak.
7695         (Binary.DoResolveOperator): Store results of operator lookup.
7696         Use them to detect if we need to warn about unintended reference
7697         comparisons.
7698
7699 2005-07-15  Raja R Harinath  <rharinath@novell.com>
7700
7701         Fix #72969.
7702         * namespace.cs (Namespace.Lookup): Add back location parameter.
7703         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
7704         * delegate.cs, ecore.cs, expression.cs: Update to changes.
7705
7706         * codegen.cs (EmitContext.DeclSpace): Make readonly.
7707         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
7708         (Namespace.LookupType): ... this.
7709         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
7710         of namespaces.
7711         * typemanager.cs (LookupTypeReflection): Remove buggy code that
7712         purported to handle pointers.
7713         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
7714         CoreLookupType.
7715
7716 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
7717
7718         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
7719         type as namespace.
7720
7721 2005-07-15  Raja R Harinath  <rharinath@novell.com>
7722
7723         * namespace.cs (Namespace.Lookup): Drop location parameter.
7724         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
7725         (NamespaceEntry.Lookup): ... this.
7726         (NamespaceEntry.Error_AmbiguousTypeReference):
7727         Move here from DeclSpace.
7728         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
7729         names ...
7730         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
7731         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
7732         Move to NamespaceEntry.
7733         * delegate.cs, expression.cs: Update to changes.
7734
7735 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
7736
7737         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
7738         CheckAttributeType and refactored.
7739         (Attribute.ResolvePossibleAttributeType): Changed to reuse
7740         ResolveAsTypeTerminal error handling.
7741         (ResolveAsTypeTerminal): Introduced because of global attributes extra
7742         handling.
7743         (GetSignatureForError): Print errors in same way.
7744
7745         * class.cs,
7746         * codegen.cs: Reflect attribute GetSignatureForError change.
7747
7748         * ecore.cs,
7749         * expression.cs: Add silent parameter to ResolveAsTypeStep.
7750
7751         * namespace.cs (UsingEntry): Refactored to make fields private.
7752
7753         * assign.cs,
7754         statement.cs: Error_UnexpectedKind has extra parameter.
7755
7756 2005-07-14  Raja R Harinath  <rharinath@novell.com>
7757
7758         * ecore.cs (IAlias): Remove.
7759         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
7760         that implement the interface.
7761         * namespace.cs (Namespace): Likewise.
7762         (Namespace.declspaces): Renamed from 'defined_names'.
7763         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
7764         DeclSpace instead of an IAlias.
7765         * tree.cs (Tree.AddDecl): Update.
7766
7767 2005-07-12  Raja R Harinath  <rharinath@novell.com>
7768
7769         * statement.cs (Block.Flags); Remove HasVarargs.
7770         (Block.HasVarargs): Move to ToplevelBlock.
7771         (Block.ThisVariable, Block.AddThisVariable): Likewise.
7772         (Block.Variables): Make protected.  Initialize variable hashtable
7773         if necessary.
7774         (Block.AddVariable): Update.
7775         (Block.Resolve): Update to changes.
7776         (ToplevelBlock.HasVarargs): New boolean.
7777         (ToplevelBlock.ThisVariable): Move here from Block.
7778         (ToplevelBlock.AddThisVariable): Likewise.
7779         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
7780         * expression.cs (This.ResolveBase): Update to changes.
7781         (ArglistAccess.DoResolve): Likewise.
7782
7783 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
7784
7785         Fix #75321
7786         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
7787
7788         * class.cs (TypeContainer.VerifyMembers): Distinguish between
7789         not used and not used & assigned.
7790         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
7791
7792 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
7793
7794         Fix #75053
7795         * expression.cs (Is.DoResolve): null is never provided type.
7796
7797 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
7798
7799         Fix #52496
7800         * cs-parser.jay: Less strict event error rule to catch more errors.
7801
7802 2005-07-08  Martin Baulig  <martin@ximian.com>
7803
7804         Fix test-iter-10.cs - distinguish whether we `yield' in a property
7805         gettter (allowed) or setter (not allowed).
7806
7807         * class.cs (Accessor): Implement IIteratorContainer.
7808         (Accessor.Yields): New public field.
7809         (PropertyBase.PropertyMethod.Define): Handle iterators on a
7810         per-accessor basis.
7811
7812         * cs-parser.jay
7813         (get_accessor_declaration, set_accessor_declaration): Set the
7814         `yields' flag on the accessor, not the property.
7815         (property_declaration): Do the iterators check on a per-accessor
7816         basis and not for the whole property.
7817
7818 2005-07-08  Martin Baulig  <martin@ximian.com>
7819
7820         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
7821         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
7822
7823 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
7824
7825         Fix #74975
7826         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
7827         (ExtractSecurityPermissionSet): Cope with self referencing security
7828         attributes properly.
7829
7830         * driver.cs (SetOutputFile): Made public property OutputFile.
7831
7832 2005-07-07  Raja R Harinath  <rharinath@novell.com>
7833
7834         Fix #75486.
7835         * class.cs (TypeContainer.first_nonstatic_field): Rename from
7836         has_nonstatic_fields.  Make into a FieldBase pointer.
7837         (TypeContainer.AddField): Add CS0282 check.
7838         (TypeContainer.EmitType): Update.
7839
7840 2005-07-06  Miguel de Icaza  <miguel@novell.com>
7841
7842         * cs-tokenizer.cs (consume_identifier): Do not create strings to
7843         compare if they start with __.
7844
7845 2005-07-06  Raja R Harinath  <rharinath@novell.com>
7846
7847         * statement.cs (Switch.SwitchGoverningType): Only look at
7848         UserCasts that don't need implicit standard conversions to one of
7849         the allowed switch types (Fixes test-322.cs).
7850         (LocalInfo.Resolve): Re-enable sanity-test.
7851
7852 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
7853
7854         * cs-tokenizer.cs (consume_identifier): Detect double undescores
7855         
7856         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
7857         
7858         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
7859
7860 2005-07-06  Raja R Harinath  <rharinath@novell.com>
7861
7862         Fix #75472.
7863         * ecore.cs (SimpleName.GetSignatureForError): Add.
7864         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
7865         (MemberAccess.GetSignatureForError): Add.
7866
7867 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
7868  
7869         The big error and warning messages review.
7870         
7871         * anonymous.cs,
7872         * assign.cs,
7873         * attribute.cs,
7874         * class.cs,
7875         * codegen.cs,
7876         * convert.cs,
7877         * cs-parser.jay,
7878         * cs-tokenizer.cs,
7879         * decl.cs,
7880         * delegate.cs,
7881         * doc.cs,
7882         * driver.cs,
7883         * ecore.cs,
7884         * enum.cs,
7885         * expression.cs,
7886         * flowanalysis.cs,
7887         * iterators.cs,
7888         * literal.cs,
7889         * location.cs,
7890         * modifiers.cs,
7891         * namespace.cs,
7892         * parameter.cs,
7893         * pending.cs,
7894         * report.cs,
7895         * rootcontext.cs,
7896         * statement.cs,
7897         * support.cs,
7898         * tree.cs,
7899         * typemanager.cs: Updated.
7900         
7901         * class.cs: (MethodCore.SetYields): Moved here to share.
7902         (PropertyMethod.Define): Moved iterator setup here.
7903         
7904         * iterators.cs: Add orig_method to have full access to parent
7905         container.
7906
7907 2005-07-05  Raja R Harinath  <rharinath@novell.com>
7908
7909         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
7910         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
7911         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
7912         variable of struct type.
7913         * expression.cs (Unary.ResolveOperator): Update to change.
7914         (Indirection.VerifyFixed): Likewise.
7915         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
7916         (ParameterReference.VerifyFixed): Value parameters are fixed.
7917         (This.VerifyFixed): Treat 'this' as a value parameter.
7918         * statement.cs (LocalInfo.IsFixed): Remove.
7919
7920 2005-07-01  Martin Baulig  <martin@ximian.com>
7921
7922         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
7923         `ec.EmitThis ()' to get the correct scope.
7924
7925 2005-07-01  Martin Baulig  <martin@ximian.com>
7926
7927         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
7928         instance is a ParameterReference; fixes #75299.
7929
7930 2005-07-01  Martin Baulig  <martin@ximian.com>
7931
7932         Reverted Marek's latest patch (r46725):
7933         - it contains structural changes which are neither mentioned in
7934           the ChangeLog nor explained anywhere; for example the additional
7935           argument of EmitContext's and Iterator's .ctor's and the
7936           TypeContainer.DefineMembers() change.
7937         - structural changes like this should go in in seperate patches
7938           and not be hidden in a huge patch which just seems to affect
7939           warnings and errors.
7940           a big and hard to understand patch.
7941         - it breaks iterators and causes regressions, for instance in
7942           test-iter-03.cs.      
7943
7944 2005-06-30  Raja R Harinath  <rharinath@novell.com>
7945
7946         Fix #75412.
7947         * expression.cs (Indexers.map): Remove.
7948         (Indexers.Append): Filter out inaccessible setters and getters.
7949         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
7950
7951         Fix #75283.
7952         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
7953         Refactored from ...
7954         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
7955         (FieldExpr.Emit, PropertyExpr.Emit): Update.
7956         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
7957         * expression.cs (Invocation.EmitCall): Add CS0120 check.
7958
7959 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
7960
7961         Fix #75322
7962         * class.cs (FieldBase.GetInitializerExpression): One more field
7963         for backup.
7964
7965 2005-06-28  Miguel de Icaza  <miguel@novell.com>
7966
7967         * pending.cs: Do not define a proxy if the base method is virtual,
7968         it will be picked up by the runtime (bug 75270).
7969
7970 2005-06-08  Martin Baulig  <martin@ximian.com>
7971
7972         The big Iterators rewrite :-)
7973
7974         * iterators.cs: Rewrite this to use the anonymous methods framework.
7975
7976         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
7977         before the TypeContainers; see 2test-21.cs.
7978
7979         * class.cs
7980         (TypeContainer.DefineType): Don't create a new EmitContext if we
7981         already have one (this only happens if we're an Iterator).
7982         (TypeContainer.Define): Also call Define() on all our iterators.
7983         (Method.CreateEmitContext): Added support for iterators.
7984
7985         * anonymous.cs
7986         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
7987         (AnonymousContainer.CreateMethodHost): Moved here from
7988         AnonymousMethod and made abstract.
7989         (AnonymousContainer.CreateScopeType): New abstract method.
7990         (AnonymousContainer.IsIterator): New public property.
7991         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
7992         get the ScopeTypeBuilder rather than manually defining it here. 
7993         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
7994         iterators here.
7995
7996         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
7997         before RootContext.DefineTypes().
7998
7999         * codegen.cs (EmitContext.RemapToProxy): Removed.
8000         (EmitContext.CurrentAnonymousMethod): Changed type from
8001         AnonymousMethod -> AnonymousContainer.
8002         (EmitContext.ResolveTopBlock): Protect from being called twice.
8003         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
8004         (EmitContext.EmitThis): Removed the iterators hacks; use the
8005         anonymous methods framework for that.
8006
8007         * statement.cs
8008         (ToplevelBlock.Container): Make this a property, not a field.
8009         (ToplevelBlock.ReParent): New public method; move the
8010         ToplevelBlock into a new container.
8011         (Foreach.TemporaryVariable): Simplify.
8012
8013 2005-06-05  Martin Baulig  <martin@ximian.com>
8014
8015         * statement.cs (LocalInfo.CompilerGenerated): New flag.
8016         (Block.AddTemporaryVariable): New public method; creates a new
8017         `LocalInfo' for a temporary variable.
8018         (Block.EmitMeta): Create the LocalBuilders for all the temporary
8019         variables here.
8020         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
8021         non-iterator variables.
8022
8023 2005-06-05  Martin Baulig  <martin@ximian.com>
8024
8025         * statement.cs (Foreach.TemporaryVariable): Create the
8026         LocalBuilder in the Emit phase and not in Resolve since in some
8027         situations, we don't have an ILGenerator during Resolve; see
8028         2test-19.cs for an example.
8029
8030 2005-06-04  Martin Baulig  <martin@ximian.com>
8031
8032         **** Merged r45395 from GCS ****
8033
8034         The big Foreach rewrite - Part II.
8035
8036         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
8037         with `PropertyInfo ienumerator_getcurrent'.
8038
8039         * codegen.cs (VariableStorage): Removed.
8040
8041         * statement.cs
8042         (Foreach): Derive from Statement, not ExceptionStatement.
8043         (Foreach.CollectionForeach): New nested class.  Moved all the code
8044         dealing with collection foreach here.
8045         (Foreach.ForeachHelperMethods): Removed.
8046         (Foreach.TemporaryVariable): Implement IMemoryLocation.
8047
8048 2005-05-23  Martin Baulig  <martin@ximian.com>
8049
8050         * statement.cs (Try.DoResolve): Don't create a `finally' if we
8051         don't need to.  Fix #75014.
8052
8053 2005-05-20  Martin Baulig  <martin@ximian.com>
8054
8055         Merged r44808 from GMCS.
8056
8057         * class.cs (TypeContainer.CircularDepException): Removed.
8058         (TypeContainer.DefineType): Removed the `InTransit' stuff.
8059         (TypeContainer.CheckRecursiveDefinition): Check for circular class
8060         (CS0146) and interface (CS0529) dependencies here.
8061
8062 2005-06-21  Raja R Harinath  <rharinath@novell.com>
8063
8064         * expression.cs (Invocation.EmitCall): Fix initialization
8065         'this_call' to reflect current behaviour.  Fix indentation.
8066
8067         * convert.cs (FindMostEncompassedType): Add two trivial special
8068         cases (number_of_types == 0 || number_of_types == 1).
8069         (FindMostEncompasingType): Likewise.
8070
8071 2005-06-17  Raja R Harinath  <rharinath@novell.com>
8072
8073         Some cleanups preparing for the fix of #75283.
8074         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
8075         error testing.
8076         (EventExpr.InstanceResolve): Likewise.
8077         (EventExpr.DoResolve): Remove redundant checks.
8078
8079 2005-06-10  Duncan Mak  <duncan@novell.com>
8080
8081         * cs-tokenizer.cs (process_directives): New flag for controlling
8082         the processing of preprocessor directives.
8083         (x_token): After seeing a '#', return Token.NONE instead of going
8084         to handle_preprocessing_directive() when not processing
8085         directives. This avoids unnecessary processing during the token peek in
8086         is_punct().
8087
8088         This fixes #74939.
8089
8090         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
8091         the existing error reporting methods instead of Report.Error.
8092
8093         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
8094         after Raja's rewrite.
8095
8096 2005-06-08  Miguel de Icaza  <miguel@novell.com>
8097
8098         * class.cs: Small fix.
8099
8100 2005-06-08  Raja R Harinath  <rharinath@novell.com>
8101
8102         Fix #75160.
8103         * class.cs (GetPartialBases): Fix return value check of
8104         part.GetClassBases.
8105
8106 2005-06-07  Raja R Harinath  <rharinath@novell.com>
8107
8108         Ensure that partial classes are registered in their enclosing
8109         namespace.  Initial part of fix of #75160.
8110         * tree.cs (Tree.RecordDecl): Add new namespace argument.
8111         Register declspace with namespace here, not in
8112         DeclSpace.RecordDecl.
8113         * cs-parser.jay: Pass namespace to RecordDecl.
8114         * class.cs (PartialContainer.Create): Likewise.
8115         (ClassPart.DefineType): New sanity-check.  Throws an exception if
8116         called.
8117         * decl.cs (Declspace.RecordDecl): Remove.
8118         * namespace.cs (NamespaceEntry.DefineName): Remove.
8119
8120 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
8121
8122         * rootcontext.cs: Reset TargetExt as well.
8123
8124 2005-06-03  Raja R Harinath  <rharinath@novell.com>
8125
8126         * ecore.cs (Expression.Resolve): Emit CS0654 error when
8127         -langversion:ISO-1.
8128
8129 2005-06-02  Raja R Harinath  <rharinath@novell.com>
8130
8131         Fix #75080, cs0119.cs.
8132         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
8133         of ...
8134         (Expression.Resolve): ... this.  Use it.  Remove bogus code
8135         allowing ExprClass.Type and ExprClass.Namespace for
8136         ResolveFlags.VariableOrValue.
8137         (Expression.Resolve) [1-argument variant]: Change default resolve
8138         flags based on language version.
8139         (Expression.Error_UnexpectedKind): Use a simple string array
8140         rather than an ArrayList.
8141         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
8142         not ExprClass.Type.
8143         (TypeOfVoid.DoResolve): Likewise.
8144         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
8145         flags argument -- it always has the same value.
8146
8147 2005-05-31  Raja R Harinath  <rharinath@novell.com>
8148
8149         Fix #75081.
8150         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
8151         Use it in the error message.
8152         * assign.cs, expression.cs, statement.cs: Update.
8153
8154 2005-05-30  Raja R Harinath  <rharinath@novell.com>
8155
8156         Fix #75088.
8157         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
8158         the "almostMatchedMember" case too.
8159         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
8160         that failed the accessibility checks to 'almost_match'.
8161
8162 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
8163
8164         * attribute.cs: Use internal MethodBuilder methods to set
8165         ExactSpelling and SetLastError on PInvoke methods, instead
8166         of passing them via charset.  Fixes #75060.
8167
8168 2005-05-27  Raja R Harinath  <rharinath@novell.com>
8169
8170         * parameter.cs (Parameter): Remove TODO comment.
8171         (Parameter.DefineParameter): Remove Location parameter.
8172         (Parameters.LabelParameters): Likewise.
8173         * class.cs (Constructor.Emit): Update to change.
8174         (MethodData.Emit): Likewise.
8175         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
8176         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
8177
8178 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
8179
8180         * parameter.cs,
8181           Removed Parameters.Location and added Parameter.Location instead.
8182           Removed Location parameter from Emit() and GetSignature().
8183         * anonymous.cs,
8184           class.cs,
8185           cs-parser.jay,
8186           delegate.cs,
8187           iterators.cs,
8188           statement.cs :
8189           Modified all related calls.
8190
8191 2005-05-26  Raja R Harinath  <rharinath@novell.com>
8192
8193         Improve user-defined conversion handling.
8194         * convert.cs (GetConversionOperators): Rewrite.  Return only the
8195         applicable operators.
8196         (AddConversionOperators): New.  Helper for GetConversionOperators.
8197         (FindMostEncompassedType, FindMostEncompassingType): Verify that
8198         there is only one most encompassed/encompassing type.
8199         (FindMostSpecificSource, FindMostSpecificTarget): Remove
8200         "applicable operator" handling.
8201         (UserConversion): Move cache here from GetConversionOperators.
8202         Directly cache the chosen operator, rather than the whole
8203         MethodGroup.
8204         (ExplicitNumericConversion): Fix buggy implementation of Decimal
8205         case.  Allow conversion of decimal to sbyte and byte too.
8206         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
8207         New static methods.  Used to avoid allocating EmptyExpressions in
8208         convert.cs.
8209
8210 2005-05-24  Duncan Mak  <duncan@novell.com>
8211
8212         * ecore.cs (CastFromDecimal): New class for casting a decimal to
8213         another class, used in Convert.ExplicitNumericConversion.
8214         (CastToDecimal): New class, similar to above, but casts to
8215         System.Decimal, used in Convert.ImplicitNumericConversion and also
8216         in explicit convesion from double/float to decimal.
8217
8218         * convert.cs (ImplicitNumericConversion): Handle implicit
8219         conversions to System.Decimal.
8220         (ExplicitNumericConversion): handle explicit conversions to
8221         System.Decimal.
8222
8223         This fixes #68711.
8224         
8225 2005-05-20  Miguel de Icaza  <miguel@novell.com>
8226
8227         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
8228         know the type at this stage, just break through.   Fixes #75008 
8229
8230 2005-05-19  Martin Baulig  <martin@ximian.com>
8231
8232         * delegate.cs
8233         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
8234         to disable error reporting.
8235
8236         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
8237         here since we don't want to report an error; see the new test-336.cs.
8238
8239 2005-05-19  Raja R Harinath  <rharinath@novell.com>
8240
8241         * statement.cs (ToplevelBlock.GetParameterReference)
8242         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
8243         Move here from class Block.
8244         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
8245         * expression.cs (ParameterReference.DoResolveBase): Likewise.
8246
8247 2005-05-18  Martin Baulig  <martin@ximian.com>
8248
8249         Fix #74978.
8250
8251         * flowanalysis.cs
8252         (FlowBranching.Reachability): Add non-static public And() and Or()
8253         methods.
8254         (FlowBranchingSwitch): New class; do the `break_origins' thing
8255         like in FlowBranchingLoop.
8256         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
8257         reachability, not just locals and parameters.
8258         (FlowBranching.MergeChild): Remove some of the hacks for loop and
8259         switch; MergeBreakOrigins() now takes care of that.
8260
8261 2005-05-18  Martin Baulig  <martin@ximian.com>
8262
8263         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8264         a loop and may leave it, reset the barrier; fixes #74974.
8265
8266 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
8267         
8268         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
8269         is back.
8270         
8271         * cs-parser.jay: Catch more lexical errors.
8272         
8273         * report.cs: Add one more Error method.
8274         
8275         * rootcontext.cs,
8276         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
8277
8278 2005-05-17  Martin Baulig  <martin@ximian.com>
8279
8280         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
8281         #70970. 
8282
8283 2005-05-16  Raja R Harinath  <rharinath@novell.com>
8284
8285         Fix test-382.cs.  Emit values of decimal constants.
8286         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
8287         Carved out of ...
8288         (TypeContainer.AddField): ... this.
8289         (TypeContainer.EmitFieldInitializers): Allow the list of fields
8290         with initializers to include 'Const's.
8291         (ClassPart.RegisterFieldForInitialization): Forward to
8292         PartialContainer.
8293         * const.cs (Const.Const): Pass initializer to base class.
8294         (Const.Define): In case of decimal constants, register them for
8295         initialization in a static constructor.
8296
8297 2005-05-14  Martin Baulig  <martin@ximian.com>
8298
8299         * statement.cs (Block.Resolve): Correctly handle unreachable code;
8300         do not call ResolveUnreachable() on unreachable statements in
8301         here, see the comment in the source code.
8302
8303 2005-05-13  Raja R Harinath  <rharinath@novell.com>
8304
8305         Fix #74934.
8306         * expression.cs (BinaryResolveOperator): If one of the operands of
8307         an equality comparison is 'null' and the other is a pointer type,
8308         convert the null to a NullPointer.
8309         * convert.cs (ImplicitReferenceConversion): If the expression is a
8310         NullLiteral and the target type is a pointer type, return a
8311         NullPointer instead.
8312         (ImplicitConversionStandard): Likewise.
8313
8314 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
8315         
8316         * cs-parser.jay: Set readonly context based on special constructs.
8317         
8318         * expression.cs (LocalVariableReference.DoResolveBase): Improved
8319         readonly variable error handling.
8320         
8321         * rootcontext.cs (EmitCode): Don't verify members when error
8322         occurred.
8323         
8324         * statement.cs (LocalInfo): Add reaodnly context information.
8325         (SetReadOnlyContext, GetReadOnlyContext): New methods.
8326
8327 2005-05-13  Raja R Harinath  <rharinath@novell.com>
8328
8329         * statement.cs (Block.Resolve): Revert change below.  Modify fix
8330         for #74041 to initialize 'resolved' to false only for explicit
8331         blocks.  Fixes #74873.
8332
8333 2005-05-12  Raja R Harinath  <harinath@gmail.com>
8334
8335         Fix #74920.
8336         * typemanager.cs (unmanaged_enclosing_types): New.
8337         (IsUnmanagedType): Avoid infloops by using
8338         'unmanaged_enclosing_types' to talk with recursive invocations.
8339
8340 2005-05-13  Martin Baulig  <martin@ximian.com>
8341
8342         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
8343         instance variable, not a local.  Fix #74873.
8344         (Block.ResolveUnreachable): Set it to true here.
8345
8346 2005-05-11  Duncan Mak  <duncan@novell.com>
8347
8348         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
8349         continuing to process for 'arg'.
8350         (handle_preprocessing_directive): Check the argument of the #endif
8351         directive and report error CS1025 if there are any trailing
8352         characters.
8353
8354         According to the C# spec, having even whitespace after the #endif
8355         directive is illegal; however, because we call arg.TrimEnd ()
8356         beforehand, we have the same behavior as csc, allowing whitespace
8357         after the directive.
8358
8359         Fixes #74892.
8360
8361 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
8362
8363         Fix #74863.
8364         
8365         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
8366         (Constructor.GetObsoleteAttribute): Implemented correctly.
8367
8368 2005-05-10  Martin Baulig  <martin@ximian.com>
8369
8370         * support.cs (ReflectionParameters.ParameterModifier): Use
8371         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
8372         and `ParameterAttributes.In'.  Fixes #74884.
8373
8374 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
8375
8376         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
8377         
8378         * expression.cs (Argument.GetParameterModifier): Turned to property.
8379         (Invocation.Error_InvalidArguments): Add more descriptive errors.
8380         
8381         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
8382         its C# equivalent.
8383         
8384 2005-05-09  Raja R Harinath  <rharinath@novell.com>
8385
8386         Fix #74852.
8387         * decl.cs (MemberCache.AddMethods): Register override methods,
8388         rather than non-override methods.
8389         * typemanager.cs (RegisterOverride): New.
8390         (IsOverride): Update.
8391
8392 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
8393
8394         Fix #73105.
8395         
8396         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
8397         recursive declaration.
8398         
8399         * statement.cs (Block.ResolveMeta): Report any error in resolving.
8400         
8401 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
8402
8403         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
8404         
8405         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
8406
8407 2005-05-05  Raja R Harinath  <rharinath@novell.com>
8408
8409         Fix #74797.
8410         * decl.cs (DeclSpace.FamilyAccessible): 
8411         Use TypeManager.IsNestedFamilyAccessible.
8412
8413         Fix reopened #64812.
8414         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
8415         internal'.
8416
8417 2005-05-04  Raja R Harinath  <rharinath@novell.com>
8418             Abin Thomas  <projectmonokochi@rediffmail.com>
8419             Anoob V E  <projectmonokochi@rediffmail.com>
8420             Harilal P R  <projectmonokochi@rediffmail.com>
8421
8422         Fix #64812.
8423         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
8424         allow access to all static members.
8425
8426 2005-05-04  Martin Baulig  <martin@ximian.com>
8427
8428         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
8429
8430 2005-05-04  Martin Baulig  <martin@ximian.com>
8431
8432         Fix #74655.
8433
8434         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
8435         section at the end; make things work if `default' is not the last
8436         section.        
8437
8438 2005-05-04  Martin Baulig  <martin@ximian.com>
8439
8440         Fix #70400.
8441
8442         * statement.cs (Switch): Replaced the `got_default' field with a
8443         `default_section' one.
8444         (Switch.CheckSwitch): Set `default_section' here.
8445         (Switch.Resolve): If we're a constant switch and the constant is
8446         not found, use the default section.
8447
8448 2005-05-03  Martin Baulig  <martin@ximian.com>
8449
8450         * expression.cs (ArrayAccess.EmitGetLength): New public method.
8451
8452         * statement.cs (Foreach.ArrayForeach): New nested class.
8453         (Foreach.TemporaryVariable): New nested class.
8454         (Foreach.EmitArrayForeach): Removed; this is now in the new
8455         ArrayForeach class.
8456
8457 2005-05-03  Raja R Harinath  <rharinath@novell.com>
8458
8459         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
8460         more conservative.
8461         (VerifyPendingMethods): Revert change below.
8462
8463         * typemanager.cs (IsOverride, RegisterNonOverride): New.
8464         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
8465         that used to trigger warning -28.  Remove warning -28.
8466         * expression.cs (Invocation.OverloadResolve): Use
8467         TypeManager.IsOverride to distinguish override methods.
8468
8469         Fix #74773.
8470         * pending.cs (VerifyPendingMethods): If a base type implements the
8471         requested interface, don't bother checking individual methods of
8472         the base type.  As a side-effect, this prevents the creation of
8473         unnecessary proxies.
8474
8475 2005-05-02  Martin Baulig  <martin@ximian.com>
8476
8477         Fix #70182.
8478
8479         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8480         Also `And' the locals if the old vector is null.
8481         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
8482         null; in this case we basically reset all the variables.        
8483
8484 2005-05-02  Martin Baulig  <martin@ximian.com>
8485
8486         Fix #74529.
8487
8488         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
8489         Added `FlowBranching branching' argument; always `and' the
8490         variables instead of `or'ing them unless we're an infinite loop.
8491
8492         * statement.cs (While.Resolve): Create a new sibling unless we're
8493         infinite.       
8494
8495 2005-05-02  Martin Baulig  <martin@ximian.com>
8496
8497         Fix #70140.
8498
8499         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
8500         arguments; use it instead of creating a new TopLevelBlock.
8501         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
8502         our ConstructorInitializer.
8503
8504         * statement.cs
8505         (TopLevelBlock.TopLevelBranching): New public property.
8506         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
8507         and create our `TopLevelBranching'.
8508
8509         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
8510         anonymous method host, use `block.TopLevelBranching' rather than
8511         creating a new branching.
8512
8513 2005-04-20  Miguel de Icaza  <miguel@novell.com>
8514
8515         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
8516         a ScopeInfo, if any of the current children is a child of the new
8517         entry, move those children there.
8518
8519 2005-04-30  Martin Baulig  <martin@ximian.com>
8520
8521         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
8522         at the beginning of a SwitchSection.  Fix #73335.
8523
8524 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
8525
8526         Fix #74378
8527         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
8528         
8529         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
8530         (FieldExpr.DoResolve): Obsolete members are ignored for field
8531         initializers.
8532         
8533 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
8534
8535         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
8536         of arrays detection.
8537
8538         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
8539         verification.
8540         (Field.VerifyClsCompliance): Volatile fields are not compliant.
8541
8542         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
8543         arrays report.
8544
8545 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
8546
8547         * cs-parser.jay: Use the prefered version of -unsafe in error
8548         message.
8549
8550 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
8551
8552         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
8553         circumstances.
8554
8555 2005-04-20  John Luke  <john.luke@gmail.com>
8556
8557         * driver.cs: fix typo in error message, --outout to --output
8558
8559 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
8560
8561         * codegen.cs (InRefOutArgumentResolving): New field.
8562         
8563         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
8564         fields outside contructor.
8565         
8566         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
8567         
8568 2005-04-19  Miguel de Icaza  <miguel@novell.com>
8569
8570         * anonymous.cs (CaptureContext.EmitParameterInstance): The
8571         parameter code was not completed ever, so it was not as up-to-date
8572         as local variables.  Must finish it.
8573
8574         The bug fix was to compare the Toplevel of the block, not the
8575         current block.  Thanks for Ben for pointing this out. 
8576
8577 2005-04-19  Raja R Harinath  <rharinath@novell.com>
8578
8579         * decl.cs (AddMethods): Use the declaring type of the problem
8580         method to determine if we want to squash a warning.
8581
8582 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
8583
8584         * attribute.cs: Removed debug output.
8585
8586         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
8587         
8588         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
8589         Report.Stderr.
8590         
8591 2005-04-18  Raja R Harinath  <rharinath@novell.com>
8592
8593         Fix #74481.
8594         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
8595         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
8596         all null comparisons against reference types.
8597
8598 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
8599
8600         Fix# 74565
8601         * class.cs (TypeContainer.CircularDepException) New nested
8602         exception class.
8603         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
8604         (TypeContainer.DefineType): Removed error, reset InTransit before
8605         exit.
8606         (Class.DefineType): Throw exception when is in Transit.
8607         Catch exception and report error.
8608         (Struct.DefineType): Throw exception when is in Transit.
8609         Catch exception and report error.
8610         (Interface.DefineType): Throw exception when is in Transit.
8611         Catch exception and report error.
8612
8613         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
8614         handle nested exception handlers.
8615
8616         * flowanalysis.cs (InTryWithCatch): New method, search for try with
8617         a catch.
8618
8619         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
8620         InFinally and InCatch storage.
8621
8622         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
8623         (Catch.Resolve): Set and Restore ec.InCatch.
8624         (Try.Resolve): Set and Restore ec.InFinally.
8625         (Try.HasCatch): True when try has catch.
8626
8627 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
8628
8629         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
8630           for the same event member, so exclude such cases from warning 419.
8631           Fixed bug #74633.
8632
8633 2005-04-16  Miguel de Icaza  <miguel@novell.com>
8634
8635         * expression.cs (Binary.ResolveOperator): Apply patch from John
8636         Luke to fix bug 59864: operators &, | and ^ on enumerations
8637         require that the same enum type on both sides.
8638
8639         * driver.cs: Add warnings to old flag usage, this is to assist
8640         people who produce Makefiles and hope that the Makefiles will be
8641         used on Windows.
8642
8643         * class.cs (TypeContainer.EmitType): Moved the definition of the
8644         special $PRIVATE$ field from the resolve phase to the Emit phase.
8645         During resolve we do not know if we are a struct with
8646         HasExplicitLayout, we know this only after the attributes for the
8647         type are emitted.
8648
8649         Set the FieldOffset to zero on the dummy field that we create for
8650         the class.   Fixes 74590.
8651
8652 2005-04-16  Raja R Harinath  <rharinath@novell.com>
8653
8654         Fix #73834.
8655         * ecore.cs (PropertyExpr.resolved): New.
8656         (DoResolve): Use it to handle a case of double resolution here.
8657         Handle a case of identical-name-and-type-name.
8658         * expression.cs (ArrayCreation.CheckIndices): Avoid double
8659         resolution by storing the results of expression resolution back
8660         into the "probes" array.
8661
8662 2005-04-15  Raja R Harinath  <rharinath@novell.com>
8663
8664         Fix cs0208-7.cs and cs0208-8.cs.
8665         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
8666         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
8667         error reporting to point out the reason a struct is not unmanaged.
8668
8669 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
8670
8671         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
8672           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
8673
8674 2005-04-13  Raja R Harinath  <rharinath@novell.com>
8675
8676         Fix #74528.
8677         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
8678         IdenticalNameAndTypeName here.
8679         (EventExpr.InstanceResolve): Likewise.
8680
8681 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
8682
8683         C# 2.0 DefaultCharSetAttribute implementation
8684         
8685         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
8686         which allows us to set GlobalNamespace for every resolve.
8687         (Attribute.ResolveArguments): Cut from Resolve.
8688         (Attribute.GetCharSetValue): Returns CharSet named argument.
8689         (Attribute.DefinePInvokeMethod): Gets default charset from
8690         module settings.
8691         (GlobalAttribute.ResolveAsTypeStep): Override.
8692         (GlobalAttribute.ResolveArguments): Override.
8693         
8694         * class.cs (TypeAttr): Is protected.
8695         
8696         * codegen.cs (ModuleClass.DefaultCharSet): New member.
8697         (ModuleClass.DefaultCharSetType): New memeber.
8698         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
8699         
8700         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
8701         charset from module.
8702         
8703         * delegate.cs (TypeAttr): Override.
8704         (Delegate.DefineType): Use this TypeAttr.
8705         
8706         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
8707         at very early stage (before types are defined) to resolve model
8708         module attributes. It will probably not work with corlib but it
8709         should be ok.
8710         
8711         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
8712         charset from module.
8713         
8714         * typemanager.cs (default_charset_type): New type.
8715
8716 2005-04-13  Raja R Harinath  <rharinath@novell.com>
8717
8718         * decl.cs (MemberCache.AddMethods): Don't warn if
8719         System.Object.Finalize has buggy MethodAttributes.
8720
8721         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
8722         removed below.
8723
8724 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
8725
8726         * doc.cs : detect ambiguous reference to overloaded members.
8727           Fixed bug #71603. MS 1.1 csc does not detect it.
8728
8729 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
8730
8731         * doc.cs : delegates must not be referenced with parameters.
8732           Fixed bug #71605.
8733
8734 2005-04-12  Miguel de Icaza  <miguel@novell.com>
8735
8736         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
8737
8738 2005-04-10  Miguel de Icaza  <miguel@novell.com>
8739
8740         * driver.cs (MainDriver): Stop processing if the CLS stage found
8741         errors. 
8742
8743         (CompilerCallableEntryPoint.InvokeCompiler): Always
8744         reset after execution;   Take a TextWriter argument for the
8745         output.
8746
8747         * report.cs: Use the error stream instead of hardcoding stderr. 
8748
8749 2005-04-09  Miguel de Icaza  <miguel@novell.com>
8750
8751         * class.cs: Reduce code paths to test, too small of an
8752         optimization to make it worth the extra testing.  Always perform
8753         it. 
8754
8755 2005-04-08  Raja R Harinath  <rharinath@novell.com>
8756
8757         Fix #74510.
8758         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
8759         operators that had errors reported on them.
8760
8761 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
8762
8763         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
8764         argument types.
8765         (Attribute.Resolve): Add named argument type checking.
8766         
8767         * class.cs (FixedField.Define): Use IsPrimitiveType
8768         
8769         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
8770         
8771         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
8772         unsafe parameter types.
8773         
8774         * statement.cs (Using.ResolveExpression): Add better error description.
8775         
8776         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
8777         
8778 2005-04-08  Raja R Harinath  <rharinath@novell.com>
8779
8780         Fix #74484.
8781         * attribute.cs (Attribute.GetAttributeUsage): Resolve
8782         AttributeUsageAttribute in the emitcontext of the attribute class,
8783         not in the emitcontext of the attributable entity it was attached to.
8784         * cs-parser.jay: Use 'current_class', not 'current_container',
8785         when creating a GlobalAttribute.
8786
8787 2005-04-08  Alp Toker  <alp@atoker.com>
8788
8789         * pending.cs: The fix to #58413 failed to compile methods implementing
8790         interfaces with/without params modifiers and vice versa, even though
8791         params modifiers aren't part of the signature. Make the modifier check
8792         less strict as in csc.
8793
8794 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
8795             Anoob V E  <projectmonokochi@rediffmail.com>
8796             Harilal P R  <projectmonokochi@rediffmail.com>
8797
8798         Fix #58413.
8799         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
8800         modifiers of pending methods.
8801         (PendingImplementation.PendingImplementation): Initialize it.
8802         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
8803         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
8804         with ParameterData.  Add check for modifiers.
8805         * class.cs (MethodData.Define): Update to changes.
8806
8807 2005-04-07  Raja R Harinath  <rharinath@novell.com>
8808
8809         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
8810
8811 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
8812
8813         * class.cs (PropertyMethod.Define): Check private accessor in abstract
8814         property.
8815         
8816         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
8817         
8818         * rootcontext.cs,
8819         * typemanager.cs: Registered RequiredAttributeAttribute.
8820         
8821 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
8822
8823         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
8824         Warning CS0169 is back at level 3.
8825         (IMethodData.SetMemberIsUsed): New method.
8826         
8827         * decl.cs (IsUsed): New value; moved from FieldBase.Status
8828         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
8829         
8830         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
8831
8832         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
8833         contants.
8834         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
8835         is used.
8836         
8837         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
8838         is used.
8839         
8840         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
8841         to avoid the problems with nested types.
8842
8843 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
8844             Anoob V.E  <projectmonokochi@rediffmail.com>
8845             Harilal P.R  <projectmonokochi@rediffmail.com>
8846             Raja R Harinath  <rharinath@novell.com>
8847
8848         Fix #73820.
8849         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
8850         attribute.
8851         * typemanager (GetConstructor): Make public.
8852
8853 2005-04-05  John Luke  <john.luke@gmail.com>
8854             Raja R Harinath  <rharinath@novell.com>
8855
8856         Fix #62232.
8857         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
8858         struct too.  Return false quicker in a few cases.
8859         (VerifyUnManaged): Use it.
8860
8861 2005-04-05  Raja R Harinath  <rharinath@novell.com>
8862
8863         Fix #74041.
8864         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
8865         not 'unreachable_seen'.
8866
8867 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
8868
8869         * attribute.cs (Attribute.GetValue): Removed unused.
8870         
8871         * codegen.cs (CodeGen.TrimExt): Removed unused.
8872         
8873         * cs-parser.jay (output): Removed unused.
8874         
8875         * cs-tokenizer.cs (hex_digits): Removed unused.
8876         
8877         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
8878         
8879         * expression.cs (Indirection.LoadExprValue): Removed unused.
8880         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
8881         
8882         * iterators.cs (Iterator.param_types): Removed unused.
8883         
8884         * statement.cs (Goto.block): Removed unused.
8885         (ToplevelBlock.did): Removed unused.
8886         (Switch.ResolveConstantSwitch): Removed unused.
8887
8888 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
8889
8890         * rootcontext.cs: Allow mcs to bootstrap with the compilation
8891         resetting thingy.
8892
8893 2005-04-01  Raja R Harinath  <rharinath@novell.com>
8894
8895         Fix #74232 and cs0208-3.cs.
8896         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
8897         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
8898         unmanaged type.  Don't use FieldBuilders when 't' is a
8899         TypeBuilder.  Use ModFlags and MemberType fields.
8900         * class.cs (MemberBase.member_type): Rename from MemberType.
8901         (MemberBase.MemberType): New property.  Determines member_type on
8902         demand.
8903         (MemberBase.DoDefine): Don't initialize MemberType here.
8904         (FieldMember.Define): Likewise.
8905
8906 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
8907
8908         Fix #74241
8909         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
8910         Attributes are emitted there.
8911         
8912 2005-04-01  Raja R Harinath  <rharinath@novell.com>
8913
8914         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
8915         keyword in 'partial enum' too.
8916         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
8917         is not allowed).
8918         Report from Kamil Skalski <nazgul@omega.pl>.
8919
8920         Fix #74309.
8921         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
8922         have partial containers too.
8923
8924         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
8925         in block' checks to Block.CheckInvariantMeaningInBlock.
8926         * statement.cs (Block.GetKnownVariableInfo): Make private.
8927         (Block.IsVariableUsedInChildBlock): Remove.
8928         (Block.IsVariableUsedInBlock): Likewise.
8929         (Block.CheckInvariantMeaningInBlock): New.  Show location of
8930         conflicting declaration.
8931         (Block.AddVariable): Make error messages less long-winded and more
8932         specific.  Show location of conflicting declaration.
8933         * parameter.cs (Parameters.Location): New readonly property.
8934
8935 2005-03-31  Raja R Harinath  <rharinath@novell.com>
8936
8937         Clean up semantics of invoking ResolveMemberAccess.
8938         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
8939         can have an instance, ensure that we pass in a non-TypeExpression
8940         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
8941         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
8942         argument.  Update to changes and simplify.
8943         (FieldExpr.Emitinstance): Remove CS0120 check.
8944         (PropertyExpr.EmitInstance): Likewise.
8945         * expression.cs (Argument.Resolve): Likewise.
8946         (Invocation.DoResolve): Update to changes in semantics of
8947         InstanceExpression.
8948
8949 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
8950
8951         Fix #74241
8952         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
8953         customization.
8954         
8955         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
8956
8957 2005-03-31  Raja R Harinath  <rharinath@novell.com>
8958
8959         Fix difference in behaviour with commandline invocation.
8960         * driver.cs (Driver.Reset): New.
8961         (CompilerCallableEntryPoint): Call it.
8962
8963         * statement.cs (If.Resolve): Avoid spurious "uninitialized
8964         variable" warnings if the boolean expression failed to resolve.
8965
8966 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
8967
8968         * attribute.cs: Fix the union of several permissions when some of them
8969         are unrestricted (so the result isn't an unrestricted permission set).
8970         Fix #74036.
8971
8972 2005-03-30  Raja R Harinath  <rharinath@novell.com>
8973
8974         * ecore.cs (MemberExpr): New class.  Convert from interface
8975         IMemberExpr.
8976         (MemberExpr.ResolveMemberAccess): Refactor and move here from
8977         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
8978         error checks.
8979         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
8980         (MethodGroupExpr.IsExplicitImpl): Remove.
8981         (Expression.GetFieldFromEvent): Remove.
8982         (SimpleName.MemberStaticCheck): Remove.
8983         (SimpleName.DoSimpleNameResolve): Update to changes.
8984         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
8985         (MemberAccess.IdenticalNameAndTypeName): Remove.
8986         (MemberAccess.error176): Move to MemberExpr.
8987         (MemberAccess.DoResolve): Update to changes.
8988         (BaseAccess.DoResolve): Likewise.
8989
8990 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
8991
8992         C# 2.0 Conditional attribute class implementation
8993         
8994         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
8995         Analyzes class whether it has attribute which has ConditionalAttribute
8996         and its condition is not defined.
8997         
8998         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
8999         (Class.IsExcluded): New method. Search for at least one defined
9000         condition in ConditionalAttribute of attribute class.
9001
9002 2005-03-30  Raja R Harinath  <rharinath@novell.com>
9003
9004         * ecore.cs (PropertyExpr): Derive from Expression, not
9005         ExpressionStatement.
9006         (PropertyExpr.EmitStatement): Remove.
9007
9008 2005-03-29  Raja R Harinath  <rharinath@novell.com>
9009
9010         Fix #74060.
9011         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
9012         internal field "value__" of an enum be private.  The examples for
9013         "value__" that I found on MSDN all used FieldAttributes.Private.
9014
9015         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
9016         Don't mention IL method attribute names.
9017
9018         Fix #47991.  Remove a TODO.
9019         * statement.cs (Block.Toplevel): Make into a field.
9020         (Block.Parameters): Move into ToplevelBlock.
9021         (Block.known_variables): Rename from child_variable_names.
9022         (Block.Block): Remove variants that take Parameters.  Initialize
9023         'Toplevel' with the immediately surrounding toplevel block.
9024         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
9025         LocalInfo parameter.
9026         (Block.GetKnownVariableInfo): New.
9027         (Block.IsVariableNameUsedInChildBlock): Update.
9028         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
9029         the block, even though it may not be in scope.
9030         (Block.AddVariable): Remove Parameters parameter.  Use
9031         Toplevel.Parameters instead.
9032         (Block.AddConstant): Remove Parameters parameter.
9033         (Block.GetParameterReference): Update to use Toplevel.Parameters.
9034         (Block.IsParamaterReference): Likewise.
9035         (Block.IsLocalParameter): Likewise.  Simplify a lot.
9036         (ToplevelBlock.Parameters): New.  Moved from Block.
9037         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
9038         initialize Parameters to a non-null value.
9039         * cs-parser.jay: Update to changes.
9040         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
9041         simple names that mean different things in the same block.  Use
9042         Block.IsVariableNameUsedInBlock.
9043
9044 2005-03-28  Raja R Harinath  <rharinath@novell.com>
9045
9046         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
9047         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
9048         GetTypeHandle.  It is possible for a reflected type to derive from
9049         a TypeBuilder (e.g., int[] derives from the TypeBuilder
9050         System.Array during mscorlib compilation).
9051         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
9052         contain a method_hash, don't create one either.  Don't create a
9053         deep copy of the base cache's method_hash.
9054         (MemberCache.SetupCache): Rename back from DeepCopy.
9055         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
9056         already initialized.  If we see an override function, add its
9057         underlying base virtual function to the member_hash too.
9058
9059         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
9060
9061 2005-03-26  Raja R Harinath  <harinath@acm.org>
9062
9063         Fix #73038.
9064         * assign.cs (Assign.DoResolve): When the RHS of an assignment
9065         fails to resolve, ensure that the LHS is still resolved as an
9066         lvalue.
9067
9068 2005-03-25  Raja R Harinath  <harinath@acm.org>
9069
9070         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
9071         ec.ContainerType.
9072         (Enum.current_ec): Remove.
9073         (Enum.LookupEnumValue): Remove EmitContext argument.
9074         Just uses the one created during DefineType.
9075         (Enum.FindMembers): Update.
9076         * expression.cs (MemberAccess.DoResolve): Update.
9077
9078 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
9079
9080         * assign.cs (Assign.DoResolve): Check for CS1717 when
9081         source and target are same (uses Equals).
9082
9083         * expression.cs (LocalVariableReference, ParameterReference,
9084         This): Implemented Equals, GetHashCode.
9085
9086         * statement.cs (Block.GetParameterReference): Removed useless
9087         local variable.
9088
9089 2005-03-22  Raja R Harinath  <rharinath@novell.com>
9090
9091         Fix cs0128.cs
9092         * statement.cs (Block.AddVariable): Ensure that we skip implicit
9093         blocks before deciding whether the error is cs0136 or cs0128.
9094
9095         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
9096         (using_alias_directive, using_namespace_directive): Pass
9097         MemberName, not an expression to Namespace.UsingAlias and
9098         Namespace.Using.
9099         (MakeName): Use the MemberName of the namespace.
9100         * namespace.cs (Namespace.MemberName): New.
9101         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
9102         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
9103         Likewise.
9104         * decl.cs (MemberName.Name): Make readonly.
9105         (MemberName.FromDotted): New "constructor".
9106         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
9107         (MemberCore.Name): Compute from MemberName on demand.
9108         (MemberCore.SetMemberName): Provide a way to change the
9109         MemberName.
9110         (MemberCore.AddToContainer): Don't take a fullname parameter.
9111         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
9112         fully qualified name of the container to the member name.
9113         (TypeContainer.AddToTypeContainer): Use a fully qualified name
9114         only if the type is a member of the root container.
9115         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
9116         MemberName.Left rather than searching for an embedded ".".
9117         (PartialContainer.CreatePart): Update to changes in RootContext.
9118         (MemberBase.ShortName): Turn into a property.  Use
9119         MemberCore.SetMemberName.
9120         (MemberBase.ExplicitInterfaceName): Remove.
9121         (MemberBase.UpdateMemberName): Remove.
9122         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
9123         (PropertyBase.SetMemberName): New override.
9124         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
9125         (Tree.GetDecl): New.
9126         (Tree.AllDecls): Rename from Decls.
9127         * attribute.cs, enum.cs, report.cs: Update to changes.
9128         * driver.cs (MainDriver): Use MemberName.FromDotted on
9129         RootContext.MainClass.
9130
9131 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
9132
9133         * class.cs (FixedField.Define): Check for CS1664 and more sanity
9134         checks.
9135
9136         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
9137
9138 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
9139
9140         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
9141         property accessor modifiers.
9142
9143         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
9144         fixed buffer attribute (CS1716).
9145         (PropertyMethod.HasCustomAccessModifier): When property accessor
9146         has custom modifier.
9147
9148         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
9149         modifiers.
9150         (PropertyExpr.DoResolveLValue): Add CS0272.
9151
9152 2005-03-17  Miguel de Icaza  <miguel@novell.com>
9153
9154         * convert.cs: When converting to a pointer, use the proper Conv.U
9155         or Conv.I depending on the source data type.
9156
9157         * cs-tokenizer.cs: Make the size for large decimal constants,
9158         fixes #72957.
9159
9160 2005-03-17  Martin Baulig  <martin@ximian.com>
9161
9162         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
9163         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
9164
9165 2005-03-17  Martin Baulig  <martin@ximian.com>
9166
9167         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
9168         to bool so we can return an error condition.
9169         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
9170         returned an error.
9171
9172 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
9173
9174         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
9175         attributes.
9176
9177 2005-03-16  Raja R Harinath  <rharinath@novell.com>
9178
9179         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
9180         Refactor to avoid traversing the list of assemblies, and to avoid
9181         string concatenation.
9182         * typemanager.cs (guid_attr_type): Remove.
9183         (negative_hits, pointers, references): Remove hashes.
9184         (type_hash): New.
9185         (GetConstructedType): New.  Uses type_hash to handle constructed
9186         types (arrays, references, pointers).
9187         (GetReferenceType, GetPointerType): Use it.
9188         (GetNestedType): New.  Uses type_hash to handle nested types of
9189         reflected types.
9190         (LookupType, LookupTypeDirect): Remove.
9191         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
9192         'types' hash and LookupTypeReflection directly.
9193         (params_string, params_object): Use GetConstructedType.
9194         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
9195         top-level types.
9196         (Namespace.Lookup): Use cached_types.
9197         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
9198         provided by old TypeManager.LookupType.
9199         * rootcontext.cs (MakeFQN): Remove.
9200         * decl.cs (DeclSpace.MakeFQN): Likewise.
9201         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
9202         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
9203         TypeManager.GetConstructedType.
9204         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
9205
9206 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
9207
9208         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
9209         indexers.
9210
9211         * cs-parser.jay: Reports CS1527 for any namespace element.
9212
9213         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
9214         Added CS0407.
9215
9216         * expression.cs (ParameterReference.IsAssigned): Changed error to
9217         CS0269.
9218         (Error_WrongNumArguments): Moved CS0245 detection here.
9219
9220         * statement.cs (Return.Resolve): Add CS1622 report.
9221
9222 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
9223
9224         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
9225
9226 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
9227
9228         * attribute.cs expression.cs: Get rid of some allocations.
9229
9230 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
9231
9232         * doc.cs : just eliminate the latest change.
9233
9234 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
9235
9236         * doc.cs : commented out the latest change. It breaks xml-030.cs
9237
9238 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
9239
9240         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
9241           fail. So invoke CreateType() in FindDocumentedType().
9242
9243 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
9244
9245         * cs-tokenizer.cs : added IsKeyword().
9246         * doc.cs : Detect keyword incorrectly used as identifier.
9247           Allow identifiers prefixed by @.
9248
9249 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
9250
9251         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
9252         It caused exception in namespace resolving (again!).
9253         
9254         * class.cs (Class.ctor): Removed exit.
9255         (PropertyMethod.ctor): ditto.
9256         
9257         * codegen.cs (Codegen.Reset): Reset static data.
9258         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
9259         
9260         * cs-tokenizer.cs (Cleanup): Removed.
9261         
9262         * driver.cs (GetSystemDir): Rewrote to one line command.
9263         It caused problem with unloaded dynamic modules.
9264         (UnixParseOption): Removed Exit.
9265         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
9266         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
9267         Now can be mcs used as library.
9268         
9269         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
9270         empty location.
9271         
9272         * location.cs (Reset): Reset static data.
9273         
9274         * namespace.cs (Reset): Reset static data.
9275         
9276         * report.cs (Report.Reset): Reset static data.
9277         
9278         * rootcontext.cs (RootContext.Reset): Reset static data.
9279         
9280         * tree.cs (RootTypes.ctor): Use Location.Null
9281         
9282         * typemanager.cs (TypeManager.Reset): Reset static data.
9283         (CoreLookupType): Removed Exit.
9284         (TypeHandle.Reset): Reset static data.
9285         
9286 2005-03-10  Raja R Harinath  <rharinath@novell.com>
9287
9288         Fix #73516.
9289         * typemanager.cs (ComputeNamespaces): Import namespaces from
9290         referenced modules too.
9291
9292 2005-03-09  Raja R Harinath  <rharinath@novell.com>
9293
9294         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
9295         than '.'.
9296
9297 2005-03-09  Raja R Harinath  <rharinath@novell.com>
9298
9299         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
9300         enclosing DeclSpace.  This ensures that a name-lookup populates
9301         more caches and there are fewer 'TypeExpression's.  Carve out
9302         nested type lookup into ...
9303         (LookupNestedTypeInHierarchy): ... this.
9304
9305 2005-03-09  Raja R Harinath  <rharinath@novell.com>
9306
9307         Clean up a few partial-class semantics.  
9308         Fixes test-357.cs and cs1618-2.cs.
9309         * cs-parser.jay (struct_declaration): Use 'current_class' as
9310         parent of newly-created struct.  Remove call to Register ().
9311         Use 'pop_current_class' to complete handing the current struct.
9312         (interface_declaration): Likewise.
9313         (class_declaration): Likewise.
9314         (enum_declaration): Use 'current_class' as parent of newly created
9315         enum.
9316         (delegate_declaration): Likewise.
9317         (pop_current_class): New function.  This is used to handle closing
9318         up the 'current_class' and 'current_container', and pointing them
9319         to the enclosing class/container.
9320         (CSharpParser): Initialize 'current_class' too.
9321         * decl.cs (MemberCore): Add check for invariant: a partial
9322         container is not a parsed entity, and thus does not enclose any
9323         parsed members.
9324         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
9325         (DeclSpace.BaseTypeExpr): Use it.
9326         (DeclSpace.LookupType): Add check for invariant.
9327         * class.cs (TypeContainer): Add check for invariant: a nested
9328         class should have the same NamespaceEntry as its enclosing class.
9329         (TypeContainer.EmitFieldInitializers): Make virtual.
9330         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
9331         MemberCore.
9332         (TypeContainer.Register): Remove.
9333         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
9334         null.  Use TypeResolveEmitContext for resolving base types and
9335         interfaces.  Move initialization of Parts.TypeBuilder here from
9336         ...
9337         (TypeContainer.DefineNestedTypes): ... here.
9338         (PartialContainer): Take a Namespace not a NamespaceEntry.
9339         (PartialContainer.Create): Don't use Register.  Call the
9340         appropriate Add... function directly.
9341         (ClassPart): Take both the PartialContainer and the enclosing
9342         class as constructor arguments.
9343         (ClassPart.EmitFieldInitializers): Override.
9344         (ClassPart.PartFindNestedTypes): Remove.
9345         (FieldBase.GetInitializerExpression): Resolve the initializer
9346         expression in the emit context of the enclosing class.
9347         * tree.cs (RootTypes): Remove Register ().
9348         
9349 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
9350
9351         * cs-parser.jay: Removed CS0134.
9352         
9353         * driver.cs: Removed CS1901.
9354         
9355         * expression.cs (SizeOf.DoResolve): Don't report CS0233
9356         for predefined types.
9357
9358 2005-03-07  Duncan Mak  <duncan@novell.com>
9359
9360         * codegen.cs (Save):  Catch UnauthorizedAccessException as
9361         well. Fixes bug #73454.
9362
9363 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
9364
9365         * cs-tokenizer.cs (xtoken): Add CS1035.
9366         
9367         * class.cs (MethodData.Define): Add CS0683.
9368         (FieldMember.ctor): Add CS0681.
9369
9370 2005-03-07  Raja R Harinath  <rharinath@novell.com>
9371
9372         * ecore.cs (SimpleName.DoResolve): Rename from
9373         SimpleName.DoResolveAllowStatic.
9374         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
9375         Pass 'intermediate' flag to MemberStaticCheck.
9376         (SimpleName.MemberStaticCheck): Skip "static check" only in case
9377         of "intermediate" lookups via MemberAccess.
9378         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
9379         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
9380
9381 2005-03-07  Raja R Harinath  <rharinath@novell.com>
9382
9383         Fix #73394.
9384         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
9385         slipped in because of variable names that are identical to a
9386         builtin type's BCL equivalent ('string String;', 'int Int32;').
9387         (PropertyExpr.EmitInstance): Likewise.
9388
9389 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
9390
9391         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
9392         
9393         * report.cs (warning_ignore_table): Made public.
9394
9395 2005-03-04  Raja R Harinath  <rharinath@novell.com>
9396
9397         Fix #73282.
9398         * class.cs (MethodData.Emit): Pass 'container' to
9399         container.GetObsoleteAttribute instead of 'container.Parent'.
9400
9401 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
9402
9403         * cs-parser.jay: Add 1534 error test.
9404
9405         * iterators.cs (Yield.CheckContext): Add error 1629.
9406         (Iterator.ctor): Save unsafe modifier.
9407         (MoveNextMethod.DoEmit): Restore unsafe context.
9408
9409         * namespace.cs (UsingAlias): Better error message.
9410
9411 2005-03-03  Dan Winship  <danw@novell.com>
9412
9413         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
9414         the warning message [#73219]
9415
9416 2005-03-03  Raja R Harinath  <rharinath@novell.com>
9417
9418         Fix compile with MCS 1.0.0.0.
9419         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
9420         w_restore to not depend on string constant folding.
9421
9422 2005-03-03  Raja R Harinath  <rharinath@novell.com>
9423
9424         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
9425         CS0246 check to users who passed 'silent = false'.
9426         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
9427         check.
9428         (SimpleName.SimpleNameResolve): Update.
9429         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
9430         (MemberAccess.IdenticalNameAndTypeName): Update.
9431         * doc.cs (FindDocumentedTypeNonArray): Update.
9432
9433 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
9434
9435         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
9436         * parameters.cs (ComputeAndDefineParameters): Remove.
9437         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
9438         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
9439         Use GetParameterInfo.
9440
9441 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
9442
9443         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
9444
9445 2005-03-02  Raja R Harinath  <rharinath@novell.com>
9446
9447         Unify DeclSpace.LookupType and DeclSpace.FindType.
9448         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
9449         is in charge of defining nested types on demand.
9450         (DeclSpace.LookupType): Use it when the current_type is a
9451         TypeBuilder.  Use LookupTypeDirect for reflected types.
9452         (DeclSpace.FindType): Remove.
9453         (DeclSpace.LookupInterfaceOrClass): Likewise.
9454         (DeclSpace.DefineTypeAndParents): Likewise.
9455         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
9456         DeclSpace.LookupType.
9457         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
9458         * typemanager.cs (LookupType): Simplify.
9459         (AddUserType): Remove type from negative_hits.
9460         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
9461         * class.cs (TypeContainer.FindMembers): Move handling of nested
9462         types ...
9463         (TypeContainer.FindMembers_NestedTypes): ... here.
9464         (TypeContainer.FindNestedType): Implement override.
9465         (ClassPart.FindNestedType): Delegate to PartialContainer.
9466         (ClassPart.PartFindNestedType): Looks up the nested types of the
9467         part alone.
9468
9469 2005-03-02  Martin Baulig  <martin@ximian.com>
9470
9471         * class.cs (TypeContainer.DoDefineMembers): We also need a default
9472         static constructor in static classes.
9473
9474 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
9475
9476         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
9477         sizeParamIndex is not specified.
9478
9479 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
9480
9481         Fix #73117
9482         * report.cs (WarningMessage.IsEnabled): Missing null check.
9483
9484 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
9485
9486         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
9487         in the fields and not in the properties.
9488
9489 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
9490
9491         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
9492         fields as well.
9493
9494 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
9495
9496         * attribute.cs: Small refactoring (improved robustness).
9497         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
9498         (ValidateGuid): Removed.
9499         (Resolve): Removed referenced to above mentioned.
9500         (GetAttributeUsage): Made private and changed to work without
9501         class assistance.
9502         (GetIndexerAttributeValue): Don't crash.
9503         (GetConditionalAttributeValue): Ditto.
9504         (GetClsCompliantAttributeValue): Ditto.
9505         (ExtractSecurityPermissionSet): All attributes exceptions are
9506         error 648.
9507         (GetPropertyValue): New helper.
9508         (GetMethodImplOptions): New method.
9509         (DefinePInvokeMethod): Reuse common code. Implemented handling of
9510         some missing properties.
9511         
9512         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
9513         (Method.ApplyAttributeBuilder): Updated.
9514         
9515         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
9516         exception.
9517
9518 2005-02-28  Raja R Harinath  <rharinath@novell.com>
9519
9520         Fix #73052.
9521         * report.cs (Report.SymbolRelatedToPreviousError): Handle
9522         non-simple types (array, pointer, reference).
9523
9524 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
9525
9526         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
9527
9528         * class.cs (MethodCore.IsDuplicateImplementation): Special error
9529         for operators.
9530         (Method.CheckBase): Catch wrong destructor here.
9531         (MethodData.Define): Add errors 550, 668.
9532
9533         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
9534
9535         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
9536
9537         * pending.cs (VerifyPendingMethods): Add error 551.
9538
9539         * typemanager.cs (CSharpName): Next error report helper.
9540
9541 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
9542
9543         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
9544         attributes. Removed useless attribute double check.
9545         It saves almost 2MBs for corlib.
9546
9547 2005-02-25  Raja R Harinath  <rharinath@novell.com>
9548
9549         Fix #72924.
9550         * statement.cs (ExpressionStatement.Resolve): Make robust to being
9551         called twice in case of error.
9552
9553 2005-02-23  Chris Toshok  <toshok@ximian.com>
9554
9555         Fix compiler portions of #72827.
9556         * statement.cs (Block.Emit): call Begin/EndScope on the
9557         EmitContext instead of the ILGenerator.
9558
9559         * codegen.cs (EmitContext.BeginScope): new method, call
9560         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
9561         we have one.)
9562         (EmitContext.BeginScope): same, but EndScope and CloseScope
9563
9564         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
9565         offset and call the superclass's OpenScope(int) with it.
9566         (SymbolWriter.CloseScope): get the current il
9567         offset and call superclass's CloseScope(int) with it.
9568
9569 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
9570
9571         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
9572         CS1677 for out and ref as well.
9573
9574         * class.cs (Method.Define): Add error CS1599 detection.
9575         
9576         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
9577         
9578         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
9579         
9580         * delegate.cs (Delegate.Define): Add error CS1599 detection.
9581         
9582         * support.cs.cs (ModifierDesc): New helper method.
9583
9584 2005-02-23  Raja R Harinath  <rharinath@novell.com>
9585             Abin Thomas  <projectmonokochi@rediffmail.com>
9586             Anoob V E  <projectmonokochi@rediffmail.com>
9587             Harilal P R  <projectmonokochi@rediffmail.com>
9588
9589         Fix #57851, #72718.
9590         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
9591         MemberLookup (used for error reporting) actually returns a result.
9592         Fix error report number (122, not 112).
9593
9594 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
9595             Anoob V E  <projectmonokochi@rediffmail.com>
9596             Harilal P R  <projectmonokochi@rediffmail.com>
9597
9598         Fix #71134.
9599         * pending.cs (PendingImplementation.GetAbstractMethods):
9600         Find NonPublic members too.
9601
9602 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
9603
9604         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
9605         Fixed error 217.
9606         
9607         * class.cs (MethodCore.CheckMethodAgainstBase):
9608         Add error 239 report.
9609
9610 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9611
9612         Fix #68955.
9613         * expression.cs (Invocation.IsApplicable): Make public.
9614         (Invocation.IsParamsMethodApplicable): Likewise.
9615         * delegate.cs (Delegate.VerifyApplicability): Don't use
9616         Invocation.VerifyArgumentCompat for parameter applicability
9617         testing.  Use Invocation.IsApplicable and
9618         Invocation.IsParamsMethodApplicable.
9619
9620 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
9621
9622         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
9623         
9624         * class.cs (Operator.Define): Add error 217 report.
9625         
9626 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9627
9628         * namespace.cs (UsingEntry.Resolve): Undo change below.
9629
9630 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9631
9632         Fix #72756.
9633         * ecore.cs (Expression.MemberLookupFailed): Add argument to
9634         disable the error message when the extended MemberLookup also
9635         fails.
9636         (Expression.MemberLookupFinal): Update.
9637         (SimpleName.DoSimpleNameResolve): Update.
9638         * expression.cs (MemberAccess.ResolveNamespaceOrType):
9639         Don't use MemberLookupFinal.
9640         (New.DoResolve): Update.
9641         (BaseAccess.CommonResolve): Update.
9642
9643 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9644
9645         Fix #72732.
9646         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
9647         occured previously, don't resolve again.
9648
9649 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
9650
9651         Fix #69949
9652         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
9653         argument. Call ResolveAttributeUsage for unresolved.
9654         when types doesn't match ctor arguments.
9655         
9656         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
9657         for nested attribute classes.
9658         (Class.attribute_usage): Removed.
9659         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
9660         for attribute class.
9661         
9662         * ecore.cs (IsAttribute): Removed.
9663         
9664         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
9665         
9666         * rootcontext.cs (RegisterAttribute): Removed, attributes are
9667         now normal types.
9668         (attribute_types): Removed.
9669         (EmitCode): Global attributes are emited as the latest.
9670
9671 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
9672
9673         * class.cs (EmitFieldInitializers): Don't emit field initializer
9674         for default values when optimilization is on.
9675         
9676         * constant.cs (Constant.IsDefaultValue): New property.
9677         
9678         * driver.cs: Add /optimize handling.
9679         
9680         * constant.cs,
9681         * ecore.cs,
9682         * literal.cs: Implement new IsDefaultValue property.
9683         
9684         * rootcontext.cs (Optimize): New field, holds /optimize option.
9685
9686 2005-02-18  Raja R Harinath  <rharinath@novell.com>
9687
9688         Fix crasher in re-opened #72347.
9689         * namespace.cs (Namespace.Lookup): Return null if
9690         DeclSpace.DefineType returns null.
9691
9692         Fix #72678.
9693         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
9694
9695 2005-02-18  Raja R Harinath  <rharinath@novell.com>
9696
9697         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
9698         now returns null if it cannot resolve to an lvalue.
9699         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
9700         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
9701         returned null.  Remove check for SimpleName.
9702         (EventExpr.DoResolveLValue): New.
9703         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
9704         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
9705         error from ...
9706         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
9707         avoid CS0131 error.
9708         (Unary.ResolveOperator): Move CS0211 check ...
9709         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
9710         CS0131 error.
9711         (Unary.DoResolveLValue): Simplify.
9712         (AddressOf.DoResolveLValue): New.
9713         (ArrayAccess.DoResolveLValue): New.
9714
9715 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
9716
9717         * attribute.cs (Attribute.Resolve): Add arguments casting for
9718         when types doesn't match ctor arguments.
9719
9720 2005-02-16  Raja R Harinath  <rharinath@novell.com>
9721
9722         Fix parts of #63202.
9723         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
9724         lookup of operator in base type.  Ensure that all checks happen
9725         when the operator resolves to an "op_..." method.
9726
9727 2005-02-15  Raja R Harinath  <rharinath@novell.com>
9728
9729         Fix #71992.
9730         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
9731         'ignore_cs0104' parameter.  Pass it to ...
9732         (NamespaceEntry.Lookup): ... this.
9733         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
9734         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
9735         (TypeLookupExpression.DoResolveAsTypeStep): Update.
9736         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
9737         Update.  Request that cs0104 errors be ignored.
9738         (ComposedCast.ResolveAsTypeStep): Update.
9739
9740 2005-02-14  Raja R Harinath  <rharinath@novell.com>
9741
9742         Fix #59209.
9743         * expression.cs (Invocation.BetterFunction): Remove support for
9744         comparing virtual functions and their overrides.
9745         (Invocation.IsOverride): New.
9746         (Invocation.OverloadResolve): Don't consider 'override' functions
9747         during candidate selection.  Store them in a lookaside list.
9748         If the selected method is a 'virtual' function, use the list to
9749         find any overrides that are closer to the LHS type.
9750
9751 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
9752
9753         * expression.cs (New.DoResolve): Add complex core type reduction.
9754         (New.Constantify): Converts complex core type syntax like 'new int ()'
9755         to simple constant.
9756         
9757 2005-02-14  Raja R Harinath  <rharinath@novell.com>
9758
9759         * decl.cs (EntryType.EntryType): New constructor to create an
9760         updated copy of a cache entry.
9761         (MemberCache.AddMethods): Use it.
9762         (MemberCache.ClearDeclaredOnly): Remove.
9763         (MemberCache.MemberCache): Update.
9764
9765 2005-02-11  Miguel de Icaza  <miguel@novell.com>
9766
9767         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
9768         variable.  This one is represents the actual low-level declaration
9769         of the method, as opposed to the semantic level `IsStatic'.   
9770
9771         An anonymous method which is hosted into a static method might be
9772         actually an instance method.  IsStatic would reflect the
9773         container, while MethodIsStatic represents the actual code
9774         generated.
9775
9776         * expression.cs (ParameterReference): Use the new MethodIsStatic
9777         instead of IsStatic.
9778
9779         * anonymous.cs (AnonymousMethod.Compatible): Pass the
9780         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
9781         set on the current EmitContext. 
9782
9783         * expression.cs (Cast): Overload DoResolveLValue so we can pass
9784         resolve our casted expression as an LValue.  This triggers the
9785         proper LValue processing that is later required by Assign.
9786
9787         This fixes 72347.
9788
9789         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
9790
9791 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
9792
9793         C# 2.0 Fixed buffer implementation
9794
9795         * anonymous.cs: Update after RegisterHelperClass renaming.
9796
9797         * attribute.cs (AttributeTester.fixed_buffer_cache):
9798         Cache of external fixed buffers.
9799         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
9800         implementation if field is fixed buffer else null.
9801
9802         * class.cs
9803         (TypeContainer.AddField): Accept FieldMember instead of Field.
9804         (FieldBase.IsFieldClsCompliant): Extracted code from
9805         VerifyClsCompliance descendant customization.
9806         (FixedField): New class handles fixed buffer fields.
9807         (FixedFieldExternal): Keeps information about imported fixed
9808         buffer.
9809         (IFixedField): Make access to internal or external fixed buffer
9810         same.
9811
9812         * cs-parser.jay: Add fixed buffer parsing.
9813
9814         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
9815         buffer.
9816
9817         * expression.cs (Indirection): Extended implementation to accept
9818         fixed buffer field.
9819         (PointerArithmetic.Emit): Get element from fixed buffer as well.
9820         (ElementAccess.MakePointerAccess): Get type as parameter.
9821         (DoResolve): Add fixed buffer field expression conversion.
9822         (DoResolveLValue): Ditto.
9823         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
9824         (ArrayPtr): Derives from FixedBufferPtr.
9825         (ArrayPtr.Emit): Add extra emit for array elements.
9826
9827         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
9828
9829         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
9830         for compiler generated types.
9831         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
9832
9833         * statement.cs (Fixed): Refactored to be easier add fixed buffer
9834         and consume less memory.
9835         (Fixed.Resolve): Add fixed buffer case.
9836
9837         * typemanager.cs (compiler_generated_attr_ctor,
9838         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
9839         (HasElementType): Add our own implementation to work on every
9840         runtime.
9841
9842 2005-02-11  Miguel de Icaza  <miguel@novell.com>
9843
9844         * anonymous.cs (CaptureContext): Track whether `this' has been
9845         referenced.   
9846
9847         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
9848         only captured `this' if it was implicitly done (instance
9849         methods/variables were used). 
9850
9851         * codegen.cs (EmitContext.CaptureThis): New method to flag that
9852         `this' must be captured.
9853
9854 2005-01-30  Miguel de Icaza  <miguel@novell.com>
9855  
9856         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
9857         is null it means that there has been no need to capture anything,
9858         so we just create a sibling.
9859
9860         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
9861
9862         Just a partial fix.  The other half is fairly elusive.
9863         
9864 2005-02-10  Raja R Harinath  <rharinath@novell.com>
9865
9866         Fix #52586, cs0121-4.cs.
9867         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
9868         and return a hashtable.
9869         (MemberCache.ClearDeclaredOnly): New.
9870         (MemberCache.MemberCache): Update to change.  Make a deep copy of
9871         the method_hash of a base type too.
9872         (MemberCache.AddMethods): Adapt to having a deep copy of the base
9873         type methods.  Overwrite entries with the same MethodHandle so
9874         that the ReflectedType is correct.  The process leaves in base
9875         virtual functions and their overrides as distinct entries.
9876         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
9877         matters since it was boxed in a ArrayList before.
9878         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
9879         modifier.
9880         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
9881         case of a virtual function and its override (choose the overload
9882         as better).
9883         (Invocation.OverloadResolve): Avoid 'override' members during
9884         'applicable_type' calculation.
9885
9886 2005-02-09  Raja R Harinath  <rharinath@novell.com>
9887
9888         Combine two near-redundant caches.
9889         * typemanager.cs (method_params): Rename from method_internal_params.
9890         (TypeManager.GetParameterData): New.  Replace
9891         Invocation.GetParameterData.
9892         (TypeManager.LookupParametersByBuilder): Remove.
9893         * expression.cs (Invocation.method_parameter_cache): Remove.
9894         (Invocation.GetParameterData): Remove.
9895         Update to changes.
9896         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
9897         Update to changes.
9898
9899 2005-02-08  Raja R Harinath  <rharinath@novell.com>
9900
9901         Fix #72015.
9902         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
9903         TypeManager.multicast_delegate_type is null, resolve it by looking
9904         up "System.MulticastDelegate".
9905         * rootcontext.cs (RootContext.ResolveCore): Simplify.
9906
9907 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
9908             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
9909             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
9910
9911         Fix cs0164.cs.
9912         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
9913         (LabeledStatement.AddReference): New.  Set 'referenced'.
9914         (Goto.Resolve): Use it.
9915
9916 2005-02-05  John Luke  <john.luke@gmail.com>
9917
9918         * driver.cs: remove duplicate -doc line in Usage ()
9919
9920 2005-02-04  Raja R Harinath  <rharinath@novell.com>
9921
9922         * location.cs (Location.AddFile): Fix CS2002 error report.
9923
9924 2005-02-02  Martin Baulig  <martin@ximian.com>
9925
9926         * delegate.cs (Delegate.DefineType): Report an internal error if
9927         TypeManager.multicast_delegate_type is null.  See bug #72015 for
9928         details.        
9929
9930 2005-02-02  Raja R Harinath  <rharinath@novell.com>
9931
9932         Fix a crasher in a variant of #31984.
9933         * const.cs (Constant.CheckBase): New override that defers the
9934         new-or-override check in case the base type hasn't been populated
9935         yet.
9936         (Constant.Define): Ensure the new-or-override check is performed.
9937
9938 2005-02-01  Duncan Mak  <duncan@ximian.com>
9939
9940         * const.cs (LookupConstantValue): Check that `ce' is not null
9941         before calling GetValue ().
9942
9943 2005-02-01  Raja R Harinath  <rharinath@novell.com>
9944
9945         Fix test-334.cs (#69519).
9946         * cs-parser.jay (using_alias_directive): Pass in an expression to
9947         NamespaceEntry.UsingAlias.
9948         (using_namespace_directive): Pass in an expression to
9949         NamespaceEntry.Using.
9950         (namespace_name): Don't flatten to a string.
9951         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
9952         (NamespaceEntry.AliasEntry.Resolve): Lookup using
9953         ResolveAsTypeStep.
9954         (NamespaceEntry.UsingEntry): Likewise.
9955         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
9956         changes.
9957         (NamespaceEntry.LookupForUsing): Remove.
9958         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
9959         names.
9960         (NamespaceEntry.Lookup): Remove support for dotted names.
9961
9962 2005-02-01  Raja R Harinath  <rharinath@novell.com>
9963
9964         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
9965         split into two.
9966         (NamespaceEntry.ImplicitParent): Compute on demand.
9967         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
9968         parallels the current.
9969         (NamespaceEntry.LookupForUsing): Use it.
9970         (NamespaceEntry.Lookup): If the current namespace-entry is
9971         implicit, don't search aliases and using tables.
9972
9973 2005-02-01  Raja R Harinath  <rharinath@novell.com>
9974
9975         Fix #31984.
9976         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
9977         BaseCache here.
9978         (TypeContainer.BaseCache): Compute on demand.
9979         (TypeContainer.FindMembers): Define constants and types if they're
9980         not already created.
9981         (FieldMember.Define): Move resetting of ec.InUnsafe before error
9982         check.
9983         * const.cs (Constant.Define): Make idempotent.
9984
9985 2005-01-29  Miguel de Icaza  <miguel@novell.com>
9986
9987         * pending.cs: Produce better code (no nops produced by using Ldarg
9988         + value).
9989         
9990         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
9991         i - 1' it should be arg + 1.
9992
9993         Fixes bug #71819.
9994
9995 2005-01-28  Raja R Harinath  <rharinath@novell.com>
9996
9997         * attribute.cs (Attribute.CheckAttributeType): Make private
9998         non-virtual.
9999         (Attribute.ResolveType): Make virtual.
10000         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
10001         handling of RootContext.Tree.Types.
10002
10003 2005-01-27  Raja R Harinath  <rharinath@novell.com>
10004
10005         Update attribute-handling to use the SimpleName/MemberAccess
10006         mechanisms.
10007         * cs-parser.jay (attribute): Pass in an expression to the
10008         constructors of Attribute and GlobalAttribute.
10009         * attribute.cs (Attribute): Take an expression for the name.
10010         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
10011         passed in attribute name expression.
10012         (Attribute.CheckAttributeType): Use it.
10013         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
10014         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
10015         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
10016         argument to prevent error messages if the lookup fails.
10017
10018 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
10019
10020         * expression.cs (Indirection): Implemented IVariable interface
10021         to support indirection in AddressOf operator.
10022         (PointerArithmetic.Emit): Add optimalization for case where
10023         result can be precomputed.
10024
10025 2005-01-26  Martin Baulig  <martin@ximian.com>
10026
10027         * class.cs (TypeContainer.AttributeTargets): Return the correct
10028         AttributeTargets depending on our `Kind' instead of throwing an
10029         exception; fixes #71632.
10030
10031 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
10032
10033         Fix #71257
10034         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
10035         constant members.
10036
10037 2005-01-25  Raja R Harinath  <rharinath@novell.com>
10038
10039         Fix #71602.
10040         * expression.cs (MemberAccess.DoResolve): Don't complain with
10041         cs0572 when the LHS of a member access has identical name and type
10042         name.
10043
10044 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
10045
10046         Fix #71651, #71675
10047         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
10048         CreatePermission.
10049         Create custom PermissionSet only for PermissionSetAttribute.
10050
10051 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
10052
10053         Fix #71649
10054         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
10055         delegates in static class.
10056
10057 2005-01-24  Martin Baulig  <martin@ximian.com>
10058
10059         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10060         merging an implicit block, just use its reachability.
10061
10062         * statement.cs (Block.Resolve): Make the unreachable code check
10063         work wrt. implicit blocks; see test-337 from #63842.
10064
10065 2005-01-21  Alp Toker  <alp@atoker.com>
10066  
10067         * cs-parser.jay: destructor_declaration's container is PartialContainer
10068         not Class when partial types are used, so use Kind prop instead of
10069         'is'.
10070         
10071 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
10072
10073         * cs-parser.jay: Improve error reporting when an interface
10074         declares new types.
10075
10076 2005-01-20  Dick Porter  <dick@ximian.com>
10077
10078         * support.cs: SeekableStreamReader fix from Sandor Dobos
10079         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
10080         chars are read.  Fixes bug 70369.
10081
10082 2005-01-20  Raja R Harinath  <rharinath@novell.com>
10083
10084         * cs-parser.jay (catch_clause): Simplify current_block handling
10085         somewhat.
10086
10087 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
10088
10089         * convert.cs (ImplicitStandardConversionExists): Synchronize the
10090         code with ImplicitStandardConversion to handle the implicit
10091         conversion of method groups into valid delegate invocations. 
10092
10093         The problem is that in parameter handling we were using this code
10094         path.  Fixes bug #64698
10095
10096 2005-01-19  Raja R Harinath  <rharinath@novell.com>
10097
10098         * cs-parser.jay: Fix several infelicities.
10099         - Avoid assigning to the parser value stack.  Code like 
10100           '$3 = null' is unclean.  Synthesize a value for the code block
10101           instead. 
10102         - Avoid using oob_stack for storing location information.  Use ...
10103         (_mark_): ... this.  New (empty) rule.  Saves the current location
10104         in $$.
10105         (foreach_statement): Avoid using oob_stack for current_block
10106         handling.  Use technique used in for_statement and
10107         using_statement.  Synthesize a value for the code block to store
10108         additional intermediate information.
10109
10110 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
10111
10112         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
10113         of a different type is only allowed to private fields of a
10114         containing type, not on fields of a base class.
10115
10116         See test-174.cs and error cs0122-9.cs
10117
10118 2005-01-13  Raja R Harinath  <rharinath@novell.com>
10119
10120         Fix test-335.cs (bug #58126).
10121         * cs-parser.jay (argument): Split out non-expression parts of the
10122         rule into 'non_simple_argument'.
10123         (invocation_expression): Support parenthesized invocations with
10124         multiple arguments, and with single non-simple arguments.
10125
10126 2005-01-13  Raja R Harinath  <rharinath@novell.com>
10127
10128         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
10129         places.
10130
10131 2005-01-12  Raja R Harinath  <rharinath@novell.com>
10132
10133         Fix cs0038-1.cs, cs1640-6.cs.
10134         * ecore.cs (Expression.Resolve): Remove special-case for
10135         SimpleName in error-handling.
10136         (Expression.almostMatchedMembers): Relax access permission to
10137         protected.
10138         (Expression.MemberLookupFailed): Handle duplicates in
10139         almostMatchedMembers list.
10140         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
10141         * expression.cs (New.DoResolve): Report CS1540 for more cases.
10142         * typemanager.cs (GetFullNameSignature): Use the MethodBase
10143         overload if the passed in MemberInfo is a MethodBase.
10144
10145 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
10146
10147         Fix #70749
10148         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
10149         for non-CAS & merge permission sets properly.
10150
10151 2005-01-11  Raja R Harinath  <rharinath@novell.com>
10152
10153         Improve standard-compliance of simple name and member access 
10154         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
10155         * ecore.cs (FullNamedExpression): New abstract base class 
10156         for Namespaces and TypeExpressions.
10157         (ResolveFlags.SimpleName): Remove.
10158         (SimpleName): Remove support for dotted names.
10159         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
10160         DeclSpace.FindType and DeclSpace.LookupType.
10161         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
10162         (Expression.ExprClassName): Make member function.
10163         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
10164         a namespace.  Remove creation of dotted "SimpleName"s.
10165         (MemberAccess.DoResolve): Likewise.
10166         * decl.cs (DeclSpace.Cache): Make private.
10167         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
10168         (DeclSpace.FindType): Update.
10169         (DeclSpace.LookupType): Move here from RootContext.  Return a 
10170         FullNamedExpression.
10171         * namespace.cs (Namespace): Derive from FullNamedExpression
10172         so that it can be part of expression resolution.
10173         (Namespace.Lookup): Return an FullNamedExpression.
10174         (NamespaceEntry.LookupAlias): Lookup aliases only in current
10175         namespace.
10176         * rootcontext.cs (NamespaceLookup): Remove.
10177         (LookupType): Move to DeclSpace.
10178         * attribute.cs (CheckAttributeType): Update.
10179         * doc.cs (FindDocumentedType): Remove allowAlias argument.
10180         (FindDocumentedTypeNonArray): Likewise.
10181
10182 2005-01-11  Raja R Harinath  <rharinath@novell.com>
10183
10184         Fix cs0509.cs, cs1632.cs.
10185         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
10186         is the same as IsInterface.
10187         (TypeContainer.GetClassBases): Likewise.
10188         * statement.cs (LabeledStatement.ig): New field.
10189         (LabeledStatement.LabelTarget): Save ILGenerator which created the
10190         label.
10191         (LabeledStatement.DoEmit): Check that the label was created with
10192         the same ILGenerator.
10193
10194 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
10195
10196         Fix #71058
10197         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
10198         accessors to its properties.
10199
10200         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
10201         from accessors to property.
10202         
10203 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
10204
10205         Fix #70722
10206         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
10207         only for overrides.
10208         
10209 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
10210
10211         * attribute.cs: Check for null and empty strings.  
10212
10213         I have lost another battle to Paolo.
10214
10215 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
10216
10217         Fix #70942
10218         * class.cs (PropertyMethod): Set Parent field in ctors.
10219         (SetMethod.InternalParameters): Add unsafe switch hack.
10220         Override MarkForDuplicationCheck where it is appropriate.
10221
10222         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
10223         It says whether container allows members with the same name.
10224         Base default is no.
10225         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
10226         Removed is_method parameter.
10227
10228 2005-01-06  Duncan Mak  <duncan@ximian.com>
10229
10230         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
10231         because the previous change led to incorrect reporting of CS1032
10232         ("Cannot define/undefine preprocessor symbols after first token in
10233         file"). Instead of using `tokens_seen' as the only flag that
10234         triggers CS1040, introduce `comments_seen'. This new flag is used
10235         to signify having seen comments on the current line, so it is
10236         unset after a newline.
10237
10238 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
10239
10240         * doc.cs : When searching for a type, find nested type too.
10241           This fixes bug #71040.
10242
10243 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
10244
10245         * doc.cs :
10246           - Warn missing member comment on those classes which also does not
10247             have doc comments. Fixed bug #71041.
10248           - Don't warn missing doc comment on default constructor.
10249             Fixed bug #71042.
10250
10251 2005-01-06  Duncan Mak  <duncan@ximian.com>
10252
10253         * cs-tokenizer.cs (xtoken): After handling traditional C-style
10254         comments, set `tokens_seen' to true. This allows us to detect
10255         misplaced preprocessor directives (i.e. not at the beginning of
10256         the a line, nor after whitespaces). In that case, report error
10257         CS1040. This fixes bug #56460.
10258
10259         * cs-parser.jay (interface_member_declaration): Add checks for
10260         IsExplicitImpl, and report CS0541 error if an interface member is
10261         defined as an explicit interface declaration.
10262
10263 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
10264
10265         Fix #70817
10266         * class.cs (PropertyMethod): Set Parent field in ctors.
10267         (SetMethod.InternalParameters): Add unsafe switch hack.
10268         
10269         * decl.cs (MemberCore.Parent): Cannot be readonly.
10270
10271 2005-01-06  Raja R Harinath  <rharinath@novell.com>
10272
10273         * decl.cs (DeclSpace.ResolveType): Remove.
10274         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
10275         Merge in code from ...
10276         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
10277         * class.cs, enum.cs: Update to changes.
10278
10279 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
10280
10281         * anonymous.cs: Ensure that we init the scope of our parent if it
10282         has not been initialized yet.
10283
10284 2004-12-30  Duncan Mak  <duncan@ximian.com>
10285
10286         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
10287         if field.FieldBuilder is null. Fixes #70758.
10288
10289         * convert.cs: Fixed some typos and updated some of the comments.
10290         (ImplicitStandardConversionExists):
10291         (TryImplicitIntConversion): If `target_type' is an interface and
10292         the type of `ic' implements this interface, return true or a new
10293         BoxedCast instead of null. This fixes #70468.
10294
10295 2004-12-29  Duncan Mak  <duncan@ximian.com>
10296
10297         * expression.cs (Argument.Emit): Check that Expr is
10298         IMemoryLocation before casting to it, and report CS1510 otherwise.
10299
10300         This fixes #70402.
10301
10302 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
10303
10304         * statement.cs (Block.ThisVariable): remove the recursion here, to
10305         make the --profile more sane.
10306
10307 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
10308
10309         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
10310         assembly, by JB Evain.
10311
10312 2004-12-17  Raja R Harinath  <rharinath@novell.com>
10313
10314         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
10315           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
10316         "parent" refers to enclosing type/class.  "base" refers to superclass.
10317
10318 2004-12-17  Raja R Harinath  <rharinath@novell.com>
10319
10320         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10321         Ensure that we only have GlobalAttributes.
10322         * attribute.cs (Attribute.Emit): Make non-virtual.
10323         (GlobalAttribute.Emit): Remove.
10324         (Attribute.Resolve): Make virtual.
10325         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
10326         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
10327         the argument. Don't create one.
10328         (Attribute.GetObsoleteAttribute): Likewise.
10329         (Attribute.GetClsCompliantAttributeValue): Likewise.
10330         * class.cs, decl.cs: Update to changes.
10331
10332 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
10333
10334         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
10335         
10336         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
10337         
10338         * statement.cs (Foreach.Resolve): Add error 186 report.
10339
10340 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
10341
10342         * expression.cs (Conditional.DoResolve): Add warning 429.
10343         
10344         * statement.cs (If.Resolve): Add warning 665.
10345
10346 2004-12-16  Raja R Harinath  <rharinath@novell.com>
10347
10348         New invariant: RootContext.Tree.Types.NamespaceEntry == null
10349         except when in the parser, and in GlobalAttribute.
10350         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
10351         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
10352         RootContext.Tree.Types.NamespaceEntry once work is done.
10353         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
10354         and resets RootContext.Tree.Types.NamespaceEntry.
10355
10356 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
10357
10358         * cs-parser.jay: Don't create a block for every variable.
10359
10360 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
10361
10362         * location.cs: Provide extra information.
10363
10364         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
10365         variables from the captured environment, it is the ldarg_0.
10366
10367 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
10368
10369         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
10370         find a conclusion.
10371         
10372         * class.cs: Changed warning level for 169 to avoid developer
10373         displeasure from warning flooding. It will be changed back when they
10374         fix most of current BCL warnings.
10375         
10376         * RootContext.cs: Pushed default WarningLevel to 3.
10377         
10378         * statement.cs: Removed unused variable.
10379
10380 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
10381
10382         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
10383         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
10384         Add error 502 report.
10385         (StaticClass.DefineType): Add error 441 report.
10386         (Class.AllowedModifiersProp): New virtual property as temporary
10387         extension to AllowedModifiers.
10388         (Class.DefineType): Add error 418 report. Moved ModFlags check here
10389         to share implementation with StaticClass and don't call virtual
10390         methods from ctor.
10391         
10392         * driver.cs (MainDriver): Add error 1558 test.
10393
10394         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
10395         report. Moved error 36 test here.
10396
10397         * statement.cs (Throw.Resolve): Add error 724 report.
10398
10399         * typemanager.cs: Add out_attribute_type core type.
10400         
10401 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
10402
10403         * class.cs (TypeContainer.VerifyClsCompliance): Add error
10404         3018 report.
10405         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
10406
10407         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
10408         3017 report.
10409         
10410         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
10411
10412         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
10413         Add error 3023 report.
10414         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
10415
10416         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
10417         implementation.
10418
10419 2004-12-12  John Luke  <john.luke@gmail.com>
10420
10421         * driver.cs (AddArgs): take -- into account when
10422         adding arguments, fixes bug 65710 
10423
10424 2004-12-12  Martin Baulig  <martin@ximian.com>
10425
10426         * expression.cs (Unary.TryReduceNegative): Added support for
10427         SByteConstant and ByteConstant.
10428         (Unary.Reduce): Check error values from TryReduceNegative().
10429
10430 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
10431
10432         * attributes.cs (Attribute.Resolve): Avoid multiple error report
10433         and report exception as error 182.
10434
10435 2004-12-10  Raja R Harinath  <rharinath@novell.com>
10436
10437         * driver.cs (Main): Fix message when there are warnings.
10438
10439 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
10440
10441         * delegate.cs: Fixed my fix from yesterday, sorry about that.
10442
10443 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
10444
10445         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
10446         Reduced number of warnings.
10447         
10448         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
10449
10450 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
10451
10452         * driver.cs: Removed message.
10453
10454         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
10455
10456 2004-12-08    <vargaz@freemail.hu>
10457
10458         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
10459
10460 2004-12-08  Martin Baulig  <martin@ximian.com>
10461
10462         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
10463         instead of a CS3002 for properties and indexer.
10464
10465 2004-12-08  Martin Baulig  <martin@ximian.com>
10466
10467         * decl.cs (MemberName.ToString): Make this work again.
10468
10469 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
10470
10471         * attribute.cs (Resolve): Add error 591 detection.
10472
10473         * class.cs (FieldMember.Define): Add error 1547 detection.
10474         (Indexer.Define): Add error 620 detection.
10475         (Operator.Define): Add error 590 detection.
10476
10477         * ecore.cs: Missing argument for error 79.
10478
10479         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
10480         detection.
10481
10482 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
10483
10484         Fix #70106
10485         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
10486         only.
10487
10488 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
10489
10490         * cs-parser.jay : handle doc comments on implicit/explicit operators.
10491           Some operator comments were suppressed.
10492         * doc.cs : Implicit/explicit operator name in doc comments are like
10493           "op_Explicit(type)~returnType", so added suffix handling.
10494
10495 2004-12-07  Martin Baulig  <martin@ximian.com>
10496
10497         * decl.cs
10498         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
10499         (MemberCore.GetClsCompliantAttributeValue): Likewise.
10500         (DeclSpace.ec): New protected field; store the EmitContext here.
10501         (DeclSpace.EmitContext): New public property; moved here from
10502         `TypeContainer'.
10503         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
10504         EmitContext.
10505
10506         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
10507         (Enum.Emit): Don't create a new EmitContext.
10508
10509         * delegate.cs (Delegate.DefineType): Always create the
10510         EmitContext.
10511
10512         * iterators.cs (Iterators.DefineIterator): Create a new
10513         EmitContext and store it in `ec'.
10514
10515 2004-08-24  Martin Baulig  <martin@ximian.com>
10516
10517         * typemanager.cs
10518         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
10519         this for accessibility checks.
10520         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
10521         IsNestedFamilyAccessible.
10522         (TypeManager.IsSubclassOf): New method, do what the name actually
10523         says.   
10524
10525 2004-12-06  Raja R Harinath  <rharinath@novell.com>
10526
10527         Fix crash on cs0657-17.cs.
10528         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10529         Use RootContext.Tree.Types, not 'new RootTypes ()'.
10530         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
10531         the case where the NamespaceEntry gets overwritten.
10532
10533 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
10534
10535         Fixed #69195, #56821
10536         * ecore.cs (ResolveBoolean): Tiny refactoring.
10537
10538         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
10539         of right expression resolving when left is false constant and
10540         operator is LogicalAnd OR true constant and operator is LogicalOr.
10541
10542         * statement.cs (ResolveUnreachable): Always reports warning.
10543
10544 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
10545
10546         * class.cs: Distinguish between 1721 and 1722 (just a little help
10547         for the programmer).
10548
10549 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
10550
10551         * delegate.cs: Only allow this on new versions of the language. 
10552
10553 2004-12-02  Duncan Mak  <duncan@ximian.com>
10554
10555         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
10556         Expression class.
10557         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
10558         here as a static method. Take an additional bool out parameter
10559         `must_do_cs1540_check' for signaling to InstanceResolve.
10560         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
10561         member field from PropertyExpr class and made it an argument of
10562         the method instead.
10563         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
10564         check for MarshalByRefObject, and report CS0122 instead of CS1540.
10565         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
10566         and `remove_accessor' as well as InstanceResolve: report CS0122
10567         where applicable.
10568
10569         Fixes #70129.
10570
10571 2004-12-03  Raja R Harinath  <rharinath@novell.com>
10572
10573         Fix test-327.cs, test-328.cs, and put in early infrastructure
10574         for eventually fixing #52697.
10575         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
10576         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
10577         from other methods.
10578         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
10579         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
10580         (VerifyUsing, error246): Update.
10581         * rootcontext.cs (RootContext.NamespaceLookup): Just use
10582         'NamespaceEntry.LookupNamespaceOrType'.
10583
10584 2004-12-03  Martin Baulig  <martin@ximian.com>
10585
10586         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10587         method as our child, call AnonymousMethod.Compatible() on it.
10588
10589 2004-12-03  Raja R Harinath  <rharinath@novell.com>
10590
10591         Disable XML documentation support in 'basic' profile.
10592         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
10593         Redirect XmlElement to System.Object.
10594         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
10595         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
10596         * mcs.exe.sources: Add doc-bootstrap.cs.
10597         * doc-bootstrap.cs: New file.  Contains empty stub implementation
10598         of doc.cs.
10599
10600 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
10601
10602         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
10603           comments are allowed.
10604
10605 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10606
10607         * delegate.cs: Add checks for subtypes in paramaters and return values
10608         in VerifyMethod () to add support for Covariance/Contravariance
10609         in delegates.
10610         
10611 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
10612
10613         * report.cs: Remove extra closing parenthesis.
10614
10615         * convert.cs (Error_CannotImplicitConversion): If the name of the
10616         types are the same, provide some extra information.
10617
10618         * class.cs (FieldBase): Use an unused bit field from the field to
10619         encode the `has_offset' property from the FieldMember.  This saves
10620         a couple of Ks on bootstrap compilation.
10621
10622         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10623         method as our child, return the AnonymousMethod resolved
10624         expression.
10625
10626         * expression.cs (New.DoResolve): Allow return values from
10627         NewDelegate to also include AnonymousMethods.
10628
10629         Fixes #70150.
10630
10631 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
10632
10633         Fix bug #70102
10634         * attribute.cs (Resolve): Improved implementation of params
10635         attribute arguments.
10636
10637         * support.cs (ParameterData): Add HasParams to be faster.
10638
10639 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
10640
10641         all things are for /doc support:
10642
10643         * doc.cs: new file that supports XML documentation generation.
10644         * mcs.exe.sources: added doc.cs.
10645         * driver.cs:
10646           Handle /doc command line option.
10647           Report error 2006 instead of 5 for missing file name for /doc.
10648           Generate XML documentation when required, after type resolution.
10649         * cs-tokenizer.cs:
10650           Added support for picking up documentation (/// and /** ... */),
10651           including a new XmlCommentState enumeration.
10652         * cs-parser.jay:
10653           Added lines to fill Documentation element for field, constant,
10654           property, indexer, method, constructor, destructor, operator, event
10655           and class, struct, interface, delegate, enum.
10656           Added lines to warn incorrect comment.
10657         * rootcontext.cs :
10658           Added Documentation field (passed only when /doc was specified).
10659         * decl.cs:
10660           Added DocComment, DocCommentHeader, GenerateDocComment() and
10661           OnGenerateDocComment() and some supporting private members for
10662           /doc feature to MemberCore.
10663         * class.cs:
10664           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
10665         * delegate.cs:
10666           Added overriden DocCommentHeader.
10667         * enum.cs:
10668           Added overriden DocCommentHeader and GenerateDocComment().
10669
10670 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
10671
10672         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
10673         unwrapping the enumeration values, chain to
10674         DoConstantNumericPromotions again, so we can promote things to the
10675         fundamental types (takes care of enums that are bytes, sbytes).
10676
10677         Fixes bug #62054.
10678
10679 2004-12-01  Raja R Harinath  <rharinath@novell.com>
10680
10681         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
10682         Fix long-standing bug in type-lookup.  Use FindType instead of
10683         LookupType when ec.ResolvingTypeTree.
10684         (Attribute.ResolveType, Attribute.Resolve)
10685         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
10686         Update to changes.
10687         (Attributes.Search): Remove internal version.  Update.
10688         (Attributes.SearchMulti): Update.
10689         (Attributes.GetClsCompliantAttribute): Remove.
10690         (Attributes.GetIndexerNameAttribute): Remove.
10691         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
10692         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
10693         * class.cs (Indexer.Define): Likewise.
10694
10695 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
10696
10697         Fix bug #68790
10698         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
10699         MarshallByReference members access.
10700
10701         * expression.cs: Use CheckMarshallByRefAccess;
10702         Better error CS0197 message.
10703
10704         * report.cs: Print whole related error message.
10705
10706 2004-11-30  Raja R Harinath  <rharinath@novell.com>
10707
10708         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
10709         the current directory to help debugging.
10710
10711 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
10712
10713         * class (GetClassBases): Better error 60 report.
10714         (EventProperty): Disabled warning 67 detection.
10715
10716 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
10717
10718         Fix bug #60324
10719         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
10720
10721         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
10722         precise values.
10723
10724 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
10725
10726         Fix bug #49488
10727         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
10728
10729         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
10730
10731 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
10732
10733         * attribute.cs (Attribute.Resolve): Refine error reporting and
10734         report a cs0117 if the identifier does not exist, to distinguish
10735         from 0617 which is a miss-use of the actual identifier.
10736
10737         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
10738         between cs0070 and cs0079.
10739
10740         * class.cs (MemberBase.DoDefine): When reporting a wrong
10741         accessibility level, we use MethodCore to compare instead of
10742         Method (this was a regression in some refactoring effort).
10743
10744         So now we correctly report cs0056 again.
10745
10746         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
10747         testing the target_type (which was known to be object_type) and
10748         not the source type (which is anonymous_method).
10749
10750         Fixed reporting of error cs1660.
10751
10752         * expression.cs (UserCast.Source): Expose the underlying cast.
10753
10754         * statement.cs (Switch.SwitchGoverningType): Sort the list of
10755         allowed types to find a match to int32 first (most common).
10756
10757         In addition, it ignores any ImplicitUserConversions that did an
10758         internal implicit conversion (as the switch statement allows only
10759         one integral conversion to exist).
10760
10761         * class.cs (PartialContainer.Create): rename `name' to
10762         `member_name' for clarity.  Then replace the string calls with a
10763         call to MemberName.GetPartialName, as now using
10764         MemberName.ToString is an error (this is due to the side effects
10765         it had, that were fixed in the past).
10766
10767         This will restore the error reporting on a number of partial class
10768         errors that were missusing this (and getting an exception as a
10769         results, which is now just a plain textual warning, because
10770         yyparse debug output would crash otherwise).
10771
10772 2004-11-26  Raja R Harinath  <rharinath@novell.com>
10773
10774         * Makefile (PROGRAM_INSTALL_DIR): Remove.
10775
10776 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
10777
10778         * rootcontext.cs (LookupType): Make sure to cache lookups that
10779         don't give us a negative result. This saves about 5% of corlib
10780         compilation time.
10781
10782 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
10783
10784         * report.cs (AbstractMessage.Print): messages are sent to stderr
10785
10786         * class.cs (TypeContainer.GetClassBases): It is an error to have a
10787         non-interface in the list of interfaces (at this point, either
10788         parent was properly set, or a base class is being listed in the
10789         interfaces section).
10790
10791         This flags error 1722, and resolves the crash from bug 69259.
10792
10793 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
10794
10795         * statement.cs (Using.EmitExpressionFinally): make this work right
10796         for valuetypes. Fixes 69926.
10797
10798 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
10799
10800         * const.cs (Const.ChangeType): Cope with the "0 literal can be
10801         converted to an enum" here, before we try to change the underlying
10802         type.  This code exists, but it is a different code path than the
10803         one used while encoding constants.
10804
10805         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
10806         old bug: when converting from the null literal to a pointer,
10807         return an EmptyCast, not the NullLiteral.
10808
10809         This fixes #69921, the recent null_type changes probably made this
10810         bug more prominent.
10811
10812         (ImplicitReferenceConversionExists): In addition, resynchronized
10813         the code here, so it matches the same code in
10814         ImplicitReferenceConversionExists for the `from any class-type S
10815         to any interface-type T'.
10816         
10817
10818 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
10819
10820         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
10821
10822 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
10823
10824         * cs-parser.jay: Use verbosity accordingly. 
10825
10826 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
10827
10828         * expression.cs (Unary.ResolveOperator): Do not report warning;
10829         AddressOf reads from variable.
10830         
10831         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
10832
10833 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
10834
10835         Fix bug #69462
10836
10837         * attribute.cs (Attributable): Removed CheckTargets.
10838         (Attributes.Emit): Explicit attribute targets are tested here.
10839
10840         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
10841         not enabled for interfaces.
10842
10843         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
10844         (GetAssemblyName): Ouch next bug there.
10845
10846 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10847
10848         * expression.cs: Error 275 added.
10849         
10850 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
10851
10852         Fix bug #69177 (Implemented decimal constant support)
10853
10854         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
10855         (BinaryFold): Add DecimalConstant.
10856
10857         * const.cs (Define): Decimal constant 
10858         (is not constant.
10859         (ChangeType): Add decimal type handling.
10860         (LookupConstantValue): Don't set value for decimal type but
10861         emit DecimalConstantAttribute. Needed for constant optimization.
10862
10863         * constant.cs (ToDecimal): New method.
10864         (ConvertToDecimal): New method.
10865         (IntConstant): Implemented ConvertToDecimal.
10866         (DecimalConstant.Emit): Emit optimized version for decimals in
10867         int range.
10868
10869         * expression.cs (ResolveOperator): Changed order of constant
10870         reduction to work correctly with native types which have
10871         overloaded operators.
10872         (ResolveMemberAccess): Extract constant value from attribute
10873         for decimal type.
10874
10875         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
10876
10877         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
10878         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
10879         (ChangeType): Decimal is special.
10880         (TypeToCoreType): Add decimal type.
10881
10882 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
10883
10884         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
10885         decimal types.
10886
10887 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
10888
10889         * class.cs (EventField.ApplyAttributeBuilder): Fix error
10890         test cs1667-5.cs.
10891
10892 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
10893
10894         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
10895
10896         * pending.cs (PendingImplementation): Grab only interfaces.
10897
10898 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
10899
10900         * statement.cs (ForeachHelperMethods): Add location member and
10901         error 202 detection.
10902
10903 2004-11-19  Raja R Harinath  <rharinath@novell.com>
10904
10905         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
10906         automatically handled by executable.make.
10907         (PROGRAM): Make profile-specific.
10908
10909 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
10910
10911         * expression.cs (DoResolveBase): Fixed wrong warning for out
10912         variables.
10913
10914 2004-11-18  Martin Baulig  <martin@ximian.com>
10915
10916         Merged latest changes into gmcs.  Please keep this comment in
10917         here, it makes it easier for me to see what changed in MCS since
10918         the last time I merged.
10919
10920 2004-11-17  Raja R Harinath  <rharinath@novell.com>
10921
10922         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
10923         (TypeHandle.GetMemberCache): New.
10924         (TypeHandle.TypeHandle): Update.
10925         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
10926         (TypeManager.LookupParentInterfacesCache):
10927         Rename from LookupInterfaceCache.  Optimize slightly.
10928         (TypeManager.MemberLookup_FindMembers): Update.
10929         * decl.cs (MemberCache.MemberCache): Set Container to null in the
10930         multi-type variant.
10931         (AddCacheContents): Rename from AddHashtable.
10932         * class.cs (TypeContainer.parent_container): Remove.
10933         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
10934         (TypeContainer.DoDefineMembers): Don't initialize it.
10935         Update to name changes.
10936         
10937 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
10938
10939         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
10940         that factors the code to check access modifiers on override.  
10941
10942         (PropertyBase): Use the code here.
10943
10944         Patch from Lluis S'anchez, fixes bug #69361.
10945
10946 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
10947
10948         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
10949         routine that is used to report the use of a captured variable
10950         whose address has been taken.
10951
10952         There are two checks: one when variables are being captured and
10953         the other check is when the address of a variable is taken. 
10954         
10955         (because an anonymous methods might be resolved before *or* after
10956         the address has been taken) and 
10957
10958         * expression.cs (Conditional.DoResolve): Remove the special
10959         casing that Martin added to trueExpr and falseExpr being both
10960         NullLiteral.  We get the right behavior now just by introducing
10961         the null_type into the compiler. 
10962
10963         * convert.cs (ExplicitConversion): Change the code to use
10964         null_type instead of testing `expr is NullLiteral'.
10965         (ImplicitConversionStandard): use null_type too.
10966         (ImplicitReferenceConversionExists): use null_type too.
10967         (ImplicitReferenceConversion): use null_type too.
10968
10969         * literal.cs: The type of `NullLiteral' is now null_type instead
10970         of object_type. 
10971         (Resolve): Set the type here.
10972
10973         * typemanager.cs: Introduce null_type.
10974
10975 2004-11-17  Martin Baulig  <martin@ximian.com>
10976
10977         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
10978         direction, like FindMembers() does.  Fixes #69546, testcase is in
10979         test-315.cs.    
10980
10981 2004-11-16  Martin Baulig  <martin@ximian.com>
10982
10983         This is based on a patch from Marek Safar, see bug #69082.
10984         Fixes bugs #63705 and #67130.
10985
10986         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
10987         method; create a MemberCache for an interface type and cache the
10988         result.
10989
10990         * decl.cs (IMemberContainer.ParentContainer): Removed.
10991         (IMemberContainer.ParentCache): New property.
10992         (MemberCache.SetupCacheForInterface): Removed.
10993         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
10994         to create a cache for an interface's "parent".
10995
10996         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
10997         interfaces too.
10998
10999 2004-11-16  Martin Baulig  <martin@ximian.com>
11000
11001         Merged back from gmcs; these changes already went into gmcs a
11002         couple of weeks ago.
11003
11004         * typemanager.cs
11005         (TypeManager.AddUserType): Removed the `ifaces' argument.
11006         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
11007         `TypeExpr []'.
11008         (TypeManager.AddUserInterface): Removed.
11009         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
11010         `TypeExpr []'.
11011         (TypeManager.GetInterfaces): Likewise.
11012         (TypeManager.GetExplicitInterfaces): Likewise.
11013
11014         * ecore.cs (TypeExpr.GetInterfaces): Removed.
11015
11016         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
11017         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
11018
11019 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
11020
11021         * statement.cs: Avoid adding bools to a hashtable.
11022
11023 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
11024
11025         * expression.cs (Invocation.OverloadResolve): Flag error if we are
11026         calling an unsafe method from a safe location.
11027
11028 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
11029
11030         Fix #69167
11031         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
11032
11033 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
11034
11035         * namespace.cs (VerifyUsing): use GetPartialName instead of
11036         ToString. 
11037
11038 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
11039
11040         * statement.cs (Return.Resolve): Fix regression in typo: if
11041         `in_exc', we have to request a NeedReturnLabel, this was a typo
11042         introduced in the anonymous method check-in.  Fixes #69131.
11043
11044         * Indexers were using the ShortName when defining themselves,
11045         causing a regression in the compiler bootstrap when applying the
11046         patch from 2004-11-02 (first part), now they use their full name
11047         and the bug is gone.
11048
11049 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
11050
11051         * driver.cs: Strip the path from the names of embedded resources. Fixes
11052         #68519.
11053
11054 2004-11-04  Raja R Harinath  <rharinath@novell.com>
11055
11056         Fix error message regression: cs0104-2.cs.
11057         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
11058         (AliasEntry.Resolve): Update.
11059         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
11060         'silent' flag.
11061         (RootContext.LookupType): Update.
11062
11063 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
11064
11065         * cs-parser.jay: Add support for handling accessor modifiers
11066         * class: Add support port accessor modifiers and error checking,
11067         define PropertyMethod.Define as virtual (not abstract anymore)
11068         * ecore.cs: Add checking for proeprties access with access modifiers
11069         * iterators.cs: Modify Accessor constructor call based in the modified
11070         constructor
11071 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
11072
11073         * expression.cs (StringConcat): Handle being called twice,
11074         as when we have a concat in a field init with more than two
11075         ctors in the class
11076
11077 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
11078
11079         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
11080         special case explicit implementations, we should always produce
11081         the .property or .event declaration.
11082         
11083         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
11084         since it will not return correct data if people use this
11085         unresolved in the presence of using statements (see test-313).
11086
11087         * class.cs (MethodData.Define): If we are an explicit interface
11088         implementation, set the method name to the full name of the
11089         interface plus the name of the method.  
11090
11091         Notice that using the method.MethodName.GetFullName() does not
11092         work, as it will only contain the name as declared on the source
11093         file (it can be a shorthand in the presence of using statements)
11094         and not the fully qualifed type name, for example:
11095
11096         using System;
11097
11098         class D : ICloneable {
11099                 object ICloneable.Clone ()  {
11100                 }
11101         }
11102
11103         Would produce a method called `ICloneable.Clone' instead of
11104         `System.ICloneable.Clone'.
11105
11106         * namespace.cs (Alias.Resolve): Use GetPartialName.
11107         
11108 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
11109
11110         * cs-parser.jay: Add error 1055 report.
11111
11112 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
11113
11114         * assign.cs (Assign.DoResolve): Only do the transform of
11115         assignment into a New if the types are compatible, if not, fall
11116         through and let the implicit code deal with the errors and with
11117         the necessary conversions. 
11118
11119 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
11120
11121         * cs-parser.jay: Add error 1031 report.
11122
11123         * cs-tokenizer.cs: Add location for error 1038.
11124
11125 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11126
11127         * cs-parser.jay: Add error 1016 report.
11128
11129 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11130
11131         * cs-parser.jay: Add errors 1575,1611 report.
11132
11133 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11134
11135         * cs-parser.jay: Add error 1001 report.
11136
11137 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11138
11139         Fix #68850
11140         * attribute.cs (GetMarshal): Add method argument for
11141         caller identification.
11142
11143         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
11144         agument for GetMarshal and RuntimeMissingSupport.
11145
11146 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11147
11148         * attribute.cs (ExtractSecurityPermissionSet): Removed
11149         TypeManager.code_access_permission_type.
11150
11151         * typemanager.cs: Removed TypeManager.code_access_permission_type.
11152
11153 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
11154
11155         * expression.cs (LocalVariableReference.DoResolveLValue): Check
11156         for obsolete use of a variable here.   Fixes regression on errors
11157         cs0619-25 and cs0619-26.
11158
11159 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
11160
11161         Fix #62358, implemented security attribute encoding.
11162
11163         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
11164         Tests permitted SecurityAction for assembly or other types.
11165         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
11166         data from SecurityPermissionAttribute to PermisionSet class.
11167
11168         * class.cs (ApplyAttributeBuilder): Added special handling
11169         for System.Security.Permissions.SecurityAttribute based types.
11170
11171         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
11172         special handling for System.Security.Permissions.SecurityAttribute
11173         based types.
11174
11175         * enum.cs (ApplyAttributeBuilder): Added special handling
11176         for System.Security.Permissions.SecurityAttribute based types.
11177
11178         * parameter.cs (ApplyAttributeBuilder): Added special handling
11179         for System.Security.Permissions.SecurityAttribute based types.
11180
11181         * rootcontext.cs: Next 2 core types.
11182
11183         * typemanager.cs (TypeManager.security_permission_attr_type):
11184         Built in type for the SecurityPermission Attribute.
11185         (code_access_permission_type): Build in type.
11186
11187 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
11188
11189         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
11190         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
11191         all of this information into
11192         EmitContext.EmitCapturedVariableInstance.
11193         
11194         * codegen.cs (EmitCapturedVariableInstance): move here the
11195         funcionality of emitting an ldarg.0 in the presence of a
11196         remapping.   This centralizes the instance emit code.
11197
11198         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
11199         then emit a load of this: it means that we have reached the
11200         topmost ScopeInfo: the one that contains the pointer to the
11201         instance of the class hosting the anonymous method.
11202
11203         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
11204         captures to the topmost CaptureContext.
11205
11206 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
11207
11208         * expression.cs (LocalVariableReference): Move the knowledge about
11209         the iterators into codegen's EmitCapturedVariableInstance.
11210
11211 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
11212
11213         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
11214         all code paths return a value from an anonymous method (it is the
11215         same as the 161 error, but for anonymous methods).
11216
11217 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
11218
11219         The introduction of anonymous methods in the compiler changed
11220         various ways of doing things in the compiler.  The most
11221         significant one is the hard split between the resolution phase
11222         and the emission phases of the compiler.
11223
11224         For instance, routines that referenced local variables no
11225         longer can safely create temporary variables during the
11226         resolution phase: they must do so from the emission phase,
11227         since the variable might have been "captured", hence access to
11228         it can not be done with the local-variable operations from the runtime.
11229         
11230         * statement.cs 
11231
11232         (Block.Flags): New flag `IsTopLevel' to indicate that this block
11233         is a toplevel block.
11234
11235         (ToplevelBlock): A new kind of Block, these are the blocks that
11236         are created by the parser for all toplevel method bodies.  These
11237         include methods, accessors and anonymous methods.
11238
11239         These contain some extra information not found in regular blocks:
11240         A pointer to an optional CaptureContext (for tracking captured
11241         local variables and parameters).  A pointer to the parent
11242         ToplevelBlock.
11243         
11244         (Return.Resolve): Catch missmatches when returning a value from an
11245         anonymous method (error 1662).
11246         Invoke NeedReturnLabel from the Resolve phase instead of the emit
11247         phase.
11248
11249         (Break.Resolve): ditto.
11250
11251         (SwitchLabel): instead of defining the labels during the
11252         resolution phase, we now turned the public ILLabel and ILLabelCode
11253         labels into methods called GetILLabelCode() and GetILLabel() that
11254         only define the label during the Emit phase.
11255
11256         (GotoCase): Track the SwitchLabel instead of the computed label
11257         (its contained therein).  Emit the code by using
11258         SwitchLabel.GetILLabelCode ().
11259
11260         (LocalInfo.Flags.Captured): A new flag has been introduce to track
11261         whether the Local has been captured or not.
11262
11263         (LocalInfo.IsCaptured): New property, used to tell whether the
11264         local has been captured.
11265         
11266         * anonymous.cs: Vastly updated to contain the anonymous method
11267         support.
11268
11269         The main classes here are: CaptureContext which tracks any
11270         captured information for a toplevel block and ScopeInfo used to
11271         track the activation frames for various local variables.   
11272
11273         Each toplevel block has an optional capture context associated
11274         with it.  When a method contains an anonymous method both the
11275         toplevel method and the anonymous method will create a capture
11276         context.   When variables or parameters are captured, they are
11277         recorded on the CaptureContext that owns them, for example:
11278
11279         void Demo () {
11280              int a;
11281              MyDelegate d = delegate {
11282                  a = 1;
11283              }
11284         }
11285
11286         Here `a' will be recorded as captured on the toplevel
11287         CapturedContext, the inner captured context will not have anything
11288         (it will only have data if local variables or parameters from it
11289         are captured in a nested anonymous method.
11290
11291         The ScopeInfo is used to track the activation frames for local
11292         variables, for example:
11293
11294         for (int i = 0; i < 10; i++)
11295                 for (int j = 0; j < 10; j++){
11296                    MyDelegate d = delegate {
11297                         call (i, j);
11298                    }
11299                 }
11300
11301         At runtime this captures a single captured variable `i', but it
11302         captures 10 different versions of the variable `j'.  The variable
11303         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
11304         recorded on a child.  
11305
11306         The toplevel ScopeInfo will also track information like the `this'
11307         pointer if instance variables were referenced (this is necessary
11308         as the anonymous method lives inside a nested class in the host
11309         type of the method). 
11310
11311         (AnonymousMethod): Expanded to track the Toplevel, implement
11312         `AnonymousMethod.Compatible' to tell whether an anonymous method
11313         can be converted to a target delegate type. 
11314
11315         The routine now also produces the anonymous method content
11316
11317         (AnonymousDelegate): A helper class that derives from
11318         DelegateCreation, this is used to generate the code necessary to
11319         produce the delegate for the anonymous method that was created. 
11320
11321         * assign.cs: API adjustments for new changes in
11322         Convert.ImplicitStandardConversionExists.
11323
11324         * class.cs: Adjustments to cope with the fact that now toplevel
11325         blocks are of type `ToplevelBlock'. 
11326
11327         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
11328         insteda of standard blocks.
11329
11330         Flag errors if params arguments are passed to anonymous methods.
11331
11332         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
11333         `CurrentAnonymousMethod' which points to the current Anonymous
11334         Method.  The variable points to the AnonymousMethod class that
11335         holds the code being compiled.  It is set in the new EmitContext
11336         created for the anonymous method.
11337
11338         (EmitContext.Phase): Introduce a variable and an enumeration to
11339         assist in enforcing some rules about when and where we are allowed
11340         to invoke certain methods (EmitContext.NeedsReturnLabel is the
11341         only one that enfonces this right now).
11342
11343         (EmitContext.HaveCaptureInfo): new helper method that returns
11344         whether we have a CapturedContext initialized.
11345
11346         (EmitContext.CaptureVariable): New method used to register that a
11347         LocalInfo must be flagged for capturing. 
11348
11349         (EmitContext.CapturedParameter): New method used to register that a
11350         parameters must be flagged for capturing. 
11351         
11352         (EmitContext.CapturedField): New method used to register that a
11353         field must be flagged for capturing. 
11354
11355         (EmitContext.HaveCapturedVariables,
11356         EmitContext.HaveCapturedFields): Return whether there are captured
11357         variables or fields. 
11358
11359         (EmitContext.EmitMethodHostInstance): This is used to emit the
11360         instance for the anonymous method.  The instance might be null
11361         (static methods), this (for anonymous methods that capture nothing
11362         and happen to live side-by-side with the current method body) or a
11363         more complicated expression if the method has a CaptureContext.
11364
11365         (EmitContext.EmitTopBlock): Routine that drives the emission of
11366         code: it will first resolve the top block, then emit any metadata
11367         and then emit the code.  The split is done so that we can extract
11368         any anonymous methods and flag any captured variables/parameters.
11369         
11370         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
11371         during this phase, the ILGenerator should not be used as labels
11372         and local variables declared here might not be accessible to any
11373         code that is part of an anonymous method.  
11374
11375         Exceptions to this include the temporary variables that are
11376         created by some statements internally for holding temporary
11377         variables. 
11378         
11379         (EmitContext.EmitMeta): New routine, in charge of emitting all the
11380         metadata for a cb
11381
11382         (EmitContext.TemporaryReturn): This method is typically called
11383         from the Emit phase, and its the only place where we allow the
11384         ReturnLabel to be defined other than the EmitMeta.  The reason is
11385         that otherwise we would have to duplicate a lot of logic in the
11386         Resolve phases of various methods that today is on the Emit
11387         phase. 
11388
11389         (EmitContext.NeedReturnLabel): This no longer creates the label,
11390         as the ILGenerator is not valid during the resolve phase.
11391
11392         (EmitContext.EmitThis): Extended the knowledge in this class to
11393         work in anonymous methods in addition to iterators. 
11394
11395         (EmitContext.EmitCapturedVariableInstance): This emits whatever
11396         code is necessary on the stack to access the instance to a local
11397         variable (the variable will be accessed as a field).
11398
11399         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
11400         EmitContext.EmitAddressOfParameter): Routines to support
11401         parameters (not completed at this point). 
11402         
11403         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
11404         will also remove the parameters.
11405
11406         * convert.cs (Convert): Define a `ConstantEC' which points to a
11407         null.  This is just to prefity some code that uses
11408         ImplicitStandardConversion code and do not have an EmitContext
11409         handy.
11410
11411         The idea is to flag explicitly that at that point in time, it is
11412         known that the conversion will not trigger the delegate checking
11413         code in implicit conversions (which requires a valid
11414         EmitContext). 
11415
11416         Everywhere: pass new EmitContext parameter since
11417         ImplicitStandardConversionExists now requires it to check for
11418         anonymous method conversions. 
11419
11420         (Convert.ImplicitStandardConversionExists): If the type of an
11421         expression is the anonymous_method_type, and the type is a
11422         delegate, we invoke the AnonymousMethod.Compatible method to check
11423         whether an implicit conversion is possible. 
11424
11425         (Convert.ImplicitConversionStandard): Only do implicit method
11426         group conversions if the language level is not ISO_1.
11427
11428         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
11429         MethodInfo for the Invoke method.  used by Delegate and
11430         AnonymousDelegate.
11431
11432         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
11433         method conversions if the target type is a delegate.
11434
11435         Removed extra debugging nops.
11436
11437         (LocalVariableReference): Turn the `local_info' into a public
11438         field. 
11439
11440         Add `prepared' field, the same hack used for FieldExprs to cope
11441         with composed assignments, as Local variables do not necessarily
11442         operate purely on the stack as they used to: they can be captured
11443         fields. 
11444
11445         Add `temp' for a temporary result, like fields.
11446
11447         Refactor DoResolve and DoResolveLValue into DoResolveBase.
11448
11449         It now copes with Local variables that are captured and emits the
11450         proper instance variable to load it from a field in the captured
11451         case. 
11452
11453         (ParameterReference.DoResolveBase): During the resolve phase,
11454         capture parameters if we are in an anonymous method.
11455
11456         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
11457         anonymous method, use the EmitContext helper routines to emit the
11458         parameter reference.
11459
11460         * iterators.cs: Set RemapToProxy to true/false during the
11461         EmitDispose class.
11462
11463         * parameters.cs (GetParameterByName): New helper method. 
11464
11465         * typemanager.cs (anonymous_method_type) a new type that
11466         represents an anonyous method.  This is always an internal type,
11467         used as a fencepost to test against the anonymous-methodness of an
11468         expression. 
11469         
11470 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
11471
11472         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
11473         561 report.
11474         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
11475
11476 2004-10-18  Martin Baulig  <martin@ximian.com>
11477
11478         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
11479         `Type' directly, but call ResolveType() on it.
11480         (Catch.Resolve): Likewise.
11481         (Foreach.Resolve): Likewise.
11482
11483 2004-10-18  Martin Baulig  <martin@ximian.com>
11484
11485         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
11486         `Type' directly, but call ResolveType() on it.
11487         (Probe.DoResolve): Likewise.
11488         (ArrayCreation.LookupType): Likewise.
11489         (TypeOf.DoResolve): Likewise.
11490         (SizeOf.DoResolve): Likewise.
11491
11492 2004-10-18  Martin Baulig  <martin@ximian.com>
11493
11494         * expression.cs (Invocation.BetterFunction): Put back
11495         TypeManager.TypeToCoreType().
11496
11497 2004-10-18  Raja R Harinath  <rharinath@novell.com>
11498
11499         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
11500         the ResolveType.
11501
11502 2004-10-18  Martin Baulig  <martin@ximian.com>
11503
11504         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
11505         `Type' directly, but call ResolveType() on it.
11506
11507 2004-10-18  Martin Baulig  <martin@ximian.com>
11508
11509         * class.cs (FieldMember.Define): Don't access the TypeExpr's
11510         `Type' directly, but call ResolveType() on it.
11511         (MemberBase.DoDefine): Likewise.
11512
11513         * expression.cs (New.DoResolve): Don't access the TypeExpr's
11514         `Type' directly, but call ResolveType() on it.
11515         (ComposedCast.DoResolveAsTypeStep): Likewise.
11516
11517         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
11518         `Type' directly, but call ResolveType() on it.
11519
11520 2004-10-17  John Luke  <john.luke@gmail.com>
11521
11522         * class.cs (Operator.GetSignatureForError): use CSharpName
11523
11524         * parameter.cs (Parameter.GetSignatureForError): Returns
11525         correct name even if was not defined.
11526
11527 2004-10-13  Raja R Harinath  <rharinath@novell.com>
11528
11529         Fix #65816.
11530         * class.cs (TypeContainer.EmitContext): New property.
11531         (DefineNestedTypes): Create an emitcontext for each part.
11532         (MethodCore.DoDefineParameters): Use container's emitcontext.
11533         Pass type array to InternalParameters.
11534         (MemberBase.DoDefine): Use container's emitcontext.
11535         (FieldMember.Define): Likewise.
11536         (Event.Define): Likewise.
11537         (SetMethod.GetParameterInfo): Change argument to EmitContext.
11538         Pass type array to InternalParameters.
11539         (SetIndexerMethod.GetParameterInfo): Likewise.
11540         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
11541         * delegate.cs (Define): Pass emitcontext to
11542         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
11543         array to InternalParameters.
11544         * expression.cs (ParameterReference.DoResolveBase): Pass
11545         emitcontext to GetParameterInfo.
11546         (ComposedCast.DoResolveAsTypeStep): Remove check on
11547         ec.ResolvingTypeTree.
11548         * parameter.cs (Parameter.Resolve): Change argument to
11549         EmitContext.  Use ResolveAsTypeTerminal.
11550         (Parameter.GetSignature): Change argument to EmitContext.
11551         (Parameters.ComputeSignature): Likewise.
11552         (Parameters.ComputeParameterTypes): Likewise.
11553         (Parameters.GetParameterInfo): Likewise.
11554         (Parameters.ComputeAndDefineParameterTypes): Likewise.
11555         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
11556         * support.cs (InternalParameters..ctor): Remove variant that takes
11557         a DeclSpace.
11558         * typemanager.cs (system_intptr_expr): New.
11559         (InitExpressionTypes): Initialize it.
11560
11561 2004-10-12  Chris Toshok  <toshok@ximian.com>
11562
11563         * cs-parser.jay: fix location for try_statement and catch_clause.
11564
11565 2004-10-11  Martin Baulig  <martin@ximian.com>
11566
11567         * report.cs: Don't make --fatal abort on warnings, we have
11568         -warnaserror for that.
11569
11570 2004-10-07  Raja R Harinath  <rharinath@novell.com>
11571
11572         More DeclSpace.ResolveType avoidance.
11573         * decl.cs (MemberCore.InUnsafe): New property.
11574         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
11575         with newly created EmitContext.
11576         (FieldMember.Define): Likewise.
11577         * delegate.cs (Delegate.Define): Likewise.
11578         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
11579         only if normal name-lookup fails.
11580         (TypeExpr.DoResolve): Enable error-checking.
11581         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
11582         (SizeOf.DoResolve): Likewise.
11583         (ComposedCast.DoResolveAsTypeStep): Likewise.
11584         (StackAlloc.DoResolve): Likewise.
11585         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
11586         (Block.Unsafe): New property.
11587         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
11588         (Unsafe): Set 'unsafe' flag of contained block.
11589         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
11590         (Fixed.Resolve): Likewise.
11591         (Catch.Resolve): Likewise.
11592         (Using.ResolveLocalVariableDecls): Likewise.
11593         (Foreach.Resolve): Likewise.
11594
11595 2004-10-05  John Luke <john.luke@gmail.com>
11596
11597         * cs-parser.jay: add location to error CS0175
11598
11599 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
11600
11601         * ecore.cs (Expression.Constantity): Add support for turning null
11602         into a constant.
11603
11604         * const.cs (Const.Define): Allow constants to be reference types
11605         as long as the value is Null.
11606
11607 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
11608
11609         * namespace.cs (NamespaceEntry.Using): No matter which warning
11610         level is set, check if this namespace name has already been added.
11611
11612 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
11613
11614         * expression.cs: reftype [!=]= null should always use br[true,false].
11615         # 67410
11616
11617 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
11618
11619         Fix #67108
11620         * attribute.cs: Enum conversion moved to 
11621         GetAttributeArgumentExpression to be applied to the all
11622         expressions.
11623
11624 2004-10-01  Raja R Harinath  <rharinath@novell.com>
11625
11626         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
11627         * class.c (TypeContainer.DefineType): Flag error if
11628         base types aren't accessible due to access permissions.
11629         * decl.cs (DeclSpace.ResolveType): Move logic to
11630         Expression.ResolveAsTypeTerminal.
11631         (DeclSpace.ResolveTypeExpr): Thin layer over
11632         Expression.ResolveAsTypeTerminal.
11633         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
11634         Refactor code into NestedAccess.  Use it.
11635         (DeclSpace.NestedAccess): New.
11636         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
11637         argument to silence errors.  Check access permissions.
11638         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
11639         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
11640         (Cast.DoResolve): Likewise.
11641         (New.DoResolve): Likewise.
11642         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
11643         (TypeOf.DoResolve): Likewise.
11644
11645         * expression.cs (Invocation.BetterConversion): Return the Type of
11646         the better conversion.  Implement section 14.4.2.3 more faithfully.
11647         (Invocation.BetterFunction): Make boolean.  Make correspondence to
11648         section 14.4.2.2 explicit.
11649         (Invocation.OverloadResolve): Update.
11650         (Invocation): Remove is_base field.
11651         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
11652         (Invocation.Emit): Likewise.
11653
11654 2004-09-27  Raja R Harinath  <rharinath@novell.com>
11655
11656         * README: Update to changes.
11657
11658 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
11659
11660         * cs-parser.jay: Reverted 642 warning fix.
11661
11662 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11663
11664         Fix bug #66615
11665         * decl.cs (FindMemberWithSameName): Indexer can have more than
11666         1 argument.
11667
11668 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11669
11670         * expression.cs (LocalVariableReference.DoResolveLValue):
11671         Do not report warning 219 for out values.
11672         (EmptyExpression.Null): New member to avoid extra allocations.
11673
11674 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11675
11676         * cs-parser.jay: Fix wrong warning 642 report.
11677
11678         * cs-tokenizer.cs (CheckNextToken): New helper;
11679         Inspect next character if is same as expected.
11680
11681 2004-09-23  Martin Baulig  <martin@ximian.com>
11682
11683         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
11684         (Convert.ImplicitReferenceConversionExists): Likewise.
11685
11686 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11687
11688         * class.cs (Operator.Define): Add error 448 and 559 report.
11689
11690 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
11691
11692         * class.cs (MemberBase.IsTypePermitted): New protected
11693         method for checking error CS0610.
11694
11695 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
11696
11697         * class.cs (TypeContainer.HasExplicitLayout): New property
11698         Returns whether container has StructLayout attribute set Explicit.
11699         (FieldMember): New abstract class for consts and fields.
11700         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
11701         (Field): Reuse FieldMember.
11702
11703         * const.cs (Const): Reuse FieldMember.
11704
11705         * rootcontext.cs: EmitConstants call moved to class.
11706
11707 2004-09-22  Martin Baulig  <martin@ximian.com>
11708
11709         Thanks to Peter Sestoft for this bug report.
11710
11711         * expression.cs (Conditional): If both the `trueExpr' and the
11712         `falseExpr' is a NullLiteral, return a NullLiteral.
11713
11714 2004-09-22  Martin Baulig  <martin@ximian.com>
11715
11716         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
11717         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
11718         for the "get_Current" call.
11719
11720 2004-09-22  Martin Baulig  <martin@ximian.com>
11721
11722         Marek and me just fixed one of our oldest bugs: #28562 :-)
11723
11724         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
11725
11726         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
11727         we're an EnumConstant, just return that.
11728         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
11729         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
11730         to get the value which'll actually be written into the attribute.
11731         However, we have to use GetValue() to access the attribute's value
11732         in the compiler.        
11733
11734 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
11735
11736         * constant.cs (Constant.IsNegative): New abstract property
11737         IsNegative.
11738
11739         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
11740         (StackAlloc.DoResolve): Reused IsNegative.
11741
11742 2004-09-21  Martin Baulig  <martin@ximian.com>
11743
11744         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
11745         if we're used in an iterator, we may be called from different
11746         methods.
11747
11748         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
11749         we actually have an exception block.
11750
11751 2004-09-20  John Luke <jluke@cfl.rr.com>
11752
11753         * class.cs, cs-parser.jay: Improve the error report for 1520:
11754         report the actual line where the error happens, not where the
11755         class was declared.
11756
11757         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
11758         Pass location information that was available elsewhere.
11759
11760 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
11761
11762         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
11763         runtime to delay sign assemblies.
11764
11765 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
11766
11767         * cs-parser.jay: Do not report the stack trace, this is barely
11768         used nowadays.
11769
11770 2004-08-22  John Luke  <john.luke@gmail.com>
11771  
11772         * driver.cs : check that a resource id is not already used
11773         before adding it, report CS1508 if it is, bug #63637
11774
11775 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
11776
11777         * ecore.cs: Removed dead code.
11778
11779 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
11780
11781         * class.cs: Do not report warning CS0067 on the interfaces.
11782
11783 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
11784
11785         * cs-parser.jay: Add error 504 report.
11786
11787 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
11788
11789         * rootcontext.cs: WarningLevel is 4 by default now.
11790
11791         * statement.cs (Fixed.Resolve): Do not null
11792         VariableInfo.
11793
11794 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
11795
11796         Fixed bug #55780
11797         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
11798         deep search when property is not virtual.
11799         (PropertyExpr.ResolveAccessors): Make one call for both
11800         accessors.
11801
11802 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11803
11804         Fixed bug #65766
11805         * statement.cs: Error 152 report constains also location.
11806
11807 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11808
11809         Fixed bug #65766
11810         * const.cs: Explicitly set constant as static.
11811
11812 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11813
11814         Fixed bug #64226
11815         * cs-parser.jay: Add error 1017 report.
11816
11817 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11818
11819         Fixed bug #59980, #64224
11820         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
11821
11822         * typemanager.cs (IsSpecialMethod): Simplified
11823
11824 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
11825
11826         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
11827         condition with better params.
11828
11829 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
11830
11831         Fixed bug #65238
11832         * attribute.cs (Resolve): Property has to have both
11833         accessors.
11834
11835 2004-09-14  Martin Baulig  <martin@ximian.com>
11836
11837         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
11838
11839 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
11840
11841         Fixed bug #61902
11842         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
11843         called and is obsolete then this member suppress message
11844         when call is inside next [Obsolete] method or type.
11845
11846         * expression.cs: Use TestObsoleteMethodUsage member.
11847
11848 2004-09-14  Martin Baulig  <martin@ximian.com>
11849
11850         * cs-parser.jay: Sync a bit with the GMCS version.
11851
11852 2004-09-14  Martin Baulig  <martin@ximian.com>
11853
11854         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
11855         (CSharpParser.yacc_verbose_flag): New public field.
11856
11857         * genericparser.cs: Removed.
11858
11859 2004-09-14  Raja R Harinath  <rharinath@novell.com>
11860
11861         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
11862
11863 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
11864
11865         * class.cs (MethodCore.CheckBase): Fix bug #65757.
11866
11867 2004-09-10  Martin Baulig  <martin@ximian.com>
11868
11869         Backported my MemberName changes from GMCS into MCS.
11870
11871         - we are now using a special `MemberName' class instead of using
11872         strings; in GMCS, the `MemberName' also contains the type
11873         arguments.
11874
11875         - changed the grammar rules a bit:
11876           * the old `member_name' is now a `namespace_or_type_name':
11877             The rule is that we use `namespace_or_type_name' everywhere
11878             where we expect either a "member name" (GetEnumerator) or a
11879             "member name" with an explicit interface name
11880             (IEnumerable.GetEnumerator).
11881             In GMCS, the explicit interface name may include type arguments
11882             (IEnumerable<T>.GetEnumerator).
11883           * we use `member_name' instead of just `IDENTIFIER' for
11884             "member names":
11885             The rule is that we use `member_name' wherever a member may
11886             have type parameters in GMCS.       
11887
11888         * decl.cs (MemberName): New public class.
11889         (MemberCore.MemberName): New public readonly field.
11890         (MemberCore.ctor): Take a `MemberName' argument, not a string.
11891         (DeclSpace): Likewise.
11892
11893         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
11894         * enum.cs (Enum.ctor): Likewise.
11895
11896         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
11897         MemberName.     
11898         (AliasEntry.ctor): Take a MemberName, not an Expression.
11899         (AliasEntry.UsingAlias): Likewise.
11900
11901         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
11902         (IMethodData.MemberName): Changed type from string to MemberName.
11903         (MemberBase.ExplicitInterfaceName): Likewise.
11904         (AbstractPropertyEventMethod.SetupName): Make this private.
11905         (AbstractPropertyEventMethod.ctor): Added `string prefix'
11906         argument; compute the member name here.
11907         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
11908         on the `member.MemberName' and the `prefix'.
11909
11910         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
11911         not `type_name'.
11912         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
11913         thus, we get a `MemberName' instead of a `string'.  These
11914         declarations may have type parameters in GMCS.
11915         (interface_method_declaration, delegate_declaration): Likewise.
11916         (class_declaration, interface_declaration): Likewise.
11917         (method_header): Use `namespace_or_type_name' instead of
11918         `member_name'.  We may be an explicit interface implementation.
11919         (property_declaration, event_declaration): Likewise.
11920         (member_name): This is now just an `IDENTIFIER', not a
11921         `namespace_or_type_name'.
11922         (type_name, interface_type): Removed.
11923         (namespace_or_type_name): Return a MemberName, not an Expression.
11924         (primary_expression): Use `member_name' instead of `IDENTIFIER';
11925         call GetTypeExpression() on the MemberName to get an expression.
11926         (IndexerDeclaration.interface_type): Changed type from string to
11927         MemberName.
11928         (MakeName): Operate on MemberName's instead of string's.
11929
11930 2004-09-13  Raja R Harinath  <rharinath@novell.com>
11931
11932         Fix bug #55770.
11933         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
11934         (NamespaceEntry.Lookup): Add new argument to flag if we want the
11935         lookup to avoid symbols introduced by 'using'.
11936         * rootcontext.cs (NamespaceLookup): Update.
11937
11938 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
11939
11940         * class.cs (TypeContainer.DoDefineMembers): Do not call
11941         DefineDefaultConstructor for static classes.
11942
11943 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
11944
11945         * attribute.cs (Attribute.Resolve): Add error 653 report.
11946
11947         * class.cs (Class.ApplyAttributeBuilder): Add error 641
11948         report.
11949         (Method.ApplyAttributeBuilder): Add error 685 report.
11950         (Operator.Define): Add error 564 report.
11951
11952         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
11953
11954         * expression.cs (Invocation.DoResolve): Add error
11955         245 and 250 report.
11956
11957         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
11958         error 674 report.
11959
11960 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
11961
11962         * class.cs (ConstructorInitializer.Resolve):
11963         Wrong error number (515->516).
11964
11965 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
11966
11967         * class.cs (Indexer.Define): Add error 631 report.
11968
11969 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
11970
11971         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
11972
11973 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
11974
11975         * expression.cs (Probe.DoResolve): Add error CS0241 report.
11976
11977 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
11978
11979         * cs-parser.jay: Added error CS0241 report.
11980
11981 2004-09-10  Raja R Harinath  <rharinath@novell.com>
11982
11983         * cs-parser.jay (fixed_statement): Introduce a scope for the
11984         declaration in the 'fixed' statement.
11985
11986 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
11987
11988         * cs-parser.jay: Added CS0230 error report.
11989
11990 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
11991
11992         * cs-parser.jay: Added errors CS0231 and CS0257 report.
11993
11994 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
11995
11996         * expression.cs (Argument.Resolve): Added error CS0192 and
11997         CS0199 report.
11998
11999 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
12000
12001         C# 2.0 #pragma warning feature
12002
12003         * cs-tokenizer.cs (PreProcessPragma): New method; 
12004         Handles #pragma directive.
12005
12006         * report.cs (WarningRegions): New class; Support
12007         class for #pragma warning directive. It tests whether
12008         warning is enabled for a given line.
12009
12010 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
12011
12012         * const.cs: Add more descriptive error report, tahnks to
12013         Sebastien. 
12014
12015 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
12016
12017         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
12018
12019 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
12020
12021         * expression.cs: Apply patch from Ben: Remove dead code from
12022         ArrayCreation, and remove the TurnintoConstant call in const.cs,
12023         as that code just threw an exception anwyays.
12024
12025         * const.cs: Remove the call to the turnintoconstant, for details
12026         see bug: #63144
12027         
12028         * literal.cs: The type of the null-literal is the null type;  So
12029         we use a placeholder type (literal.cs:System.Null, defined here)
12030         for it.
12031
12032         * expression.cs (Conditional.DoResolve): Remove some old code that
12033         is no longer needed, conversions have been fixed.
12034
12035         (ArrayCreationExpression.DoResolve): Return false if we fail to
12036         resolve the inner expression.
12037
12038 2004-09-07  Raja R Harinath  <rharinath@novell.com>
12039
12040         Fix test-290.cs.
12041         * cs-parser.jay (delegate_declaration): Record a delegate
12042         declaration as a type declaration.
12043         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
12044
12045 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
12046
12047         * parameter.cs: Do not crash if the type can not be resolved. 
12048
12049         * expression.cs: Report errors with unsafe pointers, fixes #64896
12050
12051 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
12052
12053         * expression.cs: Pointer arith always needs to do a conv.i
12054         if the operand is a long. fix 65320
12055
12056 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
12057
12058         Fixed cs0619-37.cs, cs0619-38.cs
12059
12060         * enum.cs (GetObsoleteAttribute): Removed.
12061
12062         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
12063         on Enum member is double staged. The first is tested member
12064         and then enum.
12065
12066 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
12067
12068         Fixed #56986, #63631, #65231
12069
12070         * class.cs: (TypeContainer.AddToMemberContainer): New method,
12071         adds member to name container.
12072         (TypeContainer.AddToTypeContainer): New method, adds type to
12073         name container.
12074         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
12075         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
12076         AddOperator): Simplified by reusing AddToMemberContainer.
12077         (TypeContainer.UserDefinedStaticConstructor): Changed to property
12078         instead of field.
12079         (Method.CheckForDuplications): Fixed implementation to test all
12080         possibilities.
12081         (MemberBase): Detection whether member is explicit interface
12082         implementation is now in constructor.
12083         (MemberBase.UpdateMemberName): Handles IndexerName.
12084         (Accessor): Changed to keep also location information.
12085         (AbstractPropertyEventMethod): Is derived from MemberCore.
12086         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
12087         will be emited or not.
12088         (PropertyBase.AreAccessorsDuplicateImplementation):
12089         Tests whether accessors are not in collision with some method.
12090         (Operator): Is derived from MethodCore to simplify common
12091         operations.
12092
12093         * decl.cs (Flags.TestMethodDuplication): Test for duplication
12094         must be performed.
12095         (DeclSpace.AddToContainer): Adds the member to defined_names
12096         table. It tests for duplications and enclosing name conflicts.
12097
12098         * enum.cs (EnumMember): Clean up to reuse the base structures
12099
12100 2004-09-03  Martin Baulig  <martin@ximian.com>
12101
12102         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
12103         into TypeContainer, to make partial classes work again.
12104
12105 2004-09-03  Martin Baulig  <martin@ximian.com>
12106
12107         * rootcontext.cs (RootContext.V2): Removed.
12108
12109 2004-03-23  Martin Baulig  <martin@ximian.com>
12110
12111         * expression.cs (Invocation.OverloadResolve): Added `bool
12112         may_fail' argument and use it instead of the Location.IsNull() hack.
12113
12114 2004-09-03  Martin Baulig  <martin@ximian.com>
12115
12116         Merged latest changes into gmcs.  Please keep this comment in
12117         here, it makes it easier for me to see what changed in MCS since
12118         the last time I merged.
12119
12120 2004-09-03  Raja R Harinath  <rharinath@novell.com>
12121
12122         Fix #61128.
12123         * expression.cs (BetterConversion): Don't allow either conversion 
12124         to be null.  Remove redundant implicit conversion test when 'q ==
12125         null' -- when this function is invoked, we already know that the
12126         implicit conversion exists.
12127         (BetterFunction): Assume that 'best' is non-null.  Remove
12128         redundant reimplementation of IsApplicable when 'best' is null.
12129         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
12130         number of arguments.
12131         (IsAncestralType): Extract from OverloadResolve.
12132         (OverloadResolve): Make robust to the MethodGroupExpr being
12133         unsorted.  Implement all the logic of Section 14.5.5.1, and
12134         support overloading of methods from multiple applicable types.
12135         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
12136
12137         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
12138         (RealError, Warning): Append type of report to related symbol.
12139
12140 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
12141
12142         * enum.cs: Fixed CLS-Compliance checks for enum members.
12143         Error tests cs3008-8.cs, cs3014-8.cs
12144
12145 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
12146
12147         Fixed bug #62342, #63102
12148         * class.cs: ImplementIndexer uses member.IsExplicitImpl
12149         like ImplementMethod.
12150
12151 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
12152
12153         * attribute.cs (Attribute.GetAttributeArgumentExpression):
12154         Fixed bug #65170.
12155
12156 2004-09-02  Martin Baulig  <martin@ximian.com>
12157
12158         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
12159         TypeManager.GetArgumentTypes() rather than calling GetParameters()
12160         on the MethodBase.
12161
12162 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
12163
12164         C# 2.0 Static classes implemented
12165
12166         * class.cs (TypeContainer): instance_constructors,
12167         initialized_fields, initialized_static_fields,
12168         default_constructor, base_inteface_types are protected to be
12169         accessible from StaticClass.
12170         (TypeContainer.DefineDefaultConstructor): New virtual method
12171         for custom default constructor generating
12172         (StaticClass): New class to handle "Static classes" feature.
12173
12174         * cs-parser.jay: Handle static keyword on class like instance
12175         of StaticClass.
12176
12177         * driver.cs: Added "/langversion" command line switch with two
12178         options (iso-1, default).
12179
12180 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
12181
12182         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
12183
12184 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
12185
12186         * delegate.cs: Style.
12187
12188 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12189
12190         * delegate.cs: Add seperate instance expr field for miguel.
12191
12192 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12193
12194         * PointerArithmetic (Resolve): make sure we are not doing
12195         pointer arith on void*. Also, make sure we are resolved
12196         by not setting eclass until resolve.
12197
12198         All callers: Make sure that PointerArithmetic gets resolved.
12199
12200 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12201
12202         * ArrayCreation (LookupType): If the type does not resolve 
12203         to an array, give an error.
12204
12205 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
12206
12207         * statement.cs (Try.Resolve): Fixed bug #64222
12208
12209 2004-08-27  Martin Baulig  <martin@ximian.com>
12210
12211         * class.cs
12212         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
12213         crash here.     
12214
12215 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
12216
12217         * ecore.cs (Constantify): Get underlying type via
12218         System.Enum.GetUnderlyingType to avoid StackOverflow on the
12219         Windows in special cases.
12220
12221 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
12222
12223         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
12224         for obtaining also private methods.
12225         (GetRemoveMethod): Used GetRemoveMethod (true)
12226         for obtaining also private methods.
12227
12228 2004-08-24  Martin Baulig  <martin@ximian.com>
12229
12230         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
12231         MethodAttributes.HideBySig for operators.
12232
12233 2004-08-23  Martin Baulig  <martin@ximian.com>
12234
12235         Back to the old error reporting system :-)
12236
12237         * report.cs (Message): Removed.
12238         (Report.MessageData, ErrorData, WarningData): Removed.
12239         (Report.Error, Warning): Back to the old system.
12240
12241 2004-08-23  Martin Baulig  <martin@ximian.com>
12242
12243         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
12244
12245         * class.cs (TypeContainer.ParentContainer): New public virtual
12246         method; replaces the explicit interface implementation.
12247         (ClassPart.ParentContainer): Override.
12248
12249 2004-08-23  Martin Baulig  <martin@ximian.com>
12250
12251         * statement.cs (Switch): Added support for constant switches; see
12252         #59428 or test-285.cs.
12253
12254 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
12255
12256         Fixed bug #62740.
12257         * statement.cs (GetEnumeratorFilter): Removed useless
12258         logic because C# specs is strict. GetEnumerator must be
12259         public.
12260
12261 2004-08-22  Martin Baulig  <martin@ximian.com>
12262
12263         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12264         a switch and may break, reset the barrier.  Fixes #59867.
12265
12266 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
12267
12268         CLS-Compliance speed up (~5% for corlib)
12269
12270         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
12271         New method. Tests container for CLS-Compliant names
12272
12273         * class.cs (TypeContainer.VerifyClsName): New method.
12274         Checks whether container name is CLS Compliant.
12275         (Constructor): Implements IMethodData.
12276
12277         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
12278         low-case table for CLS Compliance test.
12279         (MemberCache.VerifyClsParameterConflict): New method.
12280         Checks method parameters for CS3006 error.
12281
12282         * enum.cs (EnumMember): Is derived from MemberCore.
12283         (Enum.VerifyClsName): Optimized for better performance.
12284
12285 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
12286
12287         * report.cs: Renamed Error_T to Error and changed all
12288         references.
12289
12290 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
12291
12292         * class.cs (TypeContainer.IndexerArrayList): New inner class
12293         container for indexers.
12294         (TypeContainer.DefaultIndexerName): New constant for default
12295         indexer name. Replaced all "Item" with this constant.
12296         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
12297
12298         * typemanager.cs (TypeManager.default_member_ctor): Cache here
12299         DefaultMemberAttribute constructor.
12300
12301 2004-08-05  Martin Baulig  <martin@ximian.com>
12302
12303         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
12304         Fix bug #59429.
12305
12306 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
12307
12308         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
12309         multi platforms problem.
12310
12311         * compiler.csproj: Included shared files.
12312
12313 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
12314
12315         Fix bug 60333, 55971 in the more general way
12316         * attribute.cs (Attribute.GetAttributeArgumentExpression):
12317         Added arg_type argument for constant conversion.
12318         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
12319
12320 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
12321
12322         Fix bug #59760
12323         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
12324         OperatorArrayList, MethodCoreArrayList for typecontainer
12325         containers. Changed class member types to these new types.
12326         (MethodArrayList.DefineMembers): Added test for CS0659.
12327
12328 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
12329
12330         * cfold.cs: Synchronize the folding with the code in expression.cs
12331         Binary.DoNumericPromotions for uint operands.
12332
12333         * attribute.cs: Revert patch from Raja, it introduced a regression
12334         while building Blam-1.2.1 (hard to isolate a test case).
12335
12336 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
12337
12338         Fix for #55382
12339         * class.cs:
12340         (TypeContainer.Define): Renamed to DefineContainerMembers because of
12341         name collision.
12342         (MethodCore.parent_method): New member. The method we're overriding
12343         if this is an override method.
12344         (MethodCore.CheckBase): Moved from Method class and made common.
12345         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
12346         private.
12347         (MethodCore.CheckForDuplications): New abstract method. For custom
12348         member duplication search in a container
12349         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
12350         method and its return type.
12351         (Event.conflict_symbol): New member. Symbol with same name in the
12352         parent class.
12353
12354         * decl.cs:
12355         (MemberCache.FindMemberWithSameName): New method. The method
12356         is looking for conflict with inherited symbols.
12357
12358 2004-08-04  Martin Baulig  <martin@ximian.com>
12359
12360         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
12361
12362         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
12363
12364 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
12365
12366         * report.cs (Message): New enum for better error, warning reference in
12367         the code.
12368         (MessageData): New inner abstract class. It generally handles printing of
12369         error and warning messages.
12370         Removed unused Error, Warning, Message methods.
12371
12372 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
12373
12374         Fix for cs0592-8.cs test
12375         * attribute.cs
12376         (Attributable.ValidAttributeTargets): Made public.
12377         (Attribute.ExplicitTarget): New member for explicit target value.
12378         (Attribute.CheckTargets): Now we translate explicit attribute
12379         target to Target here.
12380
12381 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
12382
12383         * ecore.cs (MethodGroupExpr): new IsBase property.
12384
12385         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
12386
12387         * delegate.cs (DelegateCreation): store a MethodGroupExpr
12388         rather than an instance expr.
12389
12390         (DelegateCreation.Emit): Use the method group rather than
12391         the instance expression. Also, if you have base.Foo as the
12392         method for a delegate, make sure to emit ldftn, not ldftnvirt.
12393
12394         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
12395
12396         (NewDelegate.DoResolve): Only check for the existance of Invoke
12397         if the method is going to be needed. Use MethodGroupExpr.
12398
12399         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
12400
12401         * expression.cs: For pointer arith., make sure to use
12402         the size of the type, not the size of the pointer to
12403         the type.
12404
12405 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
12406
12407         Fix for #60722
12408         * class.cs (Class): Added error CS0502 test.
12409
12410 2004-08-03  John Luke  <jluke@cfl.rr.com>
12411             Raja R Harinath  <rharinath@novell.com>
12412
12413         Fix for #60997.
12414         * attribute.cs (Attribute.complained_before): New flag.
12415         (Attribute.ResolveType, Attribute.Resolve),
12416         (Attribute.DefinePInvokeMethod): Set it.
12417         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
12418         
12419 2004-08-03  Martin Baulig  <martin@ximian.com>
12420
12421         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
12422         use a user-defined operator; we still need to do numeric
12423         promotions in case one argument is a builtin type and the other
12424         one has an implicit conversion to that type.  Fixes #62322.
12425
12426 2004-08-02  Martin Baulig  <martin@ximian.com>
12427
12428         * statement.cs (LocalInfo.Flags): Added `IsThis'.
12429         (LocalInfo.IsThis): New public property.
12430         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
12431
12432 2004-08-01  Martin Baulig  <martin@ximian.com>
12433
12434         * class.cs (TypeContainer.GetClassBases): Don't set the default
12435         here since we may get called from GetPartialBases().
12436         (TypeContainer.DefineType): If GetClassBases() didn't return a
12437         parent, use the default one.
12438
12439 2004-07-30  Duncan Mak  <duncan@ximian.com>
12440
12441         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
12442
12443 2004-07-30  Martin Baulig  <martin@ximian.com>
12444
12445         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
12446
12447         * class.cs (SourceMethod): New public class, derive from the
12448         symbol writer's ISourceMethod.
12449         (Method): Use the new symbol writer API.
12450
12451         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
12452         as argument and use the new symbol writer.
12453
12454         * location.cs
12455         (SourceFile): Implement the symbol writer's ISourceFile.
12456         (Location.SymbolDocument): Removed.
12457         (Location.SourceFile): New public property.
12458
12459         * symbolwriter.cs: Use the new symbol writer API.
12460
12461 2004-07-30  Raja R Harinath  <rharinath@novell.com>
12462
12463         * Makefile (install-local): Remove.  Functionality moved to
12464         executable.make.
12465
12466 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
12467
12468         * Makefile: Install mcs.exe.config file together with mcs.exe.
12469         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
12470         correct runtime version.
12471         
12472 2004-07-25  Martin Baulig  <martin@ximian.com>
12473
12474         * class.cs
12475         (TypeContainer.RegisterOrder): Removed, this was unused.
12476         (TypeContainer, interface_order): Removed.
12477         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
12478         TypeContainer as argument since we can also be called with a
12479         `PartialContainer' for a partial class/struct/interface.
12480         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
12481         of checking whether we're an `Interface' - we could be a
12482         `PartialContainer'.
12483         (PartialContainer.Register): Override; call
12484         AddClass()/AddStruct()/AddInterface() on our parent.
12485
12486         * cs-parser.jay (interface_member_declaration): Add things to the
12487         `current_container', not the `current_class'.
12488
12489         * rootcontext.cs (RegisterOrder): The overloaded version which
12490         takes an `Interface' was unused, removed.
12491
12492         * typemanager.cs (TypeManager.LookupInterface): Return a
12493         `TypeContainer', not an `Interface'.
12494         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
12495         contain a `PartialContainer' for an interface, so check it's
12496         `Kind' to figure out what it is.
12497
12498 2004-07-25  Martin Baulig  <martin@ximian.com>
12499
12500         * class.cs (Class.DefaultTypeAttributes): New public constant.
12501         (Struct.DefaultTypeAttributes): Likewise.
12502         (Interface.DefaultTypeAttributes): Likewise.
12503         (PartialContainer.TypeAttr): Override this and add the
12504         DefaultTypeAttributes.
12505
12506 2004-07-25  Martin Baulig  <martin@ximian.com>
12507
12508         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
12509         we can just use the `Parent' field instead.
12510
12511 2004-07-25  Martin Baulig  <martin@ximian.com>
12512
12513         * class.cs (TypeContainer.Emit): Renamed to EmitType().
12514
12515 2004-07-25  Martin Baulig  <martin@ximian.com>
12516
12517         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
12518         our parts before defining any methods.
12519         (TypeContainer.VerifyImplements): Make this virtual.
12520         (ClassPart.VerifyImplements): Override and call VerifyImplements()
12521         on our PartialContainer.
12522
12523 2004-07-25  Martin Baulig  <martin@ximian.com>
12524
12525         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
12526
12527         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
12528         argument, we can just use the `Parent' field instead.
12529
12530         * class.cs
12531         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
12532         (MemberBase.DoDefine): Likewise.
12533
12534 2004-07-24  Martin Baulig  <martin@ximian.com>
12535
12536         * decl.cs (MemberCore.Parent): New public field.
12537         (DeclSpace.Parent): Moved to MemberCore.
12538
12539         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
12540         (MemberBase.ctor): Added TypeContainer argument, pass it to our
12541         parent's .ctor.
12542         (FieldBase, Field, Operator): Likewise.
12543         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
12544         (EventField, Event): Likewise.
12545
12546 2004-07-23  Martin Baulig  <martin@ximian.com>
12547
12548         * class.cs (PartialContainer): New public class.
12549         (ClassPart): New public class.
12550         (TypeContainer): Added support for partial classes.
12551         (TypeContainer.GetClassBases): Splitted some of the functionality
12552         out into GetNormalBases() and GetPartialBases().
12553
12554         * cs-tokenizer.cs (Token.PARTIAL): New token.
12555         (Tokenizer.consume_identifier): Added some hacks to recognize
12556         `partial', but only if it's immediately followed by `class',
12557         `struct' or `interface'.
12558
12559         * cs-parser.jay: Added support for partial clases.
12560
12561 2004-07-23  Martin Baulig  <martin@ximian.com>
12562
12563         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
12564         a `DeclSpace' and also made it readonly.
12565         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
12566         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
12567         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
12568
12569         * cs-parser.jay: Pass the `current_class', not the
12570         `current_container' (at the moment, this is still the same thing)
12571         to a new Method, Property, Event, Indexer or Constructor.
12572
12573 2004-07-23  Martin Baulig  <martin@ximian.com>
12574
12575         * cs-parser.jay (CSharpParser): Added a new `current_class' field
12576         and removed the `current_interface' one.
12577         (struct_declaration, class_declaration, interface_declaration):
12578         Set `current_class' to the newly created class/struct/interface;
12579         set their `Bases' and call Register() before parsing their body.
12580
12581 2004-07-23  Martin Baulig  <martin@ximian.com>
12582
12583         * class.cs (Kind): New public enum.
12584         (TypeContainer): Made this class abstract.
12585         (TypeContainer.Kind): New public readonly field.
12586         (TypeContainer.CheckDef): New public method; moved here from
12587         cs-parser.jay.
12588         (TypeContainer.Register): New public abstract method.
12589         (TypeContainer.GetPendingImplementations): New public abstract
12590         method.
12591         (TypeContainer.GetClassBases): Removed the `is_class' and
12592         `is_iface' parameters.
12593         (TypeContainer.DefineNestedTypes): Formerly known as
12594         DoDefineType().
12595         (ClassOrStruct): Made this class abstract.
12596
12597         * tree.cs (RootTypes): New public type. 
12598
12599 2004-07-20  Martin Baulig  <martin@ximian.com>
12600
12601         * tree.cs (Tree.RecordNamespace): Removed.
12602         (Tree.Namespaces): Removed.
12603
12604         * rootcontext.cs (RootContext.IsNamespace): Removed.
12605
12606         * cs-parser.jay (namespace_declaration): Just create a new
12607         NamespaceEntry here.
12608
12609 2004-07-20  Martin Baulig  <martin@ximian.com>
12610
12611         * statement.cs (ExceptionStatement): New abstract class.  This is
12612         now used as a base class for everyone who's using `finally'.
12613         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
12614         our local variables before using them.
12615
12616         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
12617         virtual method.  This is used by Yield.Resolve() to "steal" an
12618         outer block's `finally' clauses.
12619         (FlowBranchingException): The .ctor now takes an ExceptionStatement
12620         argument.
12621
12622         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
12623         version which takes an ExceptionStatement.  This version must be
12624         used to create exception branchings.
12625
12626         * iterator.cs
12627         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
12628         (Iterator.EmitMoveNext): Added exception support; protect the
12629         block with a `fault' clause, properly handle 'finally' clauses.
12630         (Iterator.EmitDispose): Run all the `finally' clauses here.
12631
12632 2004-07-20  Martin Baulig  <martin@ximian.com>
12633
12634         * iterator.cs: This is the first of a set of changes in the
12635         iterator code.  Match the spec more closely: if we're an
12636         IEnumerable, then GetEnumerator() must be called.  The first time
12637         GetEnumerator() is called, it returns the current instance; all
12638         subsequent invocations (if any) must create a copy.
12639
12640 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
12641
12642         * expression.cs: Resolve the constant expression before returning
12643         it. 
12644
12645 2004-07-19  Martin Baulig  <martin@ximian.com>
12646
12647         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
12648         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
12649         the return type of the new EmitContext.
12650
12651 2004-07-18  Martin Baulig  <martin@ximian.com>
12652
12653         * class.cs (Property.Define): Fix iterators.
12654
12655         * iterators.cs (Iterator.Define): Moved the
12656         `container.AddInterator (this)' call here from the .ctor; only do
12657         it if we resolved successfully.
12658
12659 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
12660
12661         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
12662         `true' for preprocessing directives that we parse.  The return
12663         value indicates whether we should return to regular tokenizing or
12664         not, not whether it was parsed successfully.
12665
12666         In the past if we were in: #if false ... #line #endif, we would
12667         resume parsing after `#line'.  See bug 61604.
12668
12669         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
12670         building: IsEnumType should return true only for enums, not for
12671         enums or System.Enum itself.  This fixes #61593.
12672
12673         Likely what happened is that corlib was wrong: mcs depended on
12674         this bug in some places.  The bug got fixed, we had to add the
12675         hack, which caused bug 61593.
12676
12677         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
12678         that was a workaround for the older conditions.
12679
12680 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
12681
12682         * assign.cs: IAssignMethod has a new interface, as documented
12683         inline. All assignment code now uses this new api.
12684
12685         * ecore.cs, expression.cs: All classes which implement
12686         IAssignMethod now use the new interface.
12687
12688         * expression.cs (Invocation): add a hack to EmitCall so that
12689         IndexerAccess can be the target of a compound assignment without
12690         evaluating its arguments twice.
12691
12692         * statement.cs: Handle changes in Invocation api.
12693
12694 2004-07-16  Martin Baulig  <martin@ximian.com>
12695
12696         * iterators.cs: Rewrote this.  We're now using one single Proxy
12697         class for both the IEnumerable and the IEnumerator interface and
12698         `Iterator' derives from Class so we can use the high-level API.
12699
12700         * class.cs (TypeContainer.AddIterator): New method.
12701         (TypeContainer.DoDefineType): New protected virtual method, which
12702         is called from DefineType().
12703         (TypeContainer.DoDefineMembers): Call DefineType() and
12704         DefineMembers() on all our iterators.
12705         (TypeContainer.Emit): Call Emit() on all our iterators.
12706         (TypeContainer.CloseType): Call CloseType() on all our iterators.
12707
12708         * codegen.cs (EmitContext.CurrentIterator): New public field.
12709
12710 2004-07-15  Martin Baulig  <martin@ximian.com>
12711
12712         * typemanager.cs
12713         (TypeManager.not_supported_exception_type): New type.   
12714
12715 2004-07-14  Martin Baulig  <martin@ximian.com>
12716
12717         * iterators.cs: Use real error numbers.
12718
12719 2004-07-14  Martin Baulig  <martin@ximian.com>
12720
12721         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
12722         requires this to be a System.Collection.IEnumerable and not a
12723         class implementing that interface.
12724         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
12725
12726 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
12727
12728         * class.cs: Fixed previous fix, it broke some error tests.
12729
12730 2004-07-12  Martin Baulig  <martin@ximian.com>
12731
12732         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
12733         Fixes #61293.
12734
12735 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
12736
12737         * assign.cs (LocalTemporary): Add new argument: is_address,If
12738         `is_address' is true, then the value that we store is the address
12739         to the real value, and not the value itself.
12740         
12741         * ecore.cs (PropertyExpr): use the new local temporary
12742         stuff to allow us to handle X.Y += z (where X is a struct)
12743
12744 2004-07-08  Martin Baulig  <martin@ximian.com>
12745
12746         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
12747         not always return, just like we're doing in Using.Resolve().
12748
12749 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
12750
12751         * cs-parser.jay (fixed_statement): flag this as Pinned.
12752
12753 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
12754
12755         * typemanager.cs (TypeManager): Removed MakePinned method, this
12756         mechanism is replaced with the .NET 2.x compatible mechanism of
12757         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
12758
12759         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
12760         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
12761         `IsFixed' property which has a different meaning.
12762
12763 2004-07-02  Raja R Harinath  <rharinath@novell.com>
12764
12765         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
12766         visible from inside a nested class, not just the names of the
12767         immediately enclosing class.
12768         Fix for bug #60730.
12769
12770 2004-06-24  Raja R Harinath  <rharinath@novell.com>
12771
12772         * expression.cs (BetterConversion): Remove buggy special-case
12773         handling of "implicit constant expression conversions".  At this
12774         point, we already know that the conversion is possible -- we're
12775         only checking to see which is better.
12776
12777 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12778
12779         * cs-parser.jay: Added error CS0210 test.
12780
12781 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12782
12783         * cs-parser.jay: Added error CS0134 test.
12784
12785 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12786
12787         Fix bug #52507
12788         * cs-parser.jay: Added error CS0145 test.
12789
12790 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12791
12792         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
12793
12794 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
12795         
12796         * expression.cs (StackAlloc.Resolve): The argument may not
12797         be a constant; deal with this case.
12798         
12799 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
12800
12801         * attribute.cs (IndexerName_GetIndexerName): Renamed to
12802         GetIndexerAttributeValue.
12803         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
12804
12805         * class.cs (Indexer.Define): Added error tests for CS0415,
12806         CS0609.
12807
12808 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
12809
12810         * attribute.cs (Attribute.Resolve): Keep field code in sync with
12811         property code.
12812
12813 2004-06-23  Martin Baulig  <martin@ximian.com>
12814
12815         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
12816         neither return nor throw, reset the barrier as well.  Fixes #60457.
12817
12818 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
12819
12820         * class.cs : EventAttributes is now set to None by default.
12821           This fixes bug #60459.
12822
12823 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
12824
12825         Fix bug #60219
12826         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
12827         Don't throw exception but return null (it's sufficient now).
12828
12829 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
12830
12831         * typemanager.cs (GetArgumentTypes): Faster implementation.
12832
12833 2004-06-18  Martin Baulig  <martin@ximian.com>
12834
12835         * attribute.cs (Attribute.Resolve): Check whether we're an
12836         EmptyCast which a Constant child.  Fixes #60333.
12837
12838 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
12839
12840         * statement.cs (EmitCollectionForeach): Account for the fact that
12841         not all valuetypes are in areas which we can take the address of.
12842         For these variables, we store to a temporary variable. Also, make
12843         sure that we dont emit a `callvirt' on a valuetype method.
12844
12845 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
12846
12847         * expression.cs (StackAlloc.DoReSolve): Added test for
12848         negative parameter (CS0247).
12849
12850 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
12851
12852         Fix bug #59792
12853         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
12854
12855 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
12856
12857         Fix bug #59781
12858         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
12859         ulong.
12860
12861 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
12862
12863         Fix bug #58254 & cs1555.cs, cs1556.cs
12864         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
12865
12866 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
12867
12868         * cs-parser.jay: Added error CS1669 test for indexers.
12869
12870 2004-06-11  Martin Baulig  <martin@ximian.com>
12871
12872         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
12873         call this twice: for params and varargs methods.
12874
12875 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12876
12877         * class.cs:
12878         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
12879
12880 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12881
12882         * attribute.cs (Attribute.GetValidTargets): Made public.
12883
12884         * class.cs: 
12885         (AbstractPropertyEventMethod): New class for better code sharing.
12886         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
12887         CS1667 report.
12888         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
12889
12890 2004-06-11  Raja R Harinath  <rharinath@novell.com>
12891
12892         Fix bug #59477.
12893         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
12894         that the call to Resolve is part of a MemberAccess.
12895         (Expression.Resolve): Use it for SimpleName resolution.
12896         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
12897         Add 'intermediate' boolean argument.
12898         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
12899         error message when the SimpleName can be resolved ambiguously
12900         between an expression and a type.
12901         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
12902         public.
12903         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
12904         call on the left-side.
12905
12906 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12907
12908         * class.cs:
12909         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
12910
12911 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12912
12913         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
12914
12915 2004-06-11  Martin Baulig  <martin@ximian.com>
12916
12917         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
12918         varargs methods if applicable.
12919
12920 2004-06-11  Martin Baulig  <martin@ximian.com>
12921
12922         * expression.cs (Invocation.EmitCall): Don't use
12923         `method.CallingConvention == CallingConventions.VarArgs' since the
12924         method could also have `CallingConventions.HasThis'.
12925
12926 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12927
12928         * class.cs (Event.GetSignatureForError): Implemented.
12929         Fixed crash in error test cs3010.cs
12930
12931 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
12932
12933         * cs-tokenizer.cs: Change the way we track __arglist to be
12934         consistent with the other keywords.
12935
12936 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
12937
12938         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
12939         tomorrow.
12940
12941 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
12942
12943         * codegen.cs: Check that all referenced assemblies have a strongname
12944         before strongnaming the compiled assembly. If not report error CS1577.
12945         Fix bug #56563. Patch by Jackson Harper.
12946         * typemanager.cs: Added a method to return all referenced assemblies.
12947         Fix bug #56563. Patch by Jackson Harper.
12948
12949 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
12950
12951         * class.cs:
12952         (Method.ApplyAttributeBuilder): Moved and added conditional
12953         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
12954
12955         * delegate.cs:
12956         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
12957
12958 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
12959
12960         Fixed #59640
12961         * class.cs: (EventField.attribute_targets): Changed default target.
12962
12963 2004-06-08  Martin Baulig  <martin@ximian.com>
12964
12965         * expression.cs (Invocation.EmitCall): Enable varargs methods.
12966
12967 2004-06-08  Martin Baulig  <martin@ximian.com>
12968
12969         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
12970
12971 2004-06-07  Martin Baulig  <martin@ximian.com>
12972
12973         Added support for varargs methods.
12974
12975         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
12976         keyword.
12977
12978         * cs-parser.jay: Added support for `__arglist'.
12979
12980         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
12981
12982         * expression.cs (Argument.AType): Added `ArgList'.
12983         (Invocation): Added support for varargs methods.
12984         (ArglistAccess): New public class.
12985         (Arglist): New public class.
12986
12987         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
12988
12989         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
12990         a method's top-level block if the method has varargs.
12991
12992         * support.cs (ReflectionParameters, InternalParameters): Added
12993         support for varargs methods.    
12994
12995 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
12996
12997         * class.cs: Provide location in indexer error report.
12998
12999         * driver.cs: Use standard names.
13000
13001         * namespace.cs: Catch the use of using after a namespace has been
13002         declared also on using aliases.
13003
13004 2004-06-03  Raja R Harinath  <rharinath@novell.com>
13005
13006         Bug #50820.
13007         * typemanager.cs (closure_private_ok, closure_invocation_type)
13008         (closure_qualifier_type, closure_invocation_assembly)
13009         (FilterWithClosure): Move to ...
13010         (Closure): New internal nested class.
13011         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
13012         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
13013         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
13014         (MemberLookup, MemberLookupFailed): Use it.
13015         * expression.cs (New.DoResolve): Treat the lookup for the
13016         constructor as being qualified by the 'new'ed type.
13017         (Indexers.GetIndexersForTypeOrInterface): Update.
13018
13019 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
13020
13021         * attribute.cs
13022         (GetConditionalAttributeValue): New method. Returns
13023         condition of ConditionalAttribute.
13024         (SearchMulti): New method.  Returns all attributes of type 't'.
13025         Use it when attribute is AllowMultiple = true.
13026         (IsConditionalMethodExcluded): New method.
13027
13028         * class.cs
13029         (Method.IsExcluded): Implemented. Returns true if method has conditional
13030         attribute and the conditions is not defined (method is excluded).
13031         (IMethodData): Extended interface for ConditionalAttribute support.
13032         (PropertyMethod.IsExcluded): Implemented.
13033
13034         * decl.cs
13035         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
13036
13037         * expression.cs
13038         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
13039         on the method.
13040
13041 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13042
13043         * expression.cs (ArrayCreationExpression): Make this just an
13044         `expression'. It can't be a statement, so the code here was
13045         dead.
13046
13047 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
13048
13049         Fixed #59072
13050         * typemanager.cs (GetFullNameSignature): New method for
13051         MethodBase types.
13052
13053 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
13054
13055         Fixed #56452
13056         * class.cs (MemberBase.GetSignatureForError): New virtual method.
13057         Use this method when MethodBuilder is null.
13058         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
13059         Added test for error CS0626 (MONO reports error for this situation).
13060         (IMethodData.GetSignatureForError): Extended interface.
13061
13062 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
13063
13064         * attribute.cs
13065         (AttributeTester.GetObsoleteAttribute): Returns instance of
13066         ObsoleteAttribute when type is obsolete.
13067
13068         * class.cs
13069         (TypeContainer.VerifyObsoleteAttribute): Override.
13070         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
13071         (MethodCode.VerifyObsoleteAttribute): Override.
13072         (MemberBase.VerifyObsoleteAttribute): Override.
13073
13074         * decl.cs
13075         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
13076         and report proper error.
13077
13078         *delegate.cs
13079         Delegate.VerifyObsoleteAttribute): Override.
13080
13081         * ecore.cs
13082         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
13083         and report proper error.
13084         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
13085
13086         * enum.cs
13087         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
13088         and enum member.
13089
13090         * expression.cs
13091         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
13092         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
13093         Added test for ObsoleteAttribute.
13094
13095         * statement.cs
13096         (Catch): Derived from Statement.
13097
13098 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
13099  
13100         Fixed bug #59071 & cs0160.cs
13101  
13102         * statement.cs (Try.Resolve): Check here whether order of catch
13103         clauses matches their dependencies.
13104
13105 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
13106
13107         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
13108         caused a regression: #59343.  Referencing nested classes from an
13109         assembly stopped working.
13110
13111 2004-05-31  Martin Baulig  <martin@ximian.com>
13112
13113         MCS is now frozen for beta 2.
13114
13115 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13116
13117         * convert.cs: add a trivial cache for overload operator resolution.
13118
13119 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13120
13121         * decl.cs: If possible, use lookuptypedirect here. We can only do
13122         this if there is no `.' after the namespace. Avoids using
13123         LookupType, which does lots of slow processing.
13124         (FindNestedType) New method, does what it says :-).
13125         * namespace.cs: use LookupTypeDirect.
13126         * rootcontext.cs: use membercache, if possible.
13127         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
13128
13129 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13130
13131         * expression.cs:
13132         According to the spec, 
13133
13134         In a member access of the form E.I, if E is a single identifier,
13135         and if the meaning of E as a simple-name (§7.5.2) is a constant,
13136         field, property, localvariable, or parameter with the same type as
13137         the meaning of E as a type-name (§3.8), then both possible
13138         meanings of E are permitted.
13139
13140         We did not check that E as a simple-name had the same type as E as
13141         a type name.
13142
13143         This trivial check gives us 5-7% on bootstrap time.
13144
13145 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13146
13147         * expression.cs (Invocation.OverloadResolve): Avoid the
13148         use of hashtables and boxing here by allocating on demand.
13149
13150 2004-05-30  Martin Baulig  <martin@ximian.com>
13151
13152         * rootcontext.cs (RootContext.LookupType): Don't cache things if
13153         we're doing a silent lookup.  Don't try to lookup nested types in
13154         TypeManager.object_type (thanks to Ben Maurer).
13155
13156 2004-05-30  Martin Baulig  <martin@ximian.com>
13157
13158         Committing a patch from Ben Maurer.
13159
13160         * rootcontext.cs (RootContext.LookupType): Cache negative results.
13161
13162 2004-05-29  Martin Baulig  <martin@ximian.com>
13163
13164         * class.cs (IMethodData.ShouldIgnore): New method.
13165
13166         * typemanager.cs (TypeManager.MethodFlags): Don't take a
13167         `Location' argument, we don't need it anywhere.  Use
13168         `IMethodData.ShouldIgnore ()' instead of
13169         `MethodData.GetMethodFlags ()'.
13170         (TypeManager.AddMethod): Removed.
13171         (TypeManager.AddMethod2): Renamed to AddMethod.
13172
13173 2004-05-29  Martin Baulig  <martin@ximian.com>
13174
13175         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
13176
13177         * convert.cs (Convert.ImplicitReferenceConversion): If we're
13178         converting from a class type S to an interface type and we already
13179         have an object on the stack, don't box it again.  Fixes #52578.
13180
13181 2004-05-29  Martin Baulig  <martin@ximian.com>
13182
13183         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
13184         Added support for `params' parameters.  Fixes #59267.
13185
13186 2004-05-29  Martin Baulig  <martin@ximian.com>
13187
13188         * literal.cs (NullPointer): Provide a private .ctor which sets
13189         `type' to TypeManager.object_type.  Fixes #59048.
13190
13191 2004-05-29  Martin Baulig  <martin@ximian.com>
13192
13193         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
13194         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
13195
13196         * ecore.cs (EventExpr.instance_expr): Make the field private.
13197
13198 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
13199
13200         Fixed bug #50080 & cs0214-2.cs
13201         * expression.cs (Cast.DoResolve): Check unsafe context here.
13202         
13203         * statement.cs (Resolve.DoResolve): Likewise.
13204
13205 2004-05-26  Martin Baulig  <martin@ximian.com>
13206
13207         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
13208
13209         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
13210         (RootContext.LookupType): Pass down the `silent' flag.
13211
13212 2004-05-25  Martin Baulig  <martin@ximian.com>
13213
13214         * expression.cs
13215         (MethodGroupExpr.IdenticalTypeName): New public property.
13216         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
13217         expression actually refers to a type.
13218
13219 2004-05-25  Martin Baulig  <martin@ximian.com>
13220
13221         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
13222         for #56176 and made it actually work.
13223
13224 2004-05-25  Martin Baulig  <martin@ximian.com>
13225
13226         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
13227         (FieldExpr, PropertyExpr): Override and implement
13228         CacheTemporaries.  Fixes #52279.
13229
13230 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
13231
13232         * location.cs: In the new compiler listing a file twice is a
13233         warning, not an error.
13234
13235 2004-05-24  Martin Baulig  <martin@ximian.com>
13236
13237         * enum.cs (Enum.DefineType): For the `BaseType' to be a
13238         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
13239
13240 2004-05-24  Martin Baulig  <martin@ximian.com>
13241
13242         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
13243         walking the `using' list.  Fixes #53921.
13244
13245 2004-05-24  Martin Baulig  <martin@ximian.com>
13246
13247         * const.cs (Const.LookupConstantValue): Added support for
13248         EmptyCast's; fixes #55251.
13249
13250 2004-05-24  Martin Baulig  <martin@ximian.com>
13251
13252         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
13253         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
13254         which does the CS0135 check.  The reason is that we first need to
13255         check whether the variable actually exists.
13256
13257 2004-05-24  Martin Baulig  <martin@ximian.com>
13258
13259         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
13260         than RootContext.LookupType() to find the explicit interface
13261         type.  Fixes #58584.
13262
13263 2004-05-24  Raja R Harinath  <rharinath@novell.com>
13264
13265         * Makefile: Simplify.  Use executable.make.
13266         * mcs.exe.sources: New file.  List of sources of mcs.exe.
13267
13268 2004-05-24  Anders Carlsson  <andersca@gnome.org>
13269
13270         * decl.cs:
13271         * enum.cs:
13272         Use the invariant culture when doing String.Compare for CLS case
13273         sensitivity.
13274         
13275 2004-05-23  Martin Baulig  <martin@ximian.com>
13276
13277         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
13278         don't have any dots.  Fixes #52622, added cs0246-8.cs.
13279
13280         * namespace.cs (NamespaceEntry.Lookup): Likewise.
13281         
13282 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
13283
13284         * class.cs (MemberBase.Define): Reuse MemberType member for 
13285         resolved type. Other methods can use it too.
13286
13287 2004-05-23  Martin Baulig  <martin@ximian.com>
13288
13289         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
13290         the variable also exists in the current block (otherwise, we need
13291         to report a CS0103).  Fixes #58670.
13292
13293 2004-05-23  Martin Baulig  <martin@ximian.com>
13294
13295         * flowanalysis.cs (Reachability.Reachable): Compute this
13296         on-the-fly rather than storing it as a field.
13297
13298 2004-05-23  Martin Baulig  <martin@ximian.com>
13299
13300         * flowanalysis.cs (Reachability.And): Manually compute the
13301         resulting `barrier' from the reachability.      
13302        
13303 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
13304
13305         Fix bug #57835
13306         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
13307         instance of ObsoleteAttribute when symbol is obsolete.
13308
13309         * class.cs
13310         (IMethodData): Extended interface for ObsoleteAttribute support.
13311
13312 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
13313
13314         * attribute.cs: Fix bug #55970
13315
13316 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
13317
13318         Fix bug #52705
13319         * attribute.cs
13320         (GetObsoleteAttribute): New method. Creates the instance of
13321         ObsoleteAttribute.
13322         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
13323         ObsoleteAttribute when member is obsolete.
13324         (AttributeTester.Report_ObsoleteMessage): Common method for
13325         Obsolete error/warning reporting.
13326
13327         * class.cs
13328         (TypeContainer.base_classs_type): New member for storing parent type.
13329
13330         * decl.cs
13331         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
13332         for this MemberCore.
13333
13334 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
13335
13336         * attribute.cs, const.cs: Fix bug #58590
13337
13338 2004-05-21  Martin Baulig  <martin@ximian.com>
13339
13340         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
13341         out parameters if the end of the method is unreachable.  Fixes
13342         #58098. 
13343
13344 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
13345
13346         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
13347         Hari was right, why extra method.
13348
13349 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
13350
13351         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
13352
13353 2004-05-20  Martin Baulig  <martin@ximian.com>
13354
13355         Merged this back from gmcs to keep the differences to a minumum.
13356
13357         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
13358         instead of a Declspace.
13359         (Attribute.ResolveType): Likewise.
13360         (Attributes.Search): Likewise.
13361         (Attributes.Contains): Likewise.
13362         (Attributes.GetClsCompliantAttribute): Likewise.
13363
13364         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
13365         argument.
13366         (MethodData.ApplyAttributes): Take an EmitContext instead of a
13367         DeclSpace.
13368
13369 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
13370
13371         Fix bug #58688 (MCS does not report error when the same attribute
13372         is assigned twice)
13373
13374         * attribute.cs (Attribute.Emit): Distinction between null and default.
13375
13376 2004-05-19  Raja R Harinath  <rharinath@novell.com>
13377
13378         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
13379         of a top-level attribute without an attribute target.
13380         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
13381         Make non-static.
13382         (Attribute.Conditional_GetConditionName), 
13383         (Attribute.Obsolete_GetObsoleteMessage): Update.
13384         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
13385         part of ScanForIndexerName.
13386         (Attribute.CanIgnoreInvalidAttribute): New function.
13387         (Attribute.ScanForIndexerName): Move to ...
13388         (Attributes.ScanForIndexerName): ... here.
13389         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
13390         (Attributes.Search): New internal variant that can choose not to
13391         complain if types aren't resolved.  The original signature now
13392         complains.
13393         (Attributes.GetClsCompliantAttribute): Use internal variant, with
13394         complaints suppressed.
13395         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
13396         only if it not useful.
13397         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
13398         top-level for attributes that are shared between the assembly
13399         and a top-level class.
13400         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
13401         * class.cs: Update to reflect changes.
13402         (DefineIndexers): Fuse loops.
13403         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
13404         a couple more variants of attribute names.
13405
13406 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
13407
13408         Fix bug #52585 (Implemented explicit attribute declaration)
13409
13410         * attribute.cs:
13411         (Attributable.ValidAttributeTargets): New abstract method. It gets
13412         list of valid attribute targets for explicit target declaration.
13413         (Attribute.Target): It holds target itself.
13414         (AttributeSection): Removed.
13415         (Attribute.CheckTargets): New method. It checks whether attribute
13416         target is valid for the current element.
13417
13418         * class.cs:
13419         (EventProperty): New class. For events that are declared like
13420         property (with add and remove accessors).
13421         (EventField): New class. For events that are declared like field.
13422         class.cs
13423
13424         * cs-parser.jay: Implemented explicit attribute target declaration.
13425
13426         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
13427         Override ValidAttributeTargets.
13428
13429         * parameter.cs:
13430         (ReturnParameter): Class for applying custom attributes on 
13431         the return type.
13432         (ParameterAtribute): New class. Class for applying custom
13433         attributes on the parameter type.
13434
13435 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
13436
13437         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
13438         definitions. 
13439
13440         (Method): Allow UNSAFE here.
13441
13442         * modifiers.cs: Support unsafe reporting.
13443
13444 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
13445
13446         * decl.cs: Fix bug #58478.
13447
13448 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13449
13450         * statement.cs: When checking for unreachable code on an EmptyStatement,
13451         set the location. Fixes bug #58488.
13452
13453 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
13454
13455         * driver.cs: Add -pkg handling.
13456
13457         From Gonzalo: UseShelLExecute=false
13458
13459 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
13460
13461         * attribute.cs:
13462         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
13463         for attribute.
13464         (Attribute.IsClsCompliaceRequired): Moved to base for better
13465         accesibility.
13466         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
13467         when attribute is AttributeUsageAttribute.
13468         (Attribute.GetValidTargets): Simplified.
13469         (Attribute.GetAttributeUsage): New method returns AttributeUsage
13470         attribute for this type.
13471         (Attribute.ApplyAttributes): Method renamed to Emit and make
13472         non-static.
13473         (GlobalAttributeSection): New class for special handling of global
13474         attributes (assembly, module).
13475         (AttributeSection.Emit): New method.
13476
13477         * class.cs: Implemented Attributable abstract methods.
13478         (MethodCore.LabelParameters): Moved to Parameter class.
13479         (Accessor): Is back simple class.
13480         (PropertyMethod): Implemented Attributable abstract class.
13481         (DelegateMethod): Implemented Attributable abstract class.
13482         (Event): New constructor for disctintion between normal Event
13483         and Event with accessors.
13484
13485         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
13486
13487         * codegen.cs, const.cs, decl.cs, delegate.cs:
13488         (CommonAssemblyModulClass): Implemented Attributable abstract class
13489         and simplified.
13490
13491         * enum.cs: Implement IAttributeSupport interface.
13492         (EnumMember): New class for emum members. Implemented Attributable
13493         abstract class
13494
13495         * parameter.cs:
13496         (ParameterBase): Is abstract.
13497         (ReturnParameter): New class for easier [return:] attribute handling.
13498
13499         * typemanager.cs: Removed builder_to_attr.
13500
13501 2004-05-11  Raja R Harinath  <rharinath@novell.com>
13502
13503         Fix bug #57151.
13504         * attribute.cs (Attribute.GetPositionalValue): New function.
13505         * class.cs (TypeContainer.VerifyMembers): New function.
13506         (TypeContainer.Emit): Use it.
13507         (ClassOrStruct): New base class for Class and Struct.
13508         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
13509         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
13510         class.
13511         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
13512         then each non-static field should have a FieldOffset attribute.
13513         Otherwise, none of the fields should have a FieldOffset attribute.
13514         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
13515         and FieldOffset attributes.
13516         * typemanager.cs (TypeManager.struct_layout_attribute_type)
13517         (TypeManager.field_offset_attribute_type): New core types.
13518         (TypeManager.InitCoreTypes): Initialize them.
13519
13520 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
13521
13522         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
13523         Return correct type.
13524         From bug #58270.
13525
13526 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
13527
13528         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
13529         be implicitly converted to ulong.
13530         
13531         * expression.cs: The logic for allowing operator &, | and ^ worked
13532         was wrong, it worked before because we did not report an error in
13533         an else branch.  Fixes 57895.
13534
13535         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
13536         allow volatile fields to be reference types.
13537
13538 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
13539
13540         * driver.cs: Add support for /debug-
13541
13542 2004-05-07  Raja R Harinath  <rharinath@novell.com>
13543
13544         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
13545         Add a 'complain' parameter to silence errors.
13546         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
13547         silently overlooked type-resolutions.
13548         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
13549         to reflect changes.
13550         (Attributes.Search): New function.
13551         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
13552         (Attributes.GetAttributeFullName): Remove hack.
13553         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
13554         Update to reflect changes.
13555         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13556         Use Attributes.Search instead of nested loops.
13557
13558 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
13559
13560         * decl.cs:
13561         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
13562         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
13563         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
13564
13565         * report.cs: (Report.Warning): Renamed to Warning_T because of
13566         parameter collision.
13567
13568 2004-05-05  Raja R Harinath  <rharinath@novell.com>
13569
13570         * expression.cs (MemberAccess.ResolveMemberAccess):
13571         Exit with non-zero status after Report.Error.
13572         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
13573         Likewise.
13574         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
13575
13576 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
13577
13578         * support.cs: Don't hang when the file is empty.
13579
13580 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
13581
13582         * support.cs: In SeekableStreamReader, compute the preamble size of the
13583           underlying stream. Position changes should take into account that initial
13584           count of bytes.
13585
13586 2004-05-03  Todd Berman  <tberman@sevenl.net>
13587
13588         * driver.cs: remove unused GetSysVersion function.
13589
13590 2004-05-03  Todd Berman  <tberman@sevenl.net>
13591
13592         * driver.cs: Remove the hack from saturday, as well as the hack
13593         from jackson (LoadAssemblyFromGac), also adds the CWD to the
13594         link_paths to get that bit proper.
13595
13596 2004-05-01  Todd Berman  <tberman@sevenl.net>
13597
13598         * driver.cs: Try a LoadFrom before a Load, this checks the current
13599         path. This is currently a bug in mono that is be fixed, however, this
13600         provides a workaround for now. This will be removed when the bug
13601         is fixed.
13602
13603 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
13604
13605         * CryptoConvert.cs: Updated to latest version. Fix issue with 
13606         incomplete key pairs (#57941).
13607
13608 2004-05-01  Todd Berman  <tberman@sevenl.net>
13609
13610         * driver.cs: Remove '.' from path_chars, now System.* loads properly
13611         from the GAC
13612
13613 2004-04-30  Jackson Harper  <jackson@ximian.com>
13614
13615         * codegen.cs: Open keys readonly.
13616         
13617 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13618
13619         * typemanager.cs: don't report cyclic struct layout when a struct
13620         contains 2 or more fields of the same type. Failed for Pango.AttrShape
13621         which has 2 Pango.Rectangle fields.
13622
13623 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13624
13625         * expression.cs: Handle IntPtr comparisons with IL code
13626         rather than a method call.
13627
13628 2004-04-29  Martin Baulig  <martin@ximian.com>
13629
13630         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
13631         the list of PropertyInfo's in class hierarchy and find the
13632         accessor.  Fixes #56013.
13633
13634 2004-04-29  Martin Baulig  <martin@ximian.com>
13635
13636         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
13637
13638 2004-04-29  Martin Baulig  <martin@ximian.com>
13639
13640         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13641
13642         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
13643
13644 2004-04-29  Martin Baulig  <martin@ximian.com>
13645
13646         * class.cs (ConstructorInitializer.Resolve): Check whether the
13647         parent .ctor is accessible.  Fixes #52146.
13648
13649 2004-04-29  Martin Baulig  <martin@ximian.com>
13650
13651         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13652
13653         * statement.cs (Using.EmitLocalVariableDecls): Use
13654         TypeManager.idisposable_type, not typeof (IDisposable).
13655         (Foreach.EmitCollectionForeach): Added support for valuetypes.
13656
13657 2004-04-29  Martin Baulig  <martin@ximian.com>
13658
13659         * class.cs (Event.Define): Don't emit the field and don't set
13660         RTSpecialName and SpecialName for events on interfaces.  Fixes
13661         #57703. 
13662
13663 2004-04-29  Raja R Harinath  <rharinath@novell.com>
13664
13665         Refactor Attribute.ApplyAttributes.
13666         * attribute.cs (Attributable): New base class for objects that can
13667         have Attributes applied on them.
13668         (Attribute): Make AttributeUsage fields public.
13669         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
13670         (Attribute.IsInternalCall): New property.
13671         (Attribute.UsageAttr): Convert to a public read-only property.
13672         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
13673         (Attribute.ResolveType, Attribute.Resolve)
13674         (Attribute.ScanForIndexerName): Update to reflect changes.
13675         (Attribute.CheckAttributeTarget): Re-format.
13676         (Attribute.ApplyAttributes): Refactor, to various
13677         Attributable.ApplyAttributeBuilder methods.
13678         * decl.cs (MemberCore): Make Attributable.
13679         * class.cs (Accessor): Make Attributable.
13680         (MethodData.ApplyAttributes): Use proper attribute types, not
13681         attribute names.
13682         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
13683         (TypeContainer.ApplyAttributeBuilder)
13684         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
13685         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
13686         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
13687         (Operator.ApplyAttributeBuilder): New factored-out methods.
13688         * const.cs (Const.ApplyAttributeBuilder): Likewise.
13689         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
13690         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
13691         * parameter.cs (ParameterBase): New Attributable base class
13692         that can also represent Return types.
13693         (Parameter): Update to the changes.
13694
13695 2004-04-29  Jackson Harper  <jackson@ximian.com>
13696
13697         * driver.cs: Prefer the corlib system version when looking for
13698         assemblies in the GAC. This is still a hack, but its a better hack
13699         now.
13700         
13701 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
13702
13703         * decl.cs, enum.cs: Improved error 3005 reporting.
13704   
13705         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
13706         (related_symbols): New private member for list of symbols
13707         related to reported error/warning.
13708         
13709         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
13710
13711 2004-04-29  Martin Baulig  <martin@ximian.com>
13712
13713         * ecore.cs (Expression.Constantify): If we're an enum and
13714         TypeManager.TypeToCoreType() doesn't give us another type, use
13715         t.UnderlyingSystemType.  Fixes #56178.  
13716
13717 2004-04-29  Martin Baulig  <martin@ximian.com>
13718
13719         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
13720         interfaces and for each interface, only add members directly
13721         declared in that interface.  Fixes #53255.
13722
13723 2004-04-28  Martin Baulig  <martin@ximian.com>
13724
13725         * expression.cs (ConditionalLogicalOperator): Use a temporary
13726         variable for `left' to avoid that we evaluate it more than once;
13727         bug #52588.
13728
13729 2004-04-28  Martin Baulig  <martin@ximian.com>
13730
13731         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
13732         `void[]' (CS1547).
13733
13734 2004-04-28  Martin Baulig  <martin@ximian.com>
13735
13736         * statement.cs (LocalInfo.Resolve): Check whether the type is not
13737         void (CS1547).
13738
13739         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
13740         whether the type is not void (CS1547).
13741
13742 2004-04-28  Martin Baulig  <martin@ximian.com>
13743
13744         * expression.cs (Unary.DoResolveLValue): Override this and report
13745         CS0131 for anything but Operator.Indirection.
13746
13747 2004-04-28  Martin Baulig  <martin@ximian.com>
13748
13749         Committing a patch from Ben Maurer; see bug #50820.
13750
13751         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13752         check for classes.
13753
13754         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13755         classes.        
13756
13757 2004-04-28  Martin Baulig  <martin@ximian.com>
13758
13759         Committing a patch from Ben Maurer; see bug #50820.
13760
13761         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13762         check for classes.
13763
13764         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13765         classes.        
13766
13767 2004-04-28  Martin Baulig  <martin@ximian.com>
13768
13769         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
13770         (Block.AddLabel): Call DoLookupLabel() to only search in the
13771         current block.
13772
13773 2004-04-28  Martin Baulig  <martin@ximian.com>
13774
13775         * cfold.cs (ConstantFold.BinaryFold): Added special support for
13776         comparing StringConstants and NullLiterals in Equality and Inequality.
13777
13778 2004-04-28  Jackson Harper  <jackson@ximian.com>
13779
13780         * driver.cs: Attempt to load referenced assemblies from the
13781         GAC. This is the quick and dirty version of this method that
13782         doesnt take into account versions and just takes the first
13783         canidate found. Will be good enough for now as we will not have more
13784         then one version installed into the GAC until I update this method.
13785
13786 2004-04-28  Martin Baulig  <martin@ximian.com>
13787
13788         * typemanager.cs (TypeManager.CheckStructCycles): New public
13789         static method to check for cycles in the struct layout.
13790
13791         * rootcontext.cs (RootContext.PopulateTypes): Call
13792         TypeManager.CheckStructCycles() for each TypeContainer.
13793         [Note: We only need to visit each type once.]
13794
13795 2004-04-28  Martin Baulig  <martin@ximian.com>
13796
13797         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
13798
13799         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
13800         success and added `out object value'.  Use a `bool resolved' field
13801         to check whether we've already been called rather than
13802         `ConstantValue != null' since this breaks for NullLiterals.
13803
13804 2004-04-28  Raja R Harinath  <rharinath@novell.com>
13805
13806         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
13807         setting of this flag, since the 'set' method may be non-public.
13808
13809 2004-04-28  Raja R Harinath  <rharinath@novell.com>
13810
13811         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
13812         check on current_vector.Block.
13813
13814 2004-04-27  Martin Baulig  <martin@ximian.com>
13815
13816         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
13817         a field initializer.  Fixes #56459.
13818
13819 2004-04-27  Martin Baulig  <martin@ximian.com>
13820
13821         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
13822         we're not attempting to use an indexer.  Fixes #52154.
13823
13824 2004-04-27  Martin Baulig  <martin@ximian.com>
13825
13826         * statement.cs (Return): Don't create a return label if we don't
13827         need it; reverts my change from January 20th.  Thanks to Ben
13828         Maurer for this.
13829
13830 2004-04-27  Martin Baulig  <martin@ximian.com>
13831
13832         According to the spec, `goto' can only leave a nested scope, but
13833         never enter it.
13834
13835         * statement.cs (Block.LookupLabel): Only lookup in the current
13836         block, don't recurse into parent or child blocks.
13837         (Block.AddLabel): Check in parent and child blocks, report
13838         CS0140/CS0158 if we find a duplicate.
13839         (Block): Removed this indexer for label lookups.
13840         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
13841         this already does the error reporting for us.
13842
13843         * flowanalysis.cs
13844         (FlowBranching.UsageVector.Block): New public variable; may be null.
13845         (FlowBranching.CreateSibling): Added `Block' argument.
13846         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
13847         label for the target of a `goto' and check whether we're not
13848         leaving a `finally'.
13849
13850 2004-04-27  Martin Baulig  <martin@ximian.com>
13851
13852         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13853         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
13854         just for returns).
13855
13856 2004-04-27  Martin Baulig  <martin@ximian.com>
13857
13858         * statement.cs (Block.AddLabel): Also check for implicit blocks
13859         and added a CS0158 check.
13860
13861 2004-04-27  Martin Baulig  <martin@ximian.com>
13862
13863         * flowanalysis.cs (FlowBranchingLoop): New class.
13864         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
13865         UsageVector's instead of an ArrayList.
13866         (FlowBranching.Label): Likewise.
13867         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
13868         (FlowBranching.AddBreakVector): New method.
13869
13870 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
13871
13872         * attribute.cs: Small regression fix: only convert the type if we
13873         the type is different, fixes System.Drawing build.
13874
13875 2004-04-27  Martin Baulig  <martin@ximian.com>
13876
13877         * attribute.cs (Attribute.Resolve): If we have a constant value
13878         for a named field or property, implicity convert it to the correct
13879         type.
13880
13881 2004-04-27  Raja R Harinath  <rharinath@novell.com>
13882
13883         * statement.cs (Block.Block): Implicit blocks share
13884         'child_variable_names' fields with parent blocks.
13885         (Block.AddChildVariableNames): Remove.
13886         (Block.AddVariable): Mark variable as "used by a child block" in
13887         every surrounding block.
13888         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
13889         been used in a child block, complain about violation of "Invariant
13890         meaning in blocks" rule.
13891         * cs-parser.jay (declare_local_variables): Don't use
13892         AddChildVariableNames.
13893         (foreach_statement): Don't create an implicit block: 'foreach'
13894         introduces a scope.
13895
13896 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
13897
13898         * convert.cs (ImplicitNumericConversion): 0 is also positive when
13899         converting from 0L to ulong.  Fixes 57522.
13900
13901 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
13902
13903         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
13904         derived class hides via 'new' keyword field from base class (test-242.cs).
13905         TODO: Handle this in the more general way.
13906         
13907         * class.cs (CheckBase): Ditto.
13908
13909 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
13910
13911         * decl.cs (caching_flags): New member for storing cached values
13912         as bit flags.
13913         (MemberCore.Flags): New enum where bit flags for caching_flags
13914         are defined.
13915         (MemberCore.cls_compliance): Moved to caching_flags.
13916         (DeclSpace.Created): Moved to caching_flags.
13917
13918         * class.cs: Use caching_flags instead of DeclSpace.Created
13919         
13920 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
13921
13922         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
13923         if we are only a derived class, not a nested class.
13924
13925         * typemanager.cs: Same as above, but do this at the MemberLookup
13926         level (used by field and methods, properties are handled in
13927         PropertyExpr).   Allow for the qualified access if we are a nested
13928         method. 
13929
13930 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
13931
13932         * class.cs: Refactoring.
13933         (IMethodData): New inteface; Holds links to parent members
13934         to avoid member duplication (reduced memory allocation).
13935         (Method): Implemented IMethodData interface.
13936         (PropertyBase): New inner classes for get/set methods.
13937         (PropertyBase.PropertyMethod): Implemented IMethodData interface
13938         (Event): New inner classes for add/remove methods.
13939         (Event.DelegateMethod): Implemented IMethodData interface.
13940
13941         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
13942         EmitContext (related to class.cs refactoring).
13943
13944 2004-04-21  Raja R Harinath  <rharinath@novell.com>
13945
13946         * delegate.cs (Delegate.VerifyApplicability): If the number of
13947         arguments are the same as the number of parameters, first try to
13948         verify applicability ignoring  any 'params' modifier on the last
13949         parameter.
13950         Fixes #56442.
13951
13952 2004-04-16  Raja R Harinath  <rharinath@novell.com>
13953
13954         * class.cs (TypeContainer.AddIndexer): Use
13955         'ExplicitInterfaceName' to determine if interface name was
13956         explicitly specified.  'InterfaceType' is not initialized at this time.
13957         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
13958         Indexers array is already in the required order.  Initialize
13959         'IndexerName' only if there are normal indexers.
13960         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
13961         (TypeContainer.Emit): Emit DefaultMember attribute only if
13962         IndexerName is initialized.
13963         Fixes #56300.
13964
13965 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
13966
13967         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
13968         Fixes #57007
13969
13970 2004-04-15  Raja R Harinath  <rharinath@novell.com>
13971
13972         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
13973         attributes.
13974         Fix for #56456.
13975
13976         * attribute.cs (Attribute.Resolve): Check for duplicate named
13977         attributes.
13978         Fix for #56463.
13979
13980 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
13981
13982         * iterators.cs (MarkYield): track whether we are in an exception,
13983         and generate code accordingly.  Use a temporary value to store the
13984         result for our state.
13985
13986         I had ignored a bit the interaction of try/catch with iterators
13987         since their behavior was not entirely obvious, but now it is
13988         possible to verify that our behavior is the same as MS .NET 2.0
13989
13990         Fixes 54814
13991
13992 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
13993
13994         * iterators.cs: Avoid creating temporaries if there is no work to
13995         do. 
13996
13997         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
13998         Enumerations, use TypeManager.EnumToUnderlying and call
13999         recursively. 
14000
14001         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
14002         bug #57013
14003
14004         (This.Emit): Use EmitContext.EmitThis to emit our
14005         instance variable.
14006
14007         (This.EmitAssign): Ditto.
14008
14009         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
14010         codepaths, we will move all the functionality into
14011         Mono.CSharp.This 
14012
14013         (FieldExpr.EmitAssign): Ditto.
14014
14015         This fixes several hidden bugs that I uncovered while doing a code
14016         review of this today.
14017
14018         * codegen.cs (EmitThis): reworked so the semantics are more clear
14019         and also support value types "this" instances.
14020
14021         * iterators.cs: Changed so that for iterators in value types, we
14022         do not pass the value type as a parameter.  
14023
14024         Initialization of the enumerator helpers is now done in the caller
14025         instead of passing the parameters to the constructors and having
14026         the constructor set the fields.
14027
14028         The fields have now `assembly' visibility instead of private.
14029
14030 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
14031
14032         * expression.cs (Argument.Resolve): Check if fields passed as ref
14033         or out are contained in a MarshalByRefObject.
14034
14035         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
14036         another compiler type.
14037
14038 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
14039
14040         * class.cs (Indexer.Define): use the new name checking method.
14041         Also, return false on an error.
14042         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
14043         (is_identifier_[start/part]_character): make static.
14044
14045 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
14046
14047         * expression.cs (Binary.ResolveOperator): Do no append strings
14048         twice: since we can be invoked more than once (array evaluation)
14049         on the same concatenation, take care of this here.  Based on a fix
14050         from Ben (bug #56454)
14051
14052 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
14053
14054         * codegen.cs: Fix another case where CS1548 must be reported (when 
14055         delay-sign isn't specified and no private is available #56564). Fix
14056         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
14057         error when MCS is used on the MS runtime and we need to delay-sign 
14058         (which seems unsupported by AssemblyBuilder - see #56621).
14059
14060 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
14061
14062         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
14063         (TypeManager.ComputeNamespaces): Faster implementation for
14064         Microsoft runtime.
14065
14066         * compiler.csproj: Updated AssemblyName to mcs.
14067
14068 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
14069
14070         * rootcontext.cs: Add new types to the boot resolution.
14071
14072         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
14073         MulticastDelegate is not allowed.
14074
14075         * typemanager.cs: Add new types to lookup: System.TypedReference
14076         and ArgIterator.
14077
14078         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
14079         check for TypedReference or ArgIterator, they are not allowed. 
14080
14081         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
14082         makes us properly catch 1510 in some conditions (see bug 56016 for
14083         details). 
14084
14085 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
14086
14087         * CryptoConvert.cs: update from corlib version
14088         with endian fixes.
14089
14090 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
14091
14092         * class.cs (Indexer.Define): Check indexername declaration
14093
14094 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
14095
14096         * attribute.cs (IsClsCompliant): Fixed problem with handling
14097         all three states (compliant, not-compliant, undetected).
14098
14099 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
14100
14101         * attribute.cs (Attribute): Location is now public.
14102         (Resolve): Store resolved arguments (pos_values) in attribute class.
14103         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
14104         (GetClsCompliantAttributeValue): New method that gets
14105         CLSCompliantAttribute value.
14106         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
14107         if exists else null.
14108         (AttributeTester): New class for CLS-Compliant verification routines.
14109
14110         * class.cs (Emit): Add CLS-Compliant verification.
14111         (Method.GetSignatureForError): Implemented.
14112         (Constructor.GetSignatureForError): Implemented
14113         (Constructor.HasCompliantArgs): Returns if constructor has
14114         CLS-Compliant arguments.
14115         (Constructor.Emit): Override.
14116         (Construcor.IsIdentifierClsCompliant): New method; For constructors
14117         is needed to test only parameters.
14118         (FieldBase.GetSignatureForError): Implemented.
14119         (TypeContainer): New member for storing base interfaces.
14120         (TypeContainer.FindMembers): Search in base interfaces too.
14121
14122         * codegen.cs (GetClsComplianceAttribute): New method that gets
14123         assembly or module CLSCompliantAttribute value.
14124         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
14125         for assembly.
14126         (ModuleClass.Emit): Add error 3012 test.
14127
14128         * const.cs (Emit): Override and call base for CLS-Compliant tests.
14129
14130         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
14131         state for all decl types.
14132         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
14133         if CLS-Compliant tests are required.
14134         (IsClsCompliaceRequired): New method. Analyze whether code
14135         must be CLS-Compliant.
14136         (IsExposedFromAssembly): New method. Returns true when MemberCore
14137         is exposed from assembly.
14138         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
14139         value or gets cached value.
14140         (HasClsCompliantAttribute): New method. Returns true if MemberCore
14141         is explicitly marked with CLSCompliantAttribute.
14142         (IsIdentifierClsCompliant): New abstract method. This method is
14143         used to testing error 3005.
14144         (IsIdentifierAndParamClsCompliant): New method. Common helper method
14145         for identifier and parameters CLS-Compliant testing.
14146         (VerifyClsCompliance): New method. The main virtual method for
14147         CLS-Compliant verifications.
14148         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
14149         null. I don't know why is null (too many public members !).
14150         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
14151         and get value of first CLSCompliantAttribute that found.
14152
14153         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
14154         (VerifyClsCompliance): Override and add extra tests.
14155
14156         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
14157         clscheck- disable CLS-Compliant verification event if assembly is has
14158         CLSCompliantAttribute(true).
14159
14160         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
14161         ApllyAttribute is now called in emit section as in the other cases.
14162         Possible future Emit integration.
14163         (IsIdentifierClsCompliant): New override.
14164         (VerifyClsCompliance): New override.
14165         (GetEnumeratorName): Returns full enum name.
14166
14167         * parameter.cs (GetSignatureForError): Implemented.
14168
14169         * report.cs (WarningData): New struct for Warning message information.
14170         (LocationOfPreviousError): New method.
14171         (Warning): New method. Reports warning based on the warning table.
14172         (Error_T): New method. Reports error based on the error table.
14173
14174         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
14175         verifications are done here.
14176
14177         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
14178
14179         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
14180         CLSCompliantAttribute.
14181         (all_imported_types): New member holds all imported types from other
14182         assemblies.
14183         (LoadAllImportedTypes): New method fills static table with exported types
14184         from all referenced assemblies.
14185         (Modules): New property returns all assembly modules.
14186
14187 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
14188
14189         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
14190         throwing a parser error.
14191
14192         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
14193         which removes the hardcoded get_/set_ prefixes for properties, as
14194         IL allows for the properties to be named something else.  
14195
14196         Bug #56013
14197
14198         * expression.cs: Do not override operand before we know if it is
14199         non-null.  Fix 56207
14200
14201 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14202
14203         * typemanager.cs: support for pinned variables.
14204
14205 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14206
14207         * decl.cs, typemanager.cs: Avoid using an arraylist
14208         as a buffer if there is only one result set.
14209
14210 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14211
14212         * expression.cs: Make sure you cant call a static method
14213         with an instance expression, bug #56174.
14214
14215 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
14216
14217         * class.cs (IsDuplicateImplementation): Improve error reporting to
14218         flag 663 (method only differs in parameter modifier).
14219
14220         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
14221         in preprocessor directives.
14222
14223         * location.cs (LookupFile): Allow for the empty path.
14224
14225         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
14226         better approach for some of that patch, but its failing with the
14227         CharSet enumeration.  For now try/catch will do.
14228
14229         * typemanager.cs: Do not crash if a struct does not have fields.
14230         Fixes 56150.
14231
14232 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
14233
14234         * expression.cs: cs0213, cant fix a fixed expression.
14235         fixes 50231.
14236
14237 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
14238
14239         * cs-parser.jay: detect invalid embeded statements gracefully.
14240         bug #51113.
14241
14242 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
14243
14244         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
14245         As a regex:
14246         s/
14247         the invocation type may not be a subclass of the tye of the item/
14248         The type of the item must be a subclass of the invocation item.
14249         /g
14250
14251         Fixes bug #50820.
14252
14253 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
14254
14255         * attribute.cs: Added methods to get a string and a bool from an
14256         attribute. Required to information from AssemblyKeyFileAttribute,
14257         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
14258         * codegen.cs: Modified AssemblyName creation to include support for
14259         strongnames. Catch additional exceptions to report them as CS1548.
14260         * compiler.csproj: Updated include CryptoConvert.cs.
14261         * compiler.csproj.user: Removed file - user specific configuration.
14262         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
14263         Mono.Security assembly. The original class is maintained and tested in
14264         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
14265         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
14266         like CSC 8.0 (C# v2) supports.
14267         * Makefile: Added CryptoConvert.cs to mcs sources.
14268         * rootcontext.cs: Added new options for strongnames.
14269
14270 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
14271
14272         * driver.cs: For --expect-error, report error code `2'
14273         if the program compiled with no errors, error code `1' if
14274         it compiled with an error other than the one expected.
14275
14276 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
14277
14278         * compiler.csproj: Updated for Visual Studio .NET 2003.
14279         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
14280         * compiler.sln: Updated for Visual Studio .NET 2003.
14281
14282 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
14283
14284         * expression.cs: Fix bug #47234. We basically need to apply the
14285         rule that we prefer the conversion of null to a reference type
14286         when faced with a conversion to 'object' (csc behaviour).
14287
14288 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14289
14290         * statement.cs: Shorter form for foreach, eliminates
14291         a local variable. r=Martin.
14292
14293 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14294
14295         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
14296         checks if we can use brtrue/brfalse to test for 0.
14297         * expression.cs: use the above in the test for using brtrue/brfalse.
14298         cleanup code a bit.
14299
14300 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14301
14302         * expression.cs: Rewrite string concat stuff. Benefits:
14303
14304         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
14305         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
14306         rather than a concat chain.
14307
14308         * typemanager.cs: Add lookups for more concat overloads.
14309
14310 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14311
14312         * expression.cs: Emit shorter il code for array init.
14313
14314         newarr
14315         dup
14316         // set 1
14317
14318         // set 2
14319
14320         newarr
14321         stloc.x
14322
14323         ldloc.x
14324         // set 1
14325
14326         ldloc.x
14327         // set 2
14328
14329 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
14330
14331         * statement.cs: Before, two switch blocks would be merged if the
14332         total size of the blocks (end_item - begin_item + 1) was less than
14333         two times the combined sizes of the blocks.
14334
14335         Now, it will only merge if after the merge at least half of the
14336         slots are filled.
14337
14338         fixes 55885.
14339
14340 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
14341
14342         * class.cs : csc build fix for GetMethods(). See bug #52503.
14343
14344 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
14345
14346         * expression.cs: Make sure fp comparisons work with NaN.
14347         This fixes bug #54303. Mig approved this patch a long
14348         time ago, but we were not able to test b/c the runtime
14349         had a related bug.
14350
14351 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
14352
14353         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
14354
14355 2004-03-19  Martin Baulig  <martin@ximian.com>
14356
14357         * class.cs (MemberCore.IsDuplicateImplementation): Report the
14358         error here and not in our caller.
14359
14360 2004-03-19  Martin Baulig  <martin@ximian.com>
14361
14362         * interface.cs: Completely killed this file.
14363         (Interface): We're now a TypeContainer and live in class.cs.
14364
14365         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
14366         argument; we're now also called for interfaces.
14367         (TypeContainer.DefineMembers): Allow this method being called
14368         multiple times.
14369         (TypeContainer.GetMethods): New public method; formerly known as
14370         Interface.GetMethod().  This is used by PendingImplementation.
14371         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
14372         it's now private and non-static.
14373         (Interface): Moved this here; it's now implemented similar to
14374         Class and Struct.
14375         (Method, Property, Event, Indexer): Added `bool is_interface'
14376         argument to their .ctor's.
14377         (MemberBase.IsInterface): New public field.
14378
14379         * cs-parser.jay: Create normal Method, Property, Event, Indexer
14380         instances instead of InterfaceMethod, InterfaceProperty, etc.
14381         (opt_interface_base): Removed; we now use `opt_class_base' instead.
14382         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
14383
14384 2004-03-19  Martin Baulig  <martin@ximian.com>
14385
14386         * class.cs (MethodCore.IsDuplicateImplementation): New private
14387         method which does the CS0111 checking.
14388         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
14389         Use IsDuplicateImplementation().
14390
14391 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
14392
14393         * decl.cs (FindMemberToOverride): New method to find the correct
14394         method or property to override in the base class.
14395         * class.cs
14396             - Make Method/Property use the above method to find the
14397               version in the base class.
14398             - Remove the InheritableMemberSignatureCompare as it is now
14399               dead code.
14400
14401         This patch makes large code bases much faster to compile, as it is
14402         O(n) rather than O(n^2) to do this validation.
14403
14404         Also, it fixes bug 52458 which is that nested classes are not
14405         taken into account when finding the base class member.
14406
14407         Reviewed/Approved by Martin.
14408
14409 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
14410
14411         * interface.cs: In all interface classes removed redundant
14412         member initialization.
14413
14414 2004-03-16  Martin Baulig  <martin@ximian.com>
14415
14416         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
14417
14418 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
14419
14420         * decl.cs (DefineTypeAndParents): New helper method to define a
14421         type's containers before the type itself is defined;  This is a
14422         bug exposed by the recent changes to Windows.Forms when an
14423         implemented interface was defined inside a class that had not been
14424         built yet.   
14425
14426         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
14427
14428         (Check): Loop correctly to report errors modifiers
14429         (UNSAFE was not in the loop, since it was the same as TOP).
14430
14431         * interface.cs: Every interface member now takes a ModFlags,
14432         instead of a "is_new" bool, which we set on the base MemberCore. 
14433
14434         Every place where we called "UnsafeOk" in the interface, now we
14435         call the proper member (InterfaceMethod.UnsafeOK) instead to get
14436         the unsafe settings from the member declaration instead of the
14437         container interface. 
14438
14439         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
14440
14441         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
14442         `set_indexer_name' to the pending bits (one per type).
14443
14444         We fixed a bug today that was picking the wrong method to
14445         override, since for properties the existing InterfaceMethod code
14446         basically ignored the method name.  Now we make sure that the
14447         method name is one of the valid indexer names.
14448
14449 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
14450  
14451         * support.cs (SeekableStreamReader): Keep track of stream byte
14452         positions and don't mix them with character offsets to the buffer.
14453
14454         Patch from Gustavo Giráldez
14455
14456 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
14457
14458         * interface.cs (InterfaceSetGetBase): Removed double member
14459         initialization, base class does it as well.
14460
14461 2004-03-13  Martin Baulig  <martin@ximian.com>
14462
14463         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
14464         when compiling corlib.
14465
14466 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
14467
14468         * convert.cs (ExplicitConversion): We were reporting an error on
14469         certain conversions (object_type source to a value type, when the
14470         expression was `null') before we had a chance to pass it through
14471         the user defined conversions.
14472
14473         * driver.cs: Replace / and \ in resource specifications to dots.
14474         Fixes 50752
14475
14476         * class.cs: Add check for duplicate operators.  Fixes 52477
14477
14478 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
14479
14480         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
14481         that are in the middle of the statements, not only at the end.
14482         Fixes #54987
14483
14484         * class.cs (TypeContainer.AddField): No longer set the
14485         `HaveStaticConstructor' flag, now we call it
14486         `UserDefineStaticConstructor' to diferentiate the slightly
14487         semantic difference.
14488
14489         The situation is that we were not adding BeforeFieldInit (from
14490         Modifiers.TypeAttr) to classes that could have it.
14491         BeforeFieldInit should be set to classes that have no static
14492         constructor. 
14493
14494         See:
14495
14496         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
14497
14498         And most importantly Zoltan's comment:
14499
14500         http://bugzilla.ximian.com/show_bug.cgi?id=44229
14501
14502         "I think beforefieldinit means 'it's ok to initialize the type sometime 
14503          before its static fields are used', i.e. initialization does not need
14504          to be triggered by the first access to the type. Setting this flag
14505          helps the JIT to compile better code, since it can run the static
14506          constructor at JIT time, and does not need to generate code to call it
14507          (possibly lots of times) at runtime. Unfortunately, mcs does not set
14508          this flag for lots of classes like String. 
14509          
14510          csc sets this flag if the type does not have an explicit static 
14511          constructor. The reasoning seems to be that if there are only static
14512          initalizers for a type, and no static constructor, then the programmer
14513          does not care when this initialization happens, so beforefieldinit
14514          can be used.
14515          
14516          This bug prevents the AOT compiler from being usable, since it 
14517          generates so many calls to mono_runtime_class_init that the AOT code
14518          is much slower than the JITted code. The JITted code is faster, 
14519          because it does not generate these calls if the vtable is type is
14520          already initialized, which is true in the majority of cases. But the
14521          AOT compiler can't do this."
14522
14523 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
14524
14525         * class.cs (MethodData.Emit): Refactor the code so symbolic
14526         information is generated for destructors;  For some reasons we
14527         were taking a code path that did not generate symbolic information
14528         before. 
14529
14530 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
14531
14532         * class.cs: Create a Constructor.CheckBase method that
14533         takes care of all validation type code. The method
14534         contains some code that was moved from Define.
14535
14536         It also includes new code that checks for duplicate ctors.
14537         This fixes bug #55148.
14538
14539 2004-03-09  Joshua Tauberer <tauberer@for.net>
14540
14541         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
14542         a { ... }-style array creation invokes EmitStaticInitializers
14543         which is not good for reference-type arrays.  String, decimal
14544         and now null constants (NullCast) are not counted toward
14545         static initializers.
14546
14547 2004-03-05  Martin Baulig  <martin@ximian.com>
14548
14549         * location.cs (SourceFile.HasLineDirective): New public field;
14550         specifies whether the file contains or is referenced by a "#line"
14551         directive.
14552         (Location.DefineSymbolDocuments): Ignore source files which
14553         either contain or are referenced by a "#line" directive.        
14554
14555 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
14556
14557         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
14558         direct access to our parent, so check the method inline there.
14559
14560 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
14561
14562         * expression.cs (Invocation.EmitCall): Miguel's last commit
14563         caused a regression. If you had:
14564
14565             T t = null;
14566             t.Foo ();
14567
14568         In Foo the implict this would be null.
14569
14570 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
14571
14572         * expression.cs (Invocation.EmitCall): If the method is not
14573         virtual, do not emit a CallVirt to it, use Call.
14574
14575         * typemanager.cs (GetFullNameSignature): Improve the method to
14576         cope with ".ctor" and replace it with the type name.
14577
14578         * class.cs (ConstructorInitializer.Resolve): Now the method takes
14579         as an argument the ConstructorBuilder where it is being defined,
14580         to catch the recursive constructor invocations.
14581
14582 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
14583
14584         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
14585         routines to check if a type is an enumerable/enumerator allow
14586         classes that implement the IEnumerable or IEnumerator interfaces.
14587
14588         * class.cs (Property, Operator): Implement IIteratorContainer, and
14589         implement SetYields.
14590
14591         (Property.Define): Do the block swapping for get_methods in the
14592         context of iterators.   We need to check if Properties also
14593         include indexers or not.
14594
14595         (Operator): Assign the Block before invoking the
14596         OperatorMethod.Define, so we can trigger the Iterator code
14597         replacement. 
14598
14599         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
14600         Property and Operator classes are not created when we parse the
14601         declarator but until we have the block completed, so we use a
14602         singleton SimpleIteratorContainer.Simple to flag whether the
14603         SetYields has been invoked.
14604
14605         We propagate this setting then to the Property or the Operator to
14606         allow the `yield' to function.
14607
14608 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
14609
14610         * codegen.cs: Implemented attribute support for modules.
14611         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
14612         Assembly/Module functionality.
14613
14614         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
14615         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
14616         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
14617
14618 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
14619
14620         * interface.cs (FindMembers): The operation is performed on all base
14621         interfaces and not only on the first. It is required for future CLS Compliance patch.
14622
14623 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
14624
14625         * statement.cs, codegen.cs:
14626         This patch deals with patterns such as:
14627
14628         public class List : IEnumerable {
14629
14630                 public MyEnumerator GetEnumerator () {
14631                         return new MyEnumerator(this);
14632                 }
14633
14634                 IEnumerator IEnumerable.GetEnumerator () {
14635                         ...
14636                 }
14637                 
14638                 public struct MyEnumerator : IEnumerator {
14639                         ...
14640                 }
14641         }
14642
14643         Before, there were a few things we did wrong:
14644         1) we would emit callvirt on a struct, which is illegal
14645         2) we emited ldarg when we needed to emit ldarga
14646         3) we would mistakenly call the interface methods on an enumerator
14647         type that derived from IEnumerator and was in another assembly. For example:
14648
14649         public class MyEnumerator : IEnumerator
14650
14651         Would have the interface methods called, even if there were public impls of the
14652         method. In a struct, this lead to invalid IL code.
14653
14654 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
14655
14656         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
14657           renamed to Emit.
14658
14659         * delegate.cs (Define): Fixed crash when delegate type is undefined.
14660
14661 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
14662
14663         * cs-parser.jay: Fix small regression: we were not testing V2
14664         compiler features correctly.
14665
14666         * interface.cs: If the emit context is null, then create one
14667
14668 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
14669
14670         * decl.cs (GetSignatureForError): New virtual method to get full name
14671           for error messages.
14672
14673         * attribute.cs (IAttributeSupport): New interface for attribute setting.
14674           Now it is possible to rewrite ApplyAttributes method to be less if/else.
14675
14676         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
14677           Duplicated members and code in these classes has been removed.
14678           Better encapsulation in these classes.
14679
14680 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
14681
14682         * assign.cs (Assign.DoResolve): When dealing with compound
14683         assignments, there is a new rule in ECMA C# 2.4 (might have been
14684         there before, but it is documented here) that states that in:
14685
14686         a op= b;
14687
14688         If b is of type int, and the `op' is a shift-operator, then the
14689         above is evaluated as:
14690
14691         a = (int) a op b 
14692
14693         * expression.cs (Binary.ResolveOperator): Instead of testing for
14694         int/uint/long/ulong, try to implicitly convert to any of those
14695         types and use that in pointer arithmetic.
14696
14697         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
14698         method to print information for from the type, not from the
14699         null-method we were given.
14700
14701 2004-02-01  Duncan Mak  <duncan@ximian.com>
14702
14703         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
14704         parsing for cmd, fixes bug #53694.
14705
14706 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
14707
14708         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
14709         in the member name duplication tests. Property and operator name duplication
14710         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
14711
14712 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
14713
14714         * interface.cs (PopulateMethod): Fixed crash when interface method
14715         returns not existing type (error test cs0246-3.cs).
14716
14717 2004-02-02  Ravi Pratap M <ravi@ximian.com>
14718
14719         * cs-parser.jay (interface_accessors): Re-write actions to also
14720         store attributes attached to get and set methods. Fix spelling
14721         while at it.
14722
14723         (inteface_property_declaration): Modify accordingly.
14724
14725         (InterfaceAccessorInfo): New helper class to store information to pass
14726         around between rules that use interface_accessors.
14727
14728         * interface.cs (Emit): Apply attributes on the get and set
14729         accessors of properties and indexers too.
14730
14731         * attribute.cs (ApplyAttributes): Modify accordingly to use the
14732         right MethodBuilder when applying attributes to the get and set accessors.
14733
14734 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
14735
14736         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
14737
14738 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
14739
14740         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
14741
14742 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
14743
14744         * cs-parser.jay: Remove YIELD token, instead use the new grammar
14745         changes that treat `yield' specially when present before `break'
14746         or `return' tokens.
14747
14748         * cs-tokenizer.cs: yield is no longer a keyword.
14749
14750 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
14751
14752         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
14753         setting for default constructors.
14754         For default constructors are almost every time set wrong Modifier. The
14755         generated IL code has been alright. But inside mcs this values was
14756         wrong and this was reason why several of my CLS Compliance tests
14757         failed.
14758
14759 2004-01-22  Martin Baulig  <martin@ximian.com>
14760
14761         * cs-parser.jay (namespace_or_type_name): Return an Expression,
14762         not a QualifiedIdentifier.  This is what `type_name_expression'
14763         was previously doing.
14764         (type_name_expression): Removed; the code is now in
14765         `namespace_or_type_name'.
14766         (qualified_identifier): Removed, use `namespace_or_type_name'
14767         instead.
14768         (QualifiedIdentifier): Removed this class.      
14769
14770 2004-01-22  Martin Baulig  <martin@ximian.com>
14771
14772         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
14773         not a string as alias name.
14774
14775 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
14776
14777         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
14778         #52730 bug, and instead compute correctly the need to use a
14779         temporary variable when requesting an address based on the
14780         static/instace modified of the field and the constructor.
14781  
14782 2004-01-21  Martin Baulig  <martin@ximian.com>
14783
14784         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
14785         class and namespace before looking up aliases.  Fixes #52517.
14786
14787 2004-01-21  Martin Baulig  <martin@ximian.com>
14788
14789         * flowanalysis.cs (UsageVector.Merge): Allow variables being
14790         assinged in a 'try'; fixes exception4.cs.
14791
14792 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14793         * class.cs : Implemented parameter-less constructor for TypeContainer
14794
14795         * decl.cs: Attributes are now stored here. New property OptAttributes
14796
14797         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
14798
14799         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
14800
14801 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14802
14803         * typemanager.cs (CSharpSignature): Now reports also inner class name.
14804           (CSharpSignature): New method for indexer and property signature.
14805
14806 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14807
14808         * pending.cs (IsVirtualFilter): Faster implementation.
14809
14810 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14811
14812         * typemanager.cs: Avoid inclusion of same assembly more than once.
14813
14814 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14815
14816         * cs-parser.jay: Fixed problem where the last assembly attribute
14817           has been applied also to following declaration (class, struct, etc.)
14818           
14819 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14820
14821         * class.cs: Added error CS0538, CS0539 reporting.
14822         Fixed crash on Microsoft runtime when field type is void.
14823
14824         * cs-parser.jay: Added error CS0537 reporting.
14825
14826         * pending.cs: Added error CS0535 reporting.
14827         Improved error report for errors CS0536, CS0534.
14828
14829 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
14830
14831         Merge a few bits from the Anonymous Method MCS tree.
14832
14833         * statement.cs (ToplevelBlock): New class for toplevel methods,
14834         will hold anonymous methods, lifted variables.
14835
14836         * cs-parser.jay: Create toplevel blocks for delegates and for
14837         regular blocks of code. 
14838
14839 2004-01-20  Martin Baulig  <martin@ximian.com>
14840
14841         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
14842         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
14843         and `NeedExplicitReturn'; added `IsLastStatement'.
14844         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
14845         have a `ReturnLabel' or we're not unreachable.
14846
14847         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
14848         child's reachability; don't just override ours with it.  Fixes
14849         #58058 (lluis's example).
14850         (FlowBranching): Added public InTryOrCatch(), InCatch(),
14851         InFinally(), InLoop(), InSwitch() and
14852         BreakCrossesTryCatchBoundary() methods.
14853
14854         * statement.cs (Return): Do all error checking in Resolve().
14855         Unless we are the last statement in a top-level block, always
14856         create a return label and jump to it.
14857         (Break, Continue): Do all error checking in Resolve(); also make
14858         sure we aren't leaving a `finally'.
14859         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
14860         statement in a top-level block.
14861         (Block.Flags): Added `IsDestructor'.
14862         (Block.IsDestructor): New public property.
14863
14864 2004-01-20  Martin Baulig  <martin@ximian.com>
14865
14866         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
14867
14868 2004-01-20  Martin Baulig  <martin@ximian.com>
14869
14870         * statement.cs (Statement.ResolveUnreachable): New public method.
14871         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
14872         (Block.Resolve): Resolve unreachable statements.
14873
14874 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
14875
14876         * expression.cs: We need to fix the case where we do
14877         not have a temp variable here.
14878
14879         * assign.cs: Only expression compound assignments need
14880         temporary variables.
14881
14882 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
14883
14884         * flowanalysis.cs: Reduce memory allocation in a few ways:
14885           - A block with no variables should not allocate a bit
14886             vector for itself.
14887           - A method with no out parameters does not need any tracking
14888             for assignment of the parameters, so we need not allocate
14889             any data for it.
14890           - The arrays:
14891                 public readonly Type[] VariableTypes;
14892                 public readonly string[] VariableNames;
14893             Are redundant. The data is already stored in the variable
14894             map, so we need not allocate another array for it.
14895           - We need to add alot of checks for if (params | locals) == null
14896             due to the first two changes.
14897
14898 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
14899
14900         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
14901         implement IMemoryLocation, we store a copy on a local variable and
14902         take the address of it.  Patch from Benjamin Jemlich
14903
14904         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
14905         to use a special "type_name_expression" rule which reduces the
14906         number of "QualifiedIdentifier" classes created, and instead
14907         directly creates MemberAccess expressions.
14908
14909 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
14910
14911         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
14912         that fixes #52853.  Null literal assignment to ValueType
14913
14914         * class.cs (MethodData.Emit): Instead of checking the name of the
14915         method to determine if its a destructor, create a new derived
14916         class from Method called Destructor, and test for that.  
14917
14918         * cs-parser.jay: Create a Destructor object instead of a Method.  
14919
14920         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
14921
14922         Fixes: 52933
14923
14924 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
14925
14926         * expression.cs (Binary.ResolveOperator): Perform an implicit
14927         conversion from MethodGroups to their delegate types on the
14928         Addition operation.
14929
14930         * delegate.cs: Introduce a new class DelegateCreation that is the
14931         base class for `NewDelegate' and `ImplicitDelegateCreation',
14932         factor some code in here.
14933
14934         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
14935         conversion from MethodGroups to compatible delegate types. 
14936
14937         * ecore.cs (Expression.Resolve): Do not flag error 654
14938         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
14939         we allow conversions from MethodGroups to delegate types now.
14940
14941         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
14942         assignments in v2 either.
14943
14944 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
14945
14946         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
14947         static read-only fields in ctors.
14948
14949         Applied patch from Benjamin Jemlich 
14950
14951         * expression.cs (UnaryMutator): Avoid leaking local variables. 
14952
14953 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
14954
14955         * cs-tokenizer.cs (IsCastToken): Allow the various native types
14956         here to return true, as they can be used like this:
14957
14958                 (XXX) int.MEMBER ()
14959
14960         Fixed 49836 and all the other dups
14961
14962 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
14963
14964         * driver.cs: Implement /win32res and /win32icon.
14965
14966 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
14967
14968         * cs-parser.jay: Add a rule to improve error handling for the
14969         common mistake of placing modifiers after the type.
14970
14971 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
14972
14973         * cs-parser.jay (interface_event_declaration): Catch
14974         initialization of events on interfaces, and report cs0068
14975
14976         * cs-parser.jay (interface_event_declaration): Catch
14977         initialization of events. 
14978
14979         * ecore.cs: Better report missing constructors.
14980
14981         * expression.cs (Binary.ResolveOperator): My previous bug fix had
14982         the error reporting done in the wrong place.  Fix.
14983
14984         * expression.cs (Binary.ResolveOperator): Catch the 
14985         operator + (E x, E y) error earlier, and later allow for implicit
14986         conversions in operator +/- (E e, U x) from U to the underlying
14987         type of E.
14988
14989         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
14990         52596, if the container class is abstract, the default constructor
14991         is protected otherwise its public (before, we were always public).
14992
14993         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
14994         fixed statement.
14995
14996         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
14997         Jemlich that fixes bug #52597, MCS was generating invalid code for
14998         idisposable structs.   Thanks to Ben for following up with this
14999         bug as well.
15000
15001 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
15002
15003         * driver.cs: Allow assemblies without code to be generated, fixes
15004         52230.
15005
15006 2004-01-07  Nick Drochak <ndrochak@gol.com>
15007
15008         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
15009
15010 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
15011
15012         * cs-parser.jay: Add rules to improve error reporting if fields or
15013         methods are declared at the namespace level (error 116)
15014
15015         * Add rules to catch event add/remove
15016
15017 2004-01-04  David Sheldon <dave-mono@earth.li>
15018
15019   * expression.cs: Added matching ")" to error message for 
15020   CS0077
15021
15022 2004-01-03 Todd Berman <tberman@gentoo.org>
15023
15024         * ecore.cs, attribute.cs:
15025         Applying fix from #52429.
15026
15027 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
15028
15029         * ecore.cs, expression.cs, statement.cs:
15030         Total rewrite of how we handle branching. We
15031         now handle complex boolean expressions with fewer
15032         jumps. As well if (x == 0) no longer emits a ceq.
15033
15034         if (x is Foo) is much faster now, because we generate
15035         better code.
15036
15037         Overall, we get a pretty big improvement on our benchmark
15038         tests. The code we generate is smaller and more readable.
15039
15040         I did a full two-stage bootstrap. The patch was reviewed
15041         by Martin and Miguel.
15042
15043 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
15044
15045         * cs-parser.jay: Make primary_expression not take a QI.
15046         we dont need this because the member_access rule covers
15047         us here. So we replace the rule with just IDENTIFIER.
15048
15049         This has two good effects. First, we remove a s/r conflict.
15050         Second, we allocate many fewer QualifiedIdentifier objects.
15051
15052 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
15053
15054         * attribute.cs: Handle MarshalAs attributes as pseudo, and
15055         set the correct information via SRE. This prevents
15056         hanging on the MS runtime. Fixes #29374.
15057
15058 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
15059
15060         * convert.cs: correctly handle conversions to value types
15061         from Enum and ValueType as unboxing conversions.
15062
15063         Fixes bug #52569. Patch by Benjamin Jemlich.
15064
15065 2004-01-02  Ravi Pratap  <ravi@ximian.com>
15066
15067         * expression.cs (BetterConversion): Prefer int -> uint
15068         over int -> ulong (csc's behaviour). This fixed bug #52046.
15069
15070 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
15071
15072         * decl.cs (MemberCache.FindMembers): now returns a
15073         MemberInfo [].
15074
15075         * typemanager.cs: In general, go with with ^^.
15076         (CopyNewMethods): take an IList.
15077         (RealMemberLookup): Only allocate an arraylist
15078         if we copy from two sets of methods.
15079
15080         This change basically does two things:
15081         1) Fewer array lists allocated due to CopyNewMethods.
15082         2) the explicit cast in MemberList costed ALOT.
15083
15084 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
15085
15086         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
15087         a hashtable to avoid needless string allocations when an identifier is
15088         used more than once (the common case).
15089
15090 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
15091
15092         * pending.cs: MS's TypeBuilder.GetInterfaces ()
15093         is broken, it will not return anything. So, we
15094         have to use the information we have in mcs to
15095         do the task.
15096
15097         * typemanager.cs: Add a cache for GetInterfaces,
15098         since this will now be used more often (due to ^^)
15099
15100         (GetExplicitInterfaces) New method that gets the
15101         declared, not effective, interfaces on a type
15102         builder (eg, if you have interface IFoo, interface
15103         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
15104         { IBar }.
15105
15106         This patch makes MCS able to bootstrap itself on
15107         Windows again.
15108
15109 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
15110
15111         * expression.cs: Remove the Nop's that Miguel put
15112         in by mistake.
15113
15114 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
15115
15116         * report.cs, codegen.cs: Give the real stack trace to
15117         the error when an exception is thrown.
15118
15119 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
15120
15121         * decl.cs: only allocate hashtables for ifaces if 
15122         it is an iface!
15123
15124 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
15125
15126         * expression.cs: fix the error from cs0121-2.cs
15127         (a parent interface has two child interfaces that
15128         have a function with the same name and 0 params
15129         and the function is called through the parent).
15130
15131 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
15132
15133         * class.cs, rootcontext.cs, typmanager.cs: do not
15134         leak pointers.
15135
15136 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
15137
15138         * codegen.cs: remove stack for the ec flow branching.
15139         It is already a linked list, so no need.
15140
15141 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
15142
15143         * Makefile: Allow custom profiler here.
15144
15145 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
15146
15147         * typemanager.cs (LookupType):
15148           - Use a static char [], because split takes
15149             a param array for args, so it was allocating
15150             every time.
15151           - Do not store true in a hashtable, it boxes.
15152
15153 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
15154
15155         * flowanalysis.cs: bytify common enums.
15156
15157 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
15158
15159         * modifiers.cs: Add a new set of flags for the
15160         flags allowed on explicit interface impls.
15161         * cs-parser.jay: catch the use of modifiers in
15162         interfaces correctly.
15163         * class.cs: catch private void IFoo.Blah ().
15164
15165         All related to bug #50572.
15166
15167 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
15168
15169         * decl.cs: Rewrite the consistant accessability checking.
15170         Accessability is not linear, it must be implemented in
15171         a tableish way. Fixes #49704.
15172
15173 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
15174
15175         * expression.cs: Handle negation in a checked context.
15176         We must use subtraction from zero. Fixes #38674.
15177
15178 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15179
15180         * class.cs: Ignore static void main in DLLs.
15181         * rootcontext.cs: Handle the target type here,
15182         since we are have to access it from class.cs
15183         * driver.cs: account for the above.
15184
15185 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15186
15187         * report.cs: Give line numbers and files if available.
15188
15189 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
15190
15191         * driver.cs: Implement /addmodule.
15192
15193         * typemanager.cs:  Change 'modules' field so it now contains Modules not
15194         ModuleBuilders.
15195
15196 2003-12-20  Martin Baulig  <martin@ximian.com>
15197
15198         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
15199         (FieldBase.IsAssigned): Removed this field.
15200         (FieldBase.SetAssigned): New public method.
15201         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
15202
15203 2003-12-20  Martin Baulig  <martin@ximian.com>
15204
15205         * expression.cs (LocalVariableReference.DoResolve): Don't set
15206         `vi.Used' if we're called from DoResolveLValue().
15207
15208         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
15209         returns the usage vector it just merged into the current one -
15210         pass this one to UsageWarning().
15211         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
15212         of the `EmitContext', don't call this recursively on our children.
15213
15214 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
15215
15216         * driver.cs: Implement /target:module.
15217
15218 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
15219
15220         * support.cs (CharArrayHashtable): New helper class.
15221
15222         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
15223         char arrays, not strings, so we can avoid creating a string in
15224         consume_identifier if the identifier is a keyword.
15225
15226 2003-12-16  Martin Baulig  <martin@ximian.com>
15227
15228         * statement.cs (LocalInfo.Assigned): Removed this property.
15229         (LocalInfo.Flags): Removed `Assigned'.
15230         (LocalInfo.IsAssigned): New public method; takes the EmitContext
15231         and uses flow analysis.
15232         (Block.UsageWarning): Made this method private.
15233         (Block.Resolve): Call UsageWarning() if appropriate.
15234
15235         * expression.cs (LocalVariableReference.DoResolve): Always set
15236         LocalInfo.Used here.
15237
15238 2003-12-13  Martin Baulig  <martin@ximian.com>
15239
15240         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
15241         any value here; we're now using flow analysis to figure out
15242         whether a statement/block returns a value.
15243
15244 2003-12-13  Martin Baulig  <martin@ximian.com>
15245
15246         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
15247         working again.
15248         (FlowBranching.MergeFinally): Don't call
15249         `branching.CheckOutParameters()' here, this is called in
15250         MergeTopBlock().
15251         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
15252         when adding the `finally' vector.       
15253
15254 2003-12-13  Martin Baulig  <martin@ximian.com>
15255
15256         * flowanalysis.cs
15257         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
15258         actually work and also fix #48962.
15259
15260 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
15261
15262         * decl.cs: Do not check System.Object for nested types,
15263         since we know it does not have any. Big bang for buck:
15264
15265         BEFORE:
15266            Run 1:   8.35 seconds
15267            Run 2:   8.32 seconds
15268            corlib:  17.99 seconds
15269         AFTER:
15270            Run 1:   8.17 seconds
15271            Run 2:   8.17 seconds
15272            corlib:  17.39 seconds
15273
15274 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
15275
15276         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
15277         time we are returning 0 members, so we save alot here.
15278
15279 2003-12-11  Martin Baulig  <martin@ximian.com>
15280
15281         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
15282         `MergeChild()', also just take the `FlowBranching' as argument;
15283         call Merge() on it and return the result.
15284         (FlowBranching.Merge): We don't need to do anything if we just
15285         have one sibling.
15286
15287 2003-12-11  Martin Baulig  <martin@ximian.com>
15288
15289         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
15290         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
15291         Maurer for this idea.
15292
15293 2003-12-11  Martin Baulig  <martin@ximian.com>
15294
15295         * flowanalysis.cs (MergeResult): This class is now gone; we now
15296         use the `UsageVector' for this.  The reason for this is that if a
15297         branching just has one sibling, we don't need to "merge" them at
15298         all - that's the next step to do.
15299         (FlowBranching.Merge): We now return a `UsageVector' instead of a
15300         `MergeResult'.
15301
15302 2003-12-11  Martin Baulig  <martin@ximian.com>
15303
15304         Reworked flow analyis and made it more precise and bug-free.  The
15305         most important change is that we're now using a special `Reachability'
15306         class instead of having "magic" meanings of `FlowReturns'.  I'll
15307         do some more cleanups and optimizations and also add some more
15308         documentation this week.
15309
15310         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
15311         largely reworked this class.
15312         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
15313         the new `Reachability' class instead of having "magic" values here.
15314         (FlowBranching): We're now using an instance of `Reachability'
15315         instead of having separate `Returns', `Breaks' etc. fields.
15316
15317         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
15318         based on flow analysis; ignore the return value of block.Emit ().
15319
15320 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
15321
15322         * driver.cs typemanager.cs: Find the mono extensions to corlib even
15323         if they are private.
15324
15325 2003-12-09  Martin Baulig  <martin@ximian.com>
15326
15327         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
15328         call them directly on the UsageVector.
15329
15330 2003-12-09  Martin Baulig  <martin@ximian.com>
15331
15332         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
15333         Changed return type from `FlowReturns' to `Reachability'.
15334
15335 2003-12-09  Martin Baulig  <martin@ximian.com>
15336
15337         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
15338         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
15339         `Reachable' fields with a single `Reachability' one.
15340
15341 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15342
15343         * class.cs (FindMembers): Remove foreach's.
15344
15345         Bootstrap times:
15346
15347         BEFORE
15348                 Run 1:   8.74 seconds
15349                 Run 2:   8.71 seconds
15350
15351         AFTER
15352                 Run 1:   8.64 seconds
15353                 Run 2:   8.58 seconds
15354
15355
15356 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15357
15358         * cs-parser.jay:
15359         * gen-treedump.cs:
15360         * statement.cs:
15361         This patch does a few things:
15362                 1. EmptyStatement is now a singleton, so it is never reallocated.
15363                 2. All blah is EmptyStatement constructs have been changed to
15364                    blah == EmptyStatement.Value, which is much faster and valid
15365                    now that EmptyStatement is a singleton.
15366                 3. When resolving a block, rather than allocating a new array for
15367                    the non-empty statements, empty statements are replaced with
15368                    EmptyStatement.Value
15369                 4. Some recursive functions have been made non-recursive.
15370         Mainly the performance impact is from (3), however (1) and (2) are needed for
15371         this to work. (4) does not make a big difference in normal situations, however
15372         it makes the profile look saner.
15373
15374         Bootstrap times:
15375
15376         BEFORE
15377         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15378         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15379         Total memory allocated: 56397 KB
15380
15381         AFTER
15382         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
15383         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
15384         Total memory allocated: 55666 KB
15385
15386 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15387
15388         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
15389         than the hashtable in a hashtable version
15390
15391         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
15392         we always end up concating a string. This results in a huge perf
15393         loss, because many strings have to be tracked by the GC. In this
15394         patch, we first use a hashtable that works with two keys, so that
15395         the strings do not need to be concat'ed.
15396
15397         Bootstrap times:
15398         BEFORE
15399                 Run 1:   8.74 seconds
15400                 Run 2:   8.71 seconds
15401
15402         AFTER
15403                 Run 1:   8.65 seconds
15404                 Run 2:   8.56 seconds
15405
15406 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15407
15408         * Makefile: Add a new target `do-time' that does a quick and simple
15409         profile, leaving easy to parse output.
15410
15411 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
15412
15413         * codegen.cs (Init): Create the dynamic assembly with 
15414         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
15415
15416 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
15417
15418         * support.cs: Make the PtrHashtable use only one
15419         instance of its comparer.
15420
15421 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
15422
15423         * typemanager.cs: Fix lookup of GetNamespaces.
15424
15425 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
15426
15427         * expression.cs: Removed redundant line.
15428
15429         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
15430         ArrayLists, use for loops with bounds.  
15431
15432         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
15433         arraylist.
15434
15435         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
15436         arraylists, use for loop with bounds.
15437
15438         The above three changes give us a 0.071 second performance
15439         improvement out of 3.294 seconds down to 3.223.  On my machine
15440         the above changes reduced the memory usage by 1,387 KB during
15441         compiler bootstrap.
15442
15443         * cs-parser.jay (QualifiedIdentifier): New class used to represent
15444         QualifiedIdentifiers.  Before we created a new string through
15445         concatenation, and mostly later on, the result would be
15446         manipulated by DecomposeQI through string manipulation.
15447
15448         This reduced the compiler memory usage for bootstrapping from
15449         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
15450         compile times in 0.05 seconds.
15451
15452 2003-11-28  Dick Porter  <dick@ximian.com>
15453
15454         * support.cs: Do string compares with the Invariant culture.
15455
15456         * rootcontext.cs: 
15457         * gen-treedump.cs: 
15458         * expression.cs: 
15459         * driver.cs: 
15460         * decl.cs: 
15461         * codegen.cs: 
15462         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
15463         the comparison is done with the Invariant culture.
15464
15465 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
15466
15467         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
15468         GetEnumerator method.
15469
15470         (ProbeCollectionType): Iterate starting at the most specific type
15471         upwards looking for a GetEnumerator
15472
15473         * expression.cs: Shift count can be up to 31 for int/uint and 63
15474         for long/ulong.
15475
15476 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
15477
15478         * statement.cs (Block.LookupLabel): Also look for the label on the
15479         children blocks.  Use a hash table to keep track of visited
15480         nodes. 
15481
15482         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
15483         we actually did transform the other operand, otherwise fall back
15484         to the common codepath that casts to long.
15485
15486         * cs-tokenizer.cs: Use the same code pattern as the int case.
15487         Maybe I should do the parsing myself, and avoid depending on the
15488         Parse routines to get this done.
15489
15490 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
15491
15492         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
15493         which fixes bug 51347.  This time test it.
15494
15495         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
15496         attributes for example can not tell the difference between these.
15497         The difference was only a syntax feature of the language. 
15498
15499         * attribute.cs: Apply attributes to delegates.
15500
15501         * delegate.cs: Call the apply attributes method.
15502
15503 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
15504
15505         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
15506         comparing 0 vs Byte.MinValue, not the value
15507
15508         (ImplicitConversionRequired): When reporting a conversion error,
15509         use error 31 to print out the constant error instead of the
15510         simpler 29.
15511
15512         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
15513         which fixes bug 51347.
15514
15515 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
15516
15517         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
15518         which fixes the -warnaserror command line option.
15519
15520 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
15521
15522         * cfold.cs (DoNumericPromotions): During constant folding of
15523         additions on UIntConstant, special case intconstants with
15524         IntConstants like we do on the expression binary operator. 
15525
15526 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
15527
15528         * convert.cs (ImplicitReferenceConversion): We were missing a case
15529         (System.Enum are not value types or class types, so we need to
15530         classify them separatedly).
15531
15532         * driver.cs: We do not support error 2007.
15533
15534 2003-11-12 Jackson Harper <jackson@ximian.com>
15535
15536         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
15537         system directory. Also use the full file name so users can
15538         libraries names mscorlib-o-tron.dll in a non system dir.
15539
15540 2003-11-10  Martin Baulig  <martin@ximian.com>
15541
15542         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
15543         (TypeManager.InitCoreTypes): Initialize them here, but instead of
15544         calling `ResolveType()' on them, directly assign their `Type'.
15545
15546 2003-11-08  Martin Baulig  <martin@ximian.com>
15547
15548         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
15549         return value and the `out parent' parameter.
15550         (TypeContainer.DefineType): Moved the CS0644 check into
15551         GetClassBases().  Don't pass the interface types to the
15552         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
15553         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
15554
15555         * ecore.cs (TypeExpr.IsAttribute): New property.
15556         (TypeExpr.GetInterfaces): New method.
15557
15558         * interface.cs (Interface.GetInterfaceTypeByName): Return a
15559         TypeExpr instead of a Type.
15560         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
15561         (Interface.DefineType): Don't pass the interface types to the
15562         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
15563         them later and then call `TypeBulider.AddInterfaceImplementation()'.
15564
15565         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
15566         instead of a `Type[]'.
15567         (TypeManager.RegisterBuilder): Likewise.
15568         (TypeManager.AddUserInterface): Likewise.
15569         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
15570         `Type[]' and also return a `TypeExpr[]'.
15571         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
15572
15573 2003-11-08  Martin Baulig  <martin@ximian.com>
15574
15575         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
15576         Expression.     
15577
15578 2003-11-08  Martin Baulig  <martin@ximian.com>
15579
15580         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
15581         TypeManager.ResolveExpressionTypes().
15582
15583         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
15584         instead of an Expression.
15585         (TypeExpr): This is now an abstract base class for `TypeExpression'.
15586         (TypeExpression): New public class; formerly known as `TypeExpr'.
15587
15588         * expression.cs (ComposedCast): Derive from TypeExpr.
15589
15590         * typemanager.cs (TypeManager.system_*_expr): These are now
15591         TypExpr's instead of Expression's.
15592         (TypeManager.ResolveExpressionTypes): New public static function;
15593         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
15594         of them.        
15595
15596 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
15597
15598         * expression.cs (New.DoResolve): Do not dereference value that
15599         might be a null return.
15600
15601         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
15602         sure that the constant value has the right type.  Fixes an
15603         unreported bug, similar to 50425.
15604
15605         * const.cs (Const.LookupConstantValue): Call
15606         ImplicitStandardConversionExists before doing a conversion to
15607         avoid havng the TypeManager.ChangeType do conversions.
15608
15609         Reduced the number of casts used
15610
15611         (Const.ChangeType): New routine to enable reuse of the constant
15612         type changing code from statement.
15613
15614         * typemanager.cs (ChangeType): Move common initialization to
15615         static global variables.
15616
15617         Fixes #50425.
15618
15619         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
15620         every value type to go through, even if it was void.  Fix that. 
15621
15622         * cs-tokenizer.cs: Use is_identifier_start_character on the start
15623         character of the define, and the is_identifier_part_character for
15624         the rest of the string.
15625
15626 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
15627
15628         * expression.cs (UnaryMutator.EmitCode): When I updated
15629         LocalVariableReference.DoResolve, I overdid it, and dropped an
15630         optimization done on local variable references.
15631
15632 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
15633
15634         * ecore.cs: Convert the return from Ldlen into an int.
15635
15636 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
15637
15638         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
15639         the accessibility, this is a special case for toplevel non-public
15640         classes (internal for instance).
15641
15642 2003-10-20  Nick Drochak <ndrochak@gol.com>
15643
15644         * ecore.cs: Fix typo and build.  Needed another right paren.
15645
15646 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
15647
15648         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
15649         `internal' case regular and protected, but not allowing protected
15650         to be evaluated later.  Bug 49840
15651
15652 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
15653
15654         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
15655         to kb.Nlast, and not the kb.nFirst to isolate the switch
15656         statement.
15657
15658         Extract the underlying type, so enumerations of long/ulong are
15659         treated like long/ulong.
15660
15661 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
15662
15663         * expression.cs (New): Overload the meaning of RequestedType to
15664         track the possible creation of the NewDelegate type, since
15665         DoResolve is invoked more than once for new constructors on field
15666         initialization.
15667
15668         See bugs: #48800 and #37014
15669
15670         * cs-parser.jay (declare_local_constants): Take an arraylist
15671         instead of a single constant.
15672
15673         (local_constant_declaration): It should take a
15674         constant_declarators, not a constant_declarator.  Fixes 49487
15675
15676         * convert.cs: Fix error report.
15677
15678 2003-10-13 Jackson Harper <jackson@ximian.com>
15679
15680         * typemanager.cs (TypeToCoreType): Add float and double this fixes
15681         bug #49611
15682
15683 2003-10-09  Martin Baulig  <martin@ximian.com>
15684
15685         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
15686         to the .ctor.
15687         (MethodCore.DoDefineParameters): Removed the TypeContainer
15688         argument; use the DeclSpace which was passed to the .ctor instead.
15689         (MethodCore.CheckParameter): Take a DeclSpace instead of a
15690         TypeContainer; we only need a DeclSpace here.
15691
15692 2003-10-09  Martin Baulig  <martin@ximian.com>
15693
15694         * class.cs (MethodData): Added additional `DeclSpace ds' argument
15695         to the .ctor.
15696         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
15697         EmitContext's .ctor.    
15698
15699 2003-10-09  Martin Baulig  <martin@ximian.com>
15700
15701         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
15702         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
15703         AsAccessible(), moved them as well.
15704
15705         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
15706
15707 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
15708
15709         * cs-parser.jay : Renamed yyName to yyNames related to jay.
15710
15711 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
15712
15713         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
15714         generation for >=, as spotted by Paolo, bug 48679.  
15715         Patch from David Waite.
15716
15717         * cs-tokenizer.cs: Add handling for #pragma.
15718
15719         * cs-parser.jay: Allow for both yield and yield return in the
15720         syntax.  The anti-cobolization of C# fight will go on!
15721
15722         * class.cs (TypeBuilder.DefineType): Catch error condition here
15723         (Parent.DefineType erroring out and returning null).
15724
15725         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15726         coping with enumerations variables, we were mistakenly processing
15727         them as a regular value type instead of built-in types.  Fixes the
15728         bug #48063
15729
15730         * typemanager.cs (IsBuiltinOrEnum): New method.
15731
15732 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
15733
15734         * cs-parser.jay: Upgrade: yield now needs the return clause.
15735
15736 2003-09-19  Martin Baulig  <martin@ximian.com>
15737
15738         * decl.cs (MemberCache.SetupCacheForInterface): Take a
15739         `MemberCache parent' argument.  Normally, an interface doesn't
15740         have a parent type except System.Object, but we use this in gmcs
15741         for generic type parameters.
15742
15743 2003-09-18  Martin Baulig  <martin@ximian.com>
15744
15745         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
15746         on `type.IsInterface'; don't check whether the type has a parent
15747         to determine whether it's an interface.
15748
15749 2003-09-15  Martin Baulig  <martin@ximian.com>
15750
15751         * class.cs (TypeContainer.DefineType): Added an error flag to
15752         avoid reporting duplicate CS0146's ("class definition is
15753         circular.").
15754
15755         * driver.cs (Driver.MainDriver): Abort if
15756         RootContext.ResolveTree() reported any errors.
15757
15758 2003-09-07  Martin Baulig  <martin@ximian.com>
15759
15760         * report.cs (Error, Warning): Added overloaded versions which take
15761         a `params object[] args' and call String.Format().
15762
15763 2003-09-07  Martin Baulig  <martin@ximian.com>
15764
15765         * decl.cs (DeclSpace..ctor): Don't call
15766         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
15767         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
15768         (DeclSpace.RecordDecl): New method.
15769
15770         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
15771
15772 2003-09-02  Ravi Pratap  <ravi@ximian.com>
15773
15774         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
15775         value attributes to be applied to ParameterBuilders.
15776
15777         * class.cs (MethodCore.LabelParameters): Make static and more
15778         generic so that it can be used from other places - like interface
15779         methods, for instance.
15780
15781         * interface.cs (Interface.Emit): Call LabelParameters before
15782         emitting attributes on the InterfaceMethod.
15783
15784 2003-08-26  Martin Baulig  <martin@ximian.com>
15785
15786         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
15787         resolving aliases; fixes #47927.
15788
15789 2003-08-26  Martin Baulig  <martin@ximian.com>
15790
15791         * statement.cs (Using.DoResolve): This is internally emitting a
15792         try/finally clause, so we need to set ec.NeedExplicitReturn if we
15793         do not always return.  Fixes #47681.
15794
15795 2003-08-26  Martin Baulig  <martin@ximian.com>
15796
15797         * decl.cs (MemberCore): Moved WarningNotHiding(),
15798         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
15799         into MemberBase.
15800         (AdditionResult): Make this nested in DeclSpace.
15801         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
15802         argument; call NamespaceEntry.Define() unless we're nested in a
15803         class or struct.
15804
15805         * namespace.cs (Namespace.DefineName): New public function.  This
15806         is called from DeclSpace's .ctor to add 
15807         (Namespace.Lookup): Include DeclSpaces in the lookup.
15808
15809         * class.cs (Operator): Derive from MemberBase, not MemberCore.
15810
15811         * const.cs (Const): Derive from MemberBase, not MemberCore.     
15812
15813 2003-08-25  Martin Baulig  <martin@ximian.com>
15814
15815         * convert.cs (Convert.ExplicitReferenceConversion): When
15816         converting from an interface type to a class, unbox if the target
15817         type is a struct type.  Fixes #47822.
15818
15819 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15820
15821         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
15822         #47854.
15823
15824 2003-08-22  Martin Baulig  <martin@ximian.com>
15825
15826         * class.cs (TypeManager.DefineType): When defining a nested type,
15827         call DefineType() on our parent; fixes #47801.
15828
15829 2003-08-22  Martin Baulig  <martin@ximian.com>
15830
15831         * class.cs (MethodData.Define): While checking if a method is an
15832         interface implementation, improve the test a bit more to fix #47654.
15833
15834 2003-08-22  Martin Baulig  <martin@ximian.com>
15835
15836         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
15837         correctly; fixes #47722.
15838
15839 2003-08-22  Martin Baulig  <martin@ximian.com>
15840
15841         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
15842         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
15843
15844         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
15845
15846 2003-08-22  Martin Baulig  <martin@ximian.com>
15847
15848         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
15849         can only be assigned in static constructors.  Fixes #47161.
15850
15851 2003-08-22  Martin Baulig  <martin@ximian.com>
15852
15853         Rewrote and improved the flow analysis code.
15854
15855         * flowbranching.cs (FlowBranching): Make this class abstract.
15856         (FlowBranching.CreateBranching): New static function to create a
15857         new flow branching.
15858         (FlowBranchingBlock, FlowBranchingException): New classes.
15859         (FlowBranching.UsageVector.Type): New public readonly field.
15860         (FlowBranching.UsageVector.Breaks): Removed the setter.
15861         (FlowBranching.UsageVector.Returns): Removed the setter.
15862         (FlowBranching.UsageVector): Added Break(), Return(),
15863         NeverReachable() and Throw() methods to modify the reachability.
15864         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
15865         done by FlowBranching.Merge().
15866         (FlowBranching.UsageVector.MergeChild): New method; merges the
15867         merge result into the current vector.
15868         (FlowBranching.Merge): New abstract method to merge a branching.
15869
15870 2003-08-12  Martin Baulig  <martin@ximian.com>
15871
15872         * expression.cs (Indirection.CacheTemporaries): Create the
15873         LocalTemporary with the pointer type, not its element type.
15874
15875 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
15876
15877         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
15878         token was a keyword or not.
15879
15880         Add `error' options where an IDENTIFIER was expected;  Provide
15881         CheckToken and CheckIdentifierToken convenience error reporting
15882         functions. 
15883
15884         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
15885
15886         * decl.cs: Rename `NamespaceEntry Namespace' public field into
15887         NameSpaceEntry NameSpaceEntry.
15888
15889         (LookupInterfaceOrClass): Avoid creating a full qualified name
15890         from namespace and name: avoid doing lookups when we know the
15891         namespace is non-existant.   Use new Tree.LookupByNamespace which
15892         looks up DeclSpaces based on their namespace, name pair.
15893
15894         * driver.cs: Provide a new `parser verbose' to display the
15895         exception thrown during parsing.  This is turned off by default
15896         now, so the output of a failure from mcs is more graceful.
15897
15898         * namespace.cs: Track all the namespaces defined in a hashtable
15899         for quick lookup.
15900
15901         (IsNamespace): New method
15902
15903 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
15904
15905         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
15906         we know that we need to concatenate (full typename can never be
15907         null). 
15908
15909         * class.cs: ditto.
15910
15911         * statement.cs: Use a bitfield;  Do not initialize to null things
15912         which are done by the constructor by default.
15913
15914         * cs-parser.jay: bug fix, parameter was 4, not 3.
15915
15916         * expression.cs: Just use the property;
15917
15918         * statement.cs: No need for GetVariableInfo method.
15919
15920 2003-08-08  Martin Baulig  <martin@ximian.com>
15921
15922         * flowanalysis.cs (FlowReturns): This is now nested in the
15923         `FlowBranching' class.
15924         (MyBitVector): Moved this here from statement.cs.
15925         (FlowBranching.SiblingType): New enum type.
15926         (FlowBranching.CreateSibling): Added `SiblingType' argument.
15927
15928 2003-08-07  Martin Baulig  <martin@ximian.com>
15929
15930         * flowanalysis.cs (FlowBranchingType): This is now nested in the
15931         `FlowBranching' class and called `BranchingType'.
15932
15933 2003-08-07  Martin Baulig  <martin@ximian.com>
15934
15935         * flowanalysis.cs: Moved all the control flow analysis code into
15936         its own file.
15937
15938 2003-08-07  Martin Baulig  <martin@ximian.com>
15939
15940         * assign.cs (Assign.DoResolve): `target' must either be an
15941         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
15942         #37319.
15943
15944 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
15945
15946         * expression.cs (BinaryMethod): This kind of expression is created by the
15947         Binary class if it determines that the operator has to be handled
15948         by a method.
15949
15950         (BinaryDelegate): This kind of expression is created if we are
15951         dealing with a + or - operator on delegates.
15952
15953         (Binary): remove method, argumetns, and DelegateOperator: when
15954         dealing with methods, 
15955
15956         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
15957
15958         * statement.cs (Block): use bitfields for the three extra booleans
15959         we had in use.   Remove unused topblock parameter.
15960
15961         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
15962
15963         * assign.cs: Drop extra unneeded tests.
15964
15965 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
15966
15967         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
15968
15969         * statement.cs (Foreach): Use VariableStorage instead of
15970         LocalBuilders.   
15971
15972         * codegen.cs (VariableStorage): New class used by clients that
15973         require a variable stored: locals or fields for variables that
15974         need to live across yield.
15975
15976         Maybe provide a convenience api for EmitThis+EmitLoad?
15977
15978         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
15979         these bad boys.
15980
15981 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
15982
15983         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
15984         RemapParameterLValue): New methods that are used to turn a
15985         precomputed FieldInfo into an expression like this:
15986
15987                 instance.FieldInfo
15988
15989         The idea is to use this instead of making LocalVariableReference
15990         have more than one meaning.
15991
15992         * cs-parser.jay: Add error production to BASE.
15993
15994         * ecore.cs: Deal with TypeManager.GetField returning null, which
15995         is now a valid return value.
15996
15997         (FieldExprNoAddress): New expression for Fields whose address can
15998         not be taken.
15999
16000         * expression.cs (LocalVariableReference): During the resolve
16001         phases, create new expressions if we are in a remapping context.
16002         Remove code that dealt with remapping here.
16003
16004         (ParameterReference): same.
16005
16006         (ProxyInstance): New expression, like the `This' expression, but
16007         it is born fully resolved.  We know what we are doing, so remove
16008         the errors that are targeted to user-provided uses of `this'.
16009
16010         * statement.cs (Foreach): our variable is now stored as an
16011         Expression;  During resolution, follow the protocol, dont just
16012         assume it will return this.
16013
16014 2003-08-06  Martin Baulig  <martin@ximian.com>
16015
16016         * support.cs (SeekableStreamReader.cs): New public class.
16017
16018         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
16019         SeekableStreamReader instead of the normal StreamReader.
16020
16021 2003-08-04  Martin Baulig  <martin@ximian.com>
16022
16023         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
16024         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
16025         deambiguate casts and delegate invocations.
16026         (parenthesized_expression): Use the new tokens to ensure this is
16027         not a cast of method invocation.
16028
16029         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
16030         when reading a `)' and Deambiguate_CloseParens () was previously
16031         called.
16032
16033         * expression.cs (ParenthesizedExpression): New class.  This is
16034         just used for the CS0075 test.
16035         (Binary.DoResolve): Check for CS0075.   
16036
16037 2003-07-29  Ravi Pratap  <ravi@ximian.com>
16038
16039         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
16040         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
16041         reference comparison.
16042
16043         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
16044         examine the ReturnType for equality - this is necessary in the
16045         cases of implicit and explicit operators whose signature also
16046         includes the return type.
16047
16048 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
16049
16050         * namespace.cs: Cache the result of the namespace computation,
16051         instead of computing it every time.
16052
16053 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
16054
16055         * decl.cs: Use a global arraylist that we reuse over invocations
16056         to avoid excesive memory consumption.  Reduces memory usage on an
16057         mcs compile by one meg (45 average).
16058
16059         * typemanager.cs (LookupTypeReflection): In .NET pointers are
16060         private, work around that.
16061
16062 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
16063
16064         * literal.cs (IntLiteral): Define Zero and One static literals. 
16065
16066         * cs-parser.jay (integer_literal): use static literals to reduce
16067         memory usage for the most used literals (0, 1 and -1).  211kb
16068         reduced in memory usage.
16069
16070         Replace all calls to `new ArrayList' with `new
16071         ArrayList(4)' which is a good average number for most allocations,
16072         and also requires only 16 bytes of memory for its buffer by
16073         default. 
16074
16075         This reduced MCS memory usage in seven megabytes for the RSS after
16076         bootstrapping.
16077
16078 2003-07-28  Ravi Pratap  <ravi@ximian.com>
16079
16080         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
16081         handle params methods the correct way by forming only one
16082         applicable set with params and normal methods in them. Earlier we
16083         were looking at params methods only if we found no normal methods
16084         which was not the correct thing to do.
16085
16086         (Invocation.BetterFunction): Take separate arguments indicating
16087         when candidate and the best method are params methods in their
16088         expanded form.
16089
16090         This fixes bugs #43367 and #46199.
16091
16092         * attribute.cs: Documentation updates.
16093
16094         (CheckAttribute): Rename to CheckAttributeTarget.
16095         (GetValidPlaces): Rename to GetValidTargets.
16096
16097         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
16098         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
16099
16100         Fixes bug #44468.
16101
16102 2003-07-28  Martin Baulig  <martin@ximian.com>
16103
16104         * class.cs (TypeContainer.DefineMembers): Use the base type's full
16105         name when looking up the base class of a nested class.  Fixes #46977.
16106
16107 2003-07-26  Martin Baulig  <martin@ximian.com>
16108
16109         * expression.cs (Indexers.Indexer): New nested struct; contains
16110         getter, setter and the indexer's type.
16111         (Indexers.Properties): This is now an ArrayList of
16112         Indexers.Indexer's.
16113         (IndexerAccess.DoResolveLValue): Correctly set the type if the
16114         indexer doesn't have any getters.
16115
16116         * assign.cs (Assign.DoResolve): Also do the implicit conversions
16117         for embedded property and indexer assignments.
16118
16119 2003-07-26  Martin Baulig  <martin@ximian.com>
16120
16121         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
16122         preprocessor directive is not the first non-whitespace character
16123         on a line.
16124
16125 2003-07-26  Martin Baulig  <martin@ximian.com>
16126
16127         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
16128         namespace parsing, follow the spec more closely.
16129
16130         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
16131         NamespaceEntry.Lookup().
16132
16133 2003-07-25  Martin Baulig  <martin@ximian.com>
16134
16135         * MethodCore.cs (OverridesSomething): New public field; it's set
16136         from TypeContainer.DefineMembers if this method overrides
16137         something (which doesn't need to be a method).  Fix #39462.
16138
16139 2003-07-25  Ravi Pratap  <ravi@ximian.com>
16140
16141         * typemanager.cs (GetMembers): Ensure that the list of members is
16142         reversed. This keeps things in sync.
16143
16144         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
16145         find an AttributeUsage attribute.
16146
16147         * expression.cs (Invocation.OverloadResolve): Perform the check
16148         which disallows Invoke to be directly called on a Delegate.
16149
16150         (Error_InvokeOnDelegate): Report error cs1533.
16151
16152 2003-07-25  Martin Baulig  <martin@ximian.com>
16153
16154         * expression.cs (Indexers.GetIndexersForType): Only look in the
16155         interface hierarchy if the requested type is already an
16156         interface.  Fixes #46788 while keeping #46502 fixed.
16157
16158 2003-07-25  Martin Baulig  <martin@ximian.com>
16159
16160         * class.cs (TypeContainer.DefineMembers): Check whether all
16161         readonly fields have been assigned and report warning CS0649 if
16162         not.
16163
16164         * statement.cs (LocalInfo.IsFixed): Always return true if this is
16165         a valuetype.
16166
16167 2003-07-24  Ravi Pratap  <ravi@ximian.com>
16168
16169         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
16170         returned from GetMethods to make things consistent with the
16171         assumptions MCS makes about ordering of methods.
16172
16173         This should comprehensively fix bug #45127 and it does :-)
16174
16175         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
16176         ordering is actually reverse.
16177
16178         * Clean up some debug messages I left lying around.
16179
16180         * interface.cs (Populate*): Get rid of code which emits attributes
16181         since the stage in which we emit attributes is the 'Emit' stage,
16182         not the define stage.
16183
16184         (Emit): Move attribute emission for interface members here.
16185
16186 2003-07-22  Ravi Pratap  <ravi@ximian.com>
16187
16188         * expression.cs (Invocation.OverloadResolve): Follow the spec more
16189         closely: we eliminate methods in base types when we have an
16190         applicable method in a top-level type.
16191
16192         Please see section 14.5.5.1 for an exact description of what goes
16193         on. 
16194
16195         This fixes bug #45127 and a host of other related to corlib compilation.
16196
16197         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
16198         array is the method corresponding to the top-level type (this is
16199         because of the changes made to icall.c) so we change this
16200         accordingly.
16201
16202         (MethodGroupExpr.Name): This too.
16203
16204         * typemanager.cs (GetElementType): New method which does the right
16205         thing when compiling corlib. 
16206
16207         * everywhere: Make use of the above in the relevant places.
16208
16209 2003-07-22  Martin Baulig  <martin@ximian.com>
16210
16211         * cs-parser.jay (invocation_expression): Moved
16212         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
16213         `cast_expression', but create a InvocationOrCast which later
16214         resolves to either an Invocation or a Cast.
16215
16216         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
16217         method; call this before EmitStatement() to make sure that this
16218         expression can be used as a statement.
16219
16220         * expression.cs (InvocationOrCast): New class; resolves to either
16221         an Invocation or a Cast.
16222
16223         * statement.cs (StatementExpression): Call ResolveStatement() on
16224         the ExpressionStatement before emitting it.
16225
16226 2003-07-21  Martin Baulig  <martin@ximian.com>
16227
16228         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
16229         `ref' and `out' attributes match; fixes #46220.
16230         (MemberAccess.ResolveMemberAccess): You can't reference a type
16231         through an expression; fixes #33180.
16232         (Indexers.GetIndexersForType): Don't return the indexers from
16233         interfaces the class implements; fixes #46502.
16234
16235 2003-07-21  Martin Baulig  <martin@ximian.com>
16236
16237         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
16238         CS0661 checks; fixes bug #30442.
16239
16240 2003-07-21  Martin Baulig  <martin@ximian.com>
16241
16242         * decl.cs (AdditionResult): Added `Error'.
16243
16244         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
16245
16246         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
16247         makes cs0031.cs actually work.
16248
16249 2003-07-20  Martin Baulig  <martin@ximian.com>
16250
16251         * namespace.cs: Fixed that bug which caused a crash when compiling
16252         the debugger's GUI.
16253
16254 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
16255
16256         * typemanager.cs (LookupTypeReflection): Never expose types which
16257         are NotPublic, NestedPrivate, NestedAssembly, or
16258         NestedFamANDAssem.  We used to return these, and later do a check
16259         that would report a meaningful error, but the problem is that we
16260         would not get the real match, if there was a name override.
16261
16262 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
16263
16264         * namespace.cs (Namespace, Name): Do not compute the namespace
16265         name dynamically, compute it in the constructor.  This reduced
16266         memory usage by 1697 KB.
16267
16268         * driver.cs: Use --pause to pause at the end.
16269
16270 2003-07-17  Peter Williams  <peter@newton.cx>
16271
16272         * Makefile: Change the name of the test target so that it doesn't
16273         conflict with the recursive test target.
16274
16275 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
16276
16277         * expression.cs (LocalVariableReference.Emit, EmitAssign,
16278         AddressOf): Do not use EmitThis, that was wrong, use the actual
16279         this pointer.
16280
16281 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
16282
16283         * class.cs (MethodData.Define): While checking if a method is an
16284         interface implementation, improve the test: If we are not public
16285         (use new test here: use the computed MethodAttributes directly,
16286         instead of the parsed modifier flags) check if the `implementing'
16287         method comes from an interface or not.
16288
16289         * pending.cs (VerifyPendingMethods): Slightly better error
16290         message.
16291
16292         * makefile: add test target that does the mcs bootstrap.
16293
16294 2003-07-16  Ravi Pratap  <ravi@ximian.com>
16295
16296         * interface.cs (Define): Do nothing here since there are no
16297         members to populate etc. Move the attribute emission out of here
16298         since this was just totally the wrong place to put it. Attribute
16299         application happens during the 'Emit' phase, not in the 'Define'
16300         phase.
16301
16302         (Emit): Add this method and move the attribute emission here
16303
16304         * rootcontext.cs (EmitCode): Call the Emit method on interface
16305         types too.
16306
16307 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
16308
16309         * expression.cs (OverloadResolve): Report error only if Location
16310         is not 'Null' which means that there was a probe going on.
16311
16312 2003-07-14  Martin Baulig  <martin@ximian.com>
16313
16314         * expression.cs (ConditionalLogicalOperator): New public class to
16315         implement user defined conditional logical operators.
16316         This is section 14.11.2 in the spec and bug #40505.
16317
16318 2003-07-14  Martin Baulig  <martin@ximian.com>
16319
16320         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
16321
16322 2003-07-14  Martin Baulig  <martin@ximian.com>
16323
16324         * codegen.cs (EmitContext.InFixedInitializer): New public field.
16325
16326         * ecore.cs (IVariable.VerifyFixed): New interface method.
16327
16328         * expression.cs (Unary.ResolveOperator): When resolving the `&'
16329         operator, check whether the variable is actually fixed.  Fixes bug
16330         #36055.  Set a variable definitely assigned when taking its
16331         address as required by the spec.
16332
16333         * statement.cs (LocalInfo.IsFixed): New field.
16334         (LocalInfo.MakePinned): Set `IsFixed' to true.
16335
16336 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
16337
16338         * attribute.cs (Attribute.Resolve): While doing a Member lookup
16339         for .ctors, ensure that we only ask for members declared in the
16340         attribute type (BindingFlags.DeclaredOnly).
16341
16342         Fixes bug #43632.
16343
16344         * expression.cs (Error_WrongNumArguments): Report error 1501
16345         correctly the way CSC does.
16346
16347 2003-07-13  Martin Baulig  <martin@ximian.com>
16348
16349         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
16350         lookup on the fully qualified name, to make things like "X.X" work
16351         where "X.X" is a fully qualified type name, but we also have a
16352         namespace "X" in the using list.  Fixes #41975.
16353
16354 2003-07-13  Martin Baulig  <martin@ximian.com>
16355
16356         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
16357         function. If we're a CompoundAssign, we need to create an embedded
16358         CompoundAssign, not an embedded Assign.
16359         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
16360         Fixes #45854.
16361
16362 2003-07-13  Martin Baulig  <martin@ximian.com>
16363
16364         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
16365         work to fix bug #46088.
16366
16367 2003-07-13  Ravi Pratap <ravi@ximian.com>
16368
16369         * class.cs (Operator.Emit): Do not emit attributes here - it is
16370         taken care of by the Method class that we delegate too. This takes
16371         care of bug #45876.
16372
16373 2003-07-10  Martin Baulig  <martin@ximian.com>
16374
16375         * expression.cs (TypeOfVoid): New class.
16376         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
16377
16378 2003-07-10  Martin Baulig  <martin@ximian.com>
16379
16380         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
16381         bug #35957.
16382
16383 2003-07-10  Martin Baulig  <martin@ximian.com>
16384
16385         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
16386         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
16387
16388         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
16389
16390         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
16391
16392 2003-07-10  Martin Baulig  <martin@ximian.com>
16393
16394         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
16395         of decimal.  Fixes #42850.
16396
16397         NOTE: I also fixed the created byte blob, but this doesn't work on
16398         the MS runtime and csc never produces any byte blobs for decimal
16399         arrays.
16400
16401 2003-07-10  Martin Baulig  <martin@ximian.com>
16402
16403         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
16404         structs; fixes #32068.
16405         (Block.AddChildVariableNames): Fixed #44302.
16406
16407 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16408
16409         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
16410
16411 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
16412
16413         * attribute.cs: And this test is onger needed.
16414
16415 2003-07-08  Martin Baulig  <martin@ximian.com>
16416
16417         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
16418         inaccessible types.  Fixes #36313.
16419
16420         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
16421
16422         * namespace.cs (NamespaceEntry): Create implicit entries for all
16423         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
16424         implicit entries for N1.N2 and N1.
16425
16426 2003-07-08  Martin Baulig  <martin@ximian.com>
16427
16428         Rewrote the handling of namespaces to fix a lot of the issues
16429         wrt. `using' aliases etc.
16430
16431         * namespace.cs (Namespace): Splitted this class into a
16432         per-assembly `Namespace' and a per-file `NamespaceEntry'.
16433
16434         * typemanager.cs (TypeManager.IsNamespace): Removed.
16435         (TypeManager.ComputeNamespaces): Only compute namespaces from
16436         loaded assemblies here, not the namespaces from the assembly we're
16437         currently compiling.
16438
16439 2003-07-08  Martin Baulig  <martin@ximian.com>
16440
16441         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
16442
16443 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
16444
16445         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
16446         already fixed it.  
16447
16448         I thought about the memory savings here, but LookupTypeReflection
16449         is used under already very constrained scenarios.  Compiling
16450         corlib or mcs only exposes one hit, so it would not really reduce
16451         any memory consumption.
16452
16453 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16454
16455         * typemanager.cs: fixes bug #45889 by only adding public types from
16456         other assemblies to the list of known types.
16457
16458 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
16459
16460         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
16461         on the type we resolved.
16462
16463 2003-07-05  Martin Baulig  <martin@ximian.com>
16464
16465         * pending.cs (PendingImplementation.ParentImplements): Don't
16466         create the proxy if the parent is abstract.
16467
16468         * class.cs (TypeContainer.DefineIndexers): Process explicit
16469         interface implementations first.  Fixes #37714.
16470
16471 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
16472
16473         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
16474         defined recursively;  but since we modify the input parameters
16475         (left is set to `this' temporarily), we reset this value if the
16476         left_is_explicit is false, which gives the original semantics to
16477         the code.  
16478
16479         * literal.cs (NullPointer): new class used to represent a null
16480         literal in a pointer context.
16481
16482         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
16483         type is a pointer, use a NullPointer object instead of a
16484         NullLiteral.   Closes 43687
16485
16486         (ExplicitConversion): Convert pointer values using
16487         the conv opcode to the proper type.
16488
16489         * ecore.cs (New): change ValueTypeVariable property into a method,
16490         that returns whether the valuetype is suitable for being used.
16491
16492         * expression.cs (Binary.DoNumericPromotions): Only return if we
16493         the int constant was a valid uint, and we can return both left and
16494         right as uints.  If not, we continue processing, to trigger the
16495         type conversion.  This fixes 39018.
16496
16497         * statement.cs (Block.EmitMeta): During constant resolution, set
16498         the CurrentBlock property on the emitcontext, so that we resolve
16499         constants propertly.
16500
16501 2003-07-02  Martin Baulig  <martin@ximian.com>
16502
16503         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
16504         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
16505
16506         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
16507         than emitting it here.
16508
16509         * statement.cs: Fixed some more flow analysis bugs.
16510
16511 2003-07-02  Martin Baulig  <martin@ximian.com>
16512
16513         * class.cs (MethodData.Define): When implementing interface
16514         methods, set Final unless we're Virtual.
16515
16516         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
16517         check work for interface methods.
16518
16519 2003-07-01  Martin Baulig  <martin@ximian.com>
16520
16521         * ecore.cs (EmitContext.This): Replaced this property with a
16522         GetThis() method which takes a Location argument.  This ensures
16523         that we get the correct error location for a CS0188.
16524
16525 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
16526
16527         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
16528         ImplicitStandardConversion.
16529
16530         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
16531
16532 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
16533
16534         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
16535         optimization.
16536
16537 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
16538
16539         * class.cs (Constructor.Define): Turn off initlocals for unsafe
16540         constructors.
16541
16542         (MethodData.Define): Turn off initlocals for unsafe methods.
16543
16544 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
16545
16546         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
16547         complete;  Fixes #37521.
16548
16549         * delegate.cs: Use Modifiers.TypeAttr to compute the
16550         TypeAttributes, instead of rolling our own.  This makes the flags
16551         correct for the delegates.
16552
16553 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
16554
16555         * class.cs (Constructor.Define): Set the private flag for static
16556         constructors as well.
16557
16558         * cs-parser.jay (statement_expression): Set the return value to
16559         null, to avoid a crash when we catch an error.
16560
16561 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
16562
16563         * cs-parser.jay: Applied patch from Jackson that adds support for
16564         extern and unsafe modifiers to destructor declarations.
16565
16566         * expression.cs: Report error 21 if the user is trying to index a
16567         System.Array.
16568
16569         * driver.cs: Add an error message, suggested by the bug report.
16570
16571         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
16572         if we do not have a ": this ()" constructor initializer.  Fixes 45149
16573
16574 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
16575
16576         * namespace.cs: Add some information to reduce FAQs.
16577
16578 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
16579
16580         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
16581         underlying enumeration types.  Fixes #43915.
16582
16583         * expression.cs: Treat ushort/short as legal values to be used in
16584         bitwise operations.
16585
16586 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
16587
16588         * delegate.cs: transfer custom attributes for paramenters from
16589         the delegate declaration to Invoke and BeginInvoke.
16590
16591 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
16592
16593         * attribute.cs: handle custom marshalers and emit marshal info
16594         for fields, too.
16595
16596 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
16597
16598         * makefile.gnu: Added anonymous.cs to the compiler sources.
16599
16600 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
16601
16602         * iterators.cs: Change the name of the proxy class to include two
16603         underscores.
16604
16605         * cs-parser.jay: Update grammar to include anonymous methods.
16606
16607         * anonymous.cs: new file.
16608
16609 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
16610
16611         * class.cs (Field.Define): Add missing test for pointers and
16612         safety. 
16613
16614 2003-05-27  Ravi Pratap  <ravi@ximian.com>
16615
16616         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
16617         we use the stobj opcode.
16618
16619         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
16620         since it wasn't the correct fix. 
16621
16622         It still is puzzling that we are required to use stobj for IntPtr
16623         which seems to be a ValueType.
16624
16625 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
16626
16627         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
16628         during regular simple name resolution.   Now, the trick is that
16629         instead of returning for processing the simplename, we do a
16630         TypeManager.LookupType (ie, a rooted lookup as opposed to a
16631         contextual lookup type).   If a match is found, return that, if
16632         not, return for further composition.
16633
16634         This fixes long-standing 30485.
16635
16636         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
16637         using the address to initialize an object, do an Stobj instead of
16638         using the regular Stelem.
16639
16640         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
16641         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
16642         Because if we are a BaseIndexerAccess that value will be true.
16643         Fixes 43643.
16644
16645         * statement.cs (GotoCase.Resolve): Return after reporting an
16646         error, do not attempt to continue. 
16647
16648         * expression.cs (PointerArithmetic.Emit): If our operand is a
16649         long, convert our constants to match the operand before
16650         multiplying.  Convert to I type before adding.   Fixes 43670.
16651
16652 2003-05-14  Ravi Pratap  <ravi@ximian.com>
16653
16654         * enum.cs (ImplicitConversionExists) : Rename to
16655         ImplicitEnumConversionExists to remove ambiguity. 
16656
16657         * ecore.cs (NullCast): New type of cast expression class which
16658         basically is very similar to EmptyCast with the difference being
16659         it still is a constant since it is used only to cast a null to
16660         something else
16661         (eg. (string) null)
16662
16663         * convert.cs (ImplicitReferenceConversion): When casting a null
16664         literal, we return a NullCast.
16665
16666         * literal.cs (NullLiteralTyped): Remove - I don't see why this
16667         should be around anymore.
16668
16669         The renaming (reported was slightly wrong). Corrections:
16670
16671         ConvertImplicitStandard -> ImplicitConversionStandard
16672         ConvertExplicitStandard -> ExplicitConversionStandard
16673
16674         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
16675         before passing them in !
16676
16677         * convert.cs (ImplicitConversionStandard): When comparing for
16678         equal expr and target types, ensure that expr is not a
16679         NullLiteral.
16680
16681         In general, we must not be checking (expr_type ==
16682         target_type) in the top level conversion methods
16683         (ImplicitConversion, ExplicitConversion etc). This checking is
16684         done in the methods that they delegate to.
16685
16686 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
16687
16688         * convert.cs: Move Error_CannotConvertType,
16689         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
16690         ImplicitNumericConversion, ImplicitConversionExists,
16691         ImplicitUserConversionExists, StandardConversionExists,
16692         FindMostEncompassedType, FindMostSpecificSource,
16693         FindMostSpecificTarget, ImplicitUserConversion,
16694         ExplicitUserConversion, GetConversionOperators,
16695         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
16696         TryImplicitIntConversion, Error_CannotConvertImplicit,
16697         ConvertImplicitRequired, ConvertNumericExplicit,
16698         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
16699         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
16700         its own file.
16701
16702         Perform the following renames:
16703
16704         StandardConversionExists -> ImplicitStandardConversionExists
16705         ConvertImplicit -> ImplicitConversion
16706         ConvertImplicitStandard -> ImplicitStandardConversion
16707         TryImplicitIntConversion -> ImplicitIntConversion
16708         ConvertImplicitRequired -> ImplicitConversionRequired
16709         ConvertNumericExplicit -> ExplicitNumericConversion
16710         ConvertReferenceExplicit -> ExplicitReferenceConversion
16711         ConvertExplicit -> ExplicitConversion
16712         ConvertExplicitStandard -> ExplicitStandardConversion
16713
16714 2003-05-19  Martin Baulig  <martin@ximian.com>
16715
16716         * statement.cs (TypeInfo.StructInfo): Made this type protected.
16717         (TypeInfo): Added support for structs having structs as fields.
16718
16719         * ecore.cs (FieldExpr): Implement IVariable.
16720         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
16721         VariableInfo for the field.
16722
16723 2003-05-18  Martin Baulig  <martin@ximian.com>
16724
16725         * expression.cs (This.DoResolve): Report a CS0027 if we're
16726         emitting a field initializer.
16727
16728 2003-05-18  Martin Baulig  <martin@ximian.com>
16729
16730         * expression.cs (This.ResolveBase): New public function.
16731         (This.DoResolve): Check for CS0188.
16732
16733         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
16734         This.Resolve().
16735
16736         * ecore.cs (MethodGroupExpr.DoResolve): Set the
16737         `instance_expression' to null if we don't have any non-static
16738         methods.
16739
16740 2003-05-18  Martin Baulig  <martin@ximian.com>
16741
16742         Reworked the way how local variables and parameters are handled by
16743         the flow analysis code.
16744
16745         * statement.cs (TypeInfo, VariableMap): New public classes.
16746         (VariableInfo): New public class.  This is now responsible for
16747         checking whether a variable has been assigned.  It is used for
16748         parameters and local variables.
16749         (Block.EmitMeta): Take the InternalParameters as argument; compute
16750         the layout of the flow vectors here.
16751         (Block.LocalMap, Block.ParameterMap): New public properties.
16752         (FlowBranching): The .ctor doesn't get the InternalParameters
16753         anymore since Block.EmitMeta() now computes the layout of the flow
16754         vector.
16755         (MyStructInfo): This class is now known as `StructInfo' and nested
16756         in `TypeInfo'; we don't access this directly anymore.
16757
16758         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
16759         property and removed IsAssigned(), IsFieldAssigned(),
16760         SetAssigned() and SetFieldAssigned(); we now call them on the
16761         VariableInfo so we don't need to duplicate this code everywhere.
16762
16763         * expression.cs (ParameterReference): Added `Block block' argument
16764         to the .ctor.
16765         (LocalVariableReference, ParameterReference, This): The new
16766         VariableInfo class is now responsible for all the definite
16767         assignment stuff.
16768
16769         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
16770         IsParameterAssigned, SetParameterAssigned): Removed.
16771
16772 2003-05-18  Martin Baulig  <martin@ximian.com>
16773
16774         * typemanager.cs (InitCoreTypes): Try calling
16775         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
16776         the 3-args-version.  Corlib now also needs our `void_type'.
16777         (GetMethod): Added overloaded version which takes an optional
16778         `bool report_errors' to allow lookups of optional methods.
16779
16780 2003-05-12  Martin Baulig  <martin@ximian.com>
16781
16782         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
16783         only used for locals and not for parameters.
16784
16785 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
16786
16787         * support.cs (InternalParameters.ParameterType): Return the
16788         ExternalType of the parameter.
16789
16790         * parameter.cs (Parameter.ExternalType): drop the two arguments,
16791         they were unused.
16792
16793 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
16794
16795         * class.cs (MethodData.Define): Do not set the `newslot' on
16796         interface members, if they are also flagged as "override".
16797
16798         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
16799         better code for ++i and i++.  This only works for static fields
16800         and local variables.
16801
16802         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
16803         want to pull the DeclSpace out of the builder_to_declspace instead
16804         of the TypeBuilder (like in TypeContainer.FindMembers).
16805
16806         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
16807         instead of LookupTypeContainer.  Fixes the crash on .NET for
16808         looking up interface members.
16809
16810         * const.cs: Create our own emit context during the Definition
16811         stage, so that constants are evaluated in the proper context, when
16812         a recursive definition happens.
16813
16814 2003-05-11  Martin Baulig  <martin@ximian.com>
16815
16816         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
16817         new block for a switch section.
16818         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
16819         the adding/lookup in the switch block.  Fixes #39828.
16820
16821 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
16822
16823         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
16824         functionality: I needed to convert the data after I had performed
16825         the add/sub operation into the operands type size.
16826
16827         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
16828         pass the type for the box operation, otherwise the resulting
16829         object would have been of type object.
16830
16831         (BoxedCast): Add constructor to specify the type to box as.
16832
16833 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
16834
16835         * iterators.cs: I was reusing the `count' variable inadvertently,
16836         take steps to not allow this to happen.
16837
16838 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
16839
16840         * attribute.cs (Attribute.Resolve): Params attributes are encoded
16841         by creating an array at the point where the params starts and
16842         putting all those arguments there, then adjusting the size of the
16843         array.
16844
16845 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
16846
16847         * expression.cs (New.AddressOf): Implement interface
16848         IMemoryLocation.  This is used when the `new' operator is used in
16849         the context of an invocation to a method on a value type.
16850
16851         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
16852         example. 
16853
16854         * namespace.cs: Also check the using aliases here.
16855
16856         * driver.cs: Move the test for using validity after the types have
16857         been entered, so we do a single pass that also includes the using
16858         aliases. 
16859
16860         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
16861         in the regular case.   CreateSiblingForFinally is doing extra
16862         error checking.
16863
16864         * attribute.cs (GetAttributeArgumentExpression): Store the result
16865         on an out value, and use the return value to indicate failure
16866         instead of using null (which is a valid return for Constant.GetValue).
16867
16868         * statement.cs: Perform the analysis flow for the increment
16869         portion after the statement, because this will be the real flow of
16870         execution.  Fixes #42385
16871
16872         * codegen.cs (EmitContext.EmitArgument,
16873         EmitContext.EmitStoreArgument): New helper functions when the
16874         RemapToProxy flag is set.
16875
16876         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
16877         function.
16878
16879         Add support for remapping parameters. 
16880
16881         * iterators.cs: Propagate parameter values;  Store parameter
16882         values in the proxy classes.
16883
16884 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
16885
16886         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
16887         need a proxy reference;  I do not know what I was thinking
16888
16889         * cs-parser.jay (constructor_initializer): catch another error,
16890         and display nice message.
16891
16892         (field_declaration): catch void field declaration
16893         to flag a better error. 
16894
16895         * class.cs (MemberBase.CheckBase): Report an error instead of a
16896         warning if a new protected member is declared in a struct. 
16897         (Field.Define): catch the error of readonly/volatile.
16898
16899         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
16900
16901         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
16902         volatile variable is taken
16903
16904 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
16905
16906         * statement.cs (Fixed.Resolve): Report an error if we are not in
16907         an unsafe context.
16908
16909 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
16910
16911         * typemanager.cs: reuse the code that handles type clashes for
16912         delegates and enumerations.
16913
16914         * class.cs (Report28): Always report.
16915
16916         * expression.cs (EncodeAsAttribute): Allow nulls here.
16917
16918 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
16919
16920         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
16921         the functionality for testing whether an expression is valid for
16922         an attribute here.  Also handle the case of arrays of elements
16923         being stored. 
16924
16925         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
16926         encoding a linear array into an array of objects that are suitable
16927         to be passed to an CustomAttributeBuilder.
16928
16929         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
16930
16931         * ecore.cs: (FieldExpr): Handle field remapping here.
16932
16933         * iteratators.cs: Pass the instance variable (if the method is an
16934         instance method) to the constructors, so we can access the field
16935         variables on the class.
16936
16937         TODO: Test this with structs.  I think the THIS variable on
16938         structs might have to be a pointer, and not a refenrece
16939
16940 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
16941
16942         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
16943         local variables to fields in a proxy class.
16944
16945         * iterators.cs (PopulateProxy): Rename our internal fields to
16946         <XXX>.  
16947         Create a <THIS> field if we are an instance method, so we can
16948         reference our parent container variables.
16949         (MapVariable): Called back from the EmitContext code to enter a
16950         new variable to field mapping into the proxy class (we just create
16951         a FieldBuilder).
16952
16953         * expression.cs
16954         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
16955         for using the remapped locals to fields.
16956
16957         I placed the code here, because that gives the same semantics to
16958         local variables, and only changes the Emit code.
16959
16960         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
16961         statements inside iterators.
16962         (VariableInfo): Add a FieldBuilder for the cases when we are
16963         remapping local variables to fields in a proxy class
16964
16965         * ecore.cs (SimpleNameResolve): Avoid testing two times for
16966         current_block != null.
16967
16968         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
16969         not cope with strings, as it has been moved to the
16970         TableSwitchEmit.  Fixed bug in switch generation.
16971
16972         * expression.cs (New.DoResolve): Provide more context for the user
16973         when reporting an error.
16974
16975         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
16976         pointers. 
16977
16978         * expression.cs (MemberAccess.DoResolve): When we get a type back,
16979         check the permissions for it.  Note than in a type-resolution
16980         context the check was already present in DeclSpace.ResolveType,
16981         but was missing from the MemberAccess.
16982
16983         (ArrayCreation.CheckIndices): warn if the user has
16984         more nested levels of expressions, but there are no more
16985         dimensions specified.  Avoids crash on bug 41906.
16986
16987 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
16988
16989         * statement.cs (Block): replace Implicit bool, for a generic
16990         flags.   
16991         New flag: `Unchecked'.  This is used during the EmitMeta phase
16992         (which is out-of-line with the regular Resolve/Emit process for a
16993         statement, as this is done ahead of time, but still gets a chance
16994         to call constant resolve).
16995
16996         (Block.Flags): new enum for adding a new flag.
16997
16998         (Block.EmitMeta): track the state of unchecked.
16999
17000         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
17001         to enable constant resolution to work there as well.
17002
17003 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
17004
17005         * typemanager.cs (ienumerable_type): Also look up
17006         System.Collections.IEnumerable. 
17007
17008 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
17009
17010         TODO: Test more than one conditional per method.
17011
17012         * class.cs (Indexer.Define): Report the location where the user is
17013         referencing the unsupported feature.
17014
17015         (MethodData): Overload the use of `conditionals' to
17016         minimize the creation of needless ArrayLists.   This saves roughly
17017         212kb on my machine.
17018
17019         (Method): Implement the new IIteratorContainer interface.
17020         (Method.SetYields): Implement the method by setting the ModFlags
17021         to contain METHOD_YIELDS.
17022
17023         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
17024         which just got set to null.
17025
17026         * iterators.cs: New file.
17027
17028         (Yield, YieldBreak): New statements.
17029
17030         * statement.cs (Return.Resolve): Flag an error if we are used in
17031         an iterator method.
17032
17033         * codegen.cs (InIterator): New flag set if the code is being
17034         compiled in an iterator method.
17035
17036         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
17037         internal modifier, and we just use it to avoid adding extra
17038         fields, as this is seldom used.  
17039
17040         * cs-parser.jay: Add yield_statement (yield and yield break).
17041
17042         * driver.cs: New flag -v2 to turn on version 2 features. 
17043
17044         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
17045         hashtable when v2 is enabled.
17046
17047 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
17048
17049         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
17050         there is already a namespace defined with this name.
17051
17052         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
17053         people upgraded their corlibs.
17054
17055         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
17056         always use fully qualified types, no need to use the compiler
17057         front end.
17058
17059         (TypeManager.IsNamespace): Use binarysearch.
17060
17061         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
17062         AddDelegate): I did not quite use the new IsValid API properly: I
17063         have to pass the short-name and the fullname.  I was passing only
17064         the basename instead of the fullname sometimes. 
17065
17066         (TypeContainer.DefineType): call NamespaceClash.
17067
17068         * interface.cs (Interface.DefineType): use NamespaceClash before
17069         defining the type.
17070
17071         * delegate.cs (Delegate.DefineType): use NamespaceClash before
17072         defining the type.
17073
17074         * enum.cs: (Enum.DefineType): use NamespaceClash before
17075         defining the type.
17076
17077         * typemanager.cs (: 3-line patch that gives us some tasty 11%
17078         speed increase.  First, use the negative_hits cache when we get a
17079         negative.  Second, add the type with its full original name
17080         instead of the new . and + encoded name (reflection uses + to
17081         separate type from a nested type).  Use LookupTypeReflection
17082         directly which bypasses the type->name hashtable (that we already
17083         know does not contain the type.
17084
17085         * decl.cs (DeclSpace.ResolveTypeExpr): track the
17086         location/container type. 
17087
17088         * driver.cs: When passing utf8, use directly the UTF8Encoding.
17089
17090 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
17091
17092         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
17093
17094         * delegate.cs (NewDelegate.Resolve): Test whether an instance
17095         method is being referenced in the method group from a static
17096         context, and report error 120 if so.
17097
17098         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
17099         Error118. 
17100
17101         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
17102         is created, we create the A namespace).
17103
17104         * cs-parser.jay: A namespace also introduces a DeclarationFound.
17105         Fixes #41591
17106
17107 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
17108
17109         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
17110         invocation to ModuleBuilder.GetType with the same values will
17111         return a new type instance, so we need to cache its return
17112         values. 
17113
17114         * expression.cs (Binary.ResolveOperator): Only allow the compare
17115         operators on enums if they are of the same type.
17116
17117         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
17118         types of ValueType on their own case.  Before we were giving them
17119         the same treatment as objects.
17120
17121         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
17122         fullname.  Short name is used to compare against container name.
17123         Fullname is used to check against defined namespace names.
17124
17125         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
17126         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
17127
17128         (Method.CheckBase): Call parent.
17129         (MemberBase.CheckBase): Check for protected members on sealed
17130         classes.
17131         (PropertyBase.CheckBase): Call parent.
17132         (Field.Define): Call parent.
17133
17134         * report.cs: Negative error codes are now mapped to 8000 - code,
17135         so that the display is render more nicely.
17136
17137         * typemanager.cs: Do not use try/catch, instead report a regular
17138         error. 
17139
17140         (GetPointerType, GetReferenceType): These methods provide
17141         mechanisms to obtain the T* and T& from a T.  We had the code
17142         previously scattered around the code base, and it also used
17143         TypeManager.LookupType that would go through plenty of caches.
17144         This one goes directly to the type source.
17145
17146         In some places we did the Type.GetType followed by
17147         ModuleBuilder.GetType, but not in others, so this unifies the
17148         processing as well.
17149
17150         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
17151         statements now that we have namespace information.
17152
17153         * typemanager.cs (IsNamespace): New method, returns whether the
17154         string presented is a namespace or not.
17155
17156         (ComputeNamespaces): New public entry point, computes the list of
17157         available namespaces, using the GetNamespaces API call in Mono, or
17158         the slower version in MS.NET.   
17159
17160         Now before we start the semantic analysis phase, we have a
17161         complete list of namespaces including everything that the user has
17162         provided.
17163
17164         Deleted old code to cache namespaces in .nsc files.
17165
17166 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
17167
17168         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
17169         class/struct location definition Location for the implicit
17170         constructor location.
17171
17172         (Operator.Define): Use the location of the operator for the
17173         implicit Method definition.
17174
17175         (Constructor.Emit): use the constructor location for the implicit
17176         base initializer constructor.
17177
17178         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
17179         and the Expression class now contains two new methods:
17180
17181         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
17182         isolate type lookup from the rest of the resolution process.
17183
17184         Since we use Expressions to hold type definitions due to the way
17185         we parse the input we have historically overloaded Resolve to
17186         perform the Type lookups if a special flag is passed.  Now this is
17187         eliminated and two methods take their place. 
17188
17189         The differences in the two methods between xStep and xTerminal is
17190         that xStep is involved in our current lookup system that uses
17191         SimpleNames to compose a name, while xTerminal is used just to
17192         catch the case where the simplename lookup failed.
17193
17194 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
17195
17196         * expression.cs (ResolveMemberAccess): Remove redundant code.
17197         TypeExpr expressions are always born fully resolved.
17198
17199         * interface.cs (PopulateMethod): Do not lookup the types twice.
17200         We were doing it once during SemanticAnalysis and once during
17201         PopulateMethod.
17202
17203         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
17204         in local variable type definitions, were being returned as a
17205         SimpleName (we decomposed everything into a string), that is
17206         because primary_expression was being used instead of a type in the
17207         grammar (reduce/reduce conflicts).
17208
17209         The part that was wrong is that we converted the expression into a
17210         string (an oversimplification in one hand, compounded with primary
17211         expressions doing string concatenation).
17212
17213         So things like:
17214
17215         A.B.C [] x;
17216
17217         Would return "A.B.C[]" as a SimpleName.  This stopped things like
17218         using clauses from working on this particular context.  And a type
17219         was being matched directly against "A.B.C[]".
17220
17221         We now use the correct approach, and allow for ComposedCast to be
17222         part of the unary expression.  So the "A.B.C []" become a composed
17223         cast of "A.B.C" (as a nested group of MemberAccess with a
17224         SimpleName at the end) plus the rank composition "[]". 
17225
17226         Also fixes 35567
17227
17228 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
17229
17230         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
17231         for the access level checking.
17232
17233         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
17234         `TypeContainer container', because I kept getting confused when I
17235         was debugging this code.
17236
17237         * expression.cs (Indexers): Instead of tracking getters/setters,
17238         we now track them in parallel.  We create one arraylist less, but
17239         most importantly it is possible now for the LValue code to find a
17240         matching get for a set.
17241
17242         (IndexerAccess.DoResolveLValue): Update the code.
17243         GetIndexersForType has been modified already to extract all the
17244         indexers from a type.  The code assumed it did not.
17245
17246         Also make the code set the correct return type for the indexer.
17247         This was fixed a long time ago for properties, but was missing for
17248         indexers.  It used to be void_type.
17249
17250         (Binary.Emit): Test first for doubles instead of
17251         floats, as they are more common.
17252
17253         (Binary.EmitBranchable): Use the .un version of the branch opcodes
17254         when dealing with floats and the <=, >= operators.  This fixes bug
17255         #39314 
17256
17257         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
17258         to load the array value by emitting a load on the foreach variable
17259         type.  This was incorrect.  
17260
17261         We now emit the code to load an element using the the array
17262         variable type, and then we emit the conversion operator.
17263
17264         Fixed #40176
17265
17266 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
17267
17268         * attribute.cs: Avoid allocation of ArrayLists in the common case.
17269
17270 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
17271
17272         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
17273         test for protection before we test for signatures. 
17274
17275         (MethodSignature.ToString): implement.
17276
17277         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
17278         to the case where we reduced into a LongConstant.
17279
17280         * decl.cs (CheckAccessLevel): If the type is an array, we can not
17281         depend on whether the information is acurrate, because the
17282         Microsoft runtime will always claim that the array type is public,
17283         regardless of the real state.
17284
17285         If the type is a pointer, another problem happens: the type is
17286         reported as non-public in Microsoft.  
17287
17288         In both cases we have to call CheckAccessLevel recursively with
17289         the underlying type as the argument to be tested.
17290
17291 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
17292
17293         * assign.cs (Assign.Emit): If we are dealing with a compound
17294         assignment expression, we should use the code path that stores the
17295         intermediate result in a temporary value.  This fixes #40903.
17296
17297         *expression.cs (Indirection.ToString): Provide ToString method for
17298         debugging. 
17299
17300 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
17301
17302         * class.cs: Null out fields holding references to Block objects so
17303         they can be garbage collected.
17304
17305         * expression.cs (OverloadResolve): Remove unused local.
17306
17307 2003-04-07  Martin Baulig  <martin@ximian.com>
17308
17309         * codegen.cs (EmitContext.CurrentFile): New public field.
17310         (EmitContext.Mark): Use the CurrentFile to check whether the
17311         location is in the correct file.
17312         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
17313
17314 2003-04-07  Martin Baulig  <martin@ximian.com>
17315
17316         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
17317
17318         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
17319         location.  [FIXME: The location argument which gets passed to this
17320         method is sometimes wrong!]
17321
17322 2003-04-07  Nick Drochak <ndrochak@gol.com>
17323
17324         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
17325
17326 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
17327
17328         * expression.cs (Indirection.EmitAssign): We were using the
17329         temporary, but returning immediately instead of continuing the
17330         EmitAssing flow.
17331
17332 2003-04-06  Martin Baulig  <martin@ximian.com>
17333
17334         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
17335         if it's a nested child, but also deriving from the outer class.
17336         See test 190.cs.
17337
17338         * typemanager.cs (IsNestedChildOf): Make this work if it's a
17339         nested child, but also deriving from the outer class.  See
17340         test-190.cs.
17341         (FilterWithClosure): We may access private members of the outer
17342         class if we're a nested child and deriving from the outer class.
17343         (RealMemberLookup): Only set `closure_private_ok' if the
17344         `original_bf' contained BindingFlags.NonPublic.
17345
17346 2003-04-05  Martin Baulig  <martin@ximian.com>
17347
17348         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
17349
17350 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
17351
17352         * class.cs (Event.Define): Do not allow abstract events to have
17353         initializers. 
17354
17355 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
17356
17357         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
17358         block in event declarations.
17359
17360         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
17361         value type, get its address.
17362
17363         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
17364         leaving a class on the stack instead of a boolean value (int
17365         0/1).  Change the code so we compare against null, and then the
17366         result against zero.
17367
17368         * class.cs (TypeContainer.GetClassBases): We were checking for the
17369         parent class being sealed too late.
17370
17371         * expression.cs (Binary.Emit): For <= and >= when dealing with
17372         floating point values, use cgt.un and clt.un instead of cgt and
17373         clt alone.
17374
17375 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
17376
17377         * statement.cs: Apply the same optimization as MS: skip the 
17378         GetEnumerator returning an IEnumerator, and use the one returning a 
17379         CharEnumerator instead. This allows us to avoid the try-finally block 
17380         and the boxing.
17381
17382 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
17383
17384         * cs-parser.jay: Attributes cannot be applied to
17385                          namespaces. Fixes #40473
17386
17387 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17388
17389         * class.cs:
17390         (Add*): check if the name is valid using the full name for constants,
17391         fields, properties and events.
17392
17393 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
17394
17395         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
17396         char constants to be part of the enumeration.
17397
17398         * expression.cs (Conditional.DoResolve): Add support for operator
17399         true. Implements the missing functionality from 14.12
17400
17401         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
17402         operator true/false as required by the spec.
17403
17404         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
17405         implicit conversion to boolean.
17406
17407         * statement.cs (Statement.ResolveBoolean): A boolean expression is
17408         also one where the type implements `operator true'. 
17409
17410         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
17411         get an expression that will invoke operator true based on an
17412         expression.  
17413
17414         (GetConversionOperators): Removed the hack that called op_True
17415         here.  
17416
17417         (Expression.ResolveBoolean): Move this from Statement.
17418
17419 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
17420
17421         * ecore.cs (FieldExpr): do not allow initialization of initonly
17422         fields on derived classes
17423
17424 2003-03-13  Martin Baulig  <martin@ximian.com>
17425
17426         * statement.cs (Block.Emit): Call ig.BeginScope() and
17427         ig.EndScope() when compiling with debugging info; call
17428         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
17429
17430 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
17431
17432         * expression.cs (Indexers): Do not construct immediately, allow
17433         for new members to be appended as we go.  Fixes 38143
17434
17435 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17436
17437         * expression.cs: save/restore context when resolving an unchecked
17438         expression.
17439
17440 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
17441
17442         * cfold.cs: Catch division by zero in modulus operator during
17443         constant folding.
17444
17445 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
17446
17447         * interface.cs (Interface.DefineMembers): Avoid defining members
17448         twice. 
17449
17450 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
17451
17452         * driver.cs: handle the +/- options for -noconfig
17453
17454         * statement.cs (Unckeched.Resolve): Also track the state of
17455         unchecked in the Resolve phase.
17456
17457 2003-02-27  Martin Baulig  <martin@ximian.com>
17458
17459         * ecore.cs (Expression.MemberLookup): Don't create a
17460         MethodGroupExpr for something which is not a method.  Fixes #38291.
17461
17462 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
17463
17464         * class.cs (MemberBase.CheckParameters): Also check that the type
17465         is unmanaged if it is a pointer.
17466
17467         * expression.cs (SizeOf.Resolve): Add location information.
17468
17469         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
17470         a managed type is declared.
17471
17472         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
17473         parameter modifiers as well.  Fixes bug 38606
17474
17475         * class.cs: Very sad.  Am backing out the speed up changes
17476         introduced by the ArrayList -> Array in the TypeContainer, as they
17477         were not actually that much faster, and introduced a bug (no error
17478         reports on duplicated methods).
17479
17480         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
17481         source first, this will guarantee that we have a valid expression
17482         before calling in lower levels functions that will require a
17483         resolved object.  Then use this original_source in the
17484         target.ResolveLValue instead of the original source that was
17485         passed to us.
17486
17487         Another change.  Use target.Resolve instead of LValueResolve.
17488         Although we are resolving for LValues, we will let the Assign code
17489         take care of that (it will be called again from Resolve).  This
17490         basically allows code like this:
17491
17492         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
17493         class Y { void A (X x) { x [0] += o; }
17494
17495         The problem was that the indexer was trying to resolve for
17496         set_Item (idx, object o) and never finding one.  The real set_Item
17497         was set_Item (idx, X).  By delaying the process we get the right
17498         semantics. 
17499
17500         Fixes bug 36505
17501
17502 2003-02-23  Martin Baulig  <martin@ximian.com>
17503
17504         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
17505         while calling DoEmit ().
17506
17507         * codegen.cs (EmitContext.Mark): Don't mark locations in other
17508         source files; if you use the #line directive inside a method, the
17509         compiler stops emitting line numbers for the debugger until it
17510         reaches the end of the method or another #line directive which
17511         restores the original file.
17512
17513 2003-02-23  Martin Baulig  <martin@ximian.com>
17514
17515         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
17516
17517 2003-02-23  Martin Baulig  <martin@ximian.com>
17518
17519         * statement.cs (Block.AddChildVariableNames): We need to call this
17520         recursively, not just for our immediate children.
17521
17522 2003-02-23  Martin Baulig  <martin@ximian.com>
17523
17524         * class.cs (Event.Define): Always make the field private, like csc does.
17525
17526         * typemanager.cs (TypeManager.RealMemberLookup): Make events
17527         actually work, fixes bug #37521.
17528
17529 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
17530
17531         * delegate.cs: When creating the various temporary "Parameters"
17532         classes, make sure that we call the ComputeAndDefineParameterTypes
17533         on those new parameters (just like we do with the formal ones), to
17534         allow them to be resolved in the context of the DeclSpace.
17535
17536         This fixes the bug that Dick observed in Bugzilla #38530.
17537
17538 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
17539
17540         * expression.cs (ResolveMemberAccess): When resolving a constant,
17541         do not attempt to pull a constant if the value was not able to
17542         generate a valid constant.
17543
17544         * const.cs (LookupConstantValue): Do not report more errors than required.
17545
17546 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17547
17548         * expression.cs: fixes bug #38328.
17549
17550 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
17551
17552         * class.cs: Changed all the various members that can be part of a
17553         class from being an ArrayList to be an Array of the right type.
17554         During the DefineType type_list, interface_list, delegate_list and
17555         enum_list are turned into types, interfaces, delegates and enums
17556         arrays.  
17557
17558         And during the member population, indexer_list, event_list,
17559         constant_list, field_list, instance_constructor_list, method_list,
17560         operator_list and property_list are turned into their real arrays.
17561
17562         Although we could probably perform this operation earlier, for
17563         good error reporting we need to keep the lists and remove the
17564         lists for longer than required.
17565
17566         This optimization was triggered by Paolo profiling the compiler
17567         speed on the output of `gen-sample-program.pl' perl script. 
17568
17569         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
17570         not crash in methods like MemberLookupFailed that use this field.  
17571
17572         This problem arises when the compiler fails to resolve a type
17573         during interface type definition for example.
17574
17575 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
17576
17577         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
17578         inherit from System.Object, so we have to stop at null, not only
17579         when reaching System.Object.
17580
17581 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
17582
17583         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
17584         DeclaredOnly because the parent indexer might have had a different
17585         name, but did not loop until the top of the hierarchy was reached.
17586
17587         The problem this one fixes is 35492: when a class implemented an
17588         indexer from an interface, we were getting the interface method
17589         (which was abstract) and we were flagging an error (can not invoke
17590         abstract method).
17591
17592         This also keeps bug 33089 functioning, and test-148 functioning.
17593
17594         * typemanager.cs (IsSpecialMethod): The correct way of figuring
17595         out if a method is special is to see if it is declared in a
17596         property or event, or whether it is one of the predefined operator
17597         names.   This should fix correctly #36804.
17598
17599 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
17600
17601         The goal here is to remove the dependency on EmptyCast.Peel ().
17602         Killing it completely.
17603
17604         The problem is that currently in a number of places where
17605         constants are expected, we have to "probe" for an EmptyCast, and
17606         Peel, which is not the correct thing to do, as this will be
17607         repetitive and will likely lead to errors. 
17608
17609         The idea is to remove any EmptyCasts that are used in casts that
17610         can be reduced to constants, so we only have to cope with
17611         constants. 
17612
17613         This bug hunt was triggered by Bug 37363 and the desire to remove
17614         the duplicate pattern where we were "peeling" emptycasts to check
17615         whether they were constants.  Now constants will always be
17616         constants.
17617
17618         * ecore.cs: Use an enumconstant here instead of wrapping with
17619         EmptyCast.  
17620
17621         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
17622         throwing me off.  By handling this we can get rid of a few hacks.
17623
17624         * statement.cs (Switch): Removed Peel() code.
17625
17626 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
17627
17628         * class.cs: Location information for error 508
17629
17630         * expression.cs (New.DoResolve): Add a guard against double
17631         resolution of an expression.  
17632
17633         The New DoResolve might be called twice when initializing field
17634         expressions (see EmitFieldInitializers, the call to
17635         GetInitializerExpression will perform a resolve on the expression,
17636         and later the assign will trigger another resolution
17637
17638         This leads to bugs (#37014)
17639
17640         * delegate.cs: The signature for EndInvoke should contain any ref
17641         or out parameters as well.  We were not doing this in the past. 
17642
17643         * class.cs (Field.Define): Do not overwrite the type definition
17644         inside the `volatile' group.  Turns out that volatile enumerations
17645         were changing the type here to perform a validity test, which
17646         broke conversions. 
17647
17648 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
17649
17650         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
17651         and structs, we do not want to load the instance variable
17652
17653         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
17654         enum_type has to be handled like an object reference (implicit
17655         conversions exists from this to object), but the regular IsClass
17656         and IsValueType tests will never return true for this one.
17657
17658         Also we use TypeManager.IsValueType instead of type.IsValueType,
17659         just for consistency with the rest of the code (this is only
17660         needed if we ever use the construct exposed by test-180.cs inside
17661         corlib, which we dont today).
17662
17663 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
17664
17665         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
17666         just InternalCall.
17667
17668 2003-02-09  Martin Baulig  <martin@ximian.com>
17669
17670         * namespace.cs (Namespace..ctor): Added SourceFile argument.
17671         (Namespace.DefineNamespaces): New static public method; this is
17672         called when we're compiling with debugging to add all namespaces
17673         to the symbol file.
17674
17675         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
17676         pass it to the Namespace's .ctor.
17677
17678         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
17679         and MethodBase arguments; pass the namespace ID to the symwriter;
17680         pass the MethodBase instead of the token to the symwriter.
17681         (SymbolWriter.DefineNamespace): New method to add a namespace to
17682         the symbol file.
17683
17684 2003-02-09  Martin Baulig  <martin@ximian.com>
17685
17686         * symbolwriter.cs: New file.  This is a wrapper around
17687         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
17688         methods here in near future.
17689
17690 2003-02-09  Martin Baulig  <martin@ximian.com>
17691
17692         * codegen.cs (EmitContext.Mark): Just pass the arguments to
17693         ILGenerator.MarkSequencePoint() which are actually used by the
17694         symbol writer.
17695
17696 2003-02-09  Martin Baulig  <martin@ximian.com>
17697
17698         * location.cs (SourceFile): New public sealed class.  This
17699         contains the name and an index which is used in the location's token.
17700         (Location): Reserve an appropriate number of bits in the token for
17701         the source file instead of walking over that list, this gives us a
17702         really huge performance improvement when compiling with debugging.
17703
17704         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
17705         `SourceFile' argument instead of a string.
17706         (Driver.ProcessFile): Add all the files via Location.AddFile(),
17707         but don't parse/tokenize here, we need to generate the list of all
17708         source files before we do that.
17709         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
17710         the files.
17711
17712         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
17713         instead of a string.
17714
17715         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
17716         of a string.
17717
17718 2003-02-09  Martin Baulig  <martin@ximian.com>
17719
17720         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
17721         filename on `#line default'.
17722
17723 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
17724
17725         * statement.cs: don't clear the pinned var when the fixed statement
17726         returns from the method (fixes bug#37752).
17727
17728 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
17729
17730         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
17731         to IsValueType.
17732
17733 2003-02-07  Martin Baulig  <martin@ximian.com>
17734
17735         * driver.cs: Removed the `--debug-args' command line argument.
17736
17737         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
17738         automatically by the AsssemblyBuilder.
17739         (CodeGen.InitializeSymbolWriter): We don't need to call any
17740         initialization function on the symbol writer anymore.  This method
17741         doesn't take any arguments.
17742
17743 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
17744
17745         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
17746         from referenced assemblies as well.
17747
17748 2003-02-02  Martin Baulig  <martin@ximian.com>
17749
17750         * class.cs (MethodData.Emit): Generate debugging info for external methods.
17751
17752 2003-02-02  Martin Baulig  <martin@ximian.com>
17753
17754         * class.cs (Constructor.Emit): Open the symbol writer before
17755         emitting the constructor initializer.
17756         (ConstructorInitializer.Emit): Call ec.Mark() to allow
17757         single-stepping through constructor initializers.
17758
17759 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
17760
17761         * class.cs: Handle error 549: do not allow virtual methods in
17762         sealed classes. 
17763
17764 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
17765
17766         * decl.cs: Check access levels when resolving types
17767
17768 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
17769
17770         * statement.cs: Add parameters and locals set in catch blocks that might 
17771         return to set vector
17772
17773 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
17774
17775         * class.cs (Operator): Set the SpecialName flags for operators.
17776
17777         * expression.cs (Invocation.DoResolve): Only block calls to
17778         accessors and operators on SpecialName methods.
17779
17780         (Cast.TryReduce): Handle conversions from char constants.
17781
17782
17783 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
17784
17785         * statement.cs: small memory and time optimization in FlowBranching.
17786
17787 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
17788
17789         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
17790         problem that the last fix but in the other sid (Set).
17791
17792         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
17793         access when there is no indexer in the hierarchy.
17794
17795 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
17796
17797         * class.cs: Combine some if statements.
17798
17799 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17800
17801         * driver.cs: fixed bug #37187.
17802
17803 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
17804
17805         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
17806         any indexer, it's needed to build a list with all the indexers in the
17807         hierarchy (AllGetters), else we have problems. Fixes #35653.
17808
17809 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
17810
17811         * class.cs (MethodData.Define): It is wrong for an interface
17812         implementation to be static in both cases: explicit and implicit.
17813         We were only handling this in one case.
17814
17815         Improve the if situation there to not have negations.
17816
17817         * class.cs (Field.Define): Turns out that we do not need to check
17818         the unsafe bit on field definition, only on usage.  Remove the test.
17819
17820 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17821
17822         * driver.cs: use assembly.Location instead of Codebase (the latest
17823         patch made mcs fail when using MS assemblies).
17824
17825 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
17826
17827         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
17828         get the path to *corlib.dll.
17829
17830 2003-01-21  Nick Drochak <ndrochak@gol.com>
17831
17832         * cs-tokenizer.cs:
17833         * pending.cs:
17834         * typemanager.cs: Remove compiler warnings
17835
17836 2003-01-20  Duncan Mak  <duncan@ximian.com>
17837
17838         * AssemblyInfo.cs: Bump the version number to 0.19.
17839
17840 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17841
17842         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
17843
17844 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
17845
17846         * class.cs (Constructor::Emit): Emit debugging info for constructors.
17847
17848 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
17849
17850         * cs-parser.jay: Small fix: we were not comparing the constructor
17851         name correctly.   Thanks to Zoltan for the initial pointer.
17852
17853 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
17854
17855         * cs-tokenizer.cs: Set file name when specified with #line
17856
17857 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
17858
17859         * cs-parser.jay: Only perform the constructor checks here if we
17860         are named like the class;  This will help provider a better
17861         error.  The constructor path is taken when a type definition is
17862         not found, but most likely the user forgot to add the type, so
17863         report that rather than the constructor error.
17864
17865 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
17866
17867         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
17868         allocations.
17869
17870 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17871
17872         * cs-parser.jay: Add cleanup call.
17873
17874 2003-01-13  Duncan Mak  <duncan@ximian.com>
17875
17876         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
17877         consistent with other methods.
17878
17879 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17880
17881         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
17882
17883 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
17884
17885         * attribute.cs: only set GuidAttr to true when we have a
17886         GuidAttribute.
17887
17888 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17889
17890         * ecore.cs:
17891         * expression.cs:
17892         * typemanager.cs: fixes to allow mcs compile corlib with the new
17893         Type.IsSubclassOf fix.
17894
17895 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
17896
17897         * expression.cs (LocalVariableReference.DoResolve): Classify a
17898         constant as a value, not as a variable.   Also, set the type for
17899         the variable.
17900
17901         * cs-parser.jay (fixed_statement): take a type instead of a
17902         pointer_type, so we can produce a better error message later.
17903
17904         * statement.cs (Fixed.Resolve): Flag types that are not pointers
17905         as an error.  
17906
17907         (For.DoEmit): Make inifinite loops have a
17908         non-conditional branch back.
17909
17910         (Fixed.DoEmit): First populate the pinned variables, then emit the
17911         statement, then clear the variables.  Before I was emitting the
17912         code once for each fixed piece.
17913
17914
17915 2003-01-08  Martin Baulig  <martin@ximian.com>
17916
17917         * statement.cs (FlowBranching.MergeChild): A break in a
17918         SWITCH_SECTION does not leave a loop.  Fixes #36155.
17919
17920 2003-01-08  Martin Baulig  <martin@ximian.com>
17921
17922         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
17923         lives in the same number space than `param_map'.  Fixes #36154.
17924
17925 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
17926
17927         * cs-parser.jay (constructor_declaration): Set the
17928         Constructor.ModFlags before probing for it.  This makes the
17929         compiler report 514, 515 and 132 (the code was there, but got
17930         broken). 
17931
17932         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
17933         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
17934         (GotoCase.Resolve): Set `Returns' to ALWAYS.
17935
17936 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
17937
17938         * enum.cs: create the enum static fields using the enum type.
17939
17940 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
17941
17942         * class.cs: don't try to create the ParamBuilder for the return
17943         type if it's not needed (and handle it breaking for the ms runtime
17944         anyway).
17945
17946 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
17947
17948         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
17949
17950 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
17951
17952         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
17953         the command.   This showed up while compiling the JANET source
17954         code, which used \r as its only newline separator.
17955
17956 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
17957
17958         * class.cs (Method.Define): If we are an operator (because it
17959         reuses our code), then set the SpecialName and HideBySig.  #36128
17960
17961 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
17962
17963         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
17964         exception, report error 120 `object reference required'.
17965
17966         * driver.cs: Add --pause option, used during to measure the size
17967         of the process as it goes with --timestamp.
17968
17969         * expression.cs (Invocation.DoResolve): Do not allow methods with
17970         SpecialName to be invoked.
17971
17972 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
17973
17974         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
17975         number before adding it.
17976
17977 2002-12-21  Ravi Pratap  <ravi@ximian.com>
17978
17979         * ecore.cs (StandardImplicitConversion): When in an unsafe
17980         context, we allow conversion between void * to any other pointer
17981         type. This fixes bug #35973.
17982
17983 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
17984
17985         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
17986         is not thrown when extensionless outputs are used 
17987
17988 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17989
17990         * rootcontext.cs: fixed compilation of corlib.
17991
17992 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
17993
17994         * attribute.cs (Attributes.Contains): Add new method.
17995
17996         * class.cs (MethodCore.LabelParameters): if the parameter is an
17997         `out' parameter, check that no attribute `[In]' has been passed.
17998
17999         * enum.cs: Handle the `value__' name in an enumeration.
18000
18001 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
18002
18003         * decl.cs: Added special case to allow overrides on "protected
18004         internal" methods
18005
18006 2002-12-18  Ravi Pratap  <ravi@ximian.com>
18007
18008         * attribute.cs (Attributes.AddAttributeSection): Rename to this
18009         since it makes much more sense.
18010
18011         (Attributes.ctor): Don't require a Location parameter.
18012
18013         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
18014
18015         * attribute.cs (ApplyAttributes): Remove extra Location parameters
18016         since we already have that information per attribute.
18017
18018         * everywhere : make appropriate changes.
18019
18020         * class.cs (LabelParameters): Write the code which actually
18021         applies attributes to the return type. We can't do this on the MS
18022         .NET runtime so we flag a warning in the case an exception is
18023         thrown.
18024
18025 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
18026
18027         * const.cs: Handle implicit null conversions here too.
18028
18029 2002-12-17  Ravi Pratap  <ravi@ximian.com>
18030
18031         * class.cs (MethodCore.LabelParameters): Remove the extra
18032         Type [] parameter since it is completely unnecessary. Instead
18033         pass in the method's attributes so that we can extract
18034         the "return" attribute.
18035
18036 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
18037
18038         * cs-parser.jay (parse): Use Report.Error to flag errors instead
18039         of ignoring it and letting the compile continue.
18040
18041         * typemanager.cs (ChangeType): use an extra argument to return an
18042         error condition instead of throwing an exception.
18043
18044 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
18045
18046         * expression.cs (Unary.TryReduce): mimic the code for the regular
18047         code path.  Perform an implicit cast in the cases where we can
18048         implicitly convert to one of the integral types, and then reduce
18049         based on that constant.   This fixes bug #35483.
18050
18051 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18052
18053         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
18054
18055 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18056
18057         * namespace.cs: fixed bug #35489.
18058
18059 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
18060
18061         * class.cs: Remove some dead code.
18062
18063         * cs-parser.jay: Estimate the number of methods needed
18064         (RootContext.MethodCount);
18065
18066         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
18067         numbers instead of StringBuilders.
18068
18069         * support.cs (PtrHashtable): Add constructor with initial size;
18070         We can now reduce reallocations of the method table.
18071
18072 2002-12-10  Ravi Pratap  <ravi@ximian.com>
18073
18074         * attribute.cs (ApplyAttributes): Keep track of the emitted
18075         attributes on a per-target basis. This fixes bug #35413.
18076
18077 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
18078
18079         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
18080         default to the Windows 1252 encoding.
18081
18082         (UnixParseOption): Support version, thanks to Alp for the missing
18083         pointer. 
18084
18085         * AssemblyInfo.cs: Add nice assembly information.
18086
18087         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
18088         (bug 35169).
18089
18090         * cs-parser.jay: Allow a trailing comma before the close bracked
18091         in the attribute_section production.
18092
18093         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
18094         address of the instance was being taken, I will take this out,
18095         because we take the address of the object immediately here.
18096
18097 2002-12-09  Ravi Pratap  <ravi@ximian.com>
18098
18099         * typemanager.cs (AreMultipleAllowed): Take care of the most
18100         obvious case where attribute type is not in the current assembly -
18101         stupid me ;-)
18102
18103 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
18104
18105         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
18106         definitions, instead of doing that afterwards.  
18107
18108         Also we use a nice little hack, depending on the constructor, we
18109         know if we are a "composed" name or a simple name.  Hence, we
18110         avoid the IndexOf test, and we avoid 
18111
18112         * codegen.cs: Add code to assist in a bug reporter to track down
18113         the source of a compiler crash. 
18114
18115 2002-12-07  Ravi Pratap  <ravi@ximian.com>
18116
18117         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
18118         types have been emitted for a given element and flag an error
18119         if something which does not have AllowMultiple set is used more
18120         than once.
18121
18122         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
18123         attribute types and their corresponding AllowMultiple properties
18124
18125         (AreMultipleAllowed): Check the property for a given type.
18126
18127         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
18128         property in the case we have a TypeContainer.
18129
18130         (Attributes.AddAttribute): Detect duplicates and just skip on
18131         adding them. This trivial fix catches a pretty gross error in our
18132         attribute emission - global attributes were being emitted twice!
18133
18134         Bugzilla bug #33187 is now fixed.
18135
18136 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
18137
18138         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
18139         instead of pp_and).
18140
18141         * expression.cs (Binary.ResolveOperator): I can only use the
18142         Concat (string, string, string) and Concat (string, string,
18143         string, string) if the child is actually a concatenation of
18144         strings. 
18145
18146 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
18147
18148         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
18149         context where we need a 2-character lookahead.
18150
18151         * pending.cs (PendingImplementation): Rework so we can keep track
18152         of interface types all the time, and flag those which were
18153         implemented by parents as optional.
18154
18155 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
18156
18157         * expression.cs (Binary.ResolveOperator): Use
18158         String.Concat(string,string,string) or
18159         String.Concat(string,string,string,string) when possible. 
18160
18161         * typemanager: More helper methods.
18162
18163
18164 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
18165
18166         * pending.cs: remove the bogus return from GetMissingInterfaces()
18167         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
18168
18169 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18170
18171         * namespace.cs: avoid duplicated 'using xxx' being added to
18172         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
18173         when we get more than one 'using' statement for the same namespace.
18174         Report a CS0105 warning for it.
18175
18176 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
18177
18178         * cs-tokenizer.cs (consume_identifier): use read directly, instead
18179         of calling getChar/putback, uses internal knowledge of it.    
18180
18181         (xtoken): Reorder tokenizer so most common patterns are checked
18182         first.  This reduces the compilation time in another 5% (from 8.11s
18183         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
18184
18185         The parsing time is 22% of the compilation in mcs, and from that
18186         64% is spent on the tokenization process.  
18187
18188         I tried using a binary search for keywords, but this is slower
18189         than the hashtable.  Another option would be to do a couple of
18190         things:
18191
18192                 * Not use a StringBuilder, instead use an array of chars,
18193                   with a set value.  Notice that this way we could catch
18194                   the 645 error without having to do it *afterwards*.
18195
18196                 * We could write a hand-parser to avoid the hashtable
18197                   compares altogether.
18198
18199         The identifier consumption process takes 37% of the tokenization
18200         time.  Another 15% is spent on is_number.  56% of the time spent
18201         on is_number is spent on Int64.Parse:
18202
18203                 * We could probably choose based on the string length to
18204                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
18205                   computations. 
18206
18207         Another 3% is spend on wrapping `xtoken' in the `token' function.
18208
18209         Handle 0xa0 as whitespace (#34752)
18210
18211 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
18212
18213         * typemanager.cs (IsCLRType): New routine to tell whether a type
18214         is one of the builtin types.  
18215
18216         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
18217         typecode in more places instead of doing pointer comparissions.
18218         We could leverage some knowledge about the way the typecodes are
18219         laid out.
18220
18221         New code to cache namespaces in assemblies, it is currently not
18222         invoked, to be used soon.
18223
18224         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
18225
18226         * expression.cs (Binary.ResolveOperator): specially handle
18227         strings, and do not perform user-defined operator overloading for
18228         built-in types.
18229
18230 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
18231
18232         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
18233         internalcall as it is a pretty simple operation;  Avoid whenever
18234         possible to call Char.IsLetter.
18235
18236         (consume_identifier): Cut by half the number of
18237         hashtable calls by merging the is_keyword and GetKeyword behavior.
18238
18239         Do not short-circuit, because if we do, we
18240         report errors (ie, #if false && true would produce an invalid
18241         directive error);
18242
18243
18244 2002-11-24  Martin Baulig  <martin@ximian.com>
18245
18246         * expression.cs (Cast.TryReduce): If we're in checked syntax,
18247         check constant ranges and report a CS0221.  Fixes #33186.
18248
18249 2002-11-24  Martin Baulig  <martin@ximian.com>
18250
18251         * cs-parser.jay: Make this work for uninitialized variable
18252         declarations in the `for' initializer.  Fixes #32416.
18253
18254 2002-11-24  Martin Baulig  <martin@ximian.com>
18255
18256         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
18257         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
18258
18259 2002-11-24  Martin Baulig  <martin@ximian.com>
18260
18261         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
18262         argument; if true, we also check for user-defined conversions.
18263         This is only needed if both arguments are of a user-defined type.
18264         Fixes #30443, added test-175.cs.
18265         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
18266
18267         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
18268
18269 2002-11-24  Martin Baulig  <martin@ximian.com>
18270
18271         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
18272         function to get the store opcode.
18273         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
18274         only emit the Ldelema if the store opcode is Stobj.  You must run
18275         both test-34 and test-167 to test this.  Fixes #34529.
18276
18277 2002-11-23  Martin Baulig  <martin@ximian.com>
18278
18279         * ecore.cs (Expression.MemberLookup): Added additional
18280         `qualifier_type' argument which is used when we're being called
18281         from MemberAccess.DoResolve() and null if we're called from a
18282         SimpleName lookup.
18283         (Expression.MemberLookupFailed): New method to report errors; this
18284         does the CS1540 check and reports the correct error message.
18285
18286         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
18287         argument for the CS1540 check and redone the way how we're dealing
18288         with private members.  See the comment in the source code for details.
18289         (FilterWithClosure): Reverted this back to revision 1.197; renamed
18290         `closure_start_type' to `closure_qualifier_type' and check whether
18291         it's not null.  It was not this filter being broken, it was just
18292         being called with the wrong arguments.
18293
18294         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
18295         and pass it the correct `qualifier_type'; this also does the error
18296         handling for us.
18297
18298 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
18299
18300         * expression.cs (Invocation.EmitParams): If the we are dealing
18301         with a non-built-in value type, load its address as well.
18302
18303         (ArrayCreation): Use a a pretty constant instead
18304         of the hardcoded value 2.   Use 6 instead of 2 for the number of
18305         static initializers.  
18306
18307         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
18308         because they are not really value types, just glorified integers. 
18309
18310         * driver.cs: Do not append .exe, the CSC compiler does not do it.
18311
18312         * ecore.cs: Remove redundant code for enumerations, make them use
18313         the same code path as everything else, fixes the casting issue
18314         with enumerations in Windows.Forms.
18315
18316         * attribute.cs: Do only cast to string if it is a string, the
18317         validation happens later.
18318
18319         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
18320         people upgrade their corlibs.
18321
18322         * ecore.cs: Oops, enumerations were not following the entire code path
18323
18324 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
18325
18326         * typemanager.cs (FilterWithClosure): Commented out the test for
18327         1540 in typemanager.cs, as it has problems when accessing
18328         protected methods from a parent class (see test-174.cs). 
18329
18330         * attribute.cs (Attribute.ValidateGuid): new method.
18331         (Attribute.Resolve): Use above.
18332
18333 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
18334
18335         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
18336
18337         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
18338         handling for enumerations, as we only needed the TypeContainer
18339         functionality to begin with (this is required for the fix below to
18340         work for enums that reference constants in a container class for
18341         example). 
18342
18343         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
18344
18345         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
18346         a valid TypeBuilder to perform lookups on.o
18347
18348         * class.cs (InheritableMemberSignatureCompare): Use true in the
18349         call to GetGetMethod and GetSetMethod, because we are comparing
18350         the signature, and we need to get the methods *even* if they are
18351         private. 
18352
18353         (PropertyBase.CheckBase): ditto.
18354
18355         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
18356         GotoCase.Resolve): Use Peel on EmpytCasts.
18357
18358         * ecore.cs (EmptyCast): drop child, add Peel method.
18359
18360 2002-11-17  Martin Baulig  <martin@ximian.com>
18361
18362         * ecore.cs (EmptyCast.Child): New public property.
18363
18364         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
18365         label resolved to an EmptyCast.  Fixes #34162.
18366         (GotoCase.Resolve): Likewise.
18367         (Block.EmitMeta): Likewise.
18368
18369 2002-11-17  Martin Baulig  <martin@ximian.com>
18370
18371         * expression.cs (Invocation.BetterConversion): Prefer int over
18372         uint; short over ushort; long over ulong for integer literals.
18373         Use ImplicitConversionExists instead of StandardConversionExists
18374         since we also need to check for user-defined implicit conversions.
18375         Fixes #34165.  Added test-173.cs.
18376
18377 2002-11-16  Martin Baulig  <martin@ximian.com>
18378
18379         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
18380         with the `true' and `false' literals.  Fixes #33151.
18381
18382 2002-11-16  Martin Baulig  <martin@ximian.com>
18383
18384         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
18385         October 22nd; don't do the cs1540 check for static members.
18386
18387         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
18388         now using our own filter here and doing the cs1540 check again.
18389
18390 2002-11-16  Martin Baulig  <martin@ximian.com>
18391
18392         * support.cs (InternalParameters): Don't crash if we don't have
18393         any fixed parameters.  Fixes #33532.
18394
18395 2002-11-16  Martin Baulig  <martin@ximian.com>
18396
18397         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
18398         when looking up static methods to make this work on Windows.
18399         Fixes #33773.
18400
18401 2002-11-16  Martin Baulig  <martin@ximian.com>
18402
18403         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
18404         a setter rather than using PropertyInfo.CanWrite.
18405
18406 2002-11-15  Nick Drochak  <ndrochak@gol.com>
18407
18408         * class.cs: Allow acces to block member by subclasses. Fixes build
18409         breaker.
18410
18411 2002-11-14  Martin Baulig  <martin@ximian.com>
18412
18413         * class.cs (Constructor.Emit): Added the extern/block check.
18414         Fixes bug #33678.
18415
18416 2002-11-14  Martin Baulig  <martin@ximian.com>
18417
18418         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
18419         iteration while looking for indexers, this is needed because the
18420         indexer may have a different name in our base classes.  Fixed the
18421         error reporting (no indexers at all, not get accessor, no
18422         overloaded match).  Fixes bug #33089.
18423         (IndexerAccess.DoResolveLValue): Likewise.
18424
18425 2002-11-14  Martin Baulig  <martin@ximian.com>
18426
18427         * class.cs (PropertyBase.CheckBase): Make this work for multiple
18428         indexers.  Fixes the first part of bug #33089.
18429         (MethodSignature.InheritableMemberSignatureCompare): Added support
18430         for properties.
18431
18432 2002-11-13  Ravi Pratap  <ravi@ximian.com>
18433
18434         * attribute.cs (Attribute.Resolve): Catch the
18435         NullReferenceException and report it since it isn't supposed to
18436         happen. 
18437
18438 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
18439
18440         * expression.cs (Binary.EmitBranchable): Also handle the cases for
18441         LogicalOr and LogicalAnd that can benefit from recursively
18442         handling EmitBranchable.  The code now should be nice for Paolo.
18443
18444 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
18445
18446         * typemanager.cs (LookupType): Added a negative-hit hashtable for
18447         the Type lookups, as we perform quite a number of lookups on
18448         non-Types.  This can be removed once we can deterministically tell
18449         whether we have a type or a namespace in advance.
18450
18451         But this might require special hacks from our corlib.
18452
18453         * TODO: updated.
18454
18455         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
18456         and double which avoids a conversion from an integer to a double.
18457
18458         * expression.cs: tiny optimization, avoid calling IsConstant,
18459         because it effectively performs the lookup twice.
18460
18461 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
18462
18463         But a bogus return here to keep the semantics of the old code
18464         until the Mono runtime is fixed.
18465
18466         * pending.cs (GetMissingInterfaces): New method used to remove all
18467         the interfaces that are already implemented by our parent
18468         classes from the list of pending methods. 
18469
18470         * interface.cs: Add checks for calls after ResolveTypeExpr.
18471
18472 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
18473
18474         * class.cs (Class.Emit): Report warning 67: event not used if the
18475         warning level is beyond 3.
18476
18477         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
18478         being a NullLiteral.
18479
18480         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
18481         specifiers. 
18482
18483         * class.cs (TypeContainer.GetClassBases): Cover a missing code
18484         path that might fail if a type can not be resolved.
18485
18486         * expression.cs (Binary.Emit): Emit unsigned versions of the
18487         operators. 
18488
18489         * driver.cs: use error 5.
18490
18491 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
18492
18493         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
18494
18495 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
18496
18497         * cs-parser.jay (switch_section): A beautiful patch from Martin
18498         Baulig that fixed 33094.
18499
18500 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
18501
18502         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
18503         Check whether the base is abstract and report an error if so.
18504
18505         * expression.cs (IndexerAccess.DoResolveLValue,
18506         IndexerAccess.DoResolve): ditto. 
18507
18508         (Invocation.DoResolve): ditto.
18509
18510         (Invocation.FullMethodDesc): Improve the report string.
18511
18512         * statement.cs (Block): Eliminate IsVariableDefined as it is
18513         basically just a wrapper for GetVariableInfo.
18514
18515         * ecore.cs (SimpleName): Use new 
18516
18517         * support.cs (ReflectionParamter.ParameterType): We unwrap the
18518         type, as we return the actual parameter ref/unref state on a
18519         different call.
18520
18521 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
18522
18523         * support.cs: Return proper flags REF/OUT fixing the previous
18524         commit.  
18525
18526         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
18527         not used to mean `ref' but `ref or out' in ParameterReference
18528
18529         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
18530         full type signature instead of calling TypeManger.CSharpName
18531         ourselves. 
18532
18533         * support.cs (InternalParameters.ParameterDesc): Do not compare
18534         directly to the modflags, because REF/OUT will actually be bitsets
18535         if set. 
18536
18537         * delegate.cs (VerifyMethod): Check also the modifiers.
18538
18539         * cs-tokenizer.cs: Fix bug where floating point values with an
18540         exponent where a sign was missing was ignored.
18541
18542         * driver.cs: Allow multiple assemblies to be specified in a single
18543         /r: argument
18544
18545 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
18546
18547         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
18548         because identifiers after a parenthesis would end up in this kind
18549         of production, and we needed to desamiguate it for having casts
18550         like:
18551
18552                 (UserDefinedType *) xxx
18553
18554 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
18555
18556         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
18557         we should set on the Bindingflags.NonPublic, but not turn on
18558         private_ok.  private_ok controls whether a Private member is
18559         returned (this is chekced on the filter routine), while the
18560         BindingFlags.NonPublic just controls whether private/protected
18561         will be allowed.   This fixes the problem part of the problem of
18562         private properties being allowed to be used in derived classes.
18563
18564         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
18565         so we can call the children DoResolveLValue method (this will
18566         properly signal errors on lvalue assignments to base properties)
18567
18568         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
18569         getter are null, and we have a property info, we know that this
18570         happened because the lookup failed, so we report an error 122 for
18571         protection level violation.
18572
18573         We also silently return if setter and getter are null in the
18574         resolve functions, this condition only happens if we have flagged
18575         the error before.  This is the other half of the problem. 
18576
18577         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
18578         not have accessibility information, that is why we were returning
18579         true in the filter function in typemanager.cs.
18580
18581         To properly report 122 (property is inaccessible because of its
18582         protection level) correctly, we report this error in ResolveAccess
18583         by failing if both the setter and the getter are lacking (ie, the
18584         lookup failed). 
18585
18586         DoResolve and DoLResolve have been modified to check for both
18587         setter/getter being null and returning silently, the reason being
18588         that I did not want to put the knowledge about this error in upper
18589         layers, like:
18590
18591         int old = Report.Errors;
18592         x = new PropertyExpr (...);
18593         if (old != Report.Errors)
18594                 return null;
18595         else
18596                 return x;
18597
18598         So the property expr is returned, but it is invalid, so the error
18599         will be flagged during the resolve process. 
18600
18601         * class.cs: Remove InheritablePropertySignatureCompare from the
18602         class, as we no longer depend on the property signature to compute
18603         whether it is possible to implement a method or not.
18604
18605         The reason is that calling PropertyInfo.GetGetMethod will return
18606         null (in .NET, in Mono it works, and we should change this), in
18607         cases where the Get Method does not exist in that particular
18608         class.
18609
18610         So this code:
18611
18612         class X { public virtual int A { get { return 1; } } }
18613         class Y : X { }
18614         class Z : Y { public override int A { get { return 2; } } }
18615
18616         Would fail in Z because the parent (Y) would not have the property
18617         defined.  So we avoid this completely now (because the alternative
18618         fix was ugly and slow), and we now depend exclusively on the
18619         method names.
18620
18621         (PropertyBase.CheckBase): Use a method-base mechanism to find our
18622         reference method, instead of using the property.
18623
18624         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
18625         routines are gone now.
18626
18627         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
18628         names, they were incorrectly named.
18629
18630         * cs-tokenizer.cs: Return are more gentle token on failure. 
18631
18632         * pending.cs (PendingImplementation.InterfaceMethod): This routine
18633         had an out-of-sync index variable, which caused it to remove from
18634         the list of pending methods the wrong method sometimes.
18635
18636 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
18637
18638         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
18639         CanWrite, because those refer to this particular instance of the
18640         property, and do not take into account the fact that we can
18641         override single members of a property.
18642
18643         Constructor requires an EmitContext.  The resolution process does
18644         not happen here, but we need to compute the accessors before,
18645         because the resolution does not always happen for properties.
18646
18647         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
18648         subclass, before we did not update this flag, but we did update
18649         bindingflags. 
18650
18651         (GetAccessors): Drop this routine, as it did not work in the
18652         presence of partially overwritten set/get methods. 
18653
18654         Notice that this broke the cs1540 detection, but that will require
18655         more thinking. 
18656
18657 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18658
18659         * class.cs:
18660         * codegen.cs:
18661         * driver.cs: issue a warning instead of an error if we don't support
18662         debugging for the platform. Also ignore a couple of errors that may
18663         arise when trying to write the symbols. Undo my previous patch.
18664
18665 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18666
18667         * driver.cs: ignore /debug switch except for Unix platforms.
18668
18669 2002-10-23  Nick Drochak  <ndrochak@gol.com>
18670
18671         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
18672
18673 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
18674
18675         * driver.cs: Do not make mcs-debug conditional, so we do not break
18676         builds that use it.
18677
18678         * statement.cs (UsageVector.MergeChildren): I would like Martin to
18679         review this patch.  But basically after all the children variables
18680         have been merged, the value of "Breaks" was not being set to
18681         new_breaks for Switch blocks.  I think that it should be set after
18682         it has executed.  Currently I set this to the value of new_breaks,
18683         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
18684         conservative, but I do not understand this code very well.
18685
18686         I did not break anything in the build, so that is good ;-)
18687
18688         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
18689
18690 2002-10-20  Mark Crichton  <crichton@gimp.org>
18691
18692         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
18693
18694 2002-10-20  Nick Drochak  <ndrochak@gol.com>
18695
18696         * cfold.cs: Fixed compile blocker.
18697
18698 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
18699
18700         * driver.cs: I was chekcing the key, not the file.
18701
18702 2002-10-19  Ravi Pratap  <ravi@ximian.com>
18703
18704         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
18705         message that we were generating - we just need to silently return
18706         a null.
18707
18708 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
18709
18710         * class.cs (Event.Define): Change my previous commit, as this
18711         breaks the debugger.  This is a temporary hack, as it seems like
18712         the compiler is generating events incorrectly to begin with.
18713
18714         * expression.cs (Binary.ResolveOperator): Added support for 
18715         "U operator - (E x, E y)"
18716
18717         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
18718         y)".
18719
18720         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
18721         init-only variables, but this path did not take into account that
18722         there might be also instance readonly variables.  Correct this
18723         problem. 
18724
18725         This fixes bug 32253
18726
18727         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
18728         delegates as well.
18729
18730         * driver.cs: Change the extension for modules to `netmodule'
18731
18732         * cs-parser.jay: Improved slightly the location tracking for
18733         the debugger symbols.
18734
18735         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
18736         modifiers that were specified instead of the hardcoded value
18737         (FamAndAssem).  This was basically ignoring the static modifier,
18738         and others.  Fixes 32429.
18739
18740         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
18741         fixed a bug in the process (32476)
18742
18743         * expression.cs (ArrayAccess.EmitAssign): Patch from
18744         hwang_rob@yahoo.ca that fixes bug 31834.3
18745
18746 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
18747
18748         * driver.cs: Make the module extension .netmodule.
18749
18750 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
18751
18752         * driver.cs: Report an error if the resource file is not found
18753         instead of crashing.
18754
18755         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
18756         false, like Emit does.
18757
18758 2002-10-16  Nick Drochak  <ndrochak@gol.com>
18759
18760         * typemanager.cs: Remove unused private member.  Also reported mcs
18761         bug to report this as a warning like csc.
18762
18763 2002-10-15  Martin Baulig  <martin@gnome.org>
18764
18765         * statement.cs (Statement.Emit): Made this a virtual method; emits
18766         the line number info and calls DoEmit().
18767         (Statement.DoEmit): New protected abstract method, formerly knows
18768         as Statement.Emit().
18769
18770         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
18771
18772 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
18773
18774         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
18775         have fixed a remaining problem: not every AddXXXX was adding a
18776         fully qualified name.  
18777
18778         Now everyone registers a fully qualified name in the DeclSpace as
18779         being defined instead of the partial name.  
18780
18781         Downsides: we are slower than we need to be due to the excess
18782         copies and the names being registered this way.  
18783
18784         The reason for this is that we currently depend (on the corlib
18785         bootstrap for instance) that types are fully qualified, because
18786         we dump all the types in the namespace, and we should really have
18787         types inserted into the proper namespace, so we can only store the
18788         basenames in the defined_names array.
18789
18790 2002-10-10  Martin Baulig  <martin@gnome.org>
18791
18792         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
18793         from bug #31834, see the bug report for a testcase which is
18794         miscompiled.
18795
18796 2002-10-10  Martin Baulig  <martin@gnome.org>
18797
18798         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
18799         flow analysis code for this.
18800
18801         * statement.cs (Do, While, For): Tell the flow analysis code about
18802         infinite loops.
18803         (FlowBranching.UsageVector): Added support for infinite loops.
18804         (Block.Resolve): Moved the dead code elimination here and use flow
18805         analysis to do it.
18806
18807 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
18808
18809         * class.cs (Field.Define): Catch cycles on struct type
18810         definitions. 
18811
18812         * typemanager.cs (IsUnmanagedtype): Do not recursively check
18813         fields if the fields are static.  We only need to check instance
18814         fields. 
18815
18816         * expression.cs (As.DoResolve): Test for reference type.
18817
18818         * statement.cs (Using.ResolveExpression): Use
18819         ConvertImplicitRequired, not ConvertImplicit which reports an
18820         error on failture
18821         (Using.ResolveLocalVariableDecls): ditto.
18822
18823         * expression.cs (Binary.ResolveOperator): Report errors in a few
18824         places where we had to.
18825
18826         * typemanager.cs (IsUnmanagedtype): Finish implementation.
18827
18828 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
18829
18830         * expression.cs: Use StoreFromPtr instead of extracting the type
18831         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
18832
18833         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
18834         an enumeration value to a System.Enum, but System.Enum is not a
18835         value type, but an class type, so we need to box.
18836
18837         (Expression.ConvertExplicit): One codepath could return
18838         errors but not flag them.  Fix this.  Fixes #31853
18839
18840         * parameter.cs (Resolve): Do not allow void as a parameter type.
18841
18842 2002-10-06  Martin Baulig  <martin@gnome.org>
18843
18844         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
18845         if it's a class type and not a struct.  Fixes #31815.
18846
18847 2002-10-06  Martin Baulig  <martin@gnome.org>
18848
18849         * statement.cs: Reworked the flow analysis code a bit to make it
18850         usable for dead code elimination.
18851
18852 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18853
18854         * cs-parser.jay: allow empty source files. Fixes bug #31781.
18855
18856 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
18857
18858         * expression.cs (ComposedCast.DoResolveType): A quick workaround
18859         to fix the test 165, will investigate deeper.
18860
18861 2002-10-04  Martin Baulig  <martin@gnome.org>
18862
18863         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
18864         finally blocks actually work.
18865         (Try.Resolve): We don't need to create a sibling for `finally' if
18866         there is no finally block.
18867
18868 2002-10-04  Martin Baulig  <martin@gnome.org>
18869
18870         * class.cs (Constructor.Define): The default accessibility for a
18871         non-default constructor is private, not public.
18872
18873 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
18874
18875         * class.cs (Constructor): Make AllowedModifiers public, add
18876         EXTERN.
18877
18878         * cs-parser.jay: Perform the modifiers test here, as the
18879         constructor for the Constructor class usually receives a zero
18880         because of the way we create it (first we create, later we
18881         customize, and we were never checking the modifiers).
18882
18883         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
18884         is a version of LookupTypeReflection that includes the type-name
18885         cache.  This can be used as a fast path for functions that know
18886         the fully qualified name and are only calling into *.GetType() to
18887         obtain a composed type.
18888
18889         This is also used by TypeManager.LookupType during its type
18890         composition.
18891
18892         (LookupType): We now also track the real type name, as sometimes
18893         we can get a quey for the real type name from things like
18894         ComposedCast.  This fixes bug 31422.
18895
18896         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
18897         complete type fullname, it does not have to go through the type
18898         resolution system to obtain the composed version of the type (for
18899         obtaining arrays or pointers).
18900
18901         (Conditional.Emit): Use the EmitBoolExpression to
18902         generate nicer code, as requested by Paolo.
18903
18904         (ArrayCreation.CheckIndices): Use the patch from
18905         hwang_rob@yahoo.ca to validate the array initializers. 
18906
18907 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
18908
18909         * class.cs (ConstructorInitializer.Emit): simplify code by using
18910         Invocation.EmitCall, and at the same time, fix the bugs in calling
18911         parent constructors that took variable arguments. 
18912
18913         * ecore.cs (Expression.ConvertNumericExplicit,
18914         Expression.ImplicitNumericConversion): Remove the code that
18915         manually wrapped decimal (InternalTypeConstructor call is now gone
18916         as well).
18917
18918         * expression.cs (Cast.TryReduce): Also handle decimal types when
18919         trying to perform a constant fold on the type.
18920
18921         * typemanager.cs (IsUnmanagedtype): Partially implemented.
18922
18923         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
18924         that only turned off an error report, and did nothing else. 
18925
18926 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
18927
18928         * driver.cs: Handle and ignore /fullpaths
18929
18930 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
18931
18932         * expression.cs (Binary.ResolveOperator): Catch the case where
18933         DoNumericPromotions returns true, 
18934
18935         (Binary.DoNumericPromotions): Simplify the code, and the tests.
18936
18937 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
18938
18939         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
18940         report error 70.
18941
18942 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
18943
18944         * ecore.cs (ConvertNumericExplicit): It is not enough that the
18945         conversion exists, but it is also required that the conversion be
18946         performed.  This manifested in "(Type64Enum) 2".  
18947
18948         * class.cs (TypeManager.AddMethod): The fix is not to change
18949         AddEnum, because that one was using a fully qualified name (every
18950         DeclSpace derivative does), but to change the AddMethod routine
18951         that was using an un-namespaced name.  This now correctly reports
18952         the duplicated name.
18953
18954         Revert patch until I can properly fix it.  The issue
18955         is that we have a shared Type space across all namespaces
18956         currently, which is wrong.
18957
18958         Options include making the Namespace a DeclSpace, and merge
18959         current_namespace/current_container in the parser.
18960
18961 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
18962
18963         * cs-parser.jay: Improve error reporting when we get a different
18964         kind of expression in local_variable_type and
18965         local_variable_pointer_type. 
18966
18967         Propagate this to avoid missleading errors being reported.
18968
18969         * ecore.cs (ImplicitReferenceConversion): treat
18970         TypeManager.value_type as a target just like object_type.   As
18971         code like this:
18972
18973         ValueType v = 1;
18974
18975         Is valid, and needs to result in the int 1 being boxed before it
18976         is assigned to the value type v.
18977
18978         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
18979         to validate the enumeration name.
18980
18981         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
18982         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
18983         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
18984
18985         * ecore.cs (TryImplicitIntConversion): When doing an
18986         implicit-enumeration-conversion, check if the type is 64-bits and
18987         perform a conversion before passing to EnumConstant.
18988
18989 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
18990
18991         * decl.cs (Error_AmbiguousTypeReference); New routine used to
18992         report ambiguous type references.  Unlike the MS version, we
18993         report what the ambiguity is.   Innovation at work ;-)
18994
18995         (DeclSpace.FindType): Require a location argument to
18996         display when we display an ambiguous error.
18997
18998         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
18999
19000         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
19001
19002         * expression.cs (EmitDynamicInitializers): Apply patch from
19003         hwang_rob@yahoo.ca that fixes the order in which we emit our
19004         initializers. 
19005
19006 2002-09-21  Martin Baulig  <martin@gnome.org>
19007
19008         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
19009         delegate takes no arguments.
19010
19011 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
19012
19013         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
19014         from integers.
19015
19016         * expression.cs: Extract the underlying type.
19017
19018         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
19019
19020         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
19021
19022 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
19023
19024         * class.cs (TypeContainer.DefineType): We can not use the nice
19025         PackingSize with the size set to 1 DefineType method, because it
19026         will not allow us to define the interfaces that the struct
19027         implements.
19028
19029         This completes the fixing of bug 27287
19030
19031         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
19032         means also structs.  This fixes part of the problem. 
19033         (Expresion.ImplicitReferenceConversionExists): ditto.
19034
19035         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
19036         error if there were no errors reported during the type lookup
19037         process, to avoid duplicates or redundant errors.  Without this
19038         you would get an ambiguous errors plus a type not found.  We have
19039         beaten the user enough with the first error.  
19040
19041         (DeclSparce.FindType): Emit a warning if we have an ambiguous
19042         reference. 
19043
19044         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
19045         during the resolution process, stop the lookup, this avoids
19046         repeated error reports (same error twice).
19047
19048         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
19049
19050         * typemanager.cs (LookupType): Redo the type lookup code to match
19051         the needs of System.Reflection.  
19052
19053         The issue is that System.Reflection requires references to nested
19054         types to begin with a "+" sign instead of a dot.  So toplevel
19055         types look like: "NameSpace.TopLevelClass", and nested ones look
19056         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
19057         levels. 
19058
19059 2002-09-19  Martin Baulig  <martin@gnome.org>
19060
19061         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
19062         says that a method always returns or always throws an exception,
19063         don't report the CS0161.
19064
19065         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
19066         set `Returns = new_returns'.
19067
19068 2002-09-19  Martin Baulig  <martin@gnome.org>
19069
19070         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
19071         to an enum constant, check for a CS0176.
19072
19073 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
19074
19075         * class.cs (TypeContainer.CheckPairedOperators): Now we check
19076         for operators that must be in pairs and report errors.
19077
19078         * ecore.cs (SimpleName.DoResolveType): During the initial type
19079         resolution process, when we define types recursively, we must
19080         check first for types in our current scope before we perform
19081         lookups in the enclosing scopes.
19082
19083         * expression.cs (MakeByteBlob): Handle Decimal blobs.
19084
19085         (Invocation.VerifyArgumentsCompat): Call
19086         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
19087         I thought we were supposed to always call this, but there are a
19088         few places in the code where we dont do it.
19089
19090 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
19091
19092         * driver.cs: Add support in -linkres and -resource to specify the
19093         name of the identifier.
19094
19095 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
19096
19097         * ecore.cs (StandardConversionExists): Sync with the conversion
19098         code: allow anything-* to void* conversions.
19099
19100         (FindMostSpecificSource): Use an Expression argument
19101         instead of a Type, because we might be handed over a Literal which
19102         gets a few more implicit conversions that plain types do not.  So
19103         this information was being lost.
19104
19105         Also, we drop the temporary type-holder expression when not
19106         required.
19107
19108 2002-09-17  Martin Baulig  <martin@gnome.org>
19109
19110         * class.cs (PropertyBase.CheckBase): Don't check the base class if
19111         this is an explicit interface implementation.
19112
19113 2002-09-17  Martin Baulig  <martin@gnome.org>
19114
19115         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
19116         different `IndexerName' attributes.
19117
19118         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
19119         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
19120         virtual CommonResolve().
19121
19122 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
19123
19124         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
19125         and convert that to the UnderlyingType.
19126
19127         * statement.cs (Foreach.Resolve): Indexers are just like variables
19128         or PropertyAccesses.
19129
19130         * cs-tokenizer.cs (consume_string): Track line numbers and columns
19131         inside quoted strings, we were not doing this before.
19132
19133 2002-09-16  Martin Baulig  <martin@gnome.org>
19134
19135         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
19136         resolve it.  This is needed for the definite assignment check of the
19137         instance expression, fixes bug #29846.
19138         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
19139
19140 2002-09-16  Nick Drochak  <ndrochak@gol.com>
19141
19142         * parameter.cs: Fix compile error.  Cannot reference static member
19143         from an instance object.  Is this an mcs bug?
19144
19145 2002-09-14  Martin Baulig  <martin@gnome.org>
19146
19147         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
19148         multiple times.  Fixes bug #30295, added test-166.cs.
19149
19150 2002-09-14  Martin Baulig  <martin@gnome.org>
19151
19152         * statement.cs (Block.Emit): Don't emit unreachable code.
19153         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
19154         `break' statements.
19155         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
19156
19157 2002-09-14  Martin Baulig  <martin@gnome.org>
19158
19159         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
19160         is set.
19161
19162 2002-09-14  Martin Baulig  <martin@gnome.org>
19163
19164         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
19165         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
19166         be false on the ms runtime.
19167
19168 2002-09-13  Martin Baulig  <martin@gnome.org>
19169
19170         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
19171         the CS0038 error message.
19172
19173 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
19174
19175         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
19176         constant inside, return it.
19177
19178 2002-09-12  Martin Baulig  <martin@gnome.org>
19179
19180         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
19181         implicit conversion can be done between enum types.
19182
19183         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
19184         check whether an implicit conversion to the current enum's UnderlyingType
19185         exists and report an error if not.
19186
19187         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
19188         without debugging support.
19189
19190         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
19191         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
19192
19193 2002-09-12  Martin Baulig  <martin@gnome.org>
19194
19195         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
19196
19197         * ecore.cs (IMemberExpr.DeclaringType): New property.
19198         (SimpleName.SimpleNameResolve): Check whether we're accessing a
19199         nonstatic member of an outer type (CS0038).
19200
19201 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
19202
19203         * driver.cs: Activate the using-error detector at warning level
19204         4 (at least for MS-compatible APIs).
19205
19206         * namespace.cs (VerifyUsing): Small buglett fix.
19207
19208         * pending.cs (PendingImplementation): pass the container pointer. 
19209
19210         * interface.cs (GetMethods): Allow for recursive definition.  Long
19211         term, I would like to move every type to support recursive
19212         definitions, not the current ordering mechanism that we have right
19213         now.
19214
19215         The situation is this: Attributes are handled before interfaces,
19216         so we can apply attributes to interfaces.  But some attributes
19217         implement interfaces, we will now handle the simple cases
19218         (recursive definitions will just get an error).  
19219
19220         * parameter.cs: Only invalidate types at the end if we fail to
19221         lookup all types.  
19222
19223 2002-09-09  Martin Baulig  <martin@gnome.org>
19224
19225         * ecore.cs (PropertyExpr.Emit): Also check for
19226         TypeManager.system_int_array_get_length so this'll also work when
19227         compiling corlib.  Fixes #30003.
19228
19229 2002-09-09  Martin Baulig  <martin@gnome.org>
19230
19231         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
19232         and throw an exception if we can't get the type's size.  Fixed #30040,
19233         added test-165.cs.
19234
19235 2002-09-09  Martin Baulig  <martin@gnome.org>
19236
19237         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
19238
19239         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
19240         context.  Fixes bug #30027.
19241
19242         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
19243         virtual functions.  Fixes bug #30043, added test-164.cs.
19244
19245 2002-09-08  Ravi Pratap  <ravi@ximian.com>
19246
19247         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
19248
19249 2002-09-08  Nick Drochak  <ndrochak@gol.com>
19250
19251         * driver.cs: Use an object to get the windows codepage since it's not a
19252         static property.
19253
19254 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
19255
19256         * statement.cs (For.Emit): for infinite loops (test == null)
19257         return whether there is a break inside, not always "true".
19258
19259         * namespace.cs (UsingEntry): New struct to hold the name of the
19260         using definition, the location where it is defined, and whether it
19261         has been used in a successful type lookup.
19262
19263         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
19264         strings.
19265
19266         * decl.cs: ditto.
19267
19268 2002-09-06  Ravi Pratap  <ravi@ximian.com>
19269
19270         * attribute.cs : Fix incorrect code which relied on catching
19271         a NullReferenceException to detect a null being passed in
19272         where an object was expected.
19273
19274 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
19275
19276         * statement.cs (Try): flag the catch variable as assigned
19277
19278         * expression.cs (Cast): Simplified by using ResolveType instead of
19279         manually resolving.
19280
19281         * statement.cs (Catch): Fix bug by using ResolveType.
19282
19283 2002-09-06  Ravi Pratap  <ravi@ximian.com>
19284
19285         * expression.cs (BetterConversion): Special case for when we have
19286         a NullLiteral as the argument and we have to choose between string
19287         and object types - we choose string the way csc does.
19288
19289         * attribute.cs (Attribute.Resolve): Catch the
19290         NullReferenceException and report error #182 since the Mono
19291         runtime no more has the bug and having this exception raised means
19292         we tried to select a constructor which takes an object and is
19293         passed a null.
19294
19295 2002-09-05  Ravi Pratap  <ravi@ximian.com>
19296
19297         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
19298         message (1502, 1503) when we can't locate a method after overload
19299         resolution. This is much more informative and closes the bug
19300         Miguel reported.
19301
19302         * interface.cs (PopulateMethod): Return if there are no argument
19303         types. Fixes a NullReferenceException bug.
19304
19305         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
19306         expressions too. Previously we were checking only in one place for
19307         positional arguments leaving out named arguments.
19308
19309         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
19310         type to the enum type is not allowed. Remove code corresponding to
19311         that.
19312
19313         (ConvertNumericExplicit): Allow explicit conversions from
19314         the underlying type to enum type. This precisely follows the spec
19315         and closes a bug filed by Gonzalo.
19316
19317 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19318
19319         * compiler.csproj:
19320         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
19321
19322 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
19323
19324         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
19325         it was important that we stored the right value after the
19326         reduction in `converted'.
19327
19328 2002-09-04  Martin Baulig  <martin@gnome.org>
19329
19330         * location.cs (Location.SymbolDocument): Use full pathnames for the
19331         source files.
19332
19333 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
19334
19335         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
19336         of the expression resolve mechanism, because that will catch the
19337         SimpleName error failures.
19338
19339         (Conditional): If we can not resolve the
19340         expression, return, do not crash.
19341
19342 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19343
19344         * cs-tokenizer.cs:
19345         (location): display token name instead of its number.
19346
19347 2002-08-28  Martin Baulig  <martin@gnome.org>
19348
19349         * expression.cs (Binary.ResolveOperator): Don't silently return
19350         but return an error if an operator cannot be applied between two
19351         enum types.
19352
19353 2002-08-28  Martin Baulig  <martin@gnome.org>
19354
19355         * class.cs (Constructor.Define): Set the permission attributes
19356         correctly instead of making all constructors public.
19357
19358 2002-08-28  Martin Baulig  <martin@gnome.org>
19359
19360         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
19361         for private members before reporting a CS0103; if we find anything,
19362         it's a CS0122.
19363
19364 2002-08-28  Martin Baulig  <martin@gnome.org>
19365
19366         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
19367         to check whether `closure_start_type == closure_invocation_type',
19368         we also need to check whether `m.DeclaringType == closure_invocation_type'
19369         before bypassing the permission checks.  We might be accessing
19370         protected/private members from the base class.
19371         (TypeManager.RealMemberLookup): Only set private_ok if private
19372         members were requested via BindingFlags.NonPublic.
19373
19374         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
19375
19376         * expression.cs (MemberAccess.ResolveMemberAccess): Set
19377         MethodGroupExpr.IsExplicitImpl if appropriate.
19378         (Invocation.DoResolve): Don't report the CS0120 for explicit
19379         interface implementations.
19380
19381 2002-08-27  Martin Baulig  <martin@gnome.org>
19382
19383         * expression.cs (Invocation.DoResolve): If this is a static
19384         method and we don't have an InstanceExpression, we must report
19385         a CS0120.
19386
19387 2002-08-25  Martin Baulig  <martin@gnome.org>
19388
19389         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
19390         `==' between a valuetype and an object.
19391
19392 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
19393
19394         * ecore.cs (TypeExpr): Provide a ToString method.
19395
19396 2002-08-24  Martin Baulig  <martin@gnome.org>
19397
19398         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
19399         now called proggie.dbg and it's a binary file.
19400
19401 2002-08-23  Martin Baulig  <martin@gnome.org>
19402
19403         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
19404
19405 2002-08-23  Martin Baulig  <martin@gnome.org>
19406
19407         * struct.cs (MyStructInfo.ctor): Make this work with empty
19408         structs; it's not allowed to use foreach() on null.
19409
19410 2002-08-23  Martin Baulig  <martin@gnome.org>
19411
19412         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
19413         writer the full pathname of the generated assembly.
19414
19415 2002-08-23  Martin Baulig  <martin@gnome.org>
19416
19417         * statements.cs (FlowBranching.UsageVector.MergeChildren):
19418         A `finally' block never returns or breaks; improved handling of
19419         unreachable code.
19420
19421 2002-08-23  Martin Baulig  <martin@gnome.org>
19422
19423         * statement.cs (Throw.Resolve): Allow `throw null'.
19424
19425 2002-08-23  Martin Baulig  <martin@gnome.org>
19426
19427         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
19428         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
19429         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
19430         MemberLookup would return a wrong event if this is an explicit
19431         interface implementation and the class has an event with the same
19432         name.
19433
19434 2002-08-23  Martin Baulig  <martin@gnome.org>
19435
19436         * statement.cs (Block.AddChildVariableNames): New public method.
19437         (Block.AddChildVariableName): Likewise.
19438         (Block.IsVariableNameUsedInChildBlock): Likewise.
19439         (Block.AddVariable): Check whether a variable name has already
19440         been used in a child block.
19441
19442         * cs-parser.jay (declare_local_variables): Mark all variable names
19443         from the current block as being used in a child block in the
19444         implicit block.
19445
19446 2002-08-23  Martin Baulig  <martin@gnome.org>
19447
19448         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
19449         find the symbol writer.
19450
19451         * driver.cs: csc also allows the arguments to /define being
19452         separated by commas, not only by semicolons.
19453
19454 2002-08-23  Martin Baulig  <martin@gnome.org>
19455
19456         * interface.cs (Interface.GetMembers): Added static check for events.
19457
19458 2002-08-15  Martin Baulig  <martin@gnome.org>
19459
19460         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
19461         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
19462
19463         * ecore.cs (Expression.MemberLookup): Added documentation and explained
19464         why the MethodData.EmitDestructor() change was necessary.
19465
19466 2002-08-20  Martin Baulig  <martin@gnome.org>
19467
19468         * class.cs (TypeContainer.FindMembers): Added static check for events.
19469
19470         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
19471
19472         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
19473         use Type.GetEvents(), not Type.FindMembers().
19474
19475 2002-08-20  Martin Baulig  <martin@gnome.org>
19476
19477         * decl.cs (MemberCache): Added a special method cache which will
19478         be used for method-only searched.  This ensures that a method
19479         search will return a MethodInfo with the correct ReflectedType for
19480         inherited methods.      
19481
19482 2002-08-20  Martin Baulig  <martin@gnome.org>
19483
19484         * decl.cs (DeclSpace.FindMembers): Made this public.
19485
19486 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19487
19488         * delegate.cs: fixed build on windows.
19489         [FIXME:  Filed as bug #29150: MCS must report these errors.]
19490
19491 2002-08-19  Ravi Pratap  <ravi@ximian.com>
19492
19493         * ecore.cs (StandardConversionExists): Return a false
19494         if we are trying to convert the void type to anything else
19495         since that is not allowed.
19496
19497         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
19498         we flag error 70 in the event an event is trying to be accessed
19499         directly from outside the declaring type.
19500
19501 2002-08-20  Martin Baulig  <martin@gnome.org>
19502
19503         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
19504         MemberCache from typemanager.cs to decl.cs.
19505
19506 2002-08-19  Martin Baulig  <martin@gnome.org>
19507
19508         * class.cs (TypeContainer): Implement IMemberContainer.
19509         (TypeContainer.DefineMembers): Create the MemberCache.
19510         (TypeContainer.FindMembers): Do better BindingFlags checking; only
19511         return public members if BindingFlags.Public was given, check
19512         whether members are static.
19513
19514 2002-08-16  Martin Baulig  <martin@gnome.org>
19515
19516         * decl.cs (DeclSpace.Define): Splitted this in Define and
19517         DefineMembers.  DefineMembers is called first and initializes the
19518         MemberCache.
19519
19520         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
19521         DefineMembers() on all our DeclSpaces.
19522
19523         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
19524         but call DefineMembers() on all nested interfaces.  We call their
19525         Define() in our new Define() function.
19526
19527         * interface.cs (Interface): Implement IMemberContainer.
19528         (Interface.Define): Moved all code except the attribute stuf to
19529         DefineMembers().
19530         (Interface.DefineMembers): Initialize the member cache.
19531
19532         * typemanager.cs (IMemberFinder): Removed this interface, we don't
19533         need this anymore since we can use MemberCache.FindMembers directly.
19534
19535 2002-08-19  Martin Baulig  <martin@gnome.org>
19536
19537         * typemanager.cs (MemberCache): When creating the cache for an
19538         interface type, add all inherited members.
19539         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
19540         to `out bool used_cache' and documented it.
19541         (TypeManager.MemberLookup): If we already used the cache in the first
19542         iteration, we don't need to do the interfaces check.
19543
19544 2002-08-19  Martin Baulig  <martin@gnome.org>
19545
19546         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
19547         here from IMemberFinder and don't implement this interface anymore.
19548         (DeclSpace.MemberCache): Moved here from IMemberFinder.
19549
19550         * typemanager.cs (IMemberFinder): This interface is now only used by
19551         classes which actually support the member cache.
19552         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
19553         since we only put DeclSpaces into this Hashtable.
19554         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
19555         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
19556
19557 2002-08-16  Martin Baulig  <martin@gnome.org>
19558
19559         * typemanager.cs (ICachingMemberFinder): Removed.
19560         (IMemberFinder.MemberCache): New property.
19561         (TypeManager.FindMembers): Merged this with RealFindMembers().
19562         This function will never be called from TypeManager.MemberLookup()
19563         so we can't use the cache here, just the IMemberFinder.
19564         (TypeManager.MemberLookup_FindMembers): Check whether the
19565         IMemberFinder has a MemberCache and call the cache's FindMembers
19566         function.
19567         (MemberCache): Rewrote larger parts of this yet another time and
19568         cleaned it up a bit.
19569
19570 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
19571
19572         * driver.cs (LoadArgs): Support quoting.
19573
19574         (Usage): Show the CSC-like command line arguments.
19575
19576         Improved a few error messages.
19577
19578 2002-08-15  Martin Baulig  <martin@gnome.org>
19579
19580         * typemanager.cs (IMemberContainer.Type): New property.
19581         (IMemberContainer.IsInterface): New property.
19582
19583         The following changes are conditional to BROKEN_RUNTIME, which is
19584         defined at the top of the file.
19585
19586         * typemanager.cs (MemberCache.MemberCache): Don't add the base
19587         class'es members, but add all members from TypeHandle.ObjectType
19588         if we're an interface.
19589         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
19590         is the current type.
19591         (MemberCache.CacheEntry.Container): Removed this field.
19592         (TypeHandle.GetMembers): Include inherited members.
19593
19594 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19595
19596         * typemanager.cs: fixed compilation and added a comment on a field that
19597         is never used.
19598
19599 2002-08-15  Martin Baulig  <martin@gnome.org>
19600
19601         * class.cs (ConstructorInitializer.Resolve): In the
19602         Expression.MemberLookup call, use the queried_type as
19603         invocation_type.
19604
19605         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
19606         declared' attribute, it's always true.
19607         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
19608         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
19609         temporary wrapper for FindMembers which tells MemberLookup whether
19610         members from the base classes are included in the return value.
19611         This will go away soon.
19612         (TypeManager.MemberLookup): Use this temporary hack here; once the
19613         new MemberCache is completed, we don't need to do the DeclaredOnly
19614         looping here anymore since the MemberCache will take care of this.
19615         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
19616         (MemberCache): When creating the MemberCache for a class, get
19617         members from the current class and all its base classes.
19618         (MemberCache.CacheEntry.Container): New field.  This is a
19619         temporary hack until the Mono runtime is fixed to distinguish
19620         between ReflectedType and DeclaringType.  It allows us to use MCS
19621         with both the MS runtime and the unfixed Mono runtime without
19622         problems and without accecting performance.
19623         (MemberCache.SearchMembers): The DeclaredOnly looping from
19624         TypeManager.MemberLookup is now done here.      
19625
19626 2002-08-14  Martin Baulig  <martin@gnome.org>
19627
19628         * statement.cs (MyStructInfo.MyStructInfo): Don't call
19629         Type.GetFields on dynamic types but get the fields from the
19630         corresponding TypeContainer.
19631         (MyStructInfo.GetStructInfo): Added check for enum types.
19632
19633         * typemanager.cs (MemberList.IsSynchronized): Implemented.
19634         (MemberList.SyncRoot): Implemented.
19635         (TypeManager.FilterWithClosure): No need to check permissions if
19636         closure_start_type == closure_invocation_type, don't crash if
19637         closure_invocation_type is null.
19638
19639 2002-08-13  Martin Baulig  <martin@gnome.org>
19640
19641         Rewrote TypeContainer.FindMembers to use a member cache.  This
19642         gives us a speed increase of about 35% for the self-hosting MCS
19643         build and of about 15-20% for the class libs (both on GNU/Linux).
19644
19645         * report.cs (Timer): New class to get enhanced profiling.  This
19646         whole class is "TIMER" conditional since it remarkably slows down
19647         compilation speed.
19648
19649         * class.cs (MemberList): New class.  This is an IList wrapper
19650         which we're now using instead of passing MemberInfo[]'s around to
19651         avoid copying this array unnecessarily.
19652         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
19653         (ICachingMemberFinder, IMemberContainer): New interface.
19654         (TypeManager.FilterWithClosure): If `criteria' is null, the name
19655         has already been checked, otherwise use it for the name comparision.
19656         (TypeManager.FindMembers): Renamed to RealMemberFinder and
19657         provided wrapper which tries to use ICachingMemberFinder.FindMembers
19658         if possible.  Returns a MemberList, not a MemberInfo [].
19659         (TypeHandle): New class, implements IMemberContainer.  We create
19660         one instance of this class per type, it contains a MemberCache
19661         which is used to do the member lookups.
19662         (MemberCache): New class.  Each instance of this class contains
19663         all members of a type and a name-based hash table.
19664         (MemberCache.FindMembers): This is our new member lookup
19665         function.  First, it looks up all members of the requested name in
19666         the hash table.  Then, it walks this list and sorts out all
19667         applicable members and returns them.
19668
19669 2002-08-13  Martin Baulig  <martin@gnome.org>
19670
19671         In addition to a nice code cleanup, this gives us a performance
19672         increase of about 1.4% on GNU/Linux - not much, but it's already
19673         half a second for the self-hosting MCS compilation.
19674
19675         * typemanager.cs (IMemberFinder): New interface.  It is used by
19676         TypeManager.FindMembers to call FindMembers on a TypeContainer,
19677         Enum, Delegate or Interface.
19678         (TypeManager.finder_to_member_finder): New PtrHashtable.
19679         (TypeManager.finder_to_container): Removed.
19680         (TypeManager.finder_to_delegate): Removed.
19681         (TypeManager.finder_to_interface): Removed.
19682         (TypeManager.finder_to_enum): Removed.
19683
19684         * interface.cs (Interface): Implement IMemberFinder.
19685
19686         * delegate.cs (Delegate): Implement IMemberFinder.
19687
19688         * enum.cs (Enum): Implement IMemberFinder.
19689
19690         * class.cs (TypeContainer): Implement IMemberFinder.
19691
19692 2002-08-12  Martin Baulig  <martin@gnome.org>
19693
19694         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
19695
19696 2002-08-12  Martin Baulig  <martin@gnome.org>
19697
19698         * ecore.cs (ITypeExpression): New interface for expressions which
19699         resolve to a type.
19700         (TypeExpression): Renamed to TypeLookupExpression.
19701         (Expression.DoResolve): If we're doing a types-only lookup, the
19702         expression must implement the ITypeExpression interface and we
19703         call DoResolveType() on it.
19704         (SimpleName): Implement the new ITypeExpression interface.
19705         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
19706         hack, the situation that we're only looking up types can't happen
19707         anymore when this method is called.  Moved the type lookup code to
19708         DoResolveType() and call it.
19709         (SimpleName.DoResolveType): This ITypeExpression interface method
19710         is now doing the types-only lookup.
19711         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
19712         (ResolveFlags): Added MaskExprClass.
19713
19714         * expression.cs (MemberAccess): Implement the ITypeExpression
19715         interface.
19716         (MemberAccess.DoResolve): Added support for a types-only lookup
19717         when we're called via ITypeExpression.DoResolveType().
19718         (ComposedCast): Implement the ITypeExpression interface.
19719
19720         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
19721         Expression.Resolve() with ResolveFlags.Type instead.
19722
19723 2002-08-12  Martin Baulig  <martin@gnome.org>
19724
19725         * interface.cs (Interface.Define): Apply attributes.
19726
19727         * attribute.cs (Attribute.ApplyAttributes): Added support for
19728         interface attributes.
19729
19730 2002-08-11  Martin Baulig  <martin@gnome.org>
19731
19732         * statement.cs (Block.Emit): Only check the "this" variable if we
19733         do not always throw an exception.
19734
19735         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
19736         whether the property has a set accessor.
19737
19738 2002-08-11  Martin Baulig  <martin@gnome.org>
19739
19740         Added control flow analysis support for structs.
19741
19742         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
19743         with control flow analysis turned off.
19744         (IVariable): New interface.
19745         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
19746         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
19747         (FieldExpr.DoResolve): Resolve the instance expression with flow
19748         analysis turned off and do the definite assignment check after the
19749         resolving when we know what the expression will resolve to.
19750
19751         * expression.cs (LocalVariableReference, ParameterReference):
19752         Implement the new IVariable interface, only call the flow analysis
19753         code if ec.DoFlowAnalysis is true.
19754         (This): Added constructor which takes a Block argument.  Implement
19755         the new IVariable interface.
19756         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
19757         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
19758         This does the definite assignment checks for struct members.
19759
19760         * class.cs (Constructor.Emit): If this is a non-static `struct'
19761         constructor which doesn't have any initializer, call
19762         Block.AddThisVariable() to tell the flow analysis code that all
19763         struct elements must be initialized before control returns from
19764         the constructor.
19765
19766         * statement.cs (MyStructInfo): New public class.
19767         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
19768         argument to this indexer.  If non-zero, check an individual struct
19769         member, not the whole struct.
19770         (FlowBranching.CheckOutParameters): Check struct members.
19771         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
19772         overloaded versions of these methods which take an additional
19773         `int field_idx' argument to check struct members.
19774         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
19775         overloaded versions of these methods which take an additional
19776         `string field_name' argument to check struct member.s
19777         (VariableInfo): Implement the IVariable interface.
19778         (VariableInfo.StructInfo): New public property.  Returns the
19779         MyStructInfo instance of the variable if it's a struct or null.
19780         (Block.AddThisVariable): New public method.  This is called from
19781         Constructor.Emit() for non-static `struct' constructor which do
19782         not have any initializer.  It creates a special variable for the
19783         "this" instance variable which will be checked by the flow
19784         analysis code to ensure that all of the struct's fields are
19785         initialized before control returns from the constructor.
19786         (UsageVector): Added support for struct members.  If a
19787         variable/parameter is a struct with N members, we reserve a slot
19788         in the usage vector for each member.  A struct is considered fully
19789         initialized if either the struct itself (slot 0) or all its
19790         members are initialized.
19791
19792 2002-08-08  Martin Baulig  <martin@gnome.org>
19793
19794         * driver.cs (Driver.MainDriver): Only report an error CS5001
19795         if there were no compilation errors.
19796
19797         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
19798         `UnsafeContext' property to determine whether the parent is in
19799         unsafe context rather than checking the parent's ModFlags:
19800         classes nested in an unsafe class are unsafe as well.
19801
19802 2002-08-08  Martin Baulig  <martin@gnome.org>
19803
19804         * statement.cs (UsageVector.MergeChildren): Distinguish between
19805         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
19806         we return.  Added test17() and test18() to test-154.cs.
19807
19808 2002-08-08  Martin Baulig  <martin@gnome.org>
19809
19810         * typemanager.cs (TypeManager.FilterWithClosure): If we have
19811         Family access, make sure the invoking type isn't a subclass of the
19812         queried type (that'd be a CS1540).
19813
19814         * ecore.cs (Expression.MemberLookup): Added overloaded version of
19815         this method which takes an additional `Type invocation_type'.
19816
19817         * expression.cs (BaseAccess.DoResolve): Use the base type as
19818         invocation and query type.
19819         (MemberAccess.DoResolve): If the lookup failed and we're about to
19820         report a CS0122, try a lookup with the ec.ContainerType - if this
19821         succeeds, we must report a CS1540.
19822
19823 2002-08-08  Martin Baulig  <martin@gnome.org>
19824
19825         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
19826         (MethodGroupExpr): Implement the IMemberExpr interface.
19827
19828         * expression (MemberAccess.ResolveMemberAccess): No need to have
19829         any special code for MethodGroupExprs anymore, they're now
19830         IMemberExprs.   
19831
19832 2002-08-08  Martin Baulig  <martin@gnome.org>
19833
19834         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
19835         Family, FamANDAssem and FamORAssem permissions.
19836         (TypeManager.IsSubclassOrNestedChildOf): New public method.
19837
19838 2002-08-08  Martin Baulig  <martin@gnome.org>
19839
19840         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
19841         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
19842         or loop block.
19843
19844 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
19845
19846         * driver.cs: implemented /resource option to embed managed resources.
19847
19848 2002-08-07  Martin Baulig  <martin@gnome.org>
19849
19850         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
19851         (FieldBase.HasFieldInitializer): New public property.
19852         (FieldBase.GetInitializerExpression): New public method.  Resolves and
19853         returns the field initializer and makes sure it is only resolved once.
19854         (TypeContainer.EmitFieldInitializers): Call
19855         FieldBase.GetInitializerExpression to get the initializer, this ensures
19856         that it isn't resolved multiple times.
19857
19858         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
19859         the resolving process (SimpleName/MemberLookup) that we're currently
19860         emitting a field initializer (which must not access any instance members,
19861         this is an error CS0236).
19862
19863         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
19864         argument, if the `IsFieldInitializer' flag is set, we must report and
19865         error CS0236 and not an error CS0120.   
19866
19867 2002-08-07  Martin Baulig  <martin@gnome.org>
19868
19869         * ecore.cs (IMemberExpr): New public interface.
19870         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
19871         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
19872         if the expression is an IMemberExpr.
19873
19874         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
19875         to be null, implicitly default to `this' if we're non-static in
19876         this case.  Simplified the code a lot by using the new IMemberExpr
19877         interface.  Also fixed bug #28176 here.
19878
19879 2002-08-06  Martin Baulig  <martin@gnome.org>
19880
19881         * cs-parser.jay (SimpleLookup): Removed.  We need to create
19882         ParameterReferences during semantic analysis so that we can do a
19883         type-only search when resolving Cast, TypeOf and SizeOf.
19884         (block): Pass the `current_local_parameters' to the Block's
19885         constructor.
19886
19887         * class.cs (ConstructorInitializer): Added `Parameters parameters'
19888         argument to the constructor.
19889         (ConstructorInitializer.Resolve): Create a temporary implicit
19890         block with the parameters.
19891
19892         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
19893         references here if we aren't doing a type-only search.
19894
19895         * statement.cs (Block): Added constructor which takes a
19896         `Parameters parameters' argument.
19897         (Block.Parameters): New public property.
19898
19899         * support.cs (InternalParameters.Parameters): Renamed `parameters'
19900         to `Parameters' and made it public readonly.
19901
19902 2002-08-06  Martin Baulig  <martin@gnome.org>
19903
19904         * ecore.cs (Expression.Warning): Made this public as well.
19905
19906         * report.cs (Report.Debug): Print the contents of collections.
19907
19908 2002-08-06  Martin Baulig  <martin@gnome.org>
19909
19910         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
19911         used to tell Resolve() which kinds of expressions it may return.
19912         (Expression.Resolve): Added overloaded version of this method which
19913         takes a `ResolveFlags flags' argument.  This can be used to tell
19914         Resolve() which kinds of expressions it may return.  Reports a
19915         CS0118 on error.
19916         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
19917         ResolveFlags.SimpleName.
19918         (Expression.Error118): Added overloaded version of this method which
19919         takes a `ResolveFlags flags' argument.  It uses the flags to determine
19920         which kinds of expressions are allowed.
19921
19922         * expression.cs (Argument.ResolveMethodGroup): New public method.
19923         Resolves an argument, but allows a MethodGroup to be returned.
19924         This is used when invoking a delegate.
19925
19926         * TODO: Updated a bit.
19927
19928 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19929
19930         Fixed compilation with csc.
19931
19932         * ecore.cs: Expression.Error made public. Is this correct? Should
19933         Warning be made public too?
19934
19935         * expression.cs: use ea.Location instead of ea.loc.
19936         [FIXME:  Filed as bug #28607: MCS must report these errors.]
19937
19938 2002-08-06  Martin Baulig  <martin@gnome.org>
19939
19940         * ecore.cs (Expression.loc): Moved the location here instead of
19941         duplicating it in all derived classes.
19942         (Expression.Location): New public property.
19943         (Expression.Error, Expression.Warning): Made them non-static and
19944         removed the location argument.
19945         (Expression.Warning): Added overloaded version which takes an
19946         `int level' argument.
19947         (Expression.Error118): Make this non-static and removed the
19948         expression and location arguments.
19949         (TypeExpr): Added location argument to the constructor.
19950
19951         * expression.cs (StaticCallExpr): Added location argument to
19952         the constructor.
19953         (Indirection, PointerArithmetic): Likewise.
19954         (CheckedExpr, UnCheckedExpr): Likewise.
19955         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
19956         (StringPtr): Likewise.
19957
19958
19959 2002-08-05  Martin Baulig  <martin@gnome.org>
19960
19961         * expression.cs (BaseAccess.DoResolve): Actually report errors.
19962
19963         * assign.cs (Assign.DoResolve): Check whether the source
19964         expression is a value or variable.
19965
19966         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
19967         while resolving the corresponding blocks.
19968
19969         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
19970         an error, don't silently return null.
19971
19972         * statement.cs (Block.AddVariable): Do the error reporting here
19973         and distinguish between CS0128 and CS0136.
19974         (Block.DoResolve): Report all unused labels (warning CS0164).
19975         (LabeledStatement): Pass the location to the constructor.
19976         (LabeledStatement.HasBeenReferenced): New property.
19977         (LabeledStatement.Resolve): Set it to true here.
19978
19979         * statement.cs (Return.Emit): Return success even after reporting
19980         a type mismatch error (CS0126 or CS0127), this is what csc does and
19981         it avoids confusing the users with any consecutive errors.
19982
19983 2002-08-05  Martin Baulig  <martin@gnome.org>
19984
19985         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
19986
19987         * const.cs (Const.LookupConstantValue): Catch circular definitions.
19988
19989         * expression.cs (MemberAccess.DoResolve): Silently return if an
19990         error has already been reported.
19991
19992         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
19993         error has already been reported.
19994
19995 2002-08-05  Martin Baulig  <martin@gnome.org>
19996
19997         * statement.cs (UsageVector): Only initialize the `parameters'
19998         vector if we actually have any "out" parameters.
19999
20000 2002-08-05  Martin Baulig  <martin@gnome.org>
20001
20002         * expression.cs (Binary.ResolveOperator): When combining delegates,
20003         they must have the same type.
20004
20005 2002-08-05  Martin Baulig  <martin@gnome.org>
20006
20007         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
20008         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
20009         work with the ms runtime and we also don't need it: if we're a
20010         PropertyBuilder and not in the `indexer_arguments' hash, then we
20011         are a property and not an indexer.
20012
20013         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
20014         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
20015         since the latter one doesn't work with the ms runtime.
20016
20017 2002-08-03  Martin Baulig  <martin@gnome.org>
20018
20019         Fixed bugs #27998 and #22735.
20020
20021         * class.cs (Method.IsOperator): New public field.
20022         (Method.CheckBase): Report CS0111 if there's already a method
20023         with the same parameters in the current class.  Report CS0508 when
20024         attempting to change the return type of an inherited method.
20025         (MethodData.Emit): Report CS0179 if a method doesn't have a body
20026         and it's not marked abstract or extern.
20027         (PropertyBase): New abstract base class for Property and Indexer.
20028         (PropertyBase.CheckBase): Moved here from Property and made it work
20029         for indexers.
20030         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
20031         the same so we can reuse it there.
20032         (Property, Indexer): Derive from PropertyBase.
20033         (MethodSignature.inheritable_property_signature_filter): New delegate
20034         to find properties and indexers.
20035
20036         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
20037         argument and improved error reporting.
20038
20039         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
20040         EmptyReadOnlyParameters and made it a property.
20041
20042         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
20043         version of this method which takes a `PropertyInfo indexer'.
20044         (TypeManager.RegisterIndexer): New method.
20045
20046         * class.cs: Added myself as author of this file :-)
20047
20048 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20049
20050         * class.cs: fixed compilation on windoze.
20051
20052 2002-08-03  Martin Baulig  <martin@gnome.org>
20053
20054         * interface.cs (Interface.GetInterfaceBases): Check whether all
20055         base interfaces are at least as accessible than the current one.
20056
20057         * class.cs (TypeContainer.GetClassBases): Check whether base types
20058         are at least as accessible than the current type.
20059         (TypeContainer.AsAccessible): Implemented and made non-static.
20060         (MemberBase.CheckParameters): Report errors if the accessibility
20061         checks fail.
20062
20063         * delegate.cs (Delegate.Delegate): The default visibility is
20064         internal for top-level types and private for nested types.
20065         (Delegate.Define): Report errors if the accessibility checks fail.
20066
20067         * enum.cs (Enum.Enum): The default visibility is internal for
20068         top-level types and private for nested types.
20069         (Enum.DefineType): Compute the correct visibility.
20070
20071         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
20072         function which takes a `bool is_toplevel' instead of a TypeContainer.
20073
20074         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
20075         builtin type.
20076
20077 2002-08-02  Martin Baulig  <martin@gnome.org>
20078
20079         * expression.cs (LocalVariableReferenc): Added constructor which
20080         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
20081         (LocalVariableReference.IsReadOnly): New property.
20082         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
20083         variable is readonly, use our own readonly flag to do this; you can
20084         use the new constructor to get a writable reference to a read-only
20085         variable.
20086
20087         * cs-parser.jay (foreach_statement, using_statement): Get a writable
20088         reference to the local variable.
20089
20090 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
20091
20092         * rootcontext.cs (ResolveCore): Also include System.Exception
20093
20094         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
20095         we reach an EmptyStatement.
20096
20097         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
20098         is also fine.
20099
20100         * expression.cs (Binary.ResolveOperator): Check error result in
20101         two places.
20102
20103         use brtrue/brfalse directly and avoid compares to null.
20104
20105 2002-08-02  Martin Baulig  <martin@gnome.org>
20106
20107         * class.cs (TypeContainer.Define): Define all nested interfaces here.
20108         Fixes bug #28407, added test-155.cs.
20109
20110 2002-08-01  Martin Baulig  <martin@gnome.org>
20111
20112         * class.cs (Event.EmitDefaultMethod): Make this work with static
20113         events.  Fixes #28311, added verify-3.cs.
20114
20115 2002-08-01  Martin Baulig  <martin@gnome.org>
20116
20117         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
20118         `is_disposable' fields.
20119         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
20120         `hm.is_disposable' if we're using the collection pattern.
20121         (Foreach.EmitCollectionForeach): Use the correct type for the
20122         enumerator's local variable, only emit the try/finally block if
20123         necessary (fixes #27713).
20124
20125 2002-08-01  Martin Baulig  <martin@gnome.org>
20126
20127         * ecore.cs (Expression.report118): Renamed to Error118 and made
20128         it public static.
20129
20130         * statement.cs (Throw.Resolve): Check whether the expression is of
20131         the correct type (CS0118) and whether the type derives from
20132         System.Exception (CS0155).
20133         (Catch.Resolve): New method.  Do the type lookup here and check
20134         whether it derives from System.Exception (CS0155).
20135         (Catch.CatchType, Catch.IsGeneral): New public properties.
20136
20137         * typemanager.cs (TypeManager.exception_type): Added.
20138
20139 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
20140
20141         * driver.cs: Updated About function.
20142
20143 2002-07-31  Martin Baulig  <martin@gnome.org>
20144
20145         Implemented Control Flow Analysis.
20146
20147         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
20148         (EmitContext.CurrentBranching): Added.
20149         (EmitContext.StartFlowBranching): Added.
20150         (EmitContext.EndFlowBranching): Added.
20151         (EmitContext.KillFlowBranching): Added.
20152         (EmitContext.IsVariableAssigned): Added.
20153         (EmitContext.SetVariableAssigned): Added.
20154         (EmitContext.IsParameterAssigned): Added.
20155         (EmitContext.SetParameterAssigned): Added.
20156         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
20157         Added control flow analysis stuff here.
20158
20159         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
20160         resolve the expression as lvalue.
20161         (LocalVariableReference.DoResolve): Check whether the variable has
20162         already been assigned.
20163         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
20164         the parameter as assigned here.
20165         (ParameterReference.DoResolve): Check whether the parameter has already
20166         been assigned.
20167         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
20168         expression as lvalue.
20169
20170         * statement.cs (FlowBranching): New class for the flow analysis code.
20171         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
20172         (LabeledStatement.IsDefined): New public property.
20173         (LabeledStatement.AddUsageVector): New public method to tell flow
20174         analyis that the label may be reached via a forward jump.
20175         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
20176         flow analysis.
20177         (VariableInfo.Number): New public field.  This is used by flow analysis
20178         to number all locals of a block.
20179         (Block.CountVariables): New public property.  This is the number of
20180         local variables in this block (including the locals from all parent
20181         blocks).
20182         (Block.EmitMeta): Number all the variables.
20183
20184         * statement.cs: Added flow analysis support to all classes.
20185
20186 2002-07-31  Martin Baulig  <martin@gnome.org>
20187
20188         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
20189         To get debugging messages, compile mcs with /define:MCS_DEBUG and
20190         then use this argument.
20191
20192         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
20193
20194         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
20195         use this to specify /define options.
20196
20197 2002-07-29  Martin Baulig  <martin@gnome.org>
20198
20199         * statement.cs (Fixed): Moved all code that does variable lookups
20200         and resolvings from Emit to Resolve.
20201
20202         * statement.cs (For): Moved all code that does variable lookups
20203         and resolvings from Emit to Resolve.
20204
20205         * statement.cs (Using): Moved all code that does variable lookups
20206         and resolvings from Emit to Resolve.
20207
20208 2002-07-29  Martin Baulig  <martin@gnome.org>
20209
20210         * attribute.cs (Attribute.Resolve): Explicitly catch a
20211         System.NullReferenceException when creating the
20212         CustromAttributeBuilder and report a different warning message.
20213
20214 2002-07-29  Martin Baulig  <martin@gnome.org>
20215
20216         * support.cs (ParameterData.ParameterName): Added method to
20217         get the name of a parameter.
20218
20219         * typemanager.cs (TypeManager.IsValueType): New public method.
20220
20221 2002-07-29  Martin Baulig  <martin@gnome.org>
20222
20223         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
20224         is a flag which specifies that it's either ref or out.
20225         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
20226         the out parameter to `out Parameter.Modifier mod', also set the
20227         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
20228
20229         * support.cs (InternalParameters.ParameterModifier): Distinguish
20230         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
20231         Parameter.Modifier.ISBYREF flag if it's either ref or out.
20232
20233         * expression.cs (Argument.GetParameterModifier): Distinguish
20234         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
20235         Parameter.Modifier.ISBYREF flag if it's either ref or out.
20236
20237 2002-07-29  Martin Baulig  <martin@gnome.org>
20238
20239         * expression.cs (ParameterReference.ParameterReference): Added
20240         `Location loc' argument to the constructor.
20241
20242         * cs-parser.jay: Pass location to ParameterReference.
20243
20244 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
20245
20246         * statement.cs (Try): Initialize the location.
20247
20248         * cs-parser.jay: pass location to Try.
20249
20250         * expression.cs (Unary.Reduce): Change the prototype to return
20251         whether a constant fold could be performed or not.  The result is
20252         returned in an out parameters.  In the case of Indirection and
20253         AddressOf, we want to perform the full tests.
20254
20255 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
20256
20257         * statement.cs (Statement.Emit): Flag dead code.
20258
20259 2002-07-27  Andrew Birkett  <andy@nobugs.org>
20260
20261         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
20262
20263 2002-07-27  Martin Baulig  <martin@gnome.org>
20264
20265         * class.cs (MethodData.Define): Put back call to
20266         TypeManager.AddMethod(), accidentally commented this out.
20267
20268         * report.cs (Debug): New public method to print debugging information,
20269         this is `[Conditional ("DEBUG")]'.
20270
20271 2002-07-26  Martin Baulig  <martin@gnome.org>
20272
20273         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
20274         (switch_statement): Push the current_block to the switch_stack and
20275         pop it again when we're done with the switch.
20276         (switch_section): The new block is a child of the current_block.
20277         Fixes bug #24007, added test-152.cs.
20278
20279 2002-07-27  Martin Baulig  <martin@gnome.org>
20280
20281         * expression.cs (Invocation.EmitArguments): When calling a varargs
20282         function with only its fixed arguments, we need to pass an empty
20283         array.
20284
20285 2002-07-27  Martin Baulig  <martin@gnome.org>
20286
20287         Mono 0.13 has been released.
20288
20289 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
20290
20291         * driver.cs: Rename --resource to --linkres, because that is what
20292         we do currently, we dont support --resource yet.
20293
20294         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
20295
20296 2002-07-25  Martin Baulig  <martin@gnome.org>
20297
20298         * class.cs (MethodData): New public class.  This is a `method builder'
20299         class for a method or one accessor of a Property/Indexer/Event.
20300         (MethodData.GetMethodFlags): Moved here from MemberBase.
20301         (MethodData.ApplyAttributes): Likewise.
20302         (MethodData.ApplyObsoleteAttribute): Likewise.
20303         (MethodData.ApplyConditionalAttribute): Likewise.
20304         (MethodData.ApplyDllImportAttribute): Likewise.
20305         (MethodData.CheckAbstractAndExternal): Likewise.
20306         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
20307         (MethodData.Emit): Formerly known as Method.Emit().
20308         (MemberBase): Moved everything which was specific to a single
20309         accessor/method to MethodData.
20310         (Method): Create a new MethodData and call Define() and Emit() on it.
20311         (Property, Indexer, Event): Create a new MethodData objects for each
20312         accessor and call Define() and Emit() on them.
20313
20314 2002-07-25  Martin Baulig  <martin@gnome.org>
20315
20316         Made MethodCore derive from MemberBase to reuse the code from there.
20317         MemberBase now also checks for attributes.
20318
20319         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
20320         (MemberBase.GetMethodFlags): Moved here from class Method and marked
20321         as virtual.
20322         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
20323         `CallingConventions cc' and `Attributes opt_attrs' arguments.
20324         (MemberBase.ApplyAttributes): New virtual method; applies the
20325         attributes to a method or accessor.
20326         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
20327         (MemberBase.ApplyConditionalAttribute): Likewise.
20328         (MemberBase.ApplyDllImportAttribute): Likewise.
20329         (MemberBase.CheckAbstractAndExternal): Likewise.
20330         (MethodCore.ParameterTypes): This is now a property instead of a
20331         method, it's initialized from DoDefineParameters().
20332         (MethodCore.ParameterInfo): Removed the set accessor.
20333         (MethodCore.DoDefineParameters): New protected virtual method to
20334         initialize ParameterTypes and ParameterInfo.
20335         (Method.GetReturnType): We can now simply return the MemberType.
20336         (Method.GetMethodFlags): Override the MemberBase version and add
20337         the conditional flags.
20338         (Method.CheckBase): Moved some code from Define() here, call
20339         DoDefineParameters() here.
20340         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
20341         here to avoid some larger code duplication.
20342         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
20343         ensure that abstract and external accessors don't declare a body.
20344
20345         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
20346         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
20347         lookup in the attribute's parent classes, so we need to abort as soon
20348         as we found the first match.
20349         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
20350         the attribute has no arguments.
20351
20352         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
20353         of a Method.
20354
20355 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20356
20357         * cs-parser.jay: reverted previous patch.
20358
20359 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20360
20361         * cs-parser.jay: fixed bug #22119.
20362
20363 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20364
20365         * attribute.cs: fixed compilation. The error was:
20366         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
20367         be assigned to before control leaves the current method."
20368         [FIXME:  Filed as bug #28186: MCS must report this error.]
20369
20370 2002-07-25  Martin Baulig  <martin@gnome.org>
20371
20372         * attribute.cs (Attribute.Conditional_GetConditionName): New static
20373         method to pull the condition name ouf of a Conditional attribute.
20374         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
20375         the obsolete message and error flag out of an Obsolete attribute.
20376
20377         * class.cs (Method.GetMethodFlags): New public method to get the
20378         TypeManager.MethodFlags for this method.
20379         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
20380         private methods.
20381         (Method.Define): Get and apply the Obsolete and Conditional attributes;
20382         if we're overriding a virtual function, set the new private variable
20383         `parent_method'; call the new TypeManager.AddMethod().
20384
20385         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
20386         the MethodBuilder and the Method in a PtrHashtable.
20387         (TypeManager.builder_to_method): Added for this purpose.
20388         (TypeManager.MethodFlags): Added IsObsoleteError.
20389         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
20390         Obsolete and Conditional arguments in MethodBuilders.  If we discover
20391         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
20392         the message from the attribute.
20393
20394 2002-07-24  Martin Baulig  <martin@gnome.org>
20395
20396         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
20397         preprocessor directives, ensure that the argument to #define/#undef is
20398         exactly one identifier and that it's actually an identifier.
20399
20400         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
20401         did not work ....
20402
20403 2002-07-24  Martin Baulig  <martin@gnome.org>
20404
20405         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
20406         initialize it to TypeManager.object_type in the constructor.
20407         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
20408         of the `hm.get_current' method if we're using the collection pattern.
20409         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
20410         for the explicit conversion to make it work when we're using the collection
20411         pattern and the `Current' property has a different return type than `object'.
20412         Fixes #27713.
20413
20414 2002-07-24  Martin Baulig  <martin@gnome.org>
20415
20416         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
20417         does not match, but don't report any errors.  This method is called in
20418         order for all methods in a MethodGroupExpr until a matching method is
20419         found, so we don't want to bail out if the first method doesn't match.
20420         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
20421         matches, report the 123.  Fixes #28070.
20422
20423 2002-07-24  Martin Baulig  <martin@gnome.org>
20424
20425         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
20426         TypeManager.TypeToCoreType() to the top of the method so the
20427         following equality checks will work.  Fixes #28107.
20428
20429 2002-07-24  Martin Baulig  <martin@gnome.org>
20430
20431         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
20432         operand is of type uint, and the other operand is of type sbyte,
20433         short or int, the operands are converted to type long." -
20434         Actually do what this comment already told us.  Fixes bug #28106,
20435         added test-150.cs.
20436
20437 2002-07-24  Martin Baulig  <martin@gnome.org>
20438
20439         * class.cs (MethodBase): New abstract class.  This is now a base
20440         class for Property, Indexer and Event to avoid some code duplication
20441         in their Define() and DefineMethods() methods.
20442         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
20443         generic methods for Define() and DefineMethods().
20444         (FieldBase): Derive from MemberBase, not MemberCore.
20445         (Property): Derive from MemberBase, not MemberCore.
20446         (Property.DefineMethod): Moved all the code from this method to the
20447         new MethodBase.DefineAccessor(), just call it with appropriate
20448         argumetnts.
20449         (Property.Define): Call the new Property.DoDefine(), this does some
20450         sanity checks and we don't need to duplicate the code everywhere.
20451         (Event): Derive from MemberBase, not MemberCore.
20452         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
20453         accessors, this will also make them work with interface events.
20454         (Indexer): Derive from MemberBase, not MemberCore.
20455         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
20456         (Indexer.Define): Use the new MethodBase functions.
20457
20458         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
20459         argument to the constructor.
20460         (Interface.FindMembers): Added support for interface events.
20461         (Interface.PopluateEvent): Implemented.
20462
20463         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
20464
20465 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
20466
20467         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
20468         but this is required to check for a method name being the same as
20469         the containing class.  
20470
20471         Handle this now.
20472
20473 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20474
20475         * interface.cs: initialize variable.
20476
20477 2002-07-23  Martin Baulig  <martin@gnome.org>
20478
20479         Implemented the IndexerName attribute in interfaces.
20480
20481         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
20482         name if this is an explicit interface implementation.
20483         (Indexer.InterfaceIndexerName): New public variable.  If we're
20484         implementing an interface indexer, this is the IndexerName in that
20485         interface.  Otherwise, it's the IndexerName.
20486         (Indexer.DefineMethod): If we're implementing interface indexer,
20487         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
20488         and Pending.ImplementIndexer methods.
20489         (Indexer.Define): Also define the PropertyBuilder if we're
20490         implementing an interface indexer and this is neither an explicit
20491         interface implementation nor do the IndexerName match the one in
20492         the interface.
20493
20494         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
20495         If a method is defined here, then we always need to create a proxy
20496         for it.  This is used when implementing interface indexers.
20497         (Pending.IsInterfaceIndexer): New public method.
20498         (Pending.ImplementIndexer): New public method.
20499         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
20500         This is used when implementing interface indexers to define a proxy
20501         if necessary.
20502         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
20503         define a proxy if necessary.
20504
20505         * interface.cs (Interface.IndexerName): New public variable.
20506         (Interface.PopulateIndexer): Set the IndexerName.
20507         (Interface.DefineIndexers): New private method.  Populate all the
20508         indexers and make sure their IndexerNames match.
20509
20510         * typemanager.cs (IndexerPropertyName): Added support for interface
20511         indexers.
20512
20513 2002-07-22  Martin Baulig  <martin@gnome.org>
20514
20515         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
20516         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
20517         ret if HasReturnLabel.
20518         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
20519         variables.
20520
20521         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
20522         and set the ec.LoopBeginTryCatchLevel.
20523         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
20524         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
20525         the current ec.TryCatchLevel, the branch goes out of an exception
20526         block.  In this case, we need to use Leave and not Br.
20527
20528 2002-07-22  Martin Baulig  <martin@gnome.org>
20529
20530         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
20531         block unless the block does not always return or it is contained in
20532         another try { ... } catch { ... } block.  Fixes bug #26506.
20533         Added verify-1.cs to the test suite.
20534
20535 2002-07-22  Martin Baulig  <martin@gnome.org>
20536
20537         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
20538         then we do not always return.  Fixes bug #24985.
20539
20540 2002-07-22  Martin Baulig  <martin@gnome.org>
20541
20542         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
20543         lookup on a per-class level; ie. walk up the class hierarchy until we
20544         found at least one applicable method, then choose the best among them.
20545         Fixes bug #24463 and test-29.cs.
20546
20547 2002-07-22  Martin Baulig  <martin@gnome.org>
20548
20549         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
20550         return types of the methods.  The return type is not part of the
20551         signature and we must not check it to make the `new' modifier work.
20552         Fixes bug #27999, also added test-147.cs.
20553         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
20554
20555         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
20556         on the method's return type.
20557
20558 2002-07-21  Martin Baulig  <martin@gnome.org>
20559
20560         * assign.cs: Make this work if the rightmost source is a constant and
20561         we need to do an implicit type conversion.  Also adding a few more tests
20562         to test-38.cs which should have caught this.
20563
20564         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
20565         target in the makefile for this.  The makefile.gnu is primarily intended
20566         for end-users who don't want to debug the compiler.
20567
20568 2002-07-21  Martin Baulig  <martin@gnome.org>
20569
20570         * assign.cs: Improved the Assign class so it can now handle embedded
20571         assignments (X = Y = Z = something).  As a side-effect this'll now also
20572         consume less local variables.  test-38.cs now passes with MCS, added
20573         a few new test cases to that test.
20574
20575 2002-07-20  Martin Baulig  <martin@gnome.org>
20576
20577         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
20578         instructions.  Fixes bug #27977, also added test-146.cs.
20579
20580 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20581
20582         * cs-tokenizer.cs: fixed getHex ().
20583
20584 2002-07-19  Martin Baulig  <martin@gnome.org>
20585
20586         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
20587         not Type.GetType() to lookup the array type.  This is needed when
20588         we're constructing an array of a user-defined type.
20589         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
20590         single-dimensional arrays, but also for single-dimensial arrays of
20591         type decimal.
20592
20593 2002-07-19  Martin Baulig  <martin@gnome.org>
20594
20595         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
20596         this function is called, it's not allowed to share LocalBuilders
20597         among ILGenerators.
20598
20599 2002-07-19  Martin Baulig  <martin@gnome.org>
20600
20601         * expression.cs (Argument.Resolve): Report an error 118 when trying
20602         to pass a type as argument.
20603
20604 2002-07-18  Martin Baulig  <martin@gnome.org>
20605
20606         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
20607         Conv_R_Un for the signed `long' type.
20608
20609 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
20610
20611         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
20612         `expr' for the temporary result, as that will fail if we do
20613         multiple resolves on the same expression.
20614
20615 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
20616
20617         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
20618         ec.TypeContainer for looking up aliases. 
20619
20620         * class.cs (TypeContainer): Remove LookupAlias from here.
20621
20622         * decl.cs (DeclSpace); Move here.
20623
20624 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
20625
20626         * class.cs (FindMembers): Only call filter if the constructor
20627         bulider is not null.
20628
20629         Also handle delegates in `NestedTypes' now.  Now we will perform
20630         type lookups using the standard resolution process.  This also
20631         fixes a bug.
20632
20633         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
20634         This uses Expressions (the limited kind that can be parsed by the
20635         tree) instead of strings.
20636
20637         * expression.cs (ComposedCast.ToString): Implement, used to flag
20638         errors since now we have to render expressions.
20639
20640         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
20641         FormArrayType. 
20642
20643         * ecore.cs (SimpleName.ToString): ditto.
20644
20645         * cs-parser.jay: Instead of using strings to assemble types, use
20646         Expressions to assemble the type (using SimpleName, ComposedCast,
20647         MemberAccess).  This should fix the type lookups in declarations,
20648         because we were using a different code path for this.
20649
20650         * statement.cs (Block.Resolve): Continue processing statements
20651         even when there is an error.
20652
20653 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
20654
20655         * class.cs (Event.Define): Also remove the `remove' method from
20656         the list of pending items.
20657
20658         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
20659         generate more compact code. 
20660
20661 2002-07-17  Martin Baulig  <martin@gnome.org>
20662
20663         * const.cs (Const.LookupConstantValue): Add support for constant
20664         `unchecked' and `checked' expressions.
20665         Also adding test case test-140.cs for this.
20666
20667 2002-07-17  Martin Baulig  <martin@gnome.org>
20668
20669         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
20670         check whether mi.ReturnType implements the IEnumerator interface; the
20671         `==' and the IsAssignableFrom() will fail in this situation.
20672
20673 2002-07-16  Ravi Pratap  <ravi@ximian.com>
20674
20675         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
20676         here too.
20677
20678 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20679
20680         * expression.cs: fixed bug #27811.
20681
20682 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
20683
20684         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
20685         Molaro: when we are a ref, the value already contains a pointer
20686         value, do not take the address of it.
20687
20688 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
20689         * removed mb-parser.jay and mb-tokenizer.cs
20690
20691 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20692
20693         * expression.cs: check against the building corlib void type.
20694
20695 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
20696
20697         * ecore.cs: fix for valuetype static readonly fields: when 
20698         initializing them, we need their address, not the address of a copy.
20699
20700 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
20701
20702         * typemanager.cs: register also enum_type in corlib.
20703
20704 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20705
20706         * class.cs: allow calling this (but not base) initializers in structs.
20707
20708 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
20709
20710         * ecore.cs: make sure we compare against the building base types
20711         in GetTypeSize ().
20712
20713 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
20714
20715         * typemanager.cs: fix TypeToCoreType() to handle void and object
20716         (corlib gets no more typerefs after this change).
20717
20718 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
20719
20720         * expression.cs (ArrayCreation.EmitArrayArguments): use
20721         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
20722
20723         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
20724         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
20725         array indexes, the runtime actually forbids them.
20726
20727         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
20728         for array arguments here.
20729
20730         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
20731         instead of the default for ValueTypes.
20732
20733         (New.DoEmit): Use IsValueType instead of
20734         IsSubclassOf (value_type)
20735         (New.DoResolve): ditto.
20736         (Invocation.EmitCall): ditto.
20737
20738         * assign.cs (Assign): ditto.
20739
20740         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
20741         Statements *are* currently doing part of their resolution during
20742         Emit.  
20743
20744         Expressions do always resolve during resolve, but statements are
20745         only required to propagate resolution to their children.
20746
20747 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
20748
20749         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
20750
20751         (LoadAssembly): Do not add the dll if it is already specified
20752
20753         (MainDriver): Add the System directory to the link path at the end,
20754         after all the other -L arguments. 
20755
20756         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
20757         wrong opcode for loading bytes and bools (ldelem.i1 instead of
20758         ldelem.u1) and using the opposite for sbytes.
20759
20760         This fixes Digger, and we can finally run it.
20761
20762         * driver.cs (UnixParseOption): Move the option parsing here.  
20763         (CSCParseOption): Implement CSC-like parsing of options.
20764
20765         We now support both modes of operation, the old Unix way, and the
20766         new CSC-like way.  This should help those who wanted to make cross
20767         platform makefiles.
20768
20769         The only thing broken is that /r:, /reference: and /lib: are not
20770         implemented, because I want to make those have the same semantics
20771         as the CSC compiler has, and kill once and for all the confussion
20772         around this.   Will be doing this tomorrow.
20773
20774         * statement.cs (Unsafe.Resolve): The state is checked during
20775         resolve, not emit, so we have to set the flags for IsUnsfe here.
20776
20777 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
20778
20779         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
20780         not catch the Error_ObjectRefRequired in SimpleName (as it is
20781         possible to have a class/instance variable name that later gets
20782         deambiguated), we have to check this here.      
20783
20784 2002-07-10  Ravi Pratap  <ravi@ximian.com>
20785
20786         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
20787         make static and put into Expression.
20788
20789         (Event.Define): Register the private field of the event with the 
20790         TypeManager so that GetFieldFromEvent can get at it.
20791
20792         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
20793         keep track of the private field associated with an event which
20794         has no accessors.
20795
20796         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
20797         private field.
20798
20799         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
20800
20801 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
20802
20803         * expression.cs (Binary.EmitBranchable): this routine emits the
20804         Binary expression in a branchable context.  This basically means:
20805         we need to branch somewhere, not just get the value on the stack.
20806
20807         This works together with Statement.EmitBoolExpression.
20808
20809         * statement.cs (Statement.EmitBoolExpression): Use
20810         EmitBranchable. 
20811
20812 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
20813
20814         * statement.cs (For): Reduce the number of jumps in loops.
20815
20816         (For): Implement loop inversion for the For statement.
20817
20818         (Break): We can be breaking out of a Try/Catch controlled section
20819         (foreach might have an implicit try/catch clause), so we need to
20820         use Leave instead of Br.
20821
20822         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
20823         now).  If the instace expression supports IMemoryLocation, we use
20824         the AddressOf method from the IMemoryLocation to extract the
20825         address instead of emitting the instance.
20826
20827         This showed up with `This', as we were emitting the instance
20828         always (Emit) instead of the Address of This.  Particularly
20829         interesting when This is a value type, as we dont want the Emit
20830         effect (which was to load the object).
20831
20832 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
20833
20834         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
20835
20836         * statement.cs (Checked): Set the CheckedState during the resolve
20837         process too, as the ConvCast operations track the checked state on
20838         the resolve process, and not emit.
20839
20840         * cs-parser.jay (namespace_member_declaration): Flag that we have
20841         found a declaration when we do.  This is used to flag error 1529
20842
20843         * driver.cs: Report ok when we display the help only.
20844
20845 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
20846
20847         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
20848
20849 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
20850
20851         * cs-tokenizer.cs (define): We also have to track locally the
20852         defines.  AllDefines is just used for the Conditional Attribute,
20853         but we also need the local defines for the current source code. 
20854
20855 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
20856
20857         * statement.cs (While, For, Do): These loops can exit through a
20858         Break statement, use this information to tell whether the
20859         statement is the last piece of code.
20860
20861         (Break): Flag that we break.
20862
20863         * codegen.cs (EmitContexts): New `Breaks' state variable.
20864
20865 2002-07-03  Martin Baulig  <martin@gnome.org>
20866
20867         * class.cs (TypeContainer.MethodModifiersValid): Allow override
20868         modifiers in method declarations in structs.  Otherwise, you won't
20869         be able to override things like Object.Equals().
20870
20871 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
20872
20873         * class.cs (Method, Property, Indexer): Do not allow the public
20874         modifier to be used in explicit interface implementations.
20875
20876         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
20877         override modifiers in method declarations in structs
20878
20879 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
20880
20881         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
20882         integer or real overflow, report an error
20883
20884 2002-07-02  Martin Baulig  <martin@gnome.org>
20885
20886         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
20887         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
20888         to tell the runtime about our newly created System.Object and
20889         System.ValueType types.
20890
20891 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
20892
20893         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
20894         struct instead of Ldarg/Starg.
20895
20896 2002-07-02  Martin Baulig  <martin@gnome.org>
20897
20898         * expression.cs (Indirection.Indirection): Call
20899         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
20900
20901 2002-07-02  Martin Baulig  <martin@gnome.org>
20902
20903         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
20904         ValueType, call TypeManager.TypeToCoreType() on it.
20905         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
20906         the OpCodes.Newarr argument.
20907
20908 2002-07-02  Martin Baulig  <martin@gnome.org>
20909
20910         * expression.cs (Invocation.EmitCall): When compiling corlib,
20911         replace all calls to the system's System.Array type to calls to
20912         the newly created one.
20913
20914         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
20915         System.Array methods.
20916         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
20917         from the system's System.Array type which must be replaced.
20918
20919 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
20920
20921         * typemanager.cs: load unverifiable_code_ctor so we can build
20922         corlib using the correct type. Avoid using GetTypeCode() with
20923         TypeBuilders.
20924         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
20925         TypeManager.object_type to allow building corlib.
20926
20927 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
20928
20929         * ecore.cs: handle System.Enum separately in LoadFromPtr().
20930
20931 2002-07-01  Martin Baulig  <martin@gnome.org>
20932
20933         * class.cs: Make the last change actually work, we need to check
20934         whether `ifaces != null' to avoid a crash.
20935
20936 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20937
20938         * class.cs: when we build structs without fields that implement
20939         interfaces, we need to add the interfaces separately, since there is
20940         no API to both set the size and add the interfaces at type creation
20941         time.
20942
20943 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20944
20945         * expression.cs: the dimension arguments to the array constructors
20946         need to be converted if they are a long.
20947
20948 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
20949
20950         * class.cs: don't emit ldarg.0 if there is no parent constructor
20951         (fixes showstopper for corlib).
20952
20953 2002-06-29  Martin Baulig  <martin@gnome.org>
20954
20955         MCS now compiles corlib on GNU/Linux :-)
20956
20957         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
20958         ie. check for MethodImplOptions.InternalCall.
20959
20960         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
20961         and TypeManager.attribute_type are null, so we must explicitly check
20962         whether parent is not null to find out whether it's an attribute type.
20963         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
20964         and SetBuilder, not only if the property is neither abstract nor external.
20965         This is necessary to set the MethodImplOptions on the accessor methods.
20966         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
20967         SetBuilder, see Property.Emit().
20968
20969         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
20970         populate "System.Object", "System.ValueType" and "System.Attribute" since
20971         they've already been populated from BootCorlib_PopulateCoreTypes().
20972
20973 2002-06-29  Martin Baulig  <martin@gnome.org>
20974
20975         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
20976         is the NullLiteral, we also need to make sure that target_type is not
20977         an enum type.   
20978
20979 2002-06-29  Martin Baulig  <martin@gnome.org>
20980
20981         * rootcontext.cs (RootContext.ResolveCore): We must initialize
20982         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
20983         before calling BootstrapCorlib_ResolveDelegate ().
20984
20985 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20986
20987         * statement.cs: fixed build-breaker. All tests passed ok.
20988
20989 2002-06-27  Martin Baulig  <martin@gnome.org>
20990
20991         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
20992         for System.Decimal when compiling corlib.
20993
20994 2002-06-27  Martin Baulig  <martin@gnome.org>
20995
20996         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
20997         switch blocks which contain nothing but a default clause.
20998
20999 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
21000
21001        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
21002
21003 2002-06-27  Martin Baulig  <martin@gnome.org>
21004
21005         * ecore.cs (PropertyExpr.PropertyExpr): Call
21006         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
21007
21008         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
21009         is already a TypeBuilder.
21010
21011 2002-06-27  Martin Baulig  <martin@gnome.org>
21012
21013         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
21014         `target_type == TypeManager.array_type', not IsAssignableFrom() in
21015         the "from an array-type to System.Array" case.  This makes it work
21016         when compiling corlib.
21017
21018 2002-06-27  Martin Baulig  <martin@gnome.org>
21019
21020         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
21021         non-static PropertyExpr, set its InstanceExpression.  This makes
21022         the `ICollection.Count' property work in System/Array.cs.
21023
21024 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
21025
21026         * driver.cs: Made error handling more consistent.  Errors now
21027         tracked by Report class, so many methods which used to return int
21028         now return void.  Main() now prints success/failure and 
21029         errors/warnings message.
21030
21031         Renamed '--probe' compiler argument to '--expect-error'.  Removed
21032         the magic number return values (123 and 124).  Now, if the
21033         expected error occurs, the compiler exits with success (exit value
21034         0).  If the compilation completes without seeing that particular
21035         error, the compiler exits with failure (exit value 1).  The
21036         makefile in mcs/errors has been changed to handle the new behaviour.
21037
21038         * report.cs: Made 'expected error' number a property and renamed
21039         it from 'Probe' to 'ExpectedError'.
21040
21041         * genericparser.cs: Removed error handling support, since it is
21042         now all done by Report class.
21043
21044         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
21045         class, so parse() no longer returns an int.
21046
21047         * namespace.cs: Use Report.Error instead of GenericParser.error
21048
21049 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
21050
21051         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
21052         TypeContainer.AddOperator): At the front of the list put the
21053         explicit implementations, so they get resolved/defined first. 
21054
21055 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
21056
21057         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
21058         interface type is implemented by this TypeContainer.  Used during
21059         explicit interface implementation.
21060
21061         (Property.Define, Indexer.Define, Method.Define): Validate that
21062         the given interface in the explicit implementation is one of the
21063         base classes for the containing type.
21064
21065         Also if we are explicitly implementing an interface, but there is
21066         no match in the pending implementation table, report an error.
21067
21068         (Property.Define): Only define the property if we are
21069         not explicitly implementing a property from an interface.  Use the
21070         correct name also for those properties (the same CSC uses,
21071         although that is really not needed).
21072
21073         (Property.Emit): Do not emit attributes for explicitly implemented
21074         properties, as there is no TypeBuilder.
21075
21076         (Indexer.Emit): ditto.
21077
21078         Hiding then means that we do not really *implement* a pending
21079         implementation, which makes code fail.
21080
21081 2002-06-22  Martin Baulig  <martin@gnome.org>
21082
21083         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
21084         the return value of Object.GetType().  [FIXME: we need to do this whenever
21085         we get a type back from the reflection library].
21086
21087 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
21088
21089         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
21090
21091 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
21092
21093         * attribute.cs: Return null if we can not look up the type.
21094
21095         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
21096         the interface types found.
21097
21098         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
21099         interface types found.
21100
21101         * typemanager.cs (GetInterfaces): Make this routine returns alll
21102         the interfaces and work around the lame differences between
21103         System.Type and System.Reflection.Emit.TypeBuilder in the results
21104         result for GetInterfaces.
21105
21106         (ExpandInterfaces): Given an array of interface types, expand and
21107         eliminate repeated ocurrences of an interface.  This expands in
21108         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
21109         be IA, IB, IC.
21110
21111 2002-06-21  Martin Baulig  <martin@gnome.org>
21112
21113         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
21114         on System.Enum.
21115
21116 2002-06-21  Martin Baulig  <martin@gnome.org>
21117
21118         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
21119         and called with one of the core types, return the corresponding typebuilder for
21120         that type.
21121
21122         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
21123         element type.
21124
21125 2002-06-21  Martin Baulig  <martin@gnome.org>
21126
21127         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
21128         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
21129         (Expression.ConvertReferenceExplicit): Likewise.
21130
21131         * expression.cs (ElementAccess.DoResolve): Likewise.
21132         (ElementAccess.DoResolveLValue): Likewise.
21133
21134 2002-06-10  Martin Baulig  <martin@gnome.org>
21135
21136         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
21137         add the "value" parameter to the parameter list.
21138
21139         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
21140         to our caller.
21141
21142 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
21143
21144         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
21145         the argument to an int, uint, long or ulong, per the spec.  Also
21146         catch negative constants in array creation.
21147
21148 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
21149
21150         * class.cs: do not allow the same interface to appear twice in
21151         the definition list.
21152
21153 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
21154
21155         * ecore.cs: don't use ldlen with System.Array.
21156
21157 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
21158
21159         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
21160
21161 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
21162
21163         * modifiers.cs: produce correct field attributes for protected
21164         internal. Easy fix so miguel can work on ther harder stuff:-)
21165
21166 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
21167
21168         * pending.cs: New file.  Move the code from class.cs here.
21169         Support clearning the pending flag for all methods (when not doing
21170         explicit interface implementation).
21171
21172 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
21173
21174         * rootcontext.cs: added a couple more types needed to bootstrap.
21175
21176 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
21177
21178         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
21179         constructor in the type, instead of any constructor in the type
21180         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
21181         a bug in the Mono runtime when applying the params attribute). 
21182
21183 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
21184         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
21185
21186 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
21187
21188         * expression.cs (Unary.ResolveOperator): Use TypeManager
21189         to resolve the type.
21190
21191 2002-06-13  Ravi Pratap  <ravi@ximian.com>
21192
21193         * cs-parser.jay (enum_member_declaration): Pass in the attributes
21194         attached.
21195
21196         * enum.cs (AddEnumMember): Add support to store the attributes associated 
21197         with each member too.
21198
21199         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
21200         field builders too - this takes care of the enum member case.
21201
21202 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
21203
21204         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
21205         address-of operator on both value types and pointers.
21206
21207 2002-06-10  Martin Baulig  <martin@gnome.org>
21208
21209         * interface.cs (Interface.PopulateIndexer): Add the indexer's
21210         PropertyBuilder to the `property_builders' list.
21211
21212         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
21213         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
21214         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
21215         find any indexers which are inherited from an interface.
21216
21217 2002-06-09  Martin Baulig  <martin@gnome.org>
21218
21219         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
21220         the same type as the constant if necessary.  There's also a test-130.cs
21221         for this.
21222
21223         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
21224
21225         * typemanager.cs (TypeManager.ChangeType): Previously known as
21226         Enum.ChangeEnumType().
21227
21228 2002-06-09  Martin Baulig  <martin@gnome.org>
21229
21230         * expression.cs (Cast.TryReduce): Added support for consts.
21231
21232 2002-06-08  Ravi Pratap  <ravi@ximian.com>
21233
21234         * class.cs (Accessor): Hold attributes information so we can pass
21235         it along.
21236
21237         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
21238         Modify to pass in attributes attached to the methods.
21239
21240         (add_accessor_declaration, remove_accessor_declaration): Ditto.
21241
21242         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
21243         to handle the Accessor kind :-)
21244
21245         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
21246
21247 2002-06-08  Martin Baulig  <martin@gnome.org>
21248
21249         * expression.cs (Unary.TryReduceNegative): Added support for
21250         ULongConstants.
21251
21252 2002-06-08  Martin Baulig  <martin@gnome.org>
21253
21254         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
21255         name can't be found in the `defined_names' - the caller will do a
21256         MemberLookup in this case and thus find methods in System.Enum
21257         such as Enum.IsDefined().
21258
21259 2002-06-08  Martin Baulig  <martin@gnome.org>
21260
21261         * enum.cs (Enum.ChangeEnumType): This is a custom version of
21262         Convert.ChangeType() which works with TypeBuilder created types.
21263         (Enum.LookupEnumValue, Enum.Define): Use it here.
21264
21265         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
21266         `TypeBuilder.BaseType != null' check.
21267         (TypeContainer.FindMembers): Only lookup parent members if we
21268         actually have a parent.
21269         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
21270         (ConstructorInitializer.Resolve): Likewise.
21271
21272         * interface.cs (Interface.FindMembers): Added
21273         `TypeBuilder.BaseType != null' check.
21274
21275         * rootcontext.cs (RootContext.ResolveCore): Added
21276         "System.Runtime.CompilerServices.IndexerNameAttribute" to
21277         classes_second_stage.
21278
21279         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
21280         debug_type and trace_type when compiling with --nostdlib.       
21281
21282 2002-06-07  Martin Baulig  <martin@gnome.org>
21283
21284         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
21285         (AddField): Set it to true when adding a non-static field.
21286         (DefineType): Use `have_nonstatic_fields' to find out whether we
21287         have non-static fields, not `Fields != null'.
21288
21289 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
21290
21291         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
21292         dereferencing a null on the static-field code path)
21293
21294 2002-05-30  Martin Baulig  <martin@gnome.org>
21295
21296         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
21297         to take command line arguments.  Use reflection to call the new
21298         custom `Initialize' function on the symbol writer and pass it the
21299         command line arguments.
21300
21301         * driver.cs (--debug-args): New command line argument to pass command
21302         line arguments to the symbol writer.
21303
21304 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
21305
21306         * assign.cs (DoResolve): Forgot to do the implicit conversion to
21307         the target type for indexers and properties.  Thanks to Joe for
21308         catching this.
21309
21310 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
21311
21312         * typemanager.cs (MethodFlags): returns the method flags
21313         (Obsolete/ShouldIgnore) that control warning emission and whether
21314         the invocation should be made, or ignored. 
21315
21316         * expression.cs (Invocation.Emit): Remove previous hack, we should
21317         not do this on matching a base type, we should do this based on an attribute
21318
21319         Only emit calls to System.Diagnostics.Debug and
21320         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
21321         on the command line.
21322
21323         * rootcontext.cs: Global settings for tracing and debugging.
21324
21325         * cs-tokenizer.cs (define): New utility function to track
21326         defines.   Set the global settings for TRACE and DEBUG if found.
21327
21328 2002-05-25  Ravi Pratap  <ravi@ximian.com>
21329
21330         * interface.cs (Populate*): Pass in the TypeContainer as well as
21331         the DeclSpace as parameters so that we can create EmitContexts and
21332         then use that to apply attributes etc.
21333
21334         (PopulateMethod, PopulateEvent, PopulateProperty)
21335         (PopulateIndexer): Apply attributes everywhere.
21336
21337         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
21338         etc.
21339
21340         (ApplyAttributes): Update accordingly.
21341
21342         We now apply interface attributes for all members too.
21343
21344 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
21345
21346         * class.cs (Indexer.Define); Correctly check if we are explicit
21347         implementation (instead of checking the Name for a ".", we
21348         directly look up if the InterfaceType was specified).
21349
21350         Delay the creation of the PropertyBuilder.
21351
21352         Only create the PropertyBuilder if we are not an explicit
21353         interface implementation.   This means that explicit interface
21354         implementation members do not participate in regular function
21355         lookups, and hence fixes another major ambiguity problem in
21356         overload resolution (that was the visible effect).
21357
21358         (DefineMethod): Return whether we are doing an interface
21359         implementation. 
21360
21361         * typemanager.cs: Temporary hack until we get attributes in
21362         interfaces (Ravi is working on that) and we get IndexerName
21363         support in interfaces.
21364
21365         * interface.cs: Register the indexers as properties.
21366
21367         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
21368         warning, I have verified that this is a bug in the .NET runtime
21369         (JavaScript suffers of the same problem).
21370
21371         * typemanager.cs (MemberLookup): When looking up members for
21372         interfaces, the parent of an interface is the implicit
21373         System.Object (so we succeed in searches of Object methods in an
21374         interface method invocation.  Example:  IEnumerable x;  x.ToString
21375         ()) 
21376
21377 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
21378
21379         * class.cs (Event): Events should also register if they do
21380         implement the methods that an interface requires.
21381
21382         * typemanager.cs (MemberLookup); use the new GetInterfaces
21383         method. 
21384
21385         (GetInterfaces): The code used to lookup interfaces for a type is
21386         used in more than one place, factor it here. 
21387
21388         * driver.cs: Track the errors at the bottom of the file, we kept
21389         on going.
21390
21391         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
21392         instance if the method we are calling is static!
21393
21394 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
21395
21396         * attribute.cs (ApplyAttributes): Make this function filter out
21397         the IndexerName attribute (as that attribute in reality is never
21398         applied) and return the string constant for the IndexerName
21399         attribute. 
21400
21401         * class.cs (TypeContainer.Emit): Validate that all the indexers
21402         have the same IndexerName attribute, and if so, set the
21403         DefaultName attribute on the class. 
21404
21405         * typemanager.cs: The return value might contain other stuff (not
21406         only methods).  For instance, consider a method with an "Item"
21407         property and an Item method.
21408
21409         * class.cs: If there is a problem with the parameter types,
21410         return. 
21411
21412 2002-05-24  Ravi Pratap  <ravi@ximian.com>
21413
21414         * ecore.cs (ImplicitConversionExists): Wrapper function which also
21415         looks at user defined conversion after making a call to 
21416         StandardConversionExists - we need this for overload resolution.
21417
21418         * expression.cs : Update accordingly the various method calls.
21419
21420         This fixes 2 bugs filed against implicit user defined conversions 
21421
21422 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
21423
21424         * statement.cs: Track the result of the assignment.
21425
21426 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
21427
21428         * expression.cs (MemberAccess): Improved error reporting for
21429         inaccessible members.
21430
21431 2002-05-22  Martin Baulig  <martin@gnome.org>
21432
21433         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
21434         itself with debugging support.
21435
21436 2002-05-22  Martin Baulig  <martin@gnome.org>
21437
21438         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
21439         Removed, this isn't needed anymore.
21440
21441 2002-05-20  Martin Baulig  <martin@gnome.org>
21442
21443         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
21444         be underlying type for an enum.
21445
21446 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
21447
21448         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
21449         that splits out the loading of just the core types.
21450
21451         * rootcontext.cs (ResolveCore): Split the struct resolution in
21452         two, so we can load the enumeration underlying types before any
21453         enums are used.
21454
21455         * expression.cs (Is): Bandaid until we fix properly Switch (see
21456         bug #24985 for details).
21457
21458         * typemanager.cs (ImplementsInterface): The hashtable will contain
21459         a null if there are no interfaces implemented.
21460
21461 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
21462
21463         * cs-parser.jay (indexer_declarator): It is fine to have array
21464         parameters
21465
21466 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
21467
21468         * typemanager.cs: (RegisterBuilder): New function used to register
21469         TypeBuilders that implement interfaces.  Since
21470         TypeBuilder.GetInterfaces (as usual) does not work with lame
21471         Reflection.Emit. 
21472         (AddUserType): register interfaces.
21473
21474         (ImplementsInterface): Use the builder_to_ifaces hash if we are
21475         dealing with TypeBuilder.  Also, arrays are showing up as
21476         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
21477         methods can not be invoked on them!
21478
21479         * ecore.cs (ExplicitReferenceConversionExists): Made public.
21480         (ImplicitReferenceConversionExists): Split out from
21481         StandardConversionExists. 
21482
21483         * expression.cs (As): We were only implementing one of the three
21484         cases for the as operator.  We now implement them all.
21485         (Is): Implement the various other cases for Is as well.
21486
21487         * typemanager.cs (CACHE): New define used to control if we want or
21488         not the FindMembers cache.  Seems to have a negative impact on
21489         performance currently
21490
21491         (MemberLookup): Nested types have full acess to
21492         enclosing type members
21493
21494         Remove code that coped with instance/static returns for events, we
21495         now catch this in RealFindMembers.
21496
21497         (RealFindMembers): only perform static lookup if the instance
21498         lookup did not return a type or an event.  
21499
21500 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
21501
21502         * assign.cs (CompoundAssign): We pass more semantic information
21503         now to Compound Assignments than we did before: now we have all
21504         the information at hand, and now we resolve the target *before* we
21505         do the expression expansion, which allows the "CacheValue" method
21506         to have the effect we intended (before, a [x] += 1 would generate
21507         two differen ArrayAccess expressions from the ElementAccess,
21508         during the resolution process).
21509
21510         (CompoundAssign.DoResolve): Resolve target and original_source here.
21511
21512 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
21513
21514         * expression.cs (ArrayAccess): dropped debugging information. 
21515
21516         * typemanager.cs: Small bug fix: I was always returning i_members,
21517         instead of one of i_members or s_members (depending on which had
21518         the content).
21519
21520         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
21521         method is invoked before any code generation takes place, and it
21522         is a mechanism to inform that the expression will be invoked more
21523         than once, and that the method should use temporary values to
21524         avoid having side effects
21525
21526         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
21527
21528         * ecore.cs (Expression.CacheTemporaries): Provide empty default
21529         implementation.
21530
21531         * expression.cs (Indirection, ArrayAccess): Add support for
21532         CacheTemporaries in these two bad boys. 
21533
21534         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
21535         ldobj or ldind_ref.  
21536         (StoreFromPtr): Handle stobj as well.
21537
21538         * expression.cs (UnaryMutator): Share more code.
21539
21540         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
21541         down: I was not tracking the Filter function as well, which
21542         was affecting the results of the cache.
21543
21544 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
21545
21546         * attribute.cs: Remove the hack to handle the CharSet property on
21547         StructLayouts. 
21548
21549 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
21550
21551         * attribute.cs (DoResolve): More uglyness, we now only try to
21552         resolve the attribute partially, to extract the CharSet
21553         information (only if we are a StructLayout attribute).  Otherwise 
21554
21555         (GetExtraTypeInfo): Add some code to conditionally kill in the
21556         future this.   I am more and more convinced that the .NET
21557         framework has special code to handle the attribute setting on
21558         certain elements.
21559
21560         * expression.cs (IsParamsMethodApplicable): Revert my previous
21561         foreach change here, it was wrong.
21562
21563 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
21564
21565         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
21566         (pp_expr): do not abort on unknown input, just return.
21567         (eval): abort if there are pending chars.
21568
21569         * attribute.cs (Attribute.Resolve): Positional parameters are
21570         optional.  Deal with that case.
21571
21572         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
21573         the Ansi/Unicode/Auto information for the type.
21574
21575         (TypeContainer.DefineType): instantiate the EmitContext here, as
21576         we will be using it during the type definition (to resolve
21577         attributes) and during the emit phase.
21578
21579         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
21580         to pull type information out of the attributes
21581
21582         (Attribute.Resolve): track the constructor builder, and allow for
21583         multiple invocations (structs and classes will use this).
21584
21585         * ecore.cs (MemberLookupFinal): new version with all the
21586         parameters customizable.
21587
21588         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
21589         constructors.  Return if the result value is null (as the error
21590         would have been flagged already by MemberLookupFinal)
21591
21592         Do not allow instances of abstract classes or interfaces to be
21593         created.
21594
21595         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
21596         We have to compare the assembly property here when dealing with
21597         FamANDAssem and Assembly access modifiers, because we might be
21598         creating an assembly from *modules* (that means that we are not
21599         getting TypeBuilders for types defined in other modules that are
21600         part of this assembly).
21601
21602         (Method.Emit): If the method is marked abstract and has a body,
21603         emit an error. 
21604
21605         (TypeContainer.DefineMembers): If both the defined member and the
21606         parent name match are methods, then do not emit any warnings: let
21607         the Method.Define routine take care of flagging warnings.  But if
21608         there is a mismatch (method overrides something else, or method is
21609         overriwritten by something, then emit warning).
21610
21611         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
21612         set to null, this means `do not check for the return type on the
21613         signature'. 
21614
21615         (Method.Define): set the return type for the method signature to
21616         null, so that we get methods with the same name and parameters and
21617         different return types.  This is used to flag warning 114 (you are
21618         hiding a method, and you probably want to use the new/override
21619         keywords instead).
21620
21621         * typemanager.cs (MemberLookup): Implemented proper access
21622         control, closing a long standing set of bug reports.  The problem
21623         was that the Framework only has two bits: Public and NonPublic,
21624         and NonPublic includes private and protected methods, but we need
21625         to enforce the FamANDAssem, FamOrAssem and Family. 
21626
21627 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
21628
21629         * statement.cs (GotoCase): Return true: Ammounts to giving up
21630         knowledge on whether we return or not, and letting the other case
21631         be responsible for it.
21632
21633 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
21634
21635         * driver.cs: Do not load directories for each file processed, only
21636         do it if there is a pattern.
21637
21638         * ecore.cs: Report readonly assigns here as well, as we might have
21639         been resolved only by MemberAccess.
21640
21641         (SimpleName.SimpleNameResolve): Also be useful for LValue
21642         resolution.   We need this to propagate assign to local readonly variables
21643
21644         * typemanager.cs: Use a ptrhashtable for the criteria, because we
21645         do not want to reuse potential criteria memory.
21646
21647         * class.cs (MyEventBuilder): Set reflected_type;
21648
21649         * ecore.cs (Constantify): Added support for constifying bools.
21650
21651         (RootContext.LookupType): Added a cache for values looked up in
21652         the declaration space.
21653
21654         * typemanager.cs (FindMembers): Now is a front-end to
21655         RealFindMembers, and provides a two-level hashtable-based cache to
21656         the request.  
21657
21658         15% performance improvement: from 22.5 to 19.2 seconds.
21659
21660         * expression.cs (IsParamsMethodApplicable): use foreach.
21661         (Invocation.DoResolve): ditto.
21662         (New.DoResolve): ditto.
21663         (ArrayCreation.DoResolve): ditto.
21664
21665         * ecore.cs (FindMostEncompassingType): use foreach.
21666
21667         * delegate.cs (NewDelegate.DoResolve): Use foreach
21668
21669         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
21670         (RemoveMethods): use foreach.
21671
21672         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
21673         nested foreach statements instead of for, and also break out of
21674         the inner loop once a match is found.
21675
21676         (Invocation.OverloadResolve): Use foreach, simplify the code. 
21677
21678 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
21679
21680         * cfold.cs (BinaryFold): During an enumeration evaluation context,
21681         we actually unwrap the expression to allow for extra information
21682         to be extracted. 
21683
21684         * expression.cs: Use Shr_Un on unsigned operations. 
21685
21686 2002-05-08  Ravi Pratap  <ravi@ximian.com>
21687
21688         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
21689         applicable operators was not being considered correctly. This closes
21690         the bug Miguel reported.
21691
21692 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
21693
21694         * attribute.cs: check that the type derives from System.Attribute
21695         and report the correct error in that case (moved the duplicate code to
21696         its own method, too).
21697
21698 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
21699
21700         * attribute.cs: lookup attribute type name as the spec says: first the
21701         bare attribute name and then name + "Attribute" (nant compiles with
21702         mcs after this fix).
21703
21704 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
21705
21706         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
21707         Because of the way we parse things, we should try to see if a
21708         UIntConstant can fit in an integer.
21709
21710 2002-05-07  Ravi Pratap  <ravi@ximian.com>
21711
21712         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
21713         when we are in an explicit context.
21714
21715         (ConvertReferenceExplicit): When converting from Iface type S to Class
21716         T make sure the rules are implemented as an OR.
21717
21718         * parameter.cs (ParameterType): Make it a property for now although the
21719         purpose really isn't anything immediate.
21720
21721         * expression.cs (Is*Applicable): Do better checking on the parameter type
21722         of a ref/out parameter. The ones from the system assemblies are already 
21723         marked with the correct type so we don't need to do any correction.
21724
21725         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
21726         the object type is standard too so include that.
21727
21728 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
21729
21730         * ecore.cs (StandardConversionExists): Augment with missing code:
21731         deal with IntConstant, LongConstants and Enumerations.
21732
21733         * assign.cs: Report the error, instead of failing silently
21734
21735         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
21736         typecontainer that they are declared, because the
21737         typecontainer/namespace will have the list of using clauses that
21738         need to be applied.
21739
21740         Assembly Attributes were escaping the normal registration
21741         mechanism. 
21742
21743         (EmitCode): Apply attributes within an EmitContext that represents
21744         the container they were declared on.
21745
21746         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
21747
21748 2002-05-06  Ravi Pratap  <ravi@ximian.com>
21749
21750         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
21751         Revamp completely - make much cleaner as we now operate only
21752         on a set of Types.
21753
21754         (FindMostSpecificSource, FindMostSpecificTarget): New methods
21755         to implement the logic detailed in the spec more correctly.
21756
21757         (UserDefinedConversion): Update accordingly.
21758
21759 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
21760
21761         * statement.cs: Return flow analysis information up.
21762
21763         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
21764         and the default.
21765
21766         (token): Do not consume an extra character before calling
21767         decimal_digits.
21768
21769 2002-05-06  Piers Haken <piersh@friskit.com>
21770
21771         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
21772
21773 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
21774
21775         * class.cs (Constructor.Emit): Set the IsStatic flag in the
21776         EmitContext during the instance constructor initializer
21777         resolution, to stop access to instance variables.
21778
21779         This is mandated by the spec, last paragraph of the `constructor
21780         initializers' section. 
21781
21782 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
21783
21784         * cs-parser.jay, class.cs (Accessor): new class used to represent
21785         an accessor (get or set).  In the past we used `null' to represent
21786         a missing accessor.  But this is ambiguous because there was no
21787         way to tell in abstract indexers/properties if one of them was
21788         specified.
21789
21790         Now there is a way of addressing that.
21791
21792         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
21793         instead of FindMembers.
21794
21795         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
21796         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
21797
21798         * attribute.cs: Treat indexers and properties as the same in terms
21799         of applying attributes
21800
21801         * ecore.cs (FindMostEncompassedType): Use statically initialized
21802         EmptyExpressions()s like we do elsewhere to avoid creating useless
21803         objects (and we take this out of the tight loop).
21804
21805         (GetConversionOperators): Move the code to extract the actual
21806         operators to a separate routine to clean things up.
21807
21808 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
21809
21810         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
21811         events are always registered FieldBuilders.
21812
21813         * class.cs (FieldBase): New class shared by Fields 
21814
21815         * delegate.cs: If we are a toplevel delegate, use our full name.
21816         If we are a nested delegate, then only use our tail name.
21817
21818 2002-05-02  Ravi Pratap  <ravi@ximian.com>
21819
21820         * expression.cs (IsApplicable): Ensure that we add the "&" to
21821         ref/out types before comparing it with the type of the argument.
21822
21823         (IsParamsMethodApplicable): Ditto.
21824
21825         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
21826         silly me ;-)
21827
21828         * delegate.cs : Handle the case when we have more than one applicable
21829         method. Flag an error only when we finish checking all.
21830
21831 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
21832
21833         * expression.cs: Add support for boolean static initializers.
21834
21835 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
21836
21837         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
21838
21839         * parameter.cs (ComputeParameterTypes,
21840         ComputeAndDefineParameterTypes): Better error handling: now we
21841         clear the `types' cache if we fail during any of the type lookups.
21842         We also return the status code correctly to our caller
21843
21844         * delegate.cs: If we fail to define a delegate, abort the extra
21845         steps. 
21846
21847         * expression.cs (Binary.ResolveOperator): for
21848         operator==(object,object) and operator !=(object, object) we also
21849         have to verify that there is an implicit conversion from one to
21850         the other.
21851
21852         (ArrayAccess.DoResolve): Array Access can operate on
21853         non-variables. 
21854
21855 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
21856
21857         * assign.cs (CompoundAssign): A new class used as a "flag" that
21858         the assignment actually is happening as part of a compound
21859         assignment operator.
21860
21861         During compound assignment, a few new rules exist to enable things
21862         like:
21863
21864         byte b |= 1 + 2
21865
21866         From the spec:
21867
21868         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
21869         to the type of x) if y is implicitly convertible to the type of x,
21870         and the operator is a builtin operator and the return type of the
21871         operator is explicitly convertible to the type of x. 
21872
21873         * rootcontext.cs: Reset warning level to 2.  4 catches various
21874         "interesting" features in mcs, we must clean this up at some
21875         point, but currently am trying to kill other bugs ;-)
21876
21877         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
21878         in container classes as well.  
21879
21880         * expression.cs (Binary.ResolveOperator): Handle string case
21881         before anything else (as operator overloading does emit an error
21882         before doing anything else).
21883
21884         This code could go away when we move to a table driven model, but
21885         i could not come up with a good plan last night.
21886
21887 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
21888
21889         * typemanager.cs (CSharpName): reimplementation using regex.
21890         * class.cs: added null check for fields in Emit
21891         * rootcontext.cs: set warninglevel to 4
21892
21893 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
21894
21895         * typemanager.cs (CSharpName): reimplemented with Lupus
21896         suggestion.
21897
21898 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
21899
21900         * statement.cs (If): correclty implement Resolve, because we were
21901         not catching sem errors in there.  The same process is needed
21902         everywhere else. 
21903         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
21904
21905
21906         (Statement.Warning_DeadCodeFound): Factorize code.
21907         (While): Report dead code here too.
21908
21909         (Statement): Added Resolve virtual method to allow
21910         for resolution split from the emit code.
21911
21912 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
21913
21914         * statement.cs (EmitBoolExpression): No longer try to resolve the
21915         expression here.    
21916         (MakeBoolean): New utility function that resolve, implicitly
21917         converts to boolean and tags the expression. 
21918
21919
21920         (If, Do): Implement dead code elimination.
21921         (While): Implement loop inversion
21922
21923         (Do, While, For, If): Resolve the expression prior to calling our
21924         code generation.
21925
21926 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
21927
21928         * class.cs:
21929           - added method Report28 (warning: program has more than one entry point)
21930           - added method IsEntryPoint, implements paragraph 10.1 of the spec
21931           - modified method Method.Define, the part at the end of the method
21932
21933         * rootcontext.cs: added static public Location EntryPointLocation;
21934           
21935         * ../errors/cs0028.cs : Add test case for the above warning.              
21936
21937         * typemanager.cs:
21938           - modified method CSharpName to allow arrays of primitive type to
21939             be printed nicely (e.g. instead of System.Int32[][] it now prints
21940             int[][])
21941           - added method CSharpSignature: returns the signature of a method
21942             in string format to be used in reporting errors, warnings, etc.
21943
21944         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
21945         with String.Empty.
21946
21947 2002-04-26  Ravi Pratap  <ravi@ximian.com>
21948
21949         * delegate.cs (Define): Fix extremely silly bug where I was
21950         setting the type of the 'object' parameter of the BeginInvoke
21951         method to System.IAsyncResult instead of System.Object ;-)
21952
21953 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
21954
21955         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
21956         here. 
21957
21958         (Constructor.Emit): return if we fail to initialize the
21959         constructor.  Another door closed!  
21960
21961         * expression.cs (New.DoResolve): Improve error message (from -6 to
21962         1501).  Use DeclaredOnly lookup to find the exact constructor.
21963
21964         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
21965         loop.  This is useful.
21966
21967         * cs-parser.jay: Adjust the default parameters so that destructors
21968         have the proper signature.
21969
21970 2002-04-26  Martin Baulig  <martin@gnome.org>
21971
21972         * driver.cs (LoadAssembly): If `assembly' contains any characters
21973         which are only valid in path names and not in assembly names
21974         (currently slash, backslash and point), use Assembly.LoadFrom ()
21975         instead of Assembly.Load () on the `assembly' (before iteration
21976         over the link_paths).
21977
21978 2002-04-26  Martin Baulig  <martin@gnome.org>
21979
21980         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
21981
21982 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
21983
21984         * class.cs (Property): use the new typemanager.MemberLookup
21985
21986         (TypeContainer.MemberLookup): Implement using the
21987         TypeManager.MemberLookup now. 
21988
21989         * typemanager.cs: Make MemberLookup a function of the TypeManager,
21990         and return MemberInfos, so that these can be used without an
21991         EmitContext (what we had before).
21992
21993 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
21994
21995         * expression.cs: Fix the case where the argument to params if the
21996         type of the params.  I omitted handling this before.   Fixed
21997
21998 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
21999
22000         * driver.cs: Call BootCorlib_PopulateCoreType
22001
22002         * class.cs (Property.CheckBase): Check for properties only, not
22003         for all members. 
22004
22005         * interface.cs: Temporary hack: try/catch around the
22006         CustomAttributeBuilder, because I am getting an exception that I
22007         do not understand.
22008
22009         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
22010         types whose definitions are required to be there (attributes are
22011         defined before standard types).
22012
22013         Compute definitions as we boot the various types, as they are used
22014         immediately (value_type class will need object_type, but if we do
22015         not initialize object_type, we will pass a null, which will let
22016         the runtime pick the System.Object from the existing corlib, which
22017         is not what we want).
22018
22019 2002-04-22  Patrik Torstensson <totte@labs2.com>
22020
22021         * cs-tokenizer.cs: fixed a number of trim() issues.
22022
22023 2002-04-22  Ravi Pratap  <ravi@ximian.com>
22024
22025         * expression.cs (Argument.Type): Ensure that we return the correct
22026         type when we have out or ref parameters [in which case we 
22027         append a "&"].
22028
22029 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
22030
22031         * class.cs (Property, Indexer): Allow extern modifier in there. 
22032
22033         * typemanager.cs (InitBaseTypes): Initializes object_type and
22034         value_type, since those will be used early on during the bootstrap
22035         process to compile corlib.
22036
22037         (InitCoreTypes): Move code from here to InitBaseTypes.
22038
22039 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
22040
22041         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
22042         single-dimension arrays as using the ldlen opcode.  
22043
22044         Daniel Lewis discovered this optimization.  
22045
22046         * typemanager.cs: Add signature for System.Array::get_Length
22047
22048 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22049
22050         * statement.cs: report the error when the foreach does not apply to an
22051         array nor a collection.
22052
22053 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
22054
22055         * expression.cs: Add implicit conversions to the operator ~.
22056
22057         * constant.cs (DecimalConstant.Emit): Emit decimal value.
22058
22059         * typemanager.cs: Locate the decimal constructor.
22060
22061 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22062
22063         * attribute.cs: use the new property of TypeOf.
22064         * expression.cs: added 'get' property around typearg.
22065
22066         These changes fix a build breaker reported by NickD. Is this the
22067         correct way to fix?  If not, please, revert my changes and make it
22068         work :-).
22069
22070 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
22071
22072         * attribute.cs: Add support for typeof in attribute invocations.
22073         I am not sure that this is right though.
22074
22075 2002-04-14  Duncan Mak  <duncan@ximian.com>
22076
22077         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
22078         Binary.Operator.Division case.
22079
22080 2002-04-13  Ravi Pratap  <ravi@ximian.com>
22081
22082         * class.cs (DefineType): Ensure that we do a proper check on
22083         attribute types and also register it with the TypeManager.
22084
22085         (TypeContainer.Targets): The default for attribute types is
22086         AttributeTargets.All.
22087
22088         * attribute.cs (ApplyAttributes): Registering the attribute type
22089         is done elsewhere, not when we discover we have a Usage attribute.
22090
22091 2002-04-12  Ravi Pratap  <ravi@ximian.com>
22092
22093         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
22094         and get rid of is_delegate parameter.
22095
22096         * everywhere : update.
22097
22098 2002-04-12  Ravi Pratap  <ravi@ximian.com>
22099
22100         * cs-parser.jay (compilation_unit): Revamp completely to use
22101         some new ideas that I got from Rhys' grammar to solve the problems
22102         with assembly level attributes.
22103
22104         (outer_declaration): New grammar production.
22105
22106         (attribute_sections): Add.
22107
22108         (opt_attributes): Base on attribute_sections
22109
22110         (namespace_declaration): Allow opt_attributes to tackle the case
22111         when we have assembly level attributes - we are clever in this
22112         regard now ;-)
22113
22114         * attribute.cs (ApplyAttributes): Do not worry about assembly 
22115         attributes in the non-global context.
22116
22117         * rootcontext.cs (AddGlobalAttributes): Go back to using this
22118         instead of SetGlobalAttributes.
22119
22120         * class.cs, rootcontext.cs : Ensure we define and generate 
22121         attribute types before anything else.
22122
22123         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
22124         and flag the new error -20 for the case when the attribute type
22125         does not have valid targets specified. csc does not catch this.
22126
22127         * ../errors/errors.txt : update for error # -20
22128
22129 2002-04-11  Ravi Pratap  <ravi@ximian.com>
22130
22131         * support.cs (InternalParameters.ParameterModifier): Do some null
22132         checking and return sane values.
22133
22134         * class.cs (Method.Define): If we are a PInvoke method, ensure
22135         that we are static and extern. Report error # 601
22136
22137         * ../errors/cs0601.cs : Add test case for the above error.
22138
22139 2002-04-07  Ravi Pratap  <ravi@ximian.com>
22140
22141         * rootcontext.cs (attribute_types): We need to keep type of
22142         all attribute types separately and emit code for them first.
22143
22144         (RegisterAttribute) : Implement.
22145
22146         * class.cs (DefineType): Check if the current Type is a custom
22147         attribute type and register it accordingly.
22148
22149         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
22150         adding the first attribute twice and rename to
22151
22152         (SetGlobalAttributes): this.
22153
22154         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
22155         lookups.
22156
22157         * attribute.cs (ApplyAttributes): Take an additional argument telling us
22158         if we are processing global arguments. Hmm, I am unsure of this.
22159
22160 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22161
22162         * expression.cs: added static array of strings to avoid calling
22163         Enum.ToString () for Operator in Binary. Significant recover of
22164         performance.
22165
22166 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
22167
22168         * class.cs (FindMembers): Allow the Builders of the various
22169         members to be null.  If they are skip them.  This only happens
22170         during the PInvoke declaration.
22171
22172 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
22173
22174         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
22175         failure, so we do not keep going afterwards.
22176
22177         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
22178         wanted to pass `false' as the `is_delegate' argument.  If this is
22179         the case, why not use delegate_type == null to mean `is_delegate =
22180         false' and anything else as is_delegate = true.
22181
22182 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
22183
22184         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
22185         code for the section, not the beginning of the tests.
22186
22187 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
22188
22189         * cfold.cs: Handle operator + (Enum x, Underlying x) 
22190
22191         * expression.cs (Binary): same.  Warn about errors where we have
22192         Enum/Enum in operator + as well.
22193
22194 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
22195
22196         * statement.cs:
22197                 - added support for switch(bool)
22198                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
22199                 - add TableSwitchEmit() to handle table-based switch statements
22200
22201 2002-04-05  Ravi Pratap  <ravi@ximian.com>
22202
22203         * expression.cs (Invocation.OverloadResolve): Factor out code which
22204         does parameter compatibility checking with arguments so that we can 
22205         re-use the code even from Delegate.VerifyApplicability
22206
22207         (VerifyArgumentsCompat): Move above code here.
22208
22209         * delegate.cs (VerifyApplicability): Get rid of duplicate code
22210         and instead make a call to the above method.
22211
22212 2002-03-31  Ravi Pratap  <ravi@ximian.com>
22213
22214         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
22215         We use it to keep track of classes which are attribute types.
22216
22217 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
22218
22219         * delegate.cs (Delegate.Define): Correctly define the types in the
22220         presence of fixed and array parameters.
22221
22222         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
22223         doing FindMembers.
22224
22225         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
22226         include NonPublic after the first iteration.
22227
22228         * class.cs (Indexer.CheckBase): Only check if both parents are
22229         non-null. 
22230
22231         * cs-parser.jay (accessor_body): If empty, set to null.
22232
22233         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
22234         same code path here to resolve constants names that we did have in
22235         MemberAccess.DoResolve.  There is too much code duplicated here.
22236
22237 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
22238
22239         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
22240
22241         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
22242         to MakeUnionSet.
22243
22244         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
22245         tokens, numbers and strings.
22246
22247         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
22248         parenthesis.
22249
22250         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
22251         asyncronous parameters and the regular parameters.  
22252
22253         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
22254         specify the target directory.
22255
22256         * expression.cs: (This.DoResolve): Simplify
22257         (As.Emit): Optimize, do not generate IsInst if the expression is
22258         always of the given type.
22259
22260         (Is.DoResolve): Bug fix, we were reporting both always/never for
22261         the is expression.
22262
22263         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
22264         creating too many unnecessary arrays.
22265
22266 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
22267
22268         * class.cs (EmitFieldInitializer): Use Assign expression to assign
22269         fields instead of rolling our own initializer.   Takes care of all
22270         implicit conversions, and drops unnecessary static checks/argument.
22271
22272 2002-03-31  Dick Porter  <dick@ximian.com>
22273
22274         * driver.cs: use the GetDirectories() return values properly, and
22275         use "/" as path separator.
22276
22277 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
22278
22279         * expression.cs (Unary): Optimize - - expr into expr.
22280         (Binary): Optimize a + (-b) into a -b.
22281
22282         * codegen.cs (CodeGen): Made all methods static.
22283
22284 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
22285
22286         * rootcontext.cs: 
22287
22288         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
22289         TypeBuilder property.
22290
22291         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
22292         instead. 
22293
22294         * tree.cs: Removed the various RecordXXXX, and replaced with a
22295         single RecordDecl.  Removed all the accessor methods, and just
22296         left a single access point Type 
22297
22298         * enum.cs: Rename DefineEnum to DefineType.
22299
22300         * decl.cs: New abstract method `DefineType' used to unify the
22301         Defines for Enumerations, Interfaces, TypeContainers and
22302         Delegates.
22303
22304         (FindType): Moved LookupInterfaceOrClass here.  Moved the
22305         LookupBaseClasses method that used to live in class.cs and
22306         interface.cs here, and renamed to FindType.
22307
22308         * delegate.cs: Implement DefineType.  Take advantage of the
22309         refactored pattern for locating the parent builder without taking
22310         the parent_builder argument (which we know does not work if we are
22311         nested, and triggering a toplevel definition).
22312
22313 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
22314
22315         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
22316         accessibility of a member has changed during override and report
22317         an error if so.
22318
22319         * class.cs (Method.Define, Property.Define): Only complain on
22320         overrides if the method is private, any other accessibility is
22321         fine (and since we just checked the permission is the same, we are
22322         good to go).
22323
22324         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
22325         and elif are processed always.  The other pre-processing
22326         directives are only processed if we are "taking" the path
22327
22328 2002-03-29  Martin Baulig  <martin@gnome.org>
22329
22330         * class.cs (Method.Emit): Only emit symbolic debugging info if the
22331         current location is not Null.
22332
22333         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
22334         a separate method so we can profile it.
22335
22336         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
22337         `span.Seconds' are just seconds, but no minutes or hours.
22338         (MainDriver): Profile the CodeGen.SaveSymbols calls.
22339
22340 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
22341
22342         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
22343         Remove the gratuitous set of Final:
22344
22345                                 // If an interface implementation, then we can set Final.
22346                                 if (((flags & MethodAttributes.Abstract) == 0) &&
22347                                     implementing.DeclaringType.IsInterface)
22348                                         flags |= MethodAttributes.Final;
22349
22350         I do not know what I was smoking when I used that.
22351
22352
22353         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
22354         step into fixing the name resolution issues for delegates and
22355         unifying the toplevel name resolution.
22356
22357 2002-03-28  Martin Baulig  <martin@gnome.org>
22358
22359         * class.cs (Method.Emit): If we have a symbol writer, call its
22360         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
22361         tell it about the current method.
22362
22363         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
22364         writer that we're going to emit the first byte of IL code for a new
22365         statement (a new source line).
22366         (EmitContext.EmitTopBlock): If we have a symbol writer, call
22367         EmitContext.Mark() before emitting any code.
22368
22369         * location.cs (SymbolDocument): Return null when we're Null.
22370
22371         * statement.cs (Statement): Moved the `Location loc' variable here.
22372         (Statement.EmitBoolExpression): If we have a symbol writer, call
22373         ec.Mark() before emitting any code to tell it that we're at the
22374         beginning of a new statement.
22375         (StatementExpression): Added `Location' argument to the constructor.
22376         (Block): Added public readonly variable `StartLocation' and public
22377         variable `EndLocation'.  The latter is to be set using SetEndLocation().
22378         (Block): Added constructor which takes a start and end location.
22379         (Block.SetEndLocation): New method. This sets the end location.
22380         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
22381         local variables we create.
22382         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
22383         each statement and do also mark the begin and end of the block.
22384
22385         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
22386         tell it the current lexer.Location, use Location.Null for the end of the
22387         block.
22388         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
22389         current block, set its end location using SetEndLocation().
22390         (statement_expression): StatementExpression constructor now takes the
22391         lexer.Location as additional argument.
22392         (for_statement, declare_local_variables): Likewise.
22393         (declare_local_variables): When creating a new implicit block, use the
22394         new Block constructor and pass it the lexer.Location.
22395
22396 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
22397
22398         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
22399         members also on the parent interfaces recursively.
22400
22401 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
22402
22403         * report.cs: Use new formats, since Gonzalo finished the missing
22404         bits. 
22405
22406         * expression.cs (Binary.ResolveOperator): added missing operator|
22407         operator& and operator^ for bool/bool.
22408
22409         * cs-parser.jay: CheckDef now takes a Location argument that is
22410         used to report errors more precisly (instead of reporting the end
22411         of a definition, we try to track something which is a lot closer
22412         to the source of the problem).
22413
22414         * cs-tokenizer.cs: Track global token use, so we can properly flag
22415         the use of #define/#undef after the first token has been seen.
22416
22417         Also, rename the reportXXXX to Error_DescriptiveName
22418
22419         * decl.cs (DeclSpace.IsTopLevel): Move property here from
22420         TypeContainer, so that Enum and Interface can use this too.
22421
22422         * class.cs (TypeContainer.LookupInterfaceOrClass,
22423         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
22424         `builder' argument.  Typically this was used to pass the parent
22425         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
22426         the definition).  
22427
22428         The problem is that a nested class could trigger the definition of
22429         a toplevel class, and the builder would be obviously wrong in that
22430         case. 
22431
22432         So we drop this argument, and we compute dynamically the
22433         TypeBuilder/ModuleBuilder (the correct information was available
22434         to us anyways from DeclSpace.Parent)
22435
22436         * interface.cs (Interface.DefineInterface): Drop builder
22437         parameter cleanup like class.cs
22438
22439         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
22440         like class.cs
22441
22442         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
22443         values. 
22444
22445         (Try.Emit): Propagate the returns value from the statement.
22446
22447         (Return.Emit): Even if we are leavning 
22448
22449         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
22450
22451         * modifiers.cs: Fix the computation of MethodAttributes flags.
22452
22453 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
22454
22455         * driver.cs: allow compilation of files that start with '/'.
22456         Add a default case when checking the argument of --target.
22457
22458 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
22459
22460         * interface.cs: Implement the same search algorithm for types in
22461         the interface code.
22462
22463         * delegate.cs: Do not allow multiple definition.
22464
22465         * Recovered ChangeLog that got accidentally amputated
22466
22467         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
22468
22469         * rootcontext.cs: Load manually enum to allow core classes to
22470         contain enumerations.
22471
22472         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
22473         Update to new static methods in TypeManager.
22474
22475         * typemanager.cs (GetMethod, GetConstructor): Use our
22476         implementation of FindMembers to find the members, since during
22477         corlib compilation, the types are TypeBuilders and GetMethod and
22478         GetConstructor do not work.
22479
22480         Make all methods in TypeManager static.
22481
22482         (InitCodeHelpers): Split the functionality from
22483         the InitCodeTypes function.
22484
22485         * driver.cs: Call InitCodeHelpers after we have populated the
22486         types. 
22487
22488         * cs-parser.jay (delegate_declaration): we did not used to compute
22489         the delegate name correctly for void delegates.
22490
22491 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
22492
22493         * rootcontext.cs (RootContext): Init the interface_resolve_order
22494         and type_container_resolve_order always.
22495
22496         (ResolveCore, BootstrapCorlib_ResolveClass,
22497         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
22498         compiler when compiling with --nostdlib
22499
22500         * class.cs (TypeContainer.DefineType): Check that our parent is
22501         not null.  This test is most important when we are bootstraping
22502         the core types.
22503
22504         * codegen.cs: Split out the symbol writing code.
22505
22506 2002-03-25  Martin Baulig  <martin@gnome.org>
22507
22508         * driver.cs (-g): Made -g an alias for --debug.
22509
22510 2002-03-24  Martin Baulig  <martin@gnome.org>
22511
22512         * codegen.cs (SymbolWriter): New public variable. Returns the
22513         current symbol writer.
22514         (CodeGen): Added `bool want_debugging_support' argument to the
22515          constructor. If true, tell the ModuleBuild that we want debugging
22516         support and ask it for the ISymbolWriter.
22517         (Save): If we have a symbol writer, call it's Close() method after
22518         saving the assembly.
22519
22520         * driver.c (--debug): New command line argument to create a
22521         debugger information file.
22522
22523         * location.cs (SymbolDocument): New public property. Returns an
22524         ISymbolDocumentWriter object for the current source file or null
22525         if we don't have a symbol writer.
22526
22527 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
22528
22529         * driver.cs (LoadAssembly): Correctly return when all the paths
22530         have been tried and not before.
22531
22532         * statement.cs (Switch.Emit): return the actual coverage for this
22533         statement (returns/not-returns)
22534
22535         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
22536         switch of the statement if we are the last switch section.  That
22537         kills two problems: try/catch problems (we used to emit an empty
22538         nop at the end) and switch statements where all branches would
22539         return. 
22540
22541 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
22542
22543         * driver.cs: Add default assemblies (the equivalent to the
22544         Microsoft CSC.RSP file)
22545
22546         * cs-tokenizer.cs: When updating `cols and setting it to zero,
22547         also update tokens_seen and set it to false.
22548
22549         * driver.cs: Implement --recurse for Mike.
22550
22551         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
22552         correctly splitting out the paths.
22553
22554 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
22555
22556         * interface.cs (Interface.PopulateProperty): Instead of using
22557         `parent' as the declaration space for the set parameters, use
22558         `this' 
22559
22560         * support.cs (InternalParameters): InternalParameters constructor
22561         takes a DeclSpace instead of a TypeContainer.
22562
22563         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
22564         types are being initialized, load the address of it before calling
22565         the function.  
22566
22567         (New): Provide a mechanism to disable the generation of local
22568         value type temporaries when the caller will be providing us with
22569         an address to store it.
22570
22571         (ArrayCreation.EmitDynamicInitializers): Use it.
22572
22573 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
22574
22575         * expression.cs (Invocation.EmitArguments): Only probe for array
22576         property if there is more than one argument.  Sorry about that.
22577
22578         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
22579         empty param arrays.
22580
22581         * class.cs (Method.LabelParameters): Fix incorrect code path that
22582         prevented the `ParamArrayAttribute' from being applied to the
22583         params attribute.
22584
22585 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
22586
22587         * support.cs (ReflectionParameters): Correctly compute whether the
22588         last argument is a params array.  Fixes the problem with
22589         string.Split ('a')
22590
22591         * typemanager.cs: Make the assemblies array always be non-null
22592         (empty, but non-null)
22593
22594         * tree.cs (RecordDecl): New function that abstracts the recording
22595         of names.  This reports error 101, and provides a pointer to the
22596         previous declaration.  Fixes a crash in the compiler.
22597
22598         * cs-parser.jay (constructor_declaration): Update to new grammar,
22599         and provide a constructor_body that can be empty.
22600
22601 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
22602
22603         * driver.cs: Add support for --resources.
22604
22605         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
22606         Make all types for the various array helper methods be integer.
22607
22608         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
22609         CheckState to ConvCast.
22610
22611         (ConvCast): Now it takes a `checked' state argument, to avoid
22612         depending on the emit context for the conversion, and just using
22613         the resolve time setting.
22614
22615         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
22616         instead of Invocation.EmitArguments.  We do not emit the original
22617         arguments, instead we emit those which have been converted to
22618         unsigned int expressions.
22619
22620         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
22621
22622         * codegen.cs: ditto.
22623
22624         * expression.cs (LocalVariableReference): Drop the use of the
22625         Store function that depended on the variable index.
22626
22627         * statement.cs (VariableInfo): Drop the `Idx' property from this
22628         class, as this is not taking into account the indexes for
22629         temporaries tat we generate during the execution, getting the
22630         indexes wrong.
22631
22632         * class.cs: First emit class initializers, then call the parent
22633         constructor. 
22634
22635         * expression.cs (Binary): Fix opcode emision.
22636         (UnaryMutator.EmitCode): Support checked code generation
22637
22638         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
22639         matches for events for both the Static and Instance scans,
22640         pointing to the same element.   Fix that.
22641
22642 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
22643
22644         * rootcontext.cs (ResolveTree): Always set the
22645         interface_resolve_order, because nested interfaces will be calling
22646         into us.
22647
22648         * class.cs (GetInterfaceOrClass): Track the same resolution
22649         process used by TypeManager.LookupType.  This fixes the nested
22650         type lookups in class declarations (separate path from
22651         LookupType). 
22652
22653         (TypeContainer.DefineType): Also define nested interfaces.
22654         (TypeContainer.RegisterOrder): New public function used to
22655         register the order in which child interfaces need to be closed.
22656
22657         Nested interfaces need to be closed after their parents have been
22658         created. 
22659
22660         * interface.cs (InterfaceAttr): Put all the logic for computing
22661         the interface attribute here. 
22662
22663         (DefineInterface): Register our interface order with the
22664         RootContext or with the TypeContainer depending on the case.
22665
22666 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
22667
22668         * cs-parser.jay: rework foreach statement to work with the new
22669         changes to the policy on SimpleNames.
22670
22671         * report.cs: support Stacktrace on warnings as well.
22672
22673         * makefile: drop --unsafe and /unsafe from the compile.
22674
22675 2002-03-13  Ravi Pratap  <ravi@ximian.com>
22676
22677         * ecore.cs (StandardConversionExists): Modify to take an Expression
22678         as the first parameter. Ensure we do null -> reference type conversion
22679         checking.
22680
22681         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
22682         temporary Expression objects.
22683
22684 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
22685
22686         * interface.cs: workaround bug in method overloading resolution
22687         (there is already a bugzilla bug for it).
22688
22689 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
22690
22691         We could also solve this problem by having a separate path for
22692         performing type lookups, instead of DoResolve, we could have a
22693         ResolveType entry point, and only participating pieces of the
22694         production (simplename, deref, array) would implement this. 
22695
22696         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
22697         signal SimpleName to only resolve type names and not attempt to
22698         resolve anything else.
22699
22700         * expression.cs (Cast): Set the flag.
22701
22702         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
22703
22704         * class.cs: Only report 108 if there is no `new' modifier.
22705
22706         * cs-parser.jay: rework foreach statement to work with the new
22707         changes to the policy on SimpleNames.
22708
22709         * report.cs: support Stacktrace on warnings as well.
22710
22711         * makefile: drop --unsafe and /unsafe from the compile.
22712
22713 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
22714
22715         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22716         lookups here, instead of doing that at parse time.  This means
22717         that our grammar will not introduce `LocalVariableReferences' as
22718         expressions at this point.  That solves the problem of code like
22719         this:
22720
22721         class X {
22722            static void Main ()
22723            { int X = 1;
22724             { X x = null }}}
22725
22726         This is only half the fix.  The full fix requires parameters to
22727         also be handled in this way.
22728
22729         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
22730         makes the use more obvious of the DeclSpace.  The
22731         ec.TypeContainer.TypeBuilder is now only used to pull the
22732         TypeBuilder for it.
22733
22734         My theory is that I can get rid of the TypeBuilder completely from
22735         the EmitContext, and have typecasts where it is used (from
22736         DeclSpace to where it matters).  
22737
22738         The only pending problem is that the code that implements Aliases
22739         is on TypeContainer, and probably should go in DeclSpace.
22740
22741         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22742         lookups here, instead of doing that at parse time.  This means
22743         that our grammar will not introduce `LocalVariableReferences' as
22744         expressions at this point.  That solves the problem of code like
22745         this:
22746
22747         class X {
22748            static void Main ()
22749            { int X = 1;
22750             { X x = null }}}
22751
22752         This is only half the fix.  The full fix requires parameters to
22753         also be handled in this way.
22754
22755         * class.cs (Property.DefineMethod): When implementing an interface
22756         method, set newslot, when implementing an abstract method, do not
22757         set the flag (before we tried never setting it, or always setting
22758         it, which is the difference).
22759         (Indexer.DefineMethod): same.
22760         (Method.DefineMethod): same.
22761
22762         * ecore.cs: Only set the status used flag if we get back a Field.
22763
22764         * attribute.cs: Temporary hack, so Paolo can keep working.
22765
22766 2002-03-08  Ravi Pratap  <ravi@ximian.com>
22767
22768         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
22769         the unmanaged type in the case we have a MarshalAs attribute.
22770
22771         (Resolve): Handle the case when we are parsing the special MarshalAs
22772         attribute [we need to store the unmanaged type to use later]
22773
22774         * typemanager.cs (marshal_as_attr_type): Built in type for the 
22775         MarshalAs Attribute.
22776
22777         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
22778         on parameters and accordingly set the marshalling info.
22779
22780 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
22781
22782         * class.cs: Optimizing slightly by removing redundant code after
22783         we switched to the `NoTypes' return value.
22784         (Property.DefineMethod): use NoTypes here too.
22785
22786         This fixes the bug I introduced in my last batch of changes.
22787
22788 2002-03-05  Ravi Pratap  <ravi@ximian.com>
22789
22790         * tree.cs (RecordEnum): Add. We now keep track of enums too.
22791
22792         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
22793         Enums since those are types too. 
22794
22795         * cs-parser.jay (enum_declaration): Record enums as we parse them.
22796
22797         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
22798         thanks to a call during the lookup process.
22799
22800 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
22801
22802         * statement.cs (Foreach): Lots of work to accomodate a particular
22803         kind of foreach statement that I had not kept in mind.  It is
22804         possible to have foreachs on classes that provide a GetEnumerator
22805         method that return objects that implement the "pattern" for using
22806         a foreach, there is no need to support GetEnumerator
22807         specifically. 
22808
22809         This is needed to compile nant.
22810
22811         * decl.cs: Only report 114 if the member is not `Finalize' and if
22812         the warning level is at least 2.
22813
22814         * class.cs: Moved the compare function from Method to
22815         MethodSignature. 
22816
22817         (MethodSignature.InheritableMemberSignatureCompare): Add new
22818         filter function that is used to extract inheritable methods from a
22819         class. 
22820
22821         (Method.Define): Use the new `inheritable_method_signature_filter'
22822         delegate
22823
22824         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
22825         command. 
22826
22827 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
22828
22829         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
22830
22831         * cs-parser.jay: Add opt_semicolon to the interface declaration.
22832
22833         * expression.cs: Pass location information to
22834         ConvertImplicitStandard. 
22835
22836         * class.cs: Added debugging code to track return values from
22837         interfaces. 
22838
22839 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
22840
22841         * expression.cs (Is.DoResolve): If either side of the `is' is an
22842         interface, do not flag the warning.
22843
22844         * ecore.cs (ImplicitReferenceConversion): We need a separate test
22845         for interfaces
22846
22847         * report.cs: Allow for --fatal to be used with --probe.
22848
22849         * typemanager.cs (NoTypes): Move the definition for the empty Type
22850         array here. 
22851
22852         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
22853         properties. 
22854         (TypeContainer.DefineProxy): New function used to proxy to parent
22855         implementations when implementing interfaces.
22856         (TypeContainer.ParentImplements): used to lookup if our parent
22857         implements a public function that is required by an interface.
22858         (TypeContainer.VerifyPendingMethods): Hook this up.
22859
22860         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
22861         `modules' and `assemblies' arraylists into arrays.  We only grow
22862         these are the very early start up of the program, so this improves
22863         the speedof LookupType (nicely measured).
22864
22865         * expression.cs (MakeByteBlob): Replaced unsafe code with
22866         BitConverter, as suggested by Paolo.
22867
22868         * cfold.cs (ConstantFold.Binary): Special case: perform constant
22869         folding of string concatenation, but if either side is a string,
22870         and the other is not, then return null, and let the runtime use
22871         the concatenation on the string plus the object (using
22872         `Object.ToString'). 
22873
22874 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
22875
22876         Constant Folding has been implemented now.
22877
22878         * expression.cs (Unary.Reduce): Do not throw an exception, catch
22879         the error instead on types that are not supported in one's
22880         complement. 
22881
22882         * constant.cs (Constant and all children): New set of functions to
22883         perform implict and explicit conversions.
22884
22885         * ecore.cs (EnumConstant): Implement the new functions to perform
22886         conversion by proxying to the child expression.
22887
22888         * codegen.cs: (ConstantCheckState): Constant evaluation has its
22889         own separate setting that can not be turned off from the command
22890         line using --unchecked or --checked and is only controlled using
22891         the checked/unchecked statements and expressions.  This setting is
22892         used by the constant folder to flag errors.
22893
22894         * expression.cs (CheckedExpr, UncheckedExpr): Set the
22895         ConstantCheckState as well.   
22896
22897         During Resolve, they also have to flag the state, because the
22898         constant folder runs completely in the Resolve phase.
22899
22900         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
22901         well.
22902
22903 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
22904
22905         * cfold.cs: New file, this file contains the constant folder.
22906
22907         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
22908         argument to track whether we are using the resulting address to
22909         load or store a value and provide better error messages. 
22910
22911         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
22912         new AddressOf arguments.
22913
22914         * statement.cs (Foreach.EmitCollectionForeach): Update
22915
22916         * expression.cs (Argument.Emit): Call AddressOf with proper
22917         arguments to track usage.
22918
22919         (New.DoEmit): Call AddressOf with new arguments.
22920
22921         (Unary.Emit): Adjust AddressOf call.
22922
22923 2002-03-01  Ravi Pratap  <ravi@ximian.com>
22924
22925         * cs-parser.jay (member_access): Change the case for pre-defined types
22926         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
22927         this suggestion.
22928
22929         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
22930         a method body.
22931
22932         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
22933         essentially like methods and apply attributes like MethodImplOptions to them too.
22934
22935         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
22936         not being null.
22937
22938         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
22939         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
22940         is the DeclSpace.
22941
22942         * Update code everywhere accordingly.
22943
22944         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
22945
22946         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
22947
22948 2002-02-28  Ravi Pratap  <ravi@ximian.com>
22949
22950         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
22951         try performing lookups against those instead of jumping straight into using
22952         the 'using' clauses.
22953
22954         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
22955
22956         (LookupType): Perform lookups in implicit parents too.
22957
22958         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
22959         sequence as RootContext.LookupType. 
22960
22961         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
22962         the various cases of namespace lookups into this method.
22963
22964 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
22965
22966         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
22967         in positional arguments)
22968
22969         * class.cs (Operator): Update the AllowedModifiers to contain
22970         extern. 
22971
22972         * cs-parser.jay: Update operator declaration to allow for the
22973         operator body to be empty.
22974
22975         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
22976         values. 
22977
22978 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
22979
22980         * class.cs (Method.Emit): Label parameters.
22981
22982         * driver.cs: Return 1 or 0 as the program exit code.
22983
22984 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
22985
22986         * expression.cs: Special case the `null' object when trying to
22987         auto-compute the type, as anything can be explicitly converted to
22988         that. 
22989
22990         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
22991         spotting this Paolo.
22992
22993         (Expression.ImplicitNumericConversion): Perform comparissions of
22994         the type using the underlying type in the case of an enumeration
22995         rather than using the enumeration type for the compare.
22996
22997         Cope with the underlying == type case, which is not possible to
22998         catch before. 
22999
23000         (Expression.ConvertNumericExplicit): Perform comparissions of
23001         the type using the underlying type in the case of an enumeration
23002         rather than using the enumeration type for the compare.
23003
23004         * driver.cs: If the user does not supply an extension, assume .exe
23005
23006         * cs-parser.jay (if_statement): Rewrote so that we can track the
23007         location for the if statement.
23008
23009         * expression.cs (Binary.ConstantFold): Only concat strings when
23010         the operation is "+", not everything ;-)
23011
23012         * statement.cs (Statement.EmitBoolExpression): Take a location
23013         argument. 
23014         (If, While, Do): Track location.
23015
23016         * expression.cs (Binary.ResolveOperator): In the object + string
23017         case, I was missing a call to ConvertImplicit
23018
23019 2002-02-25  Ravi Pratap  <ravi@ximian.com>
23020
23021         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
23022         Location arguments. Ensure we use RootContext.LookupType to do our work
23023         and not try to do a direct Type.GetType and ModuleBuilder.GetType
23024
23025         * interface.cs (PopulateMethod): Handle the type of the parameter being
23026         null gracefully.
23027
23028         * expression.cs (Invocation.BetterFunction): Handle the case when we 
23029         have a params method with no fixed arguments and a call is made with no
23030         arguments.
23031
23032 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
23033
23034         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
23035         the verbatim-string-literal
23036
23037         * support.cs (InternalParameters.ParameterModifier): handle null
23038         fixed parameters.
23039         (InternalParameters.ParameterType): ditto.
23040
23041         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
23042         duplicating the name of the variable parameter.
23043         (GetParameterByName): Fix bug where we were not looking up array
23044         paramters if they were the only present (thanks Paolo!).
23045         (GetParameterInfo): We only have an empty set of types if both
23046         fixed and array are set to null.
23047         (GetParameterInfo-idx): Handle FixedParameter == null
23048
23049         * cs-parser.jay: Handle the case where there is no catch
23050         statements (missing null test).
23051
23052 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
23053
23054         * driver.cs (MainDriver): Be conservative on our command line
23055         handling.
23056
23057         Catch DirectoryNotFoundException when calling GetFiles.
23058
23059         (SplitPathAndPattern): Used to split the input specification into
23060         a path and a pattern that we can feed to Directory.GetFiles.
23061
23062 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
23063
23064         * statement.cs (Fixed): Implement the last case of the Fixed
23065         statement (string handling).
23066
23067         * expression.cs (StringPtr): New class used to return a char * to
23068         a string;  Used by the Fixed statement.
23069
23070         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
23071
23072         * expression.cs (Binary.ResolveOperator): Remove redundant
23073         MemberLookup pn parent type.
23074         Optimize union call, we do not need a union if the types are the same.
23075         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
23076         type.
23077
23078         Specialize the use of MemberLookup everywhere, instead of using
23079         the default settings. 
23080
23081         (StackAlloc): Implement stackalloc keyword.
23082
23083         * cs-parser.jay: Add rule to parse stackalloc.
23084
23085         * driver.cs: Handle /h, /help, /?
23086
23087         * expression.cs (MakeByteBlob): Removed the hacks we had in place
23088         before we supported unsafe code.
23089
23090         * makefile: add --unsafe to the self compilation of mcs.
23091
23092 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
23093
23094         * expression.cs (PointerArithmetic): New class that is used to
23095         perform pointer arithmetic.
23096         (Binary.Resolve): Handle pointer arithmetic
23097         Handle pointer comparission.
23098         (ArrayPtr): Utility expression class that is used to take the
23099         address of an array.
23100
23101         (ElementAccess): Implement array access for pointers
23102
23103         * statement.cs (Fixed): Implement fixed statement for arrays, we
23104         are missing one more case before we are done.
23105
23106         * expression.cs (Indirection): Implement EmitAssign and set the
23107         ExprClass to Variable.  This allows pointer dereferences to be
23108         treated as variables, and to have values assigned to them.
23109
23110         * ecore.cs (Expression.StoreFromPtr): New utility function to
23111         store values dereferencing.
23112
23113 2002-02-20  Ravi Pratap  <ravi@ximian.com>
23114
23115         * expression.cs (Binary.ResolveOperator): Ensure that we are
23116         not trying to operate on a void type - this fixes the reported
23117         bug.
23118
23119         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
23120         the parent implementation is sealed.
23121
23122         * ../errors/cs0239.cs : Add.
23123
23124         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
23125
23126         * typemanager.cs (unverifiable_code_type): Corresponds to 
23127         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
23128         which have unsafe code in them.
23129
23130         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
23131         unsafe context.
23132
23133 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
23134
23135         * cs-tokenizer.cs: Add support for @"litreal strings"
23136
23137         Make tokenizer accept pre-processor directives
23138         on any column (remove the old C-like limitation). 
23139
23140         * rootcontext.cs (EmitCode): Emit any global attributes.
23141         (AddGlobalAttributes): Used to keep track of assembly attributes. 
23142
23143         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
23144
23145         * cs-parser.jay: Add support for global attributes.  
23146
23147 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
23148
23149         * expression.cs (Indirection): New helper class.  Unary will
23150         create Indirection classes to be able to implement the
23151         IMemoryLocation interface on it.
23152
23153 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
23154
23155         * cs-parser.jay (fixed_statement): reference the right statement.
23156
23157         * statement.cs (Fixed.Emit): Finish implementing the fixed
23158         statement for the &x case.
23159
23160 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
23161
23162         * class.cs (Property.Define, Method.Define): Remove newslot when
23163         `implementing'.  
23164
23165         * modifiers.cs: My use of NewSlot when `Abstract' was set was
23166         wrong.  NewSlot should only be used if the `new' keyword is present.
23167
23168         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
23169         locating our system dir.  Sorry about this.
23170
23171 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
23172
23173         * driver.cs (GetSystemDir): Compute correctly the location of our
23174         system assemblies.  I was using the compiler directory instead of
23175         the library directory.
23176
23177 2002-02-13  Ravi Pratap  <ravi@ximian.com>
23178
23179         * expression.cs (BetterFunction): Put back in what Miguel commented out
23180         since it is the correct fix. The problem is elsewhere ;-)
23181
23182         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
23183         parameters of the parms method are themselves compatible or not !
23184
23185         (StandardConversionExists): Fix very dangerous bug where we were forgetting
23186         to check that a class implements an interface before saying that an implicit
23187         conversion was allowed. Use ImplementsInterface to do the checking.
23188
23189 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
23190
23191         * class.cs (Method.Define): Track whether we are an explicit
23192         implementation or not.  And only call DefineMethodOverride if we
23193         are an explicit implementation.
23194
23195         (Property.DefineMethod): Ditto.
23196
23197 2002-02-11  Ravi Pratap  <ravi@ximian.com>
23198
23199         * expression.cs (BetterFunction): Catch hideous bug which was
23200          preventing us from detecting ambiguous calls due to implicit casts i.e
23201         cs0121.
23202
23203 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
23204
23205         * support.cs (Pair): Remove un-needed method.  I figured why I was
23206         getting the error in cs-parser.jay, the variable in a foreach loop
23207         is readonly, and the compiler does not really treat this as a variable.
23208
23209         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
23210         instead of EQUALS in grammar.  
23211
23212         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
23213
23214         * expression.cs (Unary.DoResolve): Check whether the argument is
23215         managed or not.
23216
23217 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
23218
23219         * support.cs: Api for Pair to set a value.  Despite the fact that
23220         the variables are public the MS C# compiler refuses to compile
23221         code that accesses the field if the variable is part of a foreach
23222         statement. 
23223
23224         * statement.cs (Fixed): Begin implementation of the fixed
23225         statement.
23226
23227         (Block.AddVariable): Return the VariableInfo on success and null
23228         on failure instead of true/false. 
23229
23230         * cs-parser.jay (foreach): Catch errors on variables already
23231         defined (we were ignoring this value before) and properly unwind
23232         the block hierarchy
23233
23234         (fixed_statement): grammar for the fixed statement.
23235
23236 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
23237
23238         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
23239         pointer types to be incretemented.
23240
23241         (SizeOf): Implement.
23242
23243         * cs-parser.jay (pointer_member_access): Implement
23244         expr->IDENTIFIER production.
23245
23246         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
23247         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
23248         on safe contexts.
23249
23250         (Unary): Implement indirection.
23251
23252         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
23253         use in non-unsafe context).
23254
23255         (SimpleName.DoResolve): Check for pointers in field access on safe
23256         contexts. 
23257
23258         (Expression.LoadFromPtr): Factor the load-indirect code in this
23259         function.  This was duplicated in UnboxCast and ParameterReference
23260
23261 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
23262
23263         * expression.cs (ComposedCast): report an error if a pointer cast
23264         is used in a safe region.
23265
23266         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
23267         pointer type casts in unsafe context.
23268
23269         * codegen.cs (EmitContext): Set up IsUnsafe.
23270
23271         * cs-parser.jay (non_expression_type): Add productions for pointer
23272         casts. 
23273
23274         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
23275         code.  We should not use force into static mode if the method is
23276         not virtual.  Fixes bug in MIS
23277
23278         * statement.cs (Do.Emit, While.Emit, For.Emit,
23279         Statement.EmitBoolExpression): Add support to Do and While to
23280         propagate infinite loop as `I do return' semantics.
23281
23282         Improve the For case to also test for boolean constants.
23283
23284         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
23285         to the list of attributes we can add.
23286
23287         Remove `EmitContext' argument.
23288
23289         * class.cs (Method.Define): Apply parameter attributes.
23290         (Constructor.Define): Apply parameter attributes.
23291         (MethodCore.LabelParameters): Move here the core of labeling
23292         parameters. 
23293
23294         * support.cs (ReflectionParameters.ParameterModifier,
23295         InternalParameters.ParameterModifier): Use IsByRef on the type and
23296         only return the OUT bit for these parameters instead of in/out/ref
23297         flags.
23298
23299         This is because I miss-understood things.  The ParameterInfo.IsIn
23300         and IsOut represent whether the parameter has the [In] and [Out]
23301         attributes set.  
23302
23303 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
23304
23305         * ecore.cs (FieldExpr.Emit): Release temporaries.
23306
23307         * assign.cs (LocalTemporary.Release): new function.
23308
23309         * codegen.cs (EmitContext.GetTemporaryStorage,
23310         EmitContext.FreeTemporaryStorage): Rework the way we deal with
23311         temporary storage.  Now we can "put back" localbuilders when we
23312         are done with them
23313
23314 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
23315
23316         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
23317         need to make a copy of the variable to generate verifiable code.
23318
23319 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
23320
23321         * driver.cs: Compute dynamically the system directory.
23322
23323         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
23324         Slower, but more generally useful.  Used by the abstract
23325         registering implementation. 
23326
23327         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
23328         the rules for the special rule on Type/instances.  First check if
23329         we have the same name, and if so, try that special static path
23330         rather than the instance path.
23331
23332 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
23333
23334         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
23335         for, while and if.
23336
23337         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
23338         Enum, ValueType, Delegate or Array for non-corlib compiles.
23339
23340         * cs-tokenizer.cs: Catch long identifiers (645)
23341
23342         * typemanager.cs (IndexerPropetyName): Ravi never tested this
23343         piece of code.
23344
23345         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
23346         fix, we were returning too early, so we were not registering
23347         pending methods from abstract classes.
23348
23349         Do not register pending methods if the class is abstract.
23350
23351         * expression.cs (Conditional.DoResolve): Report circular implicit
23352         conversions when we neecd to compute it for conditional
23353         expressions. 
23354
23355         (Is.DoResolve): If the expression is always of the provided type,
23356         flag warning 183.  If the expression can not ever be of the
23357         provided type flag warning 184.
23358
23359         * class.cs: Catch 169 as well.
23360
23361         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
23362         read. 
23363
23364 2002-01-18  Nick Drochak  <ndrochak@gol.com>
23365
23366         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
23367
23368 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
23369
23370         * interface.cs: (PopulateMethod): Check for pointers being defined
23371         only if the unsafe context is active.
23372         (PopulateProperty): ditto.
23373         (PopulateIndexer): ditto.
23374
23375         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
23376         specified.  If pointers are present, make sure that they are
23377         present in an unsafe context.
23378         (Constructor, Constructor.Define): ditto.
23379         (Field, Field.Define): ditto.
23380         (Property, Property.Define): ditto.
23381         (Event, Event.Define): ditto.
23382
23383         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
23384         hashtable if there are classes or structs defined.
23385
23386         * expression.cs (LocalVariableReference.DoResolve): Simplify this
23387         code, as the constant resolution moved.
23388
23389         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
23390         the metadata, so we can flag error 133. 
23391
23392         * decl.cs (MemberCore.UnsafeOK): New function to test that a
23393         pointer is being declared in an unsafe context.
23394
23395 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
23396
23397         * modifiers.cs (Modifiers.Check): Require a Location argument.
23398         Report error 227 for Unsafe use.
23399
23400         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
23401
23402         * statement.cs (For.Emit): If the test is null, then report that
23403         we do `return', as we wont reach anything afterwards.
23404
23405         (Switch.SwitchGoverningType): Track the expression that matched
23406         the conversion.
23407
23408         * driver.cs: Allow negative numbers as an error code to flag.
23409
23410         * cs-parser.jay: Handle 1551.
23411
23412         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
23413
23414 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
23415
23416         * cs-parser.jay: Report 1518 (type declaration can only contain
23417         class, struct, interface, enum or delegate)
23418
23419         (switch_label): Report 1523 (keywords `case' or `default' must
23420         preced code)
23421
23422         (opt_switch_sections): Report 1522 (empty switch)
23423
23424         * driver.cs: Report 1515 (response file specified multiple times)
23425         Report 1516 (Source file specified multiple times).
23426
23427         * expression.cs (Argument.Resolve): Signal 1510
23428
23429         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
23430         access not allowed in static code)
23431
23432 2002-01-11  Ravi Pratap  <ravi@ximian.com>
23433
23434         * typemanager.cs (IsPointerType): Utility method which we are going
23435         to need a lot.
23436
23437         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
23438         the object type, so we take care of that.
23439
23440         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
23441
23442         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
23443         added to non-params parameters :-)
23444
23445         * typemanager.cs (CSharpName): Include 'void' type too. 
23446
23447         (void_ptr_type): Include in the set of core types.
23448
23449         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
23450         duplicating code.
23451
23452         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
23453         an unsafe context.
23454
23455         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
23456         completely forgotten about it.
23457
23458 2002-01-10  Ravi Pratap  <ravi@ximian.com>
23459
23460         * cs-parser.jay (pointer_type): Add. This begins our implementation
23461         of parsing rules for unsafe code.
23462
23463         (unsafe_statement): Implement.
23464
23465         (embedded_statement): Modify to include the above.
23466
23467         * statement.cs (Unsafe): Implement new class for unsafe blocks.
23468
23469         * codegen.cs (EmitContext.InUnsafe): Add. This determines
23470         if the current context is an unsafe one.
23471
23472         * cs-parser.jay (local_variable_pointer_type): Since local variable types
23473         are handled differently, we need separate rules for them.
23474
23475         (local_variable_declaration): Update to use local_variable_pointer_type
23476         to allow variable declarations of unmanaged pointer types.
23477
23478         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
23479         in unsafe contexts.
23480
23481         * ../errors/cs0214.cs : Add.
23482
23483 2002-01-16  Nick Drochak  <ndrochak@gol.com>
23484
23485         * makefile: remove 'response' file when cleaning.
23486
23487 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
23488
23489         * cs-parser.jay: Report 1524.
23490
23491 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
23492
23493         * typemanager.cs (RegisterMethod): drop checking if we have
23494         registered this from here
23495
23496 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
23497
23498         * class.cs (Method.EmitDestructor): Implement calling our base
23499         destructor. 
23500
23501         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
23502         value of InFinally.
23503
23504         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
23505         this routine and will wrap the call in a try/catch block.  Deal
23506         with the case.
23507
23508 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
23509
23510         * ecore.cs (Expression.MemberLookup): instead of taking a
23511         parameter `same_type' that was used to tell whether we could
23512         access private members we compute our containing type from the
23513         EmitContext.
23514
23515         (FieldExpr): Added partial support for volatile fields.  This does
23516         not work for volatile fields exposed from assemblies, as I can not
23517         figure out how to extract the modreq from it.
23518
23519         Updated all the source files to use this.
23520
23521         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
23522         because it is referenced by MemberLookup very often. 
23523
23524 2002-01-09  Ravi Pratap  <ravi@ximian.com>
23525
23526         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
23527         TypeBuilder.GetCustomAttributes to retrieve what we need.
23528
23529         Get rid of redundant default_member_attr_type as this is the same as
23530         default_member_type which already exists.
23531
23532         * interface.cs, attribute.cs : Update accordingly.
23533
23534 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
23535
23536         * typemanager.cs: Enable IndexerPropertyName again.  It does not
23537         work for TYpeBuilders though.  Ravi, can you please fix this?
23538
23539         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
23540
23541         * expression.cs (Argument.Emit): Handle the case of ref objects
23542         being passed to ref functions;  
23543
23544         (ParameterReference.EmitLoad): Loads the content of the pointer
23545         without dereferencing.
23546
23547 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
23548
23549         * cs-tokenizer.cs: Implemented the pre-processing expressions.
23550
23551 2002-01-08  Ravi Pratap  <ravi@ximian.com>
23552
23553         * class.cs (Indexer.DefineMethod): Incorporate the interface
23554         type in the name of the method if we are doing explicit interface
23555         implementation.
23556
23557         * expression.cs (ConversionExists): Remove as it is completely obsolete.
23558
23559         (BetterConversion): Fix extremely trivial bug where we were referring to
23560         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
23561         again !
23562
23563         * ../errors/bug16.cs : Add although we have fixed it.
23564
23565 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
23566
23567         * expression.cs (BaseIndexer): Begin implementation.
23568
23569         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
23570
23571         * cs-parser.jay (indexer_declarator): Use qualified_identifier
23572         production directly to remove a shift/reduce, and implement
23573         explicit interface implementation.
23574
23575         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
23576         after a floating point suffix.
23577
23578         * expression.cs (DoNumericPromotions): Improved the conversion for
23579         uint/uint.  If we have a constant, we avoid doing a typecast to a
23580         larger type.
23581
23582         * class.cs (Indexer): Implement explicit interface implementation
23583         for indexers.
23584
23585 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
23586
23587         * class.cs: make the default instance constructor public and hidebysig.
23588
23589 2001-01-03  Ravi Pratap  <ravi@ximian.com>
23590
23591         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
23592         so we can call it from elsewhere.
23593
23594         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
23595         we emit it internally if the class has a defined indexer; otherwise the user
23596         emits it by decorating the class definition with the DefaultMemberAttribute.
23597
23598         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
23599         attribute is not used on a type which defines an indexer.
23600
23601         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
23602         character when we skip whitespace.
23603
23604         * ../errors/cs0646.cs : Add.
23605
23606 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
23607
23608         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
23609         again. 
23610
23611         * makefile: Add practical target `mcs3.exe' which builds the third
23612         generation compiler. 
23613
23614         * expression.cs (New): Fix structures constructor calling.
23615
23616         * class.cs (Property, Method, Indexer): Emit Final flag on the
23617         method if we are an interface implementation and we are not
23618         abstract. 
23619
23620         * ecore.cs (PropertyExpr): New public field `IsBase', tells
23621         whether this property is referencing a `base' method.
23622
23623         * expression.cs (Invocation.EmitCall): take an extra argument:
23624         is_base, this is used to determine whether the `call' or
23625         `callvirt' opcode should be used.
23626
23627
23628         * delegate.cs: update EmitCall.
23629
23630         * class.cs (Method.Define): Set NewSlot for the cases where we are
23631         not implementing an interface method.
23632
23633         (Property.Define): ditto.
23634
23635 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
23636
23637         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
23638         'r'.  Allows mcs to parse itself fully.
23639
23640 2002-01-02  Ravi Pratap  <ravi@ximian.com>
23641
23642         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
23643         of the number of initializers that require the InitializeArray method.
23644
23645         (CheckIndices): Store the Expression in all cases - not the plain value. Also
23646         update the above field where necessary.
23647
23648         (MakeByteBlob): Update accordingly.
23649
23650         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
23651         greater than 2.
23652
23653         (EmitDynamicInitializers): Update in accordance with the new optimization.
23654
23655         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
23656         same OpCode applies.
23657
23658         * cs-parser.jay : Fix some glaring errors I introduced.
23659
23660 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
23661
23662         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
23663         so that we can check for name clashes there too.
23664
23665         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
23666         for interface indexers.
23667
23668         * interfaces.cs (Define): Emit the default member attribute.
23669
23670         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
23671         variable was being referred to while setting the value ;-)
23672
23673 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
23674
23675         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
23676         byte-by-byte information when we know the data is zero.
23677
23678         Make the block always a multiple of 4, because
23679         DefineInitializedData has a bug.
23680
23681         * assign.cs: Fix, we should assign from the temporary, not from
23682         the source. 
23683
23684         * expression.cs (MakeByteBlob): Fix my incorrect code.
23685
23686 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
23687
23688         * typemanager.cs (EnumToUnderlying): This function is used to get
23689         the underlying type from an enumeration, because it does not
23690         always work. 
23691
23692         * constant.cs: Use the I4_S form for values between -128 and 127.
23693
23694         * statement.cs (Block.LookupLabel): Looks up a label.
23695         (Block): Drop support for labeled blocks.
23696
23697         (LabeledStatement): New kind of statement that represents a label
23698         only.
23699
23700         (Goto): Finally implement this bad boy.
23701
23702         * cs-parser.jay: Update to reflect new mechanism to implement
23703         labels.
23704
23705 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
23706
23707         * codegen.cs (EmitContext.This): a codegen property that keeps the
23708         a single instance of this instead of creating many different this
23709         instances. 
23710
23711         * delegate.cs (Delegate.DoResolve): Update to use the property;
23712
23713         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
23714
23715         * expression.cs (BaseAccess.DoResolve): Ditto.
23716
23717 2001-12-29  Ravi Pratap  <ravi@ximian.com>
23718
23719         * typemanager.cs (methodimpl_attr_type): Add to hold the type
23720         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
23721
23722         (InitCoreTypes): Update accordingly.
23723
23724         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
23725         so we can quickly store the state.
23726
23727         (ApplyAttributes): Set the correct implementation flags
23728         for InternalCall methods.
23729
23730 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
23731
23732         * expression.cs (EmitCall): if a method is not virtual, then do
23733         not use callvirt on it.
23734
23735         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
23736         user defined stuff) requires the use of stobj, which takes an
23737         address on the stack instead of an array and an index.  So emit
23738         the Ldelema operation for it.
23739
23740         (EmitStoreOpcode): Use stobj for valuetypes.
23741
23742         (UnaryMutator.EmitCode): Use the right 1 value depending on
23743         whether we are dealing with int64/uint64, float or doubles.
23744
23745         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
23746         constructors that I implemented last night.
23747
23748         (Constructor.IsDefault): Fix to work properly for static
23749         constructors.
23750
23751         * cs-parser.jay (CheckDef): report method signature errors.
23752         Update error number 103 to be 132.
23753
23754         * decl.cs: New AdditionResult enumeration value: MethodExists.
23755         Although we do this check for methods later on in the semantic
23756         analysis, catching repeated default constructors is so easy that
23757         we catch these here. 
23758
23759         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
23760         promotions code.
23761
23762         (ParameterReference.EmitAssign, Emit): handle
23763         bools as bytes.
23764
23765         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
23766         (ArrayAccess.EmitStoreOpcode): ditto.
23767
23768         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
23769
23770         * expression.cs (MakeByteBlob): Complete all the missing types
23771         (uint, short, ushort, byte, sbyte)
23772
23773         * class.cs: Only init instance field initializers on instance
23774         constructors. 
23775
23776         Rename `constructors' to instance_constructors. 
23777
23778         (TypeContainer.AddConstructor): Only add constructors to the list
23779         if it is not static.
23780
23781         Make sure that we handle default_static_constructor independently
23782         everywhere where we handle instance_constructors
23783
23784 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
23785
23786         * class.cs: Do not lookup or create a base initializer for a
23787         static constructor.
23788
23789         (ConstructorInitializer.Resolve): use the proper type to lookup
23790         for constructors.
23791
23792         * cs-parser.jay: Report error 1585 (modifiers between type and name).
23793
23794         * enum.cs, interface.cs: Remove CloseType, this is taken care by
23795         in DeclSpace. 
23796
23797         * decl.cs: CloseType is now an virtual method, the default
23798         implementation just closes this type.
23799
23800 2001-12-28  Ravi Pratap  <ravi@ximian.com>
23801
23802         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
23803         to PreserveSig by default. Also emit HideBySig on such methods.
23804
23805         Basically, set the defaults to standard values.
23806
23807         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
23808         argument, if candidate is better, it can't be worse than the best !
23809
23810         (Invocation): Re-write bits to differentiate between methods being
23811         applicable in their expanded form and their normal form - for params
23812         methods of course.
23813
23814         Get rid of use_standard everywhere as only standard conversions are allowed
23815         in overload resolution. 
23816
23817         More spec conformance.
23818
23819 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
23820
23821         * driver.cs: Add --timestamp, to see where the compiler spends
23822         most of its time.
23823
23824         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
23825         `this' in static code.
23826
23827         (SimpleName.DoResolve): Implement in terms of a helper function
23828         that allows static-references to be passed upstream to
23829         MemberAccess.
23830
23831         (Expression.ResolveWithSimpleName): Resolve specially simple
23832         names when called by MemberAccess to implement the special
23833         semantics. 
23834
23835         (Expression.ImplicitReferenceConversion): Handle conversions from
23836         Null to reference types before others, as Null's type is
23837         System.Object. 
23838
23839         * expression.cs (Invocation.EmitCall): Handle the special case of
23840         calling methods declared on a reference type from a ValueType
23841         (Base classes System.Object and System.Enum)
23842
23843         (MemberAccess.Resolve): Only perform lookups on Enumerations if
23844         the left hand side is a TypeExpr, not on every enumeration. 
23845
23846         (Binary.Resolve): If types are reference types, then do a cast to
23847         object on operators != and == of both arguments.
23848
23849         * typemanager.cs (FindMembers): Extract instance and static
23850         members if requested.
23851
23852         * interface.cs (PopulateProperty): Use void_type instead of null
23853         as the return type for the setter method.
23854
23855         (PopulateIndexer): ditto.
23856
23857 2001-12-27  Ravi Pratap  <ravi@ximian.com>
23858
23859         * support.cs (ReflectionParameters): Fix minor bug where we
23860         were examining the wrong parameter for the ParamArray attribute.
23861
23862         Cope with requests for the type of the parameter at position
23863         greater than the params parameter's. We now return the element
23864         type of the params array as that makes more sense.
23865
23866         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
23867         accordingly as we no longer have to extract the element type
23868         ourselves.
23869
23870         (Invocation.OverloadResolve): Update.
23871
23872 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
23873
23874         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
23875         against IEnumerator, test whether the return value is a descendant
23876         of the IEnumerator interface.
23877
23878         * class.cs (Indexer.Define): Use an auxiliary method to implement
23879         the other bits of the method definition.  Begin support for
23880         explicit interface implementation.
23881
23882         (Property.DefineMethod): Use TypeManager.void_type instead of null
23883         for an empty return value.
23884
23885 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
23886
23887         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
23888         dealing with a FieldExpr which is composed of a FieldBuilder, in
23889         the code path we did extract the constant, but we should have
23890         obtained the underlying value to be able to cast it (otherwise we
23891         end up in an infinite loop, this is what Ravi was running into).
23892
23893         (ArrayCreation.UpdateIndices): Arrays might be empty.
23894
23895         (MemberAccess.ResolveMemberAccess): Add support for section
23896         14.5.4.1 that deals with the special case of E.I when E is a type
23897         and something else, that I can be a reference to a static member.
23898
23899         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
23900         handle a particular array type to create byte blobs, it is just
23901         something we dont generate byteblobs for.
23902
23903         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
23904         arguments. 
23905
23906         * location.cs (Push): remove the key from the hashtable that we
23907         are about to add.   This happens for empty files.
23908
23909         * driver.cs: Dispose files after we have parsed them.
23910
23911         (tokenize): new function that only runs the tokenizer on its
23912         input, for speed testing.
23913
23914 2001-12-26  Ravi Pratap  <ravi@ximian.com>
23915
23916         * class.cs (Event.Define): Define the private field only if there
23917         are no accessors defined.
23918
23919         * expression.cs (ResolveMemberAccess): If there is no associated
23920         field with the event, that means we have an event defined with its
23921         own accessors and we should flag error cs0070 since transforming
23922         ourselves into a field is not valid in that case.
23923
23924         * ecore.cs (SimpleName.DoResolve): Same as above.
23925
23926         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
23927         and charset to sane values.
23928
23929 2001-12-25  Ravi Pratap  <ravi@ximian.com>
23930
23931         * assign.cs (DoResolve): Perform check on events only if they 
23932         are being accessed outside the declaring type.
23933
23934         * cs-parser.jay (event_declarations): Update rules to correctly
23935         set the type of the implicit parameter etc.
23936
23937         (add_accessor, remove_accessor): Set current local parameters.
23938
23939         * expression.cs (Binary): For delegate addition and subtraction,
23940         cast the return value from the method into the appropriate delegate
23941         type.
23942
23943 2001-12-24  Ravi Pratap  <ravi@ximian.com>
23944
23945         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
23946         of these as the workaround is unnecessary.
23947
23948         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
23949         delegate data - none of that is needed at all.
23950
23951         Re-write bits to extract the instance expression and the delegate method
23952         correctly.
23953
23954         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
23955         on delegates too.
23956
23957         * attribute.cs (ApplyAttributes): New method to take care of common tasks
23958         of attaching attributes instead of duplicating code everywhere.
23959
23960         * everywhere : Update code to do attribute emission using the above method.
23961
23962 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
23963
23964         * expression.cs (IsParamsMethodApplicable): if there are not
23965         parameters, return immediately.
23966
23967         * ecore.cs: The 0 literal can be implicity converted to an enum
23968         type. 
23969
23970         (SimpleName.DoResolve): First lookup the type, then lookup the
23971         members. 
23972
23973         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
23974         want to get its address.  If the InstanceExpression is not
23975         addressable, store the result in a temporary variable, then get
23976         the address of it.
23977
23978         * codegen.cs: Only display 219 errors on warning level or above. 
23979
23980         * expression.cs (ArrayAccess): Make it implement the
23981         IMemoryLocation interface.
23982
23983         (Binary.DoResolve): handle the operator == (object a, object b)
23984         and operator != (object a, object b) without incurring into a
23985         BoxedCast (because 5 != o should never be performed).
23986
23987         Handle binary enumerator operators.
23988
23989         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
23990         value type, otherwise use Ldelem_ref.
23991
23992         Use precomputed names;
23993
23994         (AddressOf): Implement address of
23995
23996         * cs-parser.jay (labeled_statement): Fix recursive block
23997         addition by reworking the production.
23998
23999         * expression.cs (New.DoEmit): New has a special case:
24000                 
24001                  If we are dealing with a ValueType, we have a few
24002                  situations to deal with:
24003                 
24004                     * The target of New is a ValueType variable, that is
24005                       easy, we just pass this as the variable reference
24006                 
24007                     * The target of New is being passed as an argument,
24008                       to a boxing operation or a function that takes a
24009                       ValueType.
24010                 
24011                       In this case, we need to create a temporary variable
24012                       that is the argument of New.
24013
24014
24015 2001-12-23  Ravi Pratap  <ravi@ximian.com>
24016
24017         * rootcontext.cs (LookupType): Check that current_type is not null before
24018         going about looking at nested types.
24019
24020         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
24021         not implement the IAssignMethod interface any more.
24022
24023         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
24024         where we tranform them into FieldExprs if they are being resolved from within
24025         the declaring type.
24026
24027         * ecore.cs (SimpleName.DoResolve): Do the same here.
24028
24029         * assign.cs (DoResolve, Emit): Clean up code considerably. 
24030
24031         * ../errors/bug10.cs : Add.
24032
24033         * ../errors/cs0070.cs : Add.
24034
24035         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
24036
24037         * assign.cs : Get rid of EventIsLocal everywhere.
24038
24039 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
24040
24041         * ecore.cs (ConvertIntLiteral): finished the implementation.
24042
24043         * statement.cs (SwitchLabel): Convert the value we are using as a
24044         key before looking up the table.
24045
24046 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
24047
24048         * codegen.cs (EmitTopBlock): Require a Location argument now.
24049
24050         * cs-parser.jay (constructor_declarator): We need to setup
24051         current_local_parameters before we parse the
24052         opt_constructor_initializer, to allow the variables to be bound
24053         to the constructor arguments.
24054
24055         * rootcontext.cs (LookupType): First lookup nested classes in our
24056         class and our parents before we go looking outside our class.
24057
24058         * expression.cs (ConstantFold): Extract/debox the values at the
24059         beginnning. 
24060
24061         * rootcontext.cs (EmitCode): Resolve the constants first before we
24062         resolve the types.  This is not really needed, but it helps debugging.
24063
24064         * statement.cs: report location.
24065
24066         * cs-parser.jay: pass location to throw statement.
24067
24068         * driver.cs: Small bug fix.
24069
24070         * report.cs: Updated format to be 4-zero filled digits.
24071
24072 2001-12-22  Ravi Pratap  <ravi@ximian.com>
24073
24074         * expression.cs (CheckIndices): Fix minor bug where the wrong
24075         variable was being referred to ;-)
24076
24077         (DoEmit): Do not call EmitStaticInitializers when the 
24078         underlying type is System.Object.
24079
24080 2001-12-21  Ravi Pratap  <ravi@ximian.com>
24081
24082         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
24083         and do the usual workaround for SRE.
24084
24085         * class.cs (MyEventBuilder.EventType): New member to get at the type
24086         of the event, quickly.
24087
24088         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
24089
24090         * assign.cs (Assign.DoResolve): Handle the case when the target
24091         is an EventExpr and perform the necessary checks.
24092
24093         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
24094         interface.
24095
24096         (SimpleName.MemberStaticCheck): Include check for EventExpr.
24097
24098         (EventExpr): Set the type in the constructor itself since we 
24099         are meant to be born fully resolved.
24100
24101         (EventExpr.Define): Revert code I wrote earlier.
24102                 
24103         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
24104         instance expression is null. The instance expression is a This in that case
24105         or a null, depending on whether it is a static method or not.
24106
24107         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
24108         refers to more than one method.
24109
24110         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
24111         and accordingly flag errors.
24112
24113 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
24114
24115         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
24116
24117 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
24118
24119         * location.cs (ToString): Provide useful rutine.
24120
24121 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
24122
24123         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
24124         objects, return the actual integral boxed.
24125
24126         * statement.cs (SwitchLabel): define an ILLabel for each
24127         SwitchLabel. 
24128
24129         (Switch.CheckSwitch): If the value is a Literal, extract
24130         the underlying literal.
24131
24132         Also in the unused hashtable we had, add the SwitchLabel so we can
24133         quickly look this value up.
24134
24135         * constant.cs: Implement a bunch of new constants.  Rewrite
24136         Literal based on this.  Made changes everywhere to adapt to this.
24137
24138         * expression.cs (Expression.MakeByteBlob): Optimize routine by
24139         dereferencing array only once, and also copes with enumrations.
24140
24141         bytes are two bytes wide, not one.
24142
24143         (Cast): Perform constant conversions.
24144
24145         * ecore.cs (TryImplicitIntConversion): Return literals instead of
24146         wrappers to the literals here.
24147
24148         * expression.cs (DoNumericPromotions): long literals can converted
24149         to ulong implicity (this is taken care of elsewhere, but I was
24150         missing this spot).
24151
24152         * ecore.cs (Expression.Literalize): Make the return type Literal,
24153         to improve type checking.
24154
24155         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
24156
24157 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
24158
24159         * literal.cs: Revert code from ravi that checked the bounds.  The
24160         bounds are sane by the definition of the type itself. 
24161
24162         * typemanager.cs: Fix implementation of ImplementsInterface.  We
24163         need to actually look up in our parent hierarchy for interfaces
24164         implemented. 
24165
24166         * const.cs: Use the underlying type for enumerations
24167
24168         * delegate.cs: Compute the basename for the delegate creation,
24169         that should fix the delegate test case, and restore the correct
24170         Type Lookup semantics in rootcontext
24171
24172         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
24173         referencing a nested type with the Reflection API is using the "+"
24174         sign. 
24175
24176         * cs-parser.jay: Do not require EOF token at the end.
24177
24178 2001-12-20  Ravi Pratap  <ravi@ximian.com>
24179
24180         * rootcontext.cs (LookupType): Concatenate type names with
24181         a '.' instead of a '+' The test suite passes again.
24182
24183         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
24184         field of the enumeration.
24185
24186         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
24187         the case when the member is an EventExpr.
24188
24189         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
24190         static has an associated instance expression.
24191
24192         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
24193
24194         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
24195
24196         * class.cs (Event.Define): Register event and perform appropriate checks
24197         for error #111.
24198
24199         We define the Add and Remove methods even if the use provides none because
24200         in that case, we provide default implementations ourselves.
24201
24202         Define a private field of the type of the event. This is done by the CSC compiler
24203         and we should be doing it too ;-)
24204
24205         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
24206         More methods we use in code we generate.
24207
24208         (multicast_delegate_type, delegate_type): Two separate types since the distinction
24209         is important.
24210
24211         (InitCoreTypes): Update accordingly for the above.
24212
24213         * class.cs (Event.Emit): Generate code for default accessors that we provide
24214
24215         (EmitDefaultMethod): Do the job in the above.
24216
24217         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
24218         appropriate place.
24219
24220 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
24221
24222         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
24223         builders even if we were missing one.
24224
24225         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
24226         pass the Basename as our class name instead of the Name.  The
24227         basename will be correctly composed for us.
24228
24229         * parameter.cs (Paramters): Now takes a Location argument.
24230
24231         * decl.cs (DeclSpace.LookupType): Removed convenience function and
24232         make all the code call directly LookupType in RootContext and take
24233         this chance to pass the Location information everywhere.
24234
24235         * Everywhere: pass Location information.
24236
24237 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
24238
24239         * class.cs (Constructor.Define): Updated way of detecting the
24240         length of the parameters.
24241
24242         (TypeContainer.DefineType): Use basename as the type name for
24243         nested types.
24244
24245         (TypeContainer.Define): Do not recursively define types here, as
24246         definition is taken care in order by the RootContext.
24247
24248         * tree.cs: Keep track of namespaces in a per-file basis.
24249
24250         * parameter.cs (Parameter.ComputeSignature): Update to use
24251         DeclSpace. 
24252
24253         (Parameters.GetSignature): ditto.
24254
24255         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
24256         instead of a TypeContainer.
24257
24258         (Interface.SemanticAnalysis): Use `this' instead of our parent to
24259         resolve names.  Because we need to be resolve in our context, not
24260         our parents.
24261
24262         * driver.cs: Implement response files.
24263
24264         * class.cs (TypeContainer.DefineType): If we are defined, do not
24265         redefine ourselves.
24266
24267         (Event.Emit): Emit the code for add/remove handlers.
24268         (Event.Define): Save the MethodBuilders for add/remove.
24269
24270         * typemanager.cs: Use pair here too.
24271
24272         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
24273         DictionaryEntry requires the first argument to be non-null.  
24274
24275         (enum_declaration): Compute full name for registering the
24276         enumeration.
24277
24278         (delegate_declaration): Instead of using
24279         formal_parameter_list, use opt_formal_parameter_list as the list
24280         can be empty.
24281
24282         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
24283         (EventParsing): New property that controls whether `add' and
24284         `remove' are returned as tokens or identifiers (for events);
24285
24286 2001-12-19  Ravi Pratap  <ravi@ximian.com>
24287
24288         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
24289         use MyEventBuilder only and let it wrap the real builder for us.
24290
24291         (MyEventBuilder): Revamp constructor etc.
24292
24293         Implement all operations that we perform on EventBuilder in precisely the same
24294         way here too.
24295
24296         (FindMembers): Update to use the EventBuilder member.
24297
24298         (Event.Emit): Update accordingly.
24299
24300 2001-12-18  Ravi Pratap  <ravi@ximian.com>
24301
24302         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
24303         by calling the appropriate methods.
24304
24305         (GetCustomAttributes): Make stubs as they cannot possibly do anything
24306         useful.
24307
24308         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
24309
24310 2001-12-17  Ravi Pratap  <ravi@ximian.com>
24311
24312         * delegate.cs (Delegate.Populate): Check that the return type
24313         and various parameters types are indeed accessible.
24314
24315         * class.cs (Constructor.Define): Same here.
24316
24317         (Field.Define): Ditto.
24318
24319         (Event.Define): Ditto.
24320
24321         (Operator.Define): Check that the underlying Method defined itself
24322         correctly - so it's MethodBuilder should not be null.
24323
24324         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
24325         expression happens to be null.
24326
24327         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
24328         members but as of now we don't seem to be able to do anything really useful with it.
24329
24330         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
24331         not the EventBuilder.
24332
24333 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
24334
24335         * cs-tokenizer.cs: Add support for defines.
24336         Add support for #if, #elif, #else, #endif
24337
24338         (eval_var): evaluates a variable.
24339         (eval): stubbed for evaluating functions.
24340
24341         * cs-parser.jay: Pass the defines information
24342
24343         * driver.cs: Add --define command line option.
24344
24345         * decl.cs: Move MemberCore here.
24346
24347         Make it the base class for DeclSpace.  This allows us to catch and
24348         report 108 and 109 for everything now.
24349
24350         * class.cs (TypeContainer.Define): Extract all the members
24351         before populating and emit the warning 108 (new keyword required
24352         to override) instead of having each member implement this.
24353
24354         (MemberCore.Define): New abstract method, we will be using this in
24355         the warning reporting engine in Populate.
24356
24357         (Operator.Define): Adjust to new MemberCore protocol. 
24358
24359         * const.cs (Const): This does not derive from Expression, it is a
24360         temporary object we use to create fields, it is a MemberCore. 
24361
24362         * class.cs (Method.Define): Allow the entry point to be in a
24363         specific class.
24364
24365         * driver.cs: Rewrite the argument handler to clean it up a bit.
24366
24367         * rootcontext.cs: Made it just an auxiliary namespace feature by
24368         making everything static.
24369
24370         * driver.cs: Adapt code to use RootContext type name instead of
24371         instance variable.
24372
24373         * delegate.cs: Remove RootContext argument.
24374
24375         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
24376         argument. 
24377
24378         * class.cs (Event.Define): The lookup can fail.
24379
24380         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
24381
24382         * expression.cs: Resolve the this instance before invoking the code.
24383
24384 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
24385
24386         * cs-parser.jay: Add a production in element_access that allows
24387         the thing to become a "type" reference.  This way we can parse
24388         things like "(string [])" as a type.
24389
24390         Note that this still does not handle the more complex rules of
24391         casts. 
24392
24393
24394         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
24395
24396         * ecore.cs: (CopyNewMethods): new utility function used to
24397         assemble the list of methods from running FindMembers.
24398
24399         (MemberLookup): Rework FindMembers so that 
24400
24401 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
24402
24403         * class.cs (TypeContainer): Remove Delegates who fail to be
24404         defined.
24405
24406         * delegate.cs (Populate): Verify that we dont get null return
24407         values.   TODO: Check for AsAccessible.
24408
24409         * cs-parser.jay: Use basename to emit error 574 (destructor should
24410         have the same name as container class), not the full name.
24411
24412         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
24413         possible representation.  
24414
24415         Also implements integer type suffixes U and L.
24416
24417 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
24418
24419         * expression.cs (ArrayCreation.DoResolve): We need to do the
24420         argument resolution *always*.
24421
24422         * decl.cs: Make this hold the namespace.  Hold the root context as
24423         well.
24424         (LookupType): Move here.
24425
24426         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
24427
24428         * location.cs (Row, Name): Fixed the code, it was always returning
24429         references to the first file.
24430
24431         * interface.cs: Register properties defined through interfaces.
24432
24433         * driver.cs: Add support for globbing on the command line
24434
24435         * class.cs (Field): Make it derive from MemberCore as well.
24436         (Event): ditto.
24437
24438 2001-12-15  Ravi Pratap  <ravi@ximian.com>
24439
24440         * class.cs (Event::Define): Check that the type of the event is a delegate
24441         type else flag error #66.
24442
24443         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
24444         same.
24445
24446         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
24447         values of EntryPoint, CharSet etc etc.
24448
24449         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
24450
24451         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
24452         be null and we should ignore this. I am not sure if this is really clean. Apparently,
24453         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
24454         which needs this to do its work.
24455
24456         * ../errors/cs0066.cs : Add.
24457
24458 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
24459
24460         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
24461         helper functions.
24462
24463         * class.cs: (MethodSignature.MethodSignature): Removed hack that
24464         clears out the parameters field.
24465         (MemberSignatureCompare): Cleanup
24466
24467         (MemberCore): New base class used to share code between MethodCore
24468         and Property.
24469
24470         (RegisterRequiredImplementations) BindingFlags.Public requires
24471         either BindingFlags.Instace or Static.  Use instance here.
24472
24473         (Property): Refactored code to cope better with the full spec.
24474
24475         * parameter.cs (GetParameterInfo): Return an empty array instead
24476         of null on error.
24477
24478         * class.cs (Property): Abstract or extern properties have no bodies.
24479
24480         * parameter.cs (GetParameterInfo): return a zero-sized array.
24481
24482         * class.cs (TypeContainer.MethodModifiersValid): Move all the
24483         method modifier validation to the typecontainer so we can reuse
24484         this on properties.
24485
24486         (MethodCore.ParameterTypes): return an empty sized array of types.
24487
24488         (Property.Define): Test property modifier validity.
24489
24490         Add tests for sealed/override too.
24491
24492         (Method.Emit): abstract or extern methods have no bodies.
24493
24494 2001-12-14  Ravi Pratap  <ravi@ximian.com>
24495
24496         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
24497         thing.
24498
24499         (Method::Define, ::Emit): Modify accordingly.
24500
24501         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
24502
24503         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
24504
24505         * makefile: Pass in /unsafe.
24506
24507 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
24508
24509         * class.cs (MakeKey): Kill routine.
24510
24511         * class.cs (TypeContainer.Define): Correctly define explicit
24512         method implementations (they require the full interface name plus
24513         the method name).
24514
24515         * typemanager.cs: Deply the PtrHashtable here and stop using the
24516         lame keys.  Things work so much better.
24517
24518         This of course broke everyone who depended on `RegisterMethod' to
24519         do the `test for existance' test.  This has to be done elsewhere.
24520
24521         * support.cs (PtrHashtable): A hashtable that avoid comparing with
24522         the object stupid Equals method (because, that like fails all over
24523         the place).  We still do not use it.
24524
24525         * class.cs (TypeContainer.SetRequiredInterface,
24526         TypeContainer.RequireMethods): Killed these two routines and moved
24527         all the functionality to RegisterRequiredImplementations.
24528
24529         (TypeContainer.RegisterRequiredImplementations): This routine now
24530         registers all the implementations required in an array for the
24531         interfaces and abstract methods.  We use an array of structures
24532         which can be computed ahead of time to reduce memory usage and we
24533         also assume that lookups are cheap as most classes will not
24534         implement too many interfaces.
24535
24536         We also avoid creating too many MethodSignatures.
24537
24538         (TypeContainer.IsInterfaceMethod): Update and optionally does not
24539         clear the "pending" bit if we find that there are problems with
24540         the declaration.
24541
24542         (TypeContainer.VerifyPendingMethods): Update to report errors of
24543         methods that look like implementations but are not.
24544
24545         (TypeContainer.Define): Add support for explicit interface method
24546         implementation. 
24547
24548 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
24549
24550         * typemanager.cs: Keep track of the parameters here instead of
24551         being a feature of the TypeContainer.
24552
24553         * class.cs: Drop the registration of parameters here, as
24554         InterfaceMethods are also interface declarations.
24555
24556         * delegate.cs: Register methods with the TypeManager not only with
24557         the TypeContainer.  This code was buggy.
24558
24559         * interface.cs: Full registation here.
24560
24561 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
24562
24563         * expression.cs: Remove reducer for binary expressions, it can not
24564         be done this way.
24565
24566         * const.cs: Put here the code that used to go into constant.cs
24567
24568         * constant.cs: Put here the code for constants, this is a new base
24569         class for Literals.
24570
24571         * literal.cs: Make Literal derive from Constant.
24572
24573 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
24574
24575         * statement.cs (Return.Emit): Report error 157 if the user
24576         attempts to return from a finally block.
24577
24578         (Return.Emit): Instead of emitting a return, jump to the end of
24579         the function.
24580
24581         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
24582         LocalBuilder to store the result of the function.  ReturnLabel is
24583         the target where we jump.
24584
24585
24586 2001-12-09  Radek Doulik  <rodo@ximian.com>
24587
24588         * cs-parser.jay: remember alias in current namespace
24589
24590         * ecore.cs (SimpleName::DoResolve): use aliases for types or
24591         namespaces
24592
24593         * class.cs (LookupAlias): lookup alias in my_namespace
24594
24595         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
24596         aliases hashtable
24597         (LookupAlias): lookup alias in this and if needed in parent
24598         namespaces
24599
24600 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
24601
24602         * support.cs: 
24603
24604         * rootcontext.cs: (ModuleBuilder) Made static, first step into
24605         making things static.  I need this to avoid passing the
24606         TypeContainer when calling ParameterType.
24607
24608         * support.cs (InternalParameters.ParameterType): Remove ugly hack
24609         that did string manipulation to compute the type and then call
24610         GetType.  Use Parameter.ParameterType instead.
24611
24612         * cs-tokenizer.cs: Consume the suffix for floating values.
24613
24614         * expression.cs (ParameterReference): figure out whether this is a
24615         reference parameter or not.  Kill an extra variable by computing
24616         the arg_idx during emission.
24617
24618         * parameter.cs (Parameters.GetParameterInfo): New overloaded
24619         function that returns whether a parameter is an out/ref value or not.
24620
24621         (Parameter.ParameterType): The type of the parameter (base,
24622         without ref/out applied).
24623
24624         (Parameter.Resolve): Perform resolution here.
24625         (Parameter.ExternalType): The full type (with ref/out applied).
24626
24627         * statement.cs (Using.Emit, Using.EmitExpression): Implement
24628         support for expressions on the using statement.
24629
24630 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
24631
24632         * statement.cs (Using.EmitLocalVariableDecls): Split the
24633         localvariable handling of the using statement.
24634
24635         (Block.EmitMeta): Keep track of variable count across blocks.  We
24636         were reusing slots on separate branches of blocks.
24637
24638         (Try.Emit): Emit the general code block, we were not emitting it. 
24639
24640         Check the type of the declaration to be an IDisposable or
24641         something that can be implicity converted to it. 
24642
24643         Emit conversions if required.
24644
24645         * ecore.cs (EmptyExpression): New utility class.
24646         (Expression.ImplicitConversionExists): New utility function.
24647
24648 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
24649
24650         * statement.cs (Using): Implement.
24651
24652         * expression.cs (LocalVariableReference): Support read only variables.
24653
24654         * statement.cs: Remove the explicit emit for the Leave opcode.
24655         (VariableInfo): Add a readonly field.
24656
24657 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
24658
24659         * ecore.cs (ConvCast): new class used to encapsulate the various
24660         explicit integer conversions that works in both checked and
24661         unchecked contexts.
24662
24663         (Expression.ConvertNumericExplicit): Use new ConvCast class to
24664         properly generate the overflow opcodes.
24665
24666 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
24667
24668         * statement.cs: The correct type for the EmptyExpression is the
24669         element_type, not the variable type.  Ravi pointed this out.
24670
24671 2001-12-04  Ravi Pratap  <ravi@ximian.com>
24672
24673         * class.cs (Method::Define): Handle PInvoke methods specially
24674         by using DefinePInvokeMethod instead of the usual one.
24675
24676         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
24677         above to do the task of extracting information and defining the method.
24678
24679 2001-12-04  Ravi Pratap  <ravi@ximian.com>
24680
24681         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
24682         of the condition for string type.
24683
24684         (Emit): Move that here. 
24685
24686         (ArrayCreation::CheckIndices): Keep string literals in their expression
24687         form.
24688
24689         (EmitDynamicInitializers): Handle strings appropriately.
24690
24691 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
24692
24693         * codegen.cs (EmitContext): Replace multiple variables with a
24694         single pointer to the current Switch statement.
24695
24696         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
24697         EmitContext.
24698
24699 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
24700
24701         * statement.cs 
24702
24703         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
24704         default'.
24705
24706         (Foreach.Emit): Foreach on arrays was not setting
24707         up the loop variables (for break/continue).
24708
24709         (GotoCase): Semi-implented.
24710
24711 2001-12-03  Ravi Pratap  <ravi@ximian.com>
24712
24713         * attribute.cs (CheckAttribute): Handle system attributes by using
24714         Attribute.GetAttributes to examine information we need.
24715
24716         (GetValidPlaces): Same here.
24717
24718         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
24719
24720         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
24721
24722         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
24723
24724         (Method::Define): Set appropriate flags if we have a DllImport attribute.
24725
24726         (Method::Emit): Handle the case when we are a PInvoke method.
24727
24728 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
24729
24730         * expression.cs: Use ResolveWithSimpleName on compound names.
24731
24732 2001-12-02  Ravi Pratap  <ravi@ximian.com>
24733
24734         * constant.cs (EmitConstant): Make sure we resolve the associated expression
24735         before trying to reduce it.
24736
24737         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
24738
24739         * constant.cs (LookupConstantValue): Implement.
24740
24741         (EmitConstant): Use the above in emitting the constant.
24742
24743         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
24744         that are user-defined by doing a LookupConstantValue on them.
24745
24746         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
24747         too, like above.
24748
24749 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
24750
24751         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
24752
24753         (BaseAccess.DoResolve): Implement.
24754
24755         (MemberAccess.DoResolve): Split this routine into a
24756         ResolveMemberAccess routine that can be used independently
24757
24758 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
24759
24760         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
24761         As that share bits of the implementation.  Is returns a boolean,
24762         while As returns the Type that is being probed.
24763
24764 2001-12-01  Ravi Pratap  <ravi@ximian.com>
24765
24766         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
24767         instead of a Literal - much easier.
24768
24769         (EnumInTransit): Remove - utterly useless :-)
24770
24771         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
24772
24773         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
24774
24775         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
24776         chain when we have no associated expression.
24777
24778 2001-11-30  Ravi Pratap  <ravi@ximian.com>
24779
24780         * constant.cs (Define): Use Location while reporting the errror.
24781
24782         Also emit a warning when 'new' is used and there is no inherited
24783         member to hide.
24784
24785         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
24786         populated.
24787
24788         (LookupEnumValue): Implement to lookup an enum member's value and define it
24789         if necessary.
24790
24791         (Populate): Re-write accordingly to use the above routine.
24792
24793 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
24794
24795         * expression.cs (This): Fix prototype for DoResolveLValue to
24796         override the base class DoResolveLValue.
24797
24798         * cs-parser.cs: Report errors cs574 and cs575 (destructor
24799         declarations) 
24800
24801         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
24802         (we need to load the address of the field here).  This fixes
24803         test-22. 
24804
24805         (FieldExpr.DoResolveLValue): Call the DoResolve
24806         function to initialize the Instance expression.
24807
24808         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
24809         correctly the GetEnumerator operation on a value type.
24810
24811         * cs-parser.jay: Add more simple parsing error catches.
24812
24813         * statement.cs (Switch): Add support for string switches.
24814         Handle null specially.
24815
24816         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
24817
24818 2001-11-28  Ravi Pratap  <ravi@ximian.com>
24819
24820         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
24821
24822         (declare_local_constant): New helper function.
24823
24824         * statement.cs (AddConstant): Keep a separate record of constants
24825
24826         (IsConstant): Implement to determine if a variable is a constant.
24827
24828         (GetConstantExpression): Implement.
24829
24830         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
24831
24832         * statement.cs (IsVariableDefined): Re-write.
24833
24834 2001-11-27  Ravi Pratap  <ravi@ximian.com>
24835
24836         * class.cs (TypeContainer::FindMembers): Look for constants
24837         in the case when we are looking for MemberTypes.Field
24838
24839         * expression.cs (MemberAccess::DoResolve): Check that in the
24840         case we are a FieldExpr and a Literal, we are not being accessed
24841         by an instance reference.
24842
24843         * cs-parser.jay (local_constant_declaration): Implement.
24844
24845         (declaration_statement): Implement for constant declarations.
24846
24847 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
24848
24849         * statement.cs (Switch): Catch double defaults.
24850
24851         (Switch): More work on the switch() statement
24852         implementation.  It works for integral values now, need to finish
24853         string support.
24854
24855
24856 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
24857
24858         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
24859         integer literals into other integer literals.  To be used by
24860         switch. 
24861
24862 2001-11-24  Ravi Pratap  <ravi@ximian.com>
24863
24864         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
24865         some memory.
24866
24867         (EmitDynamicInitializers): Cope with the above since we extract data
24868         directly from ArrayData now.
24869
24870         (ExpectInitializers): Keep track of whether initializers are mandatory
24871         or not.
24872
24873         (Bounds): Make it a hashtable to prevent the same dimension being 
24874         recorded for every element in that dimension.
24875
24876         (EmitDynamicInitializers): Fix bug which prevented the Set array method
24877         from being found.
24878
24879         Also fix bug which was causing the indices to be emitted in the reverse
24880         order.
24881
24882 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
24883
24884         * expression.cs (ArrayCreation): Implement the bits that Ravi left
24885         unfinished.  They do not work, because the underlying code is
24886         sloppy.
24887
24888 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
24889
24890         * cs-parser.jay: Remove bogus fixme.
24891
24892         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
24893         on Switch statement.
24894
24895 2001-11-23  Ravi Pratap  <ravi@ximian.com>
24896
24897         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
24898         the same. 
24899
24900         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
24901         parameter. Apparently, any expression is allowed. 
24902
24903         (ValidateInitializers): Update accordingly.
24904
24905         (CheckIndices): Fix some tricky bugs thanks to recursion.
24906
24907         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
24908         I was being completely brain-dead.
24909
24910         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
24911         and re-write acordingly.
24912
24913         (DelegateInvocation): Re-write accordingly.
24914
24915         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
24916
24917         (MakeByteBlob): Handle types more correctly.
24918
24919         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
24920         initialization from expressions but it is incomplete because I am a complete
24921         Dodo :-|
24922
24923 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
24924
24925         * statement.cs (If.Emit): Fix a bug that generated incorrect code
24926         on If.  Basically, we have to return `true' (ie, we do return to
24927         our caller) only if both branches of the if return.
24928
24929         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
24930         short-circuit operators, handle them as short circuit operators. 
24931
24932         (Cast.DoResolve): Resolve type.
24933         (Cast.Cast): Take an expression as the target type.
24934
24935         * cs-parser.jay (cast_expression): Remove old hack that only
24936         allowed a limited set of types to be handled.  Now we take a
24937         unary_expression and we resolve to a type during semantic
24938         analysis.
24939
24940         Use the grammar productions from Rhys to handle casts (this is
24941         not complete like Rhys syntax yet, we fail to handle that corner
24942         case that C# has regarding (-x), but we will get there.
24943
24944 2001-11-22  Ravi Pratap  <ravi@ximian.com>
24945
24946         * class.cs (EmitFieldInitializer): Take care of the case when we have a
24947         field which is an array type.
24948
24949         * cs-parser.jay (declare_local_variables): Support array initialization too.
24950
24951         * typemanager.cs (MakeKey): Implement.
24952
24953         (everywhere): Use the above appropriately.
24954
24955         * cs-parser.jay (for_statement): Update for array initialization while
24956         declaring variables.
24957
24958         * ecore.cs : The error message was correct, it's the variable's names that
24959         were misleading ;-) Make the code more readable.
24960
24961         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
24962         the correct type etc.
24963
24964         (ConvertExplicit): Handle Enum types by examining the underlying type.
24965
24966 2001-11-21  Ravi Pratap  <ravi@ximian.com>
24967
24968         * parameter.cs (GetCallingConvention): Always return
24969         CallingConventions.Standard for now.
24970
24971 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
24972
24973         * expression.cs (Binary.ResolveOperator): Update the values of `l'
24974         and `r' after calling DoNumericPromotions.
24975
24976         * ecore.cs: Fix error message (the types were in the wrong order).
24977
24978         * statement.cs (Foreach.ProbeCollectionType): Need to pass
24979         BindingFlags.Instance as well 
24980
24981         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
24982         implicit int literal conversion in an empty cast so that we
24983         propagate the right type upstream.
24984
24985         (UnboxCast): new class used to unbox value types.
24986         (Expression.ConvertExplicit): Add explicit type conversions done
24987         by unboxing.
24988
24989         (Expression.ImplicitNumericConversion): Oops, forgot to test for
24990         the target type before applying the implicit LongLiterals to ULong
24991         literal cast.
24992
24993 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
24994
24995         * cs-parser.jay (for_statement): Reworked the way For works: now
24996         we declare manually any variables that are introduced in
24997         for_initializer to solve the problem of having out-of-band code
24998         emition (that is what got for broken).
24999
25000         (declaration_statement): Perform the actual variable declaration
25001         that used to be done in local_variable_declaration here.
25002
25003         (local_variable_declaration): Do not declare anything, just pass
25004         the information on a DictionaryEntry
25005
25006 2001-11-20  Ravi Pratap  <ravi@ximian.com>
25007
25008         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
25009         re-write of the logic to now make it recursive.
25010
25011         (UpdateIndices): Re-write accordingly.
25012
25013         Store element data in a separate ArrayData list in the above methods.
25014
25015         (MakeByteBlob): Implement to dump the array data into a byte array.
25016
25017 2001-11-19  Ravi Pratap  <ravi@ximian.com>
25018
25019         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
25020         into CheckIndices.
25021
25022         * constant.cs (Define): Implement.
25023
25024         (EmitConstant): Re-write fully.
25025
25026         Pass in location info.
25027
25028         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
25029         respectively.
25030
25031         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
25032         DictionaryEntry since we need location info too.
25033
25034         (constant_declaration): Update accordingly.
25035
25036         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
25037         code into another method : UpdateIndices.
25038
25039 2001-11-18  Ravi Pratap  <ravi@ximian.com>
25040
25041         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
25042         some type checking etc.
25043
25044 2001-11-17  Ravi Pratap  <ravi@ximian.com>
25045
25046         * expression.cs (ArrayCreation::ValidateInitializers): Implement
25047         bits to provide dimension info if the user skips doing that.
25048
25049         Update second constructor to store the rank correctly.
25050
25051 2001-11-16  Ravi Pratap  <ravi@ximian.com>
25052
25053         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
25054         and try to implement.
25055
25056         * ../errors/cs0150.cs : Add.
25057
25058         * ../errors/cs0178.cs : Add.
25059
25060 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
25061
25062         * statement.cs: Implement foreach on multi-dimensional arrays. 
25063
25064         * parameter.cs (Parameters.GetParameterByName): Also lookup the
25065         name of the params argument.
25066
25067         * expression.cs: Use EmitStoreOpcode to get the right opcode while
25068         initializing the array.
25069
25070         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
25071         we can use this elsewhere.
25072
25073         * statement.cs: Finish implementation of foreach for single
25074         dimension arrays.
25075
25076         * cs-parser.jay: Use an out-of-band stack to pass information
25077         around, I wonder why I need this.
25078
25079         foreach_block: Make the new foreach_block the current_block.
25080
25081         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
25082         function used to return a static Parameters structure.  Used for
25083         empty parameters, as those are created very frequently.
25084
25085         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
25086
25087 2001-11-15  Ravi Pratap  <ravi@ximian.com>
25088
25089         * interface.cs : Default modifier is private, not public. The
25090         make verify test passes again.
25091
25092 2001-11-15  Ravi Pratap  <ravi@ximian.com>
25093
25094         * support.cs (ReflectionParameters): Fix logic to determine
25095         whether the last parameter is a params one. Test 9 passes again.
25096
25097         * delegate.cs (Populate): Register the builders we define with
25098         RegisterParameterForBuilder. Test 19 passes again.
25099
25100         * cs-parser.jay (property_declaration): Reference $6 instead
25101         of $$ to get at the location.
25102
25103         (indexer_declaration): Similar stuff.
25104
25105         (attribute): Ditto.
25106
25107         * class.cs (Property): Register parameters for the Get and Set methods
25108         if they exist. Test 23 passes again.
25109
25110         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
25111         call to EmitArguments as we are sure there aren't any params arguments. 
25112         Test 32 passes again.
25113
25114         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
25115         IndexOutOfRangeException. 
25116
25117         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
25118         Test 33 now passes again.
25119
25120 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
25121
25122         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
25123         broke a bunch of things.  Will have to come up with a better way
25124         of tracking locations.
25125
25126         * statement.cs: Implemented foreach for single dimension arrays.
25127
25128 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
25129
25130         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
25131         an error.  This removes the lookup from the critical path.
25132
25133         * cs-parser.jay: Removed use of temporary_loc, which is completely
25134         broken. 
25135
25136 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
25137
25138         * support.cs (ReflectionParameters.ParameterModifier): Report
25139         whether the argument is a PARAMS argument or not.
25140
25141         * class.cs: Set the attribute `ParamArrayAttribute' on the
25142         parameter argument.
25143
25144         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
25145         and cons_param_array_attribute (ConstructorInfo for
25146         ParamArrayAttribute)., 
25147
25148         * codegen.cs: Emit the return using the `Return' statement, that
25149         way we can report the error correctly for missing return values. 
25150
25151         * class.cs (Method.Emit): Clean up.
25152
25153         * expression.cs (Argument.Resolve): Take another argument: the
25154         location where this argument is used.  Notice that this is not
25155         part of the "Argument" class as to reduce the size of the
25156         structure (we know the approximate location anyways).
25157
25158         Test if the argument is a variable-reference, if not, then
25159         complain with a 206.
25160
25161         (Argument.Emit): Emit addresses of variables.
25162
25163         (Argument.FullDesc): Simplify.
25164
25165         (Invocation.DoResolve): Update for Argument.Resolve.
25166
25167         (ElementAccess.DoResolve): ditto.
25168
25169         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
25170         method should be virtual, as this method is always virtual.
25171
25172         (NewDelegate.DoResolve): Update for Argument.Resolve.
25173
25174         * class.cs (ConstructorInitializer.DoResolve): ditto.
25175
25176         * attribute.cs (Attribute.Resolve): ditto.
25177
25178 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
25179
25180         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
25181
25182         * expression.cs (ParameterReference): Drop IStackStorage and implement
25183         IAssignMethod instead. 
25184
25185         (LocalVariableReference): ditto.
25186
25187         * ecore.cs (FieldExpr): Drop IStackStorage and implement
25188         IAssignMethod instead. 
25189
25190 2001-11-13  Miguel de Icaza <miguel@ximian.com>
25191
25192         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
25193         enumerations that are used in heavily used structures derive from
25194         byte in a laughable and pathetic attempt to reduce memory usage.
25195         This is the kind of pre-optimzations that you should not do at
25196         home without adult supervision.
25197
25198         * expression.cs (UnaryMutator): New class, used to handle ++ and
25199         -- separatedly from the other unary operators.  Cleans up the
25200         code, and kills the ExpressionStatement dependency in Unary.
25201
25202         (Unary): Removed `method' and `Arguments' from this class, making
25203         it smaller, and moving it all to SimpleCall, so I can reuse this
25204         code in other locations and avoid creating a lot of transient data
25205         strucutres when not required.
25206
25207         * cs-parser.jay: Adjust for new changes.
25208
25209 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
25210
25211         * enum.cs (Enum.Populate): If there is a failure during
25212         definition, return
25213
25214         * cs-parser.jay (opt_enum_base): we used to catch type errors
25215         here, but this is really incorrect.  The type error should be
25216         catched during semantic analysis.
25217
25218 2001-12-11  Ravi Pratap  <ravi@ximian.com>
25219
25220         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
25221         current_local_parameters as expected since I, in my stupidity, had forgotten
25222         to do this :-)
25223
25224         * attribute.cs (GetValidPlaces): Fix stupid bug.
25225
25226         * class.cs (Method::Emit): Perform check on applicability of attributes.
25227
25228         (Constructor::Emit): Ditto.
25229
25230         (Field::Emit): Ditto.
25231
25232         (Field.Location): Store location information.
25233
25234         (Property, Event, Indexer, Operator): Ditto.
25235
25236         * cs-parser.jay (field_declaration): Pass in location for each field.
25237
25238         * ../errors/cs0592.cs : Add.
25239
25240 2001-11-12  Ravi Pratap  <ravi@ximian.com>
25241
25242         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
25243
25244         (InitCoreTypes): Update accordingly.
25245
25246         (RegisterAttrType, LookupAttr): Implement.
25247
25248         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
25249         info about the same.
25250
25251         (Resolve): Update to populate the above as necessary.
25252
25253         (Error592): Helper.
25254
25255         (GetValidPlaces): Helper to the above.
25256
25257         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
25258
25259         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
25260
25261 2001-11-12  Ravi Pratap  <ravi@ximian.com>
25262
25263         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
25264
25265         * ../errors/cs0617.cs : Add.
25266
25267 2001-11-11  Ravi Pratap  <ravi@ximian.com>
25268
25269         * enum.cs (Emit): Rename to Populate to be more consistent with what
25270         we expect it to do and when exactly it is called.
25271
25272         * class.cs, rootcontext.cs : Update accordingly.
25273
25274         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
25275         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
25276
25277         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
25278
25279         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
25280         of a fieldinfo using the above, when dealing with a FieldBuilder.
25281
25282 2001-11-10  Ravi Pratap  <ravi@ximian.com>
25283
25284         * ../errors/cs0031.cs : Add.
25285
25286         * ../errors/cs1008.cs : Add.
25287
25288         * ../errrors/cs0543.cs : Add.
25289
25290         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
25291         enum type.
25292
25293         (FindMembers): Implement.
25294
25295         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
25296         enums and delegates too.
25297
25298         (enum_types): Rename to builder_to_enum.
25299
25300         (delegate_types): Rename to builder_to_delegate.
25301
25302         * delegate.cs (FindMembers): Implement.
25303
25304 2001-11-09  Ravi Pratap  <ravi@ximian.com>
25305
25306         * typemanager.cs (IsEnumType): Implement.
25307
25308         * enum.cs (Emit): Re-write parts to account for the underlying type
25309         better and perform checking etc.
25310
25311         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
25312         of the underlying type.
25313
25314         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
25315         value
25316
25317         * enum.cs (error31): Helper to report error #31.
25318
25319         * cs-parser.jay (enum_declaration): Store location of each member too.
25320
25321         * enum.cs (member_to_location): New hashtable. 
25322
25323         (AddEnumMember): Update location hashtable.
25324
25325         (Emit): Use the location of each member while reporting errors.
25326
25327 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
25328
25329         * cs-parser.jay: A for_initializer if is a
25330         local_variable_declaration really ammount to have an implicit
25331         block with the variable declaration and no initializer for for.
25332
25333         * statement.cs (For.Emit): Cope with null initializers.
25334
25335         This fixes the infinite loop on for initializers.
25336
25337 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
25338
25339         * enum.cs: More cleanup.
25340
25341         * ecore.cs: Remove dead code.
25342
25343         * class.cs (Property.Emit): More simplification.
25344         (Event.Emit): ditto.
25345
25346         Reworked to have less levels of indentation.
25347
25348 2001-11-08  Ravi Pratap  <ravi@ximian.com>
25349
25350         * class.cs (Property): Emit attributes.
25351
25352         (Field): Ditto.
25353
25354         (Event): Ditto.
25355
25356         (Indexer): Ditto.
25357
25358         (Operator): Ditto.
25359
25360         * enum.cs (Emit): Ditto.
25361
25362         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
25363         Enums too.
25364
25365         * class.cs (Field, Event, etc.): Move attribute generation into the
25366         Emit method everywhere.
25367
25368         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
25369         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
25370         as we had no way of defining nested enums !
25371
25372         * rootcontext.cs : Adjust code accordingly.
25373
25374         * typemanager.cs (AddEnumType): To keep track of enum types separately.
25375
25376 2001-11-07  Ravi Pratap  <ravi@ximian.com>
25377
25378         * expression.cs (EvalConstantExpression): Move into ecore.cs
25379
25380         * enum.cs (Enum): Rename some members and make them public and readonly
25381         according to our convention.
25382
25383         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
25384         nothing else.
25385
25386         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
25387
25388         (Enum::Emit): Write a simple version for now which doesn't try to compute
25389         expressions. I shall modify this to be more robust in just a while.
25390
25391         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
25392
25393         (TypeContainer::CloseType): Create the Enum types too.
25394
25395         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
25396
25397         * expression.cs (EvalConstantExpression): Get rid of completely.
25398
25399         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
25400         user-defined values and other cases.
25401
25402         (IsValidEnumLiteral): Helper function.
25403
25404         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
25405         out there in the case we had a literal FieldExpr.
25406
25407         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
25408
25409         (Literalize): Revamp a bit to take two arguments.
25410
25411         (EnumLiteral): New class which derives from Literal to wrap enum literals.
25412
25413 2001-11-06  Ravi Pratap  <ravi@ximian.com>
25414
25415         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
25416
25417         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
25418
25419         (Resolve): Use the above to ensure we have proper initializers.
25420
25421 2001-11-05  Ravi Pratap  <ravi@ximian.com>
25422
25423         * expression.cs (Expression::EvalConstantExpression): New method to 
25424         evaluate constant expressions.
25425
25426         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
25427
25428 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
25429
25430         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
25431         in an array.
25432
25433         (Binary.ResolveOperator): Handle operator != (object a, object b)
25434         and operator == (object a, object b);
25435
25436         (Binary.DoNumericPromotions): Indicate whether the numeric
25437         promotion was possible.
25438
25439         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
25440         Implement.  
25441
25442         Made the ArrayAccess implement interface IAssignMethod instead of
25443         IStackStore as the order in which arguments are passed reflects
25444         this.
25445
25446         * assign.cs: Instead of using expr.ExprClass to select the way of
25447         assinging, probe for the IStackStore/IAssignMethod interfaces.
25448
25449         * typemanager.cs: Load InitializeArray definition.
25450
25451         * rootcontext.cs (RootContext.MakeStaticData): Used to define
25452         static data that can be used to initialize arrays. 
25453
25454 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
25455
25456         * expression.cs: Handle operator== and operator!= for booleans.
25457
25458         (Conditioal.Reduce): Implement reducer for the ?: operator.
25459
25460         (Conditional.Resolve): Implement dead code elimination.
25461
25462         (Binary.Resolve): Catch string literals and return a new
25463         concatenated string.
25464
25465         (Unary.Reduce): Implement reduction of unary expressions.
25466
25467         * ecore.cs: Split out the expression core handling here.
25468
25469         (Expression.Reduce): New method used to perform constant folding
25470         and CSE.  This is needed to support constant-expressions. 
25471
25472         * statement.cs (Statement.EmitBoolExpression): Pass true and false
25473         targets, and optimize for !x.
25474
25475 2001-11-04  Ravi Pratap  <ravi@ximian.com>
25476
25477         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
25478         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
25479         set custom atttributes.
25480
25481         * literal.cs (Literal::GetValue): New abstract method to return the actual
25482         value of the literal, cast as an object.
25483
25484         (*Literal): Implement GetValue method.
25485
25486         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
25487         expressions to the arraylist but objects of type Argument.
25488
25489         * class.cs (TypeContainer::Emit): Emit our attributes too.
25490
25491         (Method::Emit, Constructor::Emit): Ditto.
25492
25493         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
25494         to be ignoring earlier.
25495
25496 2001-11-03  Ravi Pratap  <ravi@ximian.com>
25497
25498         * attribute.cs (AttributeSection::Define): Implement to do the business
25499         of constructing a CustomAttributeBuilder.
25500
25501         (Attribute): New trivial class. Increases readability of code.  
25502
25503         * cs-parser.jay : Update accordingly.
25504
25505         (positional_argument_list, named_argument_list, named_argument): New rules
25506
25507         (attribute_arguments): Use the above so that we are more correct.
25508
25509 2001-11-02  Ravi Pratap  <ravi@ximian.com>
25510
25511         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
25512         to perform all checks for a method with a params parameter.
25513
25514         (Invocation::OverloadResolve): Update to use the above method and therefore
25515         cope correctly with params method invocations.
25516
25517         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
25518         params too.
25519
25520         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
25521         constructors in our parent too because we can't afford to miss out on 
25522         protected ones ;-)
25523
25524         * attribute.cs (AttributeSection): New name for the class Attribute
25525
25526         Other trivial changes to improve readability.
25527
25528         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
25529         use the new class names.
25530
25531 2001-11-01  Ravi Pratap  <ravi@ximian.com>
25532
25533         * class.cs (Method::Define): Complete definition for params types too
25534
25535         (Indexer::Define): Ditto.
25536
25537         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
25538         Cope everywhere with a request for info about the array parameter.
25539
25540 2001-11-01  Ravi Pratap  <ravi@ximian.com>
25541
25542         * tree.cs (RecordNamespace): Fix up to check for the correct key.
25543
25544         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
25545         local_variable_type to extract the string corresponding to the type.
25546
25547         (local_variable_type): Fixup the action to use the new helper method.
25548
25549         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
25550         go.
25551
25552         * expression.cs : Clean out code which uses the above.
25553
25554 2001-10-31  Ravi Pratap  <ravi@ximian.com>
25555
25556         * typemanager.cs (RegisterMethod): Check if we already have an existing key
25557         and bale out if necessary by returning a false.
25558
25559         (RegisterProperty): Ditto.
25560
25561         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
25562         and print out appropriate error messages.
25563
25564         * interface.cs (everywhere): Ditto.
25565
25566         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
25567         location to constructor.
25568
25569         * class.cs (Property, Event, Indexer): Update accordingly.
25570
25571         * ../errors/cs111.cs : Added.
25572
25573         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
25574         of a method, as laid down by the spec.
25575
25576         (Invocation::OverloadResolve): Use the above method.
25577
25578 2001-10-31  Ravi Pratap  <ravi@ximian.com>
25579
25580         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
25581         now take a TypeContainer and a Parameters object.
25582
25583         (ParameterData): Modify return type of ParameterModifier method to be 
25584         Parameter.Modifier and not a string.
25585
25586         (ReflectionParameters, InternalParameters): Update accordingly.
25587
25588         * expression.cs (Argument::GetParameterModifier): Same here.
25589
25590         * support.cs (InternalParameters::ParameterType): Find a better way of determining
25591         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
25592         symbol in it at all so maybe this is only for now.
25593
25594 2001-10-30  Ravi Pratap  <ravi@ximian.com>
25595
25596         * support.cs (InternalParameters): Constructor now takes an extra argument 
25597         which is the actual Parameters class.
25598
25599         (ParameterDesc): Update to provide info on ref/out modifiers.
25600
25601         * class.cs (everywhere): Update call to InternalParameters to pass in
25602         the second argument too.
25603
25604         * support.cs (ParameterData): Add ParameterModifier, which is a method 
25605         to return the modifier info [ref/out etc]
25606
25607         (InternalParameters, ReflectionParameters): Implement the above.
25608
25609         * expression.cs (Argument::ParameterModifier): Similar function to return
25610         info about the argument's modifiers.
25611
25612         (Invocation::OverloadResolve): Update to take into account matching modifiers 
25613         too.
25614
25615         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
25616         a new SetFormalParameters object which we pass to InternalParameters.
25617
25618 2001-10-30  Ravi Pratap  <ravi@ximian.com>
25619
25620         * expression.cs (NewArray): Merge into the ArrayCreation class.
25621
25622 2001-10-29  Ravi Pratap  <ravi@ximian.com>
25623
25624         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
25625         NewUserdefinedArray into one as there wasn't much of a use in having
25626         two separate ones.
25627
25628         * expression.cs (Argument): Change field's name to ArgType from Type.
25629
25630         (Type): New readonly property which returns the proper type, taking into 
25631         account ref/out modifiers.
25632
25633         (everywhere): Adjust code accordingly for the above.
25634
25635         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
25636         whether we are emitting for a ref or out parameter.
25637
25638         * expression.cs (Argument::Emit): Use the above field to set the state.
25639
25640         (LocalVariableReference::Emit): Update to honour the flag and emit the
25641         right stuff.
25642
25643         * parameter.cs (Attributes): Set the correct flags for ref parameters.
25644
25645         * expression.cs (Argument::FullDesc): New function to provide a full desc.
25646
25647         * support.cs (ParameterData): Add method ParameterDesc to the interface.
25648
25649         (ReflectionParameters, InternalParameters): Implement the above method.
25650
25651         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
25652         reporting errors.
25653
25654         (Invocation::FullMethodDesc): Ditto. 
25655
25656 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
25657
25658         * cs-parser.jay: Add extra production for the second form of array
25659         creation. 
25660
25661         * expression.cs (ArrayCreation): Update to reflect the above
25662         change. 
25663
25664         * Small changes to prepare for Array initialization.
25665
25666 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
25667
25668         * typemanager.cs (ImplementsInterface): interface might be null;
25669         Deal with this problem;
25670
25671         Also, we do store negative hits on the cache (null values), so use
25672         this instead of calling t.GetInterfaces on the type everytime.
25673
25674 2001-10-28  Ravi Pratap  <ravi@ximian.com>
25675
25676         * typemanager.cs (IsBuiltinType): New method to help determine the same.
25677
25678         * expression.cs (New::DoResolve): Get rid of array creation code and instead
25679         split functionality out into different classes.
25680
25681         (New::FormArrayType): Move into NewBuiltinArray.
25682
25683         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
25684         quite useless.
25685
25686         (NewBuiltinArray): New class to handle creation of built-in arrays.
25687
25688         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
25689         account creation of one-dimensional arrays.
25690
25691         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
25692
25693         (NewUserdefinedArray::DoResolve): Implement.
25694
25695         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
25696
25697         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
25698         we maintain inside the TypeManager. This is necessary to perform lookups on the
25699         module builder.
25700
25701         (LookupType): Update to perform GetType on the module builders too.     
25702
25703         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
25704
25705         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
25706
25707 2001-10-23  Ravi Pratap  <ravi@ximian.com>
25708
25709         * expression.cs (New::DoResolve): Implement guts of array creation.
25710
25711         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
25712
25713 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
25714
25715         * expression.cs: Fix bug I introduced lsat night that broke
25716         Delegates. 
25717
25718         (Expression.Resolve): Report a 246 error (can not resolve name)
25719         if we find a SimpleName in the stream.
25720
25721         (Expression.ResolveLValue): Ditto.
25722
25723         (Expression.ResolveWithSimpleName): This function is a variant of
25724         ResolveName, this one allows SimpleNames to be returned without a
25725         warning.  The only consumer of SimpleNames is MemberAccess
25726
25727 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
25728
25729         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
25730         might arrive here.  I have my doubts that this is correct.
25731
25732         * statement.cs (Lock): Implement lock statement.
25733
25734         * cs-parser.jay: Small fixes to support `lock' and `using'
25735
25736         * cs-tokenizer.cs: Remove extra space
25737
25738         * driver.cs: New flag --checked, allows to turn on integer math
25739         checking. 
25740
25741         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
25742         Threading.Monitor.Exit 
25743
25744 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
25745
25746         * expression.cs (IndexerAccess::DoResolveLValue): Set the
25747         Expression Class to be IndexerAccess.
25748
25749         Notice that Indexer::DoResolve sets the eclass to Value.
25750
25751 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
25752
25753         * class.cs (TypeContainer::Emit): Emit code for indexers.
25754
25755         * assign.cs (IAssignMethod): New interface implemented by Indexers
25756         and Properties for handling assignment.
25757
25758         (Assign::Emit): Simplify and reuse code. 
25759
25760         * expression.cs (IndexerAccess, PropertyExpr): Implement
25761         IAssignMethod, clean up old code. 
25762
25763 2001-10-22  Ravi Pratap  <ravi@ximian.com>
25764
25765         * typemanager.cs (ImplementsInterface): New method to determine if a type
25766         implements a given interface. Provides a nice cache too.
25767
25768         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
25769         method.
25770
25771         (ConvertReferenceExplicit): Ditto.
25772
25773         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
25774         various methods, with correct names etc.
25775
25776         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
25777         Operator.UnaryNegation.
25778
25779         * cs-parser.jay (operator_declarator): Be a little clever in the case where
25780         we have a unary plus or minus operator.
25781
25782         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
25783         UnaryMinus.
25784
25785         * everywhere : update accordingly.
25786
25787         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
25788         respectively.
25789
25790         * class.cs (Method::Define): For the case where we are implementing a method
25791         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
25792         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
25793
25794 2001-10-21  Ravi Pratap  <ravi@ximian.com>
25795
25796         * interface.cs (FindMembers): Implement to work around S.R.E
25797         lameness.
25798
25799         * typemanager.cs (IsInterfaceType): Implement.
25800
25801         (FindMembers): Update to handle interface types too.
25802
25803         * expression.cs (ImplicitReferenceConversion): Re-write bits which
25804         use IsAssignableFrom as that is not correct - it doesn't work.
25805
25806         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
25807         and accordingly override EmitStatement.
25808
25809         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
25810         using the correct logic :-)
25811
25812 2001-10-19  Ravi Pratap  <ravi@ximian.com>
25813
25814         * ../errors/cs-11.cs : Add to demonstrate error -11 
25815
25816 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
25817
25818         * assign.cs (Assign::Resolve): Resolve right hand side first, and
25819         then pass this as a hint to ResolveLValue.
25820
25821         * expression.cs (FieldExpr): Add Location information
25822
25823         (FieldExpr::LValueResolve): Report assignment to readonly
25824         variable. 
25825
25826         (Expression::ExprClassFromMemberInfo): Pass location information.
25827
25828         (Expression::ResolveLValue): Add new method that resolves an
25829         LValue. 
25830
25831         (Expression::DoResolveLValue): Default invocation calls
25832         DoResolve. 
25833
25834         (Indexers): New class used to keep track of indexers in a given
25835         Type. 
25836
25837         (IStackStore): Renamed from LValue, as it did not really describe
25838         what this did.  Also ResolveLValue is gone from this interface and
25839         now is part of Expression.
25840
25841         (ElementAccess): Depending on the element access type
25842
25843         * typemanager.cs: Add `indexer_name_type' as a Core type
25844         (System.Runtime.CompilerServices.IndexerNameAttribute)
25845
25846         * statement.cs (Goto): Take a location.
25847
25848 2001-10-18  Ravi Pratap  <ravi@ximian.com>
25849
25850         * delegate.cs (Delegate::VerifyDelegate): New method to verify
25851         if two delegates are compatible.
25852
25853         (NewDelegate::DoResolve): Update to take care of the case when
25854         we instantiate a delegate from another delegate.
25855
25856         * typemanager.cs (FindMembers): Don't even try to look up members
25857         of Delegate types for now.
25858
25859 2001-10-18  Ravi Pratap  <ravi@ximian.com>
25860
25861         * delegate.cs (NewDelegate): New class to take care of delegate
25862         instantiation.
25863
25864         * expression.cs (New): Split the delegate related code out into 
25865         the NewDelegate class.
25866
25867         * delegate.cs (DelegateInvocation): New class to handle delegate 
25868         invocation.
25869
25870         * expression.cs (Invocation): Split out delegate related code into
25871         the DelegateInvocation class.
25872
25873 2001-10-17  Ravi Pratap  <ravi@ximian.com>
25874
25875         * expression.cs (New::DoResolve): Implement delegate creation fully
25876         and according to the spec.
25877
25878         (New::DoEmit): Update to handle delegates differently.
25879
25880         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
25881         because of which we were printing out arguments in reverse order !
25882
25883         * delegate.cs (VerifyMethod): Implement to check if the given method
25884         matches the delegate.
25885
25886         (FullDelegateDesc): Implement.
25887
25888         (VerifyApplicability): Implement.
25889
25890         * expression.cs (Invocation::DoResolve): Update to accordingly handle
25891         delegate invocations too.
25892
25893         (Invocation::Emit): Ditto.
25894
25895         * ../errors/cs1593.cs : Added.
25896
25897         * ../errors/cs1594.cs : Added.
25898
25899         * delegate.cs (InstanceExpression, TargetMethod): New properties.
25900
25901 2001-10-16  Ravi Pratap  <ravi@ximian.com>
25902
25903         * typemanager.cs (intptr_type): Core type for System.IntPtr
25904
25905         (InitCoreTypes): Update for the same.
25906
25907         (iasyncresult_type, asynccallback_type): Ditto.
25908
25909         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
25910         correct.
25911
25912         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
25913         too.
25914
25915         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
25916         the builders for the 4 members of a delegate type :-)
25917
25918         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
25919         type.
25920
25921         * expression.cs (New::DoResolve): Implement guts for delegate creation.
25922
25923         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
25924
25925 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
25926
25927         * statement.cs (Break::Emit): Implement.   
25928         (Continue::Emit): Implement.
25929
25930         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
25931         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
25932         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
25933         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
25934         end loop
25935
25936         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
25937         properties that track the label for the current loop (begin of the
25938         loop and end of the loop).
25939
25940 2001-10-15  Ravi Pratap  <ravi@ximian.com>
25941
25942         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
25943         use of emitting anything at all.
25944
25945         * class.cs, rootcontext.cs : Get rid of calls to the same.
25946
25947         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
25948
25949         (Populate): Define the constructor correctly and set the implementation
25950         attributes.
25951
25952         * typemanager.cs (delegate_types): New hashtable to hold delegates that
25953         have been defined.
25954
25955         (AddDelegateType): Implement.
25956
25957         (IsDelegateType): Implement helper method.
25958
25959         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
25960
25961         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
25962         and accordingly handle it.
25963
25964         * delegate.cs (Populate): Take TypeContainer argument.
25965         Implement bits to define the Invoke method. However, I still haven't figured out
25966         how to take care of the native int bit :-(
25967
25968         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
25969         Qualify the name of the delegate, not its return type !
25970
25971         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
25972         conversion.
25973
25974         (StandardConversionExists): Checking for array types turns out to be recursive.
25975
25976         (ConvertReferenceExplicit): Implement array conversion.
25977
25978         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
25979
25980 2001-10-12  Ravi Pratap  <ravi@ximian.com>
25981
25982         * cs-parser.jay (delegate_declaration): Store the fully qualified
25983         name as it is a type declaration.
25984
25985         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
25986         readonly.
25987
25988         (DefineDelegate): Renamed from Define. Does the same thing essentially,
25989         as TypeContainer::DefineType.
25990
25991         (Populate): Method in which all the definition of the various methods (Invoke)
25992         etc is done.
25993
25994         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
25995         see.
25996
25997         (CloseDelegate): Finally creates the delegate.
25998
25999         * class.cs (TypeContainer::DefineType): Update to define delegates.
26000         (Populate, Emit and CloseType): Do the same thing here too.
26001
26002         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
26003         delegates in all these operations.
26004
26005 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
26006
26007         * expression.cs: LocalTemporary: a new expression used to
26008         reference a temporary that has been created.
26009
26010         * assign.cs: Handle PropertyAccess back here, so that we can
26011         provide the proper semantic access to properties.
26012
26013         * expression.cs (Expression::ConvertReferenceExplicit): Implement
26014         a few more explicit conversions. 
26015
26016         * modifiers.cs: `NEW' modifier maps to HideBySig.
26017
26018         * expression.cs (PropertyExpr): Make this into an
26019         ExpressionStatement, and support the EmitStatement code path. 
26020
26021         Perform get/set error checking, clean up the interface.
26022
26023         * assign.cs: recognize PropertyExprs as targets, and if so, turn
26024         them into toplevel access objects.
26025
26026 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
26027
26028         * expression.cs: PropertyExpr::PropertyExpr: use work around the
26029         SRE.
26030
26031         * typemanager.cs: Keep track here of our PropertyBuilders again to
26032         work around lameness in SRE.
26033
26034 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
26035
26036         * expression.cs (LValue::LValueResolve): New method in the
26037         interface, used to perform a second resolution pass for LValues. 
26038
26039         (This::DoResolve): Catch the use of this in static methods.
26040
26041         (This::LValueResolve): Implement.
26042
26043         (This::Store): Remove warning, assigning to `this' in structures
26044         is 
26045
26046         (Invocation::Emit): Deal with invocation of
26047         methods on value types.  We need to pass the address to structure
26048         methods rather than the object itself.  (The equivalent code to
26049         emit "this" for structures leaves the entire structure on the
26050         stack instead of a pointer to it). 
26051
26052         (ParameterReference::DoResolve): Compute the real index for the
26053         argument based on whether the method takes or not a `this' pointer
26054         (ie, the method is static).
26055
26056         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
26057         value types returned from functions when we need to invoke a
26058         method on the sturcture.
26059
26060
26061 2001-10-11  Ravi Pratap  <ravi@ximian.com>
26062
26063         * class.cs (TypeContainer::DefineType): Method to actually do the business of
26064         defining the type in the Modulebuilder or Typebuilder. This is to take
26065         care of nested types which need to be defined on the TypeBuilder using
26066         DefineNestedMethod.
26067
26068         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
26069         methods in RootContext, only ported to be part of TypeContainer.
26070
26071         (TypeContainer::GetInterfaceOrClass): Ditto.
26072
26073         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
26074
26075         * interface.cs (Interface::DefineInterface): New method. Does exactly
26076         what RootContext.CreateInterface did earlier, only it takes care of nested types 
26077         too.
26078
26079         (Interface::GetInterfaces): Move from RootContext here and port.
26080
26081         (Interface::GetInterfaceByName): Same here.
26082
26083         * rootcontext.cs (ResolveTree): Re-write.
26084
26085         (PopulateTypes): Re-write.
26086
26087         * class.cs (TypeContainer::Populate): Populate nested types too.
26088         (TypeContainer::Emit): Emit nested members too.
26089
26090         * typemanager.cs (AddUserType): Do not make use of the FullName property,
26091         instead just use the name argument passed in as it is already fully
26092         qualified.
26093
26094         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
26095         to TypeContainer mapping to see if a type is user-defined.
26096
26097         * class.cs (TypeContainer::CloseType): Implement. 
26098
26099         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
26100         the default constructor.
26101
26102         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
26103         twice.
26104
26105         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
26106
26107         * interface.cs (CloseType): Create the type here.
26108
26109         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
26110         the hierarchy.
26111
26112         Remove all the methods which are now in TypeContainer.
26113
26114 2001-10-10  Ravi Pratap  <ravi@ximian.com>
26115
26116         * delegate.cs (Define): Re-write bits to define the delegate
26117         correctly.
26118
26119 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
26120
26121         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
26122
26123         * expression.cs (ImplicitReferenceConversion): handle null as well
26124         as a source to convert to any reference type.
26125
26126         * statement.cs (Return): Perform any implicit conversions to
26127         expected return type.  
26128
26129         Validate use of return statement.  
26130
26131         * codegen.cs (EmitContext): Pass the expected return type here.
26132
26133         * class.cs (Method, Constructor, Property): Pass expected return
26134         type to EmitContext.
26135
26136 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
26137
26138         * expression.cs: Make DoResolve take an EmitContext instead of a
26139         TypeContainer.
26140
26141         Replaced `l' and `location' for `loc', for consistency.
26142
26143         (Error, Warning): Remove unneeded Tc argument.
26144
26145         * assign.cs, literal.cs, constant.cs: Update to new calling
26146         convention. 
26147
26148         * codegen.cs: EmitContext now contains a flag indicating whether
26149         code is being generated in a static method or not.
26150
26151         * cs-parser.jay: DecomposeQI, new function that replaces the old
26152         QualifiedIdentifier.  Now we always decompose the assembled
26153         strings from qualified_identifier productions into a group of
26154         memberaccesses.
26155
26156 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
26157
26158         * rootcontext.cs: Deal with field-less struct types correctly now
26159         by passing the size option to Define Type.
26160
26161         * class.cs: Removed hack that created one static field. 
26162
26163 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
26164
26165         * statement.cs: Moved most of the code generation here. 
26166
26167 2001-10-09  Ravi Pratap  <ravi@ximian.com>
26168
26169         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
26170         seem very right.
26171
26172         (ElementAccess): Remove useless bits for now - keep checks as the spec
26173         says.
26174
26175 2001-10-08  Ravi Pratap  <ravi@ximian.com>
26176
26177         * expression.cs (ElementAccess::DoResolve): Remove my crap code
26178         and start performing checks according to the spec.
26179
26180 2001-10-07  Ravi Pratap  <ravi@ximian.com>
26181
26182         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
26183         rank_specifiers instead.
26184
26185         (rank_specifiers): Change the order in which the rank specifiers are stored
26186
26187         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
26188
26189         * expression.cs (ElementAccess): Implement the LValue interface too.
26190
26191 2001-10-06  Ravi Pratap  <ravi@ximian.com>
26192
26193         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
26194         except that user defined conversions are not included.
26195
26196         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
26197         perform the conversion of the return type, if necessary.
26198
26199         (New::DoResolve): Check whether we are creating an array or an object
26200         and accordingly do the needful.
26201
26202         (New::Emit): Same here.
26203
26204         (New::DoResolve): Implement guts of array creation.
26205
26206         (New::FormLookupType): Helper function.
26207
26208 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
26209
26210         * codegen.cs: Removed most of the code generation here, and move the
26211         corresponding code generation bits to the statement classes. 
26212
26213         Added support for try/catch/finalize and throw.
26214
26215         * cs-parser.jay: Added support for try/catch/finalize.
26216
26217         * class.cs: Catch static methods having the flags override,
26218         virtual or abstract.
26219
26220         * expression.cs (UserCast): This user cast was not really doing
26221         what it was supposed to do.  Which is to be born in fully resolved
26222         state.  Parts of the resolution were being performed at Emit time! 
26223
26224         Fixed this code.
26225
26226 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
26227
26228         * expression.cs: Implicity convert the result from UserCast.
26229
26230 2001-10-05  Ravi Pratap  <ravi@ximian.com>
26231
26232         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
26233         prevented it from working correctly. 
26234
26235         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
26236         merely ConvertImplicit.
26237
26238 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
26239
26240         * typemanager.cs: Make the LookupTypeContainer function static,
26241         and not per-instance.  
26242
26243         * class.cs: Make static FindMembers (the one that takes a Type
26244         argument). 
26245
26246         * codegen.cs: Add EmitForeach here.
26247
26248         * cs-parser.jay: Make foreach a toplevel object instead of the
26249         inline expansion, as we need to perform semantic analysis on it. 
26250
26251 2001-10-05  Ravi Pratap  <ravi@ximian.com>
26252
26253         * expression.cs (Expression::ImplicitUserConversion): Rename to
26254         UserDefinedConversion.
26255
26256         (Expression::UserDefinedConversion): Take an extra argument specifying 
26257         whether we look for explicit user conversions too.
26258
26259         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
26260
26261         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
26262
26263         (ExplicitUserConversion): Make it a call to UserDefinedConversion
26264         with the appropriate arguments.
26265
26266         * cs-parser.jay (cast_expression): Record location too.
26267
26268         * expression.cs (Cast): Record location info.
26269
26270         (Expression::ConvertExplicit): Take location argument.
26271
26272         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
26273         to determine if we are doing explicit conversions.
26274
26275         (UserCast::Emit): Update accordingly.
26276
26277         (Expression::ConvertExplicit): Report an error if everything fails.
26278
26279         * ../errors/cs0030.cs : Add.
26280
26281 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
26282
26283         * modifiers.cs: If the ABSTRACT keyword is present, also set the
26284         virtual and newslot bits. 
26285
26286         * class.cs (TypeContainer::RegisterRequiredImplementations):
26287         Record methods we need.
26288
26289         (TypeContainer::MakeKey): Helper function to make keys for
26290         MethodBases, since the Methodbase key is useless.
26291
26292         (TypeContainer::Populate): Call RegisterRequiredImplementations
26293         before defining the methods.   
26294
26295         Create a mapping for method_builders_to_methods ahead of time
26296         instead of inside a tight loop.
26297
26298         (::RequireMethods):  Accept an object as the data to set into the
26299         hashtable so we can report interface vs abstract method mismatch.
26300
26301 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
26302
26303         * report.cs: Make all of it static.
26304
26305         * rootcontext.cs: Drop object_type and value_type computations, as
26306         we have those in the TypeManager anyways.
26307
26308         Drop report instance variable too, now it is a global.
26309
26310         * driver.cs: Use try/catch on command line handling.
26311
26312         Add --probe option to debug the error reporting system with a test
26313         suite. 
26314
26315         * report.cs: Add support for exiting program when a probe
26316         condition is reached.
26317
26318 2001-10-03  Ravi Pratap  <ravi@ximian.com>
26319
26320         * expression.cs (Binary::DoNumericPromotions): Fix the case when
26321         we do a forcible conversion regardless of type, to check if 
26322         ForceConversion returns a null.
26323
26324         (Binary::error19): Use location to report error.
26325
26326         (Unary::error23): Use location here too.
26327
26328         * ../errors/cs0019.cs : Check in.
26329
26330         * ../errors/cs0023.cs : Check in.
26331
26332         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
26333         case of a non-null MethodInfo object with a length of 0 !
26334
26335         (Binary::ResolveOperator): Flag error if overload resolution fails to find
26336         an applicable member - according to the spec :-)
26337         Also fix logic to find members in base types.
26338
26339         (Unary::ResolveOperator): Same here.
26340
26341         (Unary::report23): Change name to error23 and make first argument a TypeContainer
26342         as I was getting thoroughly confused between this and error19 :-)
26343
26344         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
26345         (::FindMostEncompassedType): Implement.
26346         (::FindMostEncompassingType): Implement.
26347         (::StandardConversionExists): Implement.
26348
26349         (UserImplicitCast): Re-vamp. We now need info about most specific
26350         source and target types so that we can do the necessary conversions.
26351
26352         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
26353         mathematical union with no duplicates.
26354
26355 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
26356
26357         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
26358         in order from base classes to child classes, so that we can in
26359         child classes look up in our parent for method names and
26360         attributes (required for handling abstract, virtual, new, override
26361         constructs: we need to instrospect our base class, and if we dont
26362         populate the classes in order, the introspection might be
26363         incorrect.  For example, a method could query its parent before
26364         the parent has any methods and would determine that the parent has
26365         no abstract methods (while it could have had them)).
26366
26367         (RootContext::CreateType): Record the order in which we define the
26368         classes.
26369
26370 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
26371
26372         * class.cs (TypeContainer::Populate): Also method definitions can
26373         fail now, keep track of this.
26374
26375         (TypeContainer::FindMembers): Implement support for
26376         DeclaredOnly/noDeclaredOnly flag.
26377
26378         (Constructor::Emit) Return the ConstructorBuilder.
26379
26380         (Method::Emit) Return the MethodBuilder. 
26381         Check for abstract or virtual methods to be public.
26382
26383         * rootcontext.cs (RootContext::CreateType): Register all the
26384         abstract methods required for the class to be complete and the
26385         interface methods that must be implemented. 
26386
26387         * cs-parser.jay: Report error 501 (method requires body if it is
26388         not marked abstract or extern).
26389
26390         * expression.cs (TypeOf::Emit): Implement.
26391
26392         * typemanager.cs: runtime_handle_type, new global type.
26393
26394         * class.cs (Property::Emit): Generate code for properties.
26395
26396 2001-10-02  Ravi Pratap  <ravi@ximian.com>
26397
26398         * expression.cs (Unary::ResolveOperator): Find operators on base type
26399         too - we now conform exactly to the spec.
26400
26401         (Binary::ResolveOperator): Same here.
26402
26403         * class.cs (Operator::Define): Fix minor quirk in the tests.
26404
26405         * ../errors/cs0215.cs : Added.
26406
26407         * ../errors/cs0556.cs : Added.
26408
26409         * ../errors/cs0555.cs : Added.
26410
26411 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
26412
26413         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
26414         single integer which is really efficient
26415
26416 2001-10-01  Ravi Pratap  <ravi@ximian.com>
26417
26418         *  expression.cs (Expression::ImplicitUserConversion): Use location
26419         even in the case when we are examining True operators.
26420  
26421         * class.cs (Operator::Define): Perform extensive checks to conform
26422         with the rules for operator overloading in the spec.
26423
26424         * expression.cs (Expression::ImplicitReferenceConversion): Implement
26425         some of the other conversions mentioned in the spec.
26426
26427         * typemanager.cs (array_type): New static member for the System.Array built-in
26428         type.
26429
26430         (cloneable_interface): For System.ICloneable interface.
26431
26432         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
26433         we start resolving the tree and populating types.
26434
26435         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
26436  
26437 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
26438
26439         * expression.cs (Expression::ExprClassFromMemberInfo,
26440         Expression::Literalize): Create literal expressions from
26441         FieldInfos which are literals.
26442
26443         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
26444         type casts, because they were wrong.  The test suite in tests
26445         caught these ones.
26446
26447         (ImplicitNumericConversion): ushort to ulong requires a widening
26448         cast. 
26449
26450         Int32 constant to long requires widening cast as well.
26451
26452         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
26453         for integers because the type on the stack is not i4.
26454
26455 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
26456
26457         * expression.cs (report118): require location argument. 
26458
26459         * parameter.cs: Do not dereference potential null value.
26460
26461         * class.cs: Catch methods that lack the `new' keyword when
26462         overriding a name.  Report warnings when `new' is used without
26463         anything being there to override.
26464
26465         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
26466
26467         * class.cs: Only add constructor to hashtable if it is non-null
26468         (as now constructors can fail on define).
26469
26470         (TypeManager, Class, Struct): Take location arguments.
26471
26472         Catch field instance initialization in structs as errors.
26473
26474         accepting_filter: a new filter for FindMembers that is static so
26475         that we dont create an instance per invocation.
26476
26477         (Constructor::Define): Catch errors where a struct constructor is
26478         parameterless 
26479
26480         * cs-parser.jay: Pass location information for various new
26481         constructs. 
26482
26483         * delegate.cs (Delegate): take a location argument.
26484
26485         * driver.cs: Do not call EmitCode if there were problesm in the
26486         Definition of the types, as many Builders wont be there. 
26487
26488         * decl.cs (Decl::Decl): Require a location argument.
26489
26490         * cs-tokenizer.cs: Handle properly hex constants that can not fit
26491         into integers, and find the most appropiate integer for it.
26492
26493         * literal.cs: Implement ULongLiteral.
26494
26495         * rootcontext.cs: Provide better information about the location of
26496         failure when CreateType fails.
26497
26498 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
26499
26500         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
26501         as well.
26502
26503         * expression.cs (Binary::CheckShiftArguments): Add missing type
26504         computation.
26505         (Binary::ResolveOperator): Add type to the logical and and logical
26506         or, Bitwise And/Or and Exclusive Or code paths, it was missing
26507         before.
26508
26509         (Binary::DoNumericPromotions): In the case where either argument
26510         is ulong (and most signed types combined with ulong cause an
26511         error) perform implicit integer constant conversions as well.
26512
26513 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
26514
26515         * expression.cs (UserImplicitCast): Method should always be
26516         non-null. 
26517         (Invocation::BetterConversion): Simplified test for IntLiteral.
26518
26519         (Expression::ImplicitNumericConversion): Split this routine out.
26520         Put the code that performs implicit constant integer conversions
26521         here. 
26522
26523         (Expression::Resolve): Become a wrapper around DoResolve so we can
26524         check eclass and type being set after resolve.
26525
26526         (Invocation::Badness): Remove this dead function
26527
26528         (Binary::ResolveOperator): Do not compute the expensive argumnets
26529         unless we have a union for it.
26530
26531         (Probe::Emit): Is needs to do an isinst and then
26532         compare against null.
26533
26534         (::CanConvert): Added Location argument.  If the Location argument
26535         is null (Location.Null), then we do not report errors.  This is
26536         used by the `probe' mechanism of the Explicit conversion.  We do
26537         not want to generate an error for something that the user
26538         explicitly requested to be casted.  But the pipeline for an
26539         explicit cast first tests for potential implicit casts.
26540
26541         So for now, if the Location is null, it means `Probe only' to
26542         avoid adding another argument.   Might have to revise this
26543         strategy later.
26544
26545         (ClassCast): New class used to type cast objects into arbitrary
26546         classes (used in Explicit Reference Conversions).
26547
26548         Implement `as' as well.
26549
26550         Reverted all the patches from Ravi below: they were broken:
26551
26552                 * The use of `level' as a mechanism to stop recursive
26553                   invocations is wrong.  That was there just to catch the
26554                   bug with a strack trace but not as a way of addressing
26555                   the problem.
26556
26557                   To fix the problem we have to *understand* what is going
26558                   on and the interactions and come up with a plan, not
26559                   just get things going.
26560
26561                 * The use of the type conversion cache that I proposed
26562                   last night had an open topic: How does this work across
26563                   protection domains.  A user defined conversion might not
26564                   be public in the location where we are applying the
26565                   conversion, a different conversion might be selected
26566                   (ie, private A->B (better) but public B->A (worse),
26567                   inside A, A->B applies, but outside it, B->A will
26568                   apply).
26569
26570                 * On top of that (ie, even if the above is solved),
26571                   conversions in a cache need to be abstract.  Ie, `To
26572                   convert from an Int to a Short use an OpcodeCast', not
26573                   `To convert from an Int to a Short use the OpcodeCast on
26574                   the variable 5' (which is what this patch was doing).
26575
26576 2001-09-28  Ravi Pratap  <ravi@ximian.com>
26577
26578         * expression.cs (Invocation::ConversionExists): Re-write to use
26579         the conversion cache
26580
26581         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
26582         cache all conversions done, not just user-defined ones.
26583
26584         (Invocation::BetterConversion): The real culprit. Use ConversionExists
26585         to determine if a conversion exists instead of acutually trying to 
26586         perform the conversion. It's faster too.
26587
26588         (Expression::ConvertExplicit): Modify to use ConversionExists to check
26589         and only then attempt the implicit conversion.
26590
26591 2001-09-28  Ravi Pratap  <ravi@ximian.com>
26592
26593         * expression.cs (ConvertImplicit): Use a cache for conversions
26594         already found. Check level of recursion and bail out if necessary.
26595
26596 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
26597
26598         * typemanager.cs (string_concat_string_string, string_concat_object_object):
26599         Export standard methods that we expect for string operations.
26600
26601         * statement.cs (Block::UsageWarning): Track usage of variables and
26602         report the errors for not used variables.
26603
26604         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
26605         operator. 
26606
26607 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
26608
26609         * codegen.cs: remove unnneded code 
26610
26611         * expression.cs: Removed BuiltinTypeAccess class
26612
26613         Fix the order in which implicit conversions are
26614         done.  
26615
26616         The previous fixed dropped support for boxed conversions (adding a
26617         test to the test suite now)
26618
26619         (UserImplicitCast::CanConvert): Remove test for source being null,
26620         that code is broken.  We should not feed a null to begin with, if
26621         we do, then we should track the bug where the problem originates
26622         and not try to cover it up here.
26623
26624         Return a resolved expression of type UserImplicitCast on success
26625         rather than true/false.  Ravi: this is what I was talking about,
26626         the pattern is to use a static method as a "constructor" for
26627         objects. 
26628
26629         Also, do not create arguments until the very last minute,
26630         otherwise we always create the arguments even for lookups that
26631         will never be performed. 
26632
26633         (UserImplicitCast::Resolve): Eliminate, objects of type
26634         UserImplicitCast are born in a fully resolved state. 
26635
26636         * typemanager.cs (InitCoreTypes): Init also value_type
26637         (System.ValueType). 
26638
26639         * expression.cs (Cast::Resolve): First resolve the child expression.
26640
26641         (LValue): Add new method AddressOf to be used by
26642         the `&' operator.  
26643
26644         Change the argument of Store to take an EmitContext instead of an
26645         ILGenerator, because things like FieldExpr need to be able to call
26646         their children expression to generate the instance code. 
26647
26648         (Expression::Error, Expression::Warning): Sugar functions for
26649         reporting errors.
26650
26651         (Expression::MemberLookup): Accept a TypeContainer instead of a
26652         Report as the first argument.
26653
26654         (Expression::ResolvePrimary): Killed.  I still want to improve
26655         this as currently the code is just not right.
26656
26657         (Expression::ResolveMemberAccess): Simplify, but it is still
26658         wrong. 
26659
26660         (Unary::Resolve): Catch errors in AddressOf operators.
26661
26662         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
26663         index to a byte for the short-version, or the compiler will choose
26664         the wrong Emit call, which generates the wrong data.
26665
26666         (ParameterReference::Emit, ::Store): same.
26667
26668         (FieldExpr::AddressOf): Implement.
26669
26670         * typemanager.cs: TypeManager: made public variable instead of
26671         property.
26672
26673         * driver.cs: document --fatal.
26674
26675         * report.cs (ErrorMessage, WarningMessage): new names for the old
26676         Error and Warning classes.
26677
26678         * cs-parser.jay (member_access): Turn built-in access to types
26679         into a normal simplename
26680
26681 2001-09-27  Ravi Pratap  <ravi@ximian.com>
26682
26683         * expression.cs (Invocation::BetterConversion): Fix to cope
26684         with q being null, since this was introducing a bug.
26685
26686         * expression.cs (ConvertImplicit): Do built-in conversions first.
26687
26688 2001-09-27  Ravi Pratap  <ravi@ximian.com>
26689
26690         * expression.cs (UserImplicitCast::Resolve): Fix bug.
26691
26692 2001-09-27  Ravi Pratap  <ravi@ximian.com>
26693
26694         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
26695         I had introduced long ago (what's new ?).
26696
26697         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
26698         the work of all the checking. 
26699         (ConvertImplicit): Call CanConvert and only then create object if necessary.
26700         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
26701
26702         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
26703         that is the right way. 
26704
26705         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
26706         overloading resolution. Use everywhere instead of cutting and pasting code.
26707
26708         (Binary::ResolveOperator): Use MakeUnionSet.
26709
26710         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
26711         we have to convert to bool types. Not complete yet.
26712
26713 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
26714
26715         * typemanager.cs (TypeManager::CSharpName): support ushort.
26716
26717         * expression.cs (Expression::TryImplicitIntConversion): Attempts
26718         to provide an expression that performsn an implicit constant int
26719         conversion (section 6.1.6).
26720         (Expression::ConvertImplicitRequired): Reworked to include
26721         implicit constant expression conversions.
26722
26723         (Expression::ConvertNumericExplicit): Finished.
26724
26725         (Invocation::Emit): If InstanceExpression is null, then it means
26726         that we perform a call on this.
26727
26728 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
26729
26730         * expression.cs (Unary::Emit): Remove some dead code.
26731         (Probe): Implement Resolve and Emit for `is'.
26732         (Expression::ConvertImplicitRequired): Attempt to do constant
26733         expression conversions here.  Maybe should be moved to
26734         ConvertImplicit, but I am not sure.
26735         (Expression::ImplicitLongConstantConversionPossible,
26736         Expression::ImplicitIntConstantConversionPossible): New functions
26737         that tell whether is it possible to apply an implicit constant
26738         expression conversion.
26739
26740         (ConvertNumericExplicit): Started work on explicit numeric
26741         conversions.
26742
26743         * cs-parser.jay: Update operator constants.
26744
26745         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
26746         (Parameters::GetSignature): Hook up VerifyArgs here.
26747         (Parameters::VerifyArgs): Verifies that no two arguments have the
26748         same name. 
26749
26750         * class.cs (Operator): Update the operator names to reflect the
26751         ones that the spec expects (as we are just stringizing the
26752         operator names).
26753
26754         * expression.cs (Unary::ResolveOperator): Fix bug: Use
26755         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
26756         previous usage did only work for our methods.
26757         (Expression::ConvertImplicit): Handle decimal implicit numeric
26758         conversions as well.
26759         (Expression::InternalTypeConstructor): Used to invoke constructors
26760         on internal types for default promotions.
26761
26762         (Unary::Emit): Implement special handling for the pre/post
26763         increment/decrement for overloaded operators, as they need to have
26764         the same semantics as the other operators.
26765
26766         (Binary::ResolveOperator): ditto.
26767         (Invocation::ConversionExists): ditto.
26768         (UserImplicitCast::Resolve): ditto.
26769
26770 2001-09-26  Ravi Pratap  <ravi@ximian.com>
26771
26772         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
26773         operator, return after emitting body. Regression tests pass again !
26774
26775         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
26776         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
26777         (Invocation::OverloadResolve): Ditto.
26778         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
26779
26780         * everywhere : update calls to the above methods accordingly.
26781
26782 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
26783
26784         * assign.cs (Assign): Make it inherit from ExpressionStatement.
26785
26786         * expression.cs (ExpressionStatement): New base class used for
26787         expressions that can appear in statements, so that we can provide
26788         an alternate path to generate expression that do not leave a value
26789         on the stack.
26790
26791         (Expression::Emit, and all the derivatives): We no longer return
26792         whether a value is left on the stack or not.  Every expression
26793         after being emitted leaves a single value on the stack.
26794
26795         * codegen.cs (EmitContext::EmitStatementExpression): Use the
26796         facilties of ExpressionStatement if possible.
26797
26798         * cs-parser.jay: Update statement_expression.
26799
26800 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
26801
26802         * driver.cs: Change the wording of message
26803
26804 2001-09-25  Ravi Pratap  <ravi@ximian.com>
26805
26806         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
26807         the type of the expression to the return type of the method if
26808         we have an overloaded operator match ! The regression tests pass again !
26809         (Unary::ResolveOperator): Ditto.
26810
26811         * expression.cs (Invocation::ConversionExists): Correct the member lookup
26812         to find "op_Implicit", not "implicit" ;-)
26813         (UserImplicitCast): New class to take care of user-defined implicit conversions.
26814         (ConvertImplicit, ForceConversion): Take TypeContainer argument
26815
26816         * everywhere : Correct calls to the above accordingly.
26817
26818         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
26819         (ConvertImplicit): Do user-defined conversion if it exists.
26820
26821 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
26822
26823         * assign.cs: track location.
26824         (Resolve): Use implicit conversions on assignment.
26825
26826         * literal.cs: Oops.  Not good, Emit of short access values should
26827         pass (Bytes) or the wrong argument will be selected.
26828
26829         * expression.cs (Unary::Emit): Emit code for -expr.
26830
26831         (Unary::ResolveOperator): Handle `Substract' for non-constants
26832         (substract from zero from the non-constants).
26833         Deal with Doubles as well. 
26834
26835         (Expression::ConvertImplicitRequired): New routine that reports an
26836         error if no implicit conversion exists. 
26837
26838         (Invocation::OverloadResolve): Store the converted implicit
26839         expressions if we make them
26840
26841 2001-09-24  Ravi Pratap  <ravi@ximian.com>
26842
26843         * class.cs (ConstructorInitializer): Take a Location argument.
26844         (ConstructorBaseInitializer): Same here.
26845         (ConstructorThisInitializer): Same here.
26846
26847         * cs-parser.jay : Update all calls accordingly.
26848
26849         * expression.cs (Unary, Binary, New): Take location argument.
26850         Update accordingly everywhere.
26851
26852         * cs-parser.jay : Update all calls to the above to take a location
26853         argument.
26854
26855         * class.cs : Ditto.
26856
26857 2001-09-24  Ravi Pratap  <ravi@ximian.com>
26858
26859         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
26860         (Invocation::BetterConversion): Same here
26861         (Invocation::ConversionExists): Ditto.
26862
26863         (Invocation::ConversionExists): Implement.
26864
26865 2001-09-22  Ravi Pratap  <ravi@ximian.com>
26866
26867         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
26868         Also take an additional TypeContainer argument.
26869
26870         * All over : Pass in TypeContainer as argument to OverloadResolve.
26871
26872         * typemanager.cs (CSharpName): Update to check for the string type and return
26873         that too.
26874
26875         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
26876         a given method.
26877
26878 2001-09-21  Ravi Pratap  <ravi@ximian.com>
26879
26880         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
26881         (Invocation::BetterFunction): Implement.
26882         (Invocation::BetterConversion): Implement.
26883         (Invocation::ConversionExists): Skeleton, no implementation yet.
26884
26885         Okay, things work fine !
26886
26887 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
26888
26889         * typemanager.cs: declare and load enum_type, delegate_type and
26890         void_type. 
26891
26892         * expression.cs (Expression::Emit): Now emit returns a value that
26893         tells whether a value is left on the stack or not.  This strategy
26894         might be reveted tomorrow with a mechanism that would address
26895         multiple assignments.
26896         (Expression::report118): Utility routine to report mismatches on
26897         the ExprClass.
26898
26899         (Unary::Report23): Report impossible type/operator combination
26900         utility function.
26901
26902         (Unary::IsIncrementableNumber): Whether the type can be
26903         incremented or decremented with add.
26904         (Unary::ResolveOperator): Also allow enumerations to be bitwise
26905         complemented. 
26906         (Unary::ResolveOperator): Implement ++, !, ~,
26907
26908         (Invocation::Emit): Deal with new Emit convetion.
26909
26910         * All Expression derivatives: Updated their Emit method to return
26911         whether they leave values on the stack or not.
26912
26913         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
26914         stack for expressions that are statements. 
26915
26916 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
26917
26918         * expression.cs (LValue): New interface.  Must be implemented by
26919         LValue objects.
26920         (LocalVariableReference, ParameterReference, FieldExpr): Implement
26921         LValue interface.
26922
26923         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
26924         interface for generating code, simplifies the code.
26925
26926 2001-09-20  Ravi Pratap  <ravi@ximian.com>
26927
26928         * expression.cs (everywhere): Comment out return statements in ::Resolve
26929         methods to avoid the warnings.
26930
26931 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
26932
26933         * driver.cs (parse): Report error 2001 if we can not open the
26934         source file.
26935
26936         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
26937         not resolve it.
26938
26939         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
26940         object. 
26941
26942         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
26943         otherwise nested blocks end up with the same index.
26944
26945         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
26946
26947         * expression.cs:  Instead of having FIXMEs in the Resolve
26948         functions, throw exceptions so it is obvious that we are facing a
26949         bug. 
26950
26951         * cs-parser.jay (invocation_expression): Pass Location information.
26952
26953         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
26954         Use a basename for those routines because .NET does not like paths
26955         on them. 
26956
26957         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
26958         already defined.
26959
26960 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
26961
26962         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
26963         are loading the correct data types (throws an exception if not).
26964         (TypeManager::InitCoreTypes): Use CoreLookupType
26965
26966         * expression.cs (Unary::ResolveOperator): return the child
26967         expression for expressions which are just +expr.
26968         (Unary::ResolveOperator): Return negative literals for -LITERAL
26969         expressions (otherwise they are Unary {Literal}).
26970         (Invocation::Badness): Take into account `Implicit constant
26971         expression conversions'.
26972
26973         * literal.cs (LongLiteral): Implement long literal class.
26974         (IntLiteral): export the `Value' of the intliteral. 
26975
26976 2001-09-19  Ravi Pratap  <ravi@ximian.com>
26977
26978         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
26979
26980         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
26981         instead of 'Operator'
26982
26983         * expression.cs (Binary::ResolveOperator): Update accordingly.
26984         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
26985         and 'Minus'
26986
26987         * cs-parser.jay (unary_expression): Update to use the new names.
26988
26989         * gen-treedump.cs (GetUnary): Same here.
26990
26991         * expression.cs (Unary::Resolve): Implement.
26992         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
26993         operators are found instead of making noise ;-)
26994         (Unary::ResolveOperator): New method to do precisely the same thing which
26995         Binary::ResolveOperator does for Binary expressions.
26996         (Unary.method, .Arguments): Add.
26997         (Unary::OperName): Implement.   
26998         (Unary::ForceConversion): Copy and Paste !
26999
27000         * class.cs (Operator::Define): Fix a small bug for the case when we have 
27001         a unary operator.
27002
27003         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
27004         for the inbuilt operators. Only overloading works for now ;-)
27005
27006 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
27007
27008         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
27009         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
27010
27011         * expression.cs (This::Emit): Implement. 
27012         (This::Resolve): Implement.
27013         (TypeOf:Resolve): Implement.
27014         (Expression::ResolveSimpleName): Add an implicit this to instance
27015         field references. 
27016         (MemberAccess::Resolve): Deal with Parameters and Fields. 
27017         Bind instance variable to Field expressions.
27018         (FieldExpr::Instance): New field used to track the expression that
27019         represents the object instance.
27020         (FieldExpr::Resolve): Track potential errors from MemberLookup not
27021         binding 
27022         (FieldExpr::Emit): Implement.
27023
27024         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
27025         the last instruction contains a return opcode to avoid generating
27026         the last `ret' instruction (this generates correct code, and it is
27027         nice to pass the peverify output).
27028
27029         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
27030         initializer for static and instance variables.
27031         (Constructor::Emit): Allow initializer to be null in the case of
27032         static constructors.  Only emit initializer for instance
27033         constructors. 
27034
27035         (TypeContainer::FindMembers): Return a null array if there are no
27036         matches.
27037
27038         Also fix the code for the MemberTypes.Method branch, as it was not
27039         scanning that for operators (or tried to access null variables before).
27040
27041         * assign.cs (Assign::Emit): Handle instance and static fields. 
27042
27043         * TODO: Updated.
27044
27045         * driver.cs: Stop compilation if there are parse errors.
27046
27047         * cs-parser.jay (constructor_declaration): Provide default base
27048         initializer for non-static constructors.
27049         (constructor_declarator): Do not provide a default base
27050         initializers if none was specified.
27051         Catch the fact that constructors should not have parameters.
27052
27053         * class.cs: Do not emit parent class initializers for static
27054         constructors, that should be flagged as an error.
27055
27056 2001-09-18  Ravi Pratap  <ravi@ximian.com>
27057
27058         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
27059         Move back code into TypeContainer::Populate.
27060
27061 2001-09-18  Ravi Pratap  <ravi@ximian.com>
27062
27063         * class.cs (TypeContainer::AddConstructor): Fix the check to
27064         compare against Name, not Basename. 
27065         (Operator::OpType): Change Plus and Minus to Add and Subtract.
27066
27067         * cs-parser.jay : Update accordingly.
27068
27069         * class.cs (TypeContainer::FindMembers): For the case where we are searching
27070         for methods, don't forget to look into the operators too.
27071         (RegisterMethodBuilder): Helper method to take care of this for
27072         methods, constructors and operators.
27073         (Operator::Define): Completely revamp.
27074         (Operator.OperatorMethod, MethodName): New fields.
27075         (TypeContainer::Populate): Move the registering of builders into
27076         RegisterMethodBuilder.
27077         (Operator::Emit): Re-write.
27078
27079         * expression.cs (Binary::Emit): Comment out code path to emit method
27080         invocation stuff for the case when we have a user defined operator. I am
27081         just not able to get it right !
27082
27083 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
27084
27085         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
27086         argument. 
27087
27088         (Expression::MemberLookup): Provide a version that allows to
27089         specify the MemberTypes and BindingFlags. 
27090
27091         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
27092         so it was not fetching variable information from outer blocks.
27093
27094         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
27095         Beforefieldinit as it was buggy.
27096
27097         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
27098         that Ravi put here.  
27099
27100         * class.cs (Constructor::Emit): Only emit if block is not null.
27101         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
27102         deal with this by semantically definining it as if the user had
27103         done it.
27104
27105         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
27106         constructors as we now "emit" them at a higher level.
27107
27108         (TypeContainer::DefineDefaultConstructor): Used to define the
27109         default constructors if none was provided.
27110
27111         (ConstructorInitializer): Add methods Resolve and Emit. 
27112
27113         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
27114
27115 2001-09-17  Ravi Pratap  <ravi@ximian.com>
27116
27117         * class.cs (TypeContainer::EmitDefaultConstructor): Register
27118         the default constructor builder with our hashtable for methodbuilders
27119         to methodcores.
27120
27121         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
27122         and argument_count is 0 in which case we have a match.
27123         (Binary::ResolveOperator): More null checking and miscellaneous coding
27124         style cleanup.
27125
27126 2001-09-17  Ravi Pratap  <ravi@ximian.com>
27127
27128         * rootcontext.cs (IsNameSpace): Compare against null.
27129
27130         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
27131
27132         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
27133         and Unary::Operator.
27134
27135         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
27136         accordingly.
27137
27138         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
27139         we have overloaded operators.
27140         (Binary::ResolveOperator): Implement the part which does the operator overload
27141         resolution.
27142
27143         * class.cs (Operator::Emit): Implement.
27144         (TypeContainer::Emit): Emit the operators we have too.
27145
27146         * expression.cs (Binary::Emit): Update to emit the appropriate code for
27147         the case when we have a user-defined operator.
27148
27149 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
27150
27151         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
27152
27153 2001-09-16  Ravi Pratap  <ravi@ximian.com>
27154
27155         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
27156         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
27157         (Constructor::Emit): Implement.
27158         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
27159         if we have no work to do. 
27160         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
27161         Emit method.
27162
27163         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
27164         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
27165
27166         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
27167         of parent.parent.
27168
27169 2001-09-15  Ravi Pratap  <ravi@ximian.com>
27170
27171         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
27172         in the source.
27173         (Tree::RecordNamespace): Method to do what the name says ;-)
27174         (Tree::Namespaces): Property to get at the namespaces hashtable.
27175
27176         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
27177         keep track.
27178
27179         * rootcontext.cs (IsNamespace): Fixed it :-)
27180
27181 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
27182
27183         * class.cs (TypeContainer::FindMembers): Add support for
27184         constructors. 
27185         (MethodCore): New class that encapsulates both the shared aspects
27186         of a Constructor and a Method.  
27187         (Method, Constructor): Factored pieces into MethodCore.
27188
27189         * driver.cs: Added --fatal which makes errors throw exceptions.
27190         Load System assembly as well as part of the standard library.
27191
27192         * report.cs: Allow throwing exceptions on errors for debugging.
27193
27194         * modifiers.cs: Do not use `parent', instead use the real type
27195         container to evaluate permission settings.
27196
27197         * class.cs: Put Ravi's patch back in.  He is right, and we will
27198         have to cope with the
27199
27200 2001-09-14  Ravi Pratap  <ravi@ximian.com>
27201
27202         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
27203         FamORAssem, not FamANDAssem.
27204
27205 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
27206
27207         * driver.cs: Added --parse option that only parses its input files
27208         and terminates.
27209
27210         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
27211         incorrect.  IsTopLevel is not used to tell whether an object is
27212         root_types or not (that can be achieved by testing this ==
27213         root_types).  But to see if this is a top-level *class* (not
27214         necessarly our "toplevel" container). 
27215
27216 2001-09-14  Ravi Pratap  <ravi@ximian.com>
27217
27218         * enum.cs (Enum::Define): Modify to call the Lookup method on the
27219         parent instead of a direct call to GetType.
27220
27221 2001-09-14  Ravi Pratap  <ravi@ximian.com>
27222
27223         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
27224         Modifiers.TypeAttr. This should just be a call to that method.
27225
27226         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
27227         object so that we can determine if we are top-level or not.
27228
27229         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
27230         TypeContainer too.
27231
27232         * enum.cs (Enum::Define): Ditto.
27233
27234         * modifiers.cs (FieldAttr): Re-write.
27235
27236         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
27237         (TypeContainer::HaveStaticConstructor): New property to provide access
27238         to precisely that info.
27239
27240         * modifiers.cs (MethodAttr): Re-write.
27241         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
27242
27243         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
27244         of top-level types as claimed.
27245
27246 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
27247
27248         * expression.cs (MemberLookup): Fruitless attempt to lookup
27249         constructors.  Maybe I need to emit default constructors?  That
27250         might be it (currently .NET emits this for me automatically).
27251         (Invocation::OverloadResolve): Cope with Arguments == null.
27252         (Invocation::EmitArguments): new function, shared by the new
27253         constructor and us.
27254         (Invocation::Emit): Handle static and instance methods.  Emit
27255         proper call instruction for virtual or non-virtual invocations.
27256         (New::Emit): Implement.
27257         (New::Resolve): Implement.
27258         (MemberAccess:Resolve): Implement.
27259         (MethodGroupExpr::InstanceExpression): used conforming to the spec
27260         to track instances.
27261         (FieldExpr::Resolve): Set type.
27262
27263         * support.cs: Handle empty arguments.
27264                 
27265         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
27266         SimpleLookup): Auxiliary routines to help parse a qualifier
27267         identifier.  
27268
27269         Update qualifier_identifier rule.
27270
27271         * codegen.cs: Removed debugging messages.
27272
27273         * class.cs: Make this a global thing, this acts just as a "key" to
27274         objects that we might have around.
27275
27276         (Populate): Only initialize method_builders_to_methods once.
27277
27278         * expression.cs (PropertyExpr): Initialize type from the
27279         PropertyType. 
27280
27281         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
27282         Resolve pattern.  Attempt to implicitly convert value to boolean.
27283         Emit code.
27284
27285         * expression.cs: Set the type for the int32/int32 argument case.
27286         (Binary::ResolveOperator): Set the return type to boolean for
27287         comparission operators
27288
27289         * typemanager.cs: Remove debugging print code.
27290
27291         (Invocation::Resolve): resolve type.
27292
27293         * class.cs: Allocate a MemberInfo of the correct size, as the code
27294         elsewhere depends on the test to reflect the correct contents.
27295
27296         (Method::) Keep track of parameters, due to System.Reflection holes
27297
27298         (TypeContainer::Populate): Keep track of MethodBuilders to Method
27299         mapping here.
27300
27301         (TypeContainer::FindMembers): Use ArrayList and then copy an array
27302         of the exact size and return that.
27303
27304         (Class::LookupMethodByBuilder): New function that maps
27305         MethodBuilders to its methods.  Required to locate the information
27306         on methods because System.Reflection bit us again.
27307
27308         * support.cs: New file, contains an interface ParameterData and
27309         two implementations: ReflectionParameters and InternalParameters
27310         used to access Parameter information.  We will need to grow this
27311         as required.
27312
27313         * expression.cs (Invocation::GetParameterData): implement a cache
27314         and a wrapper around the ParameterData creation for methods. 
27315         (Invocation::OverloadResolve): Use new code.
27316
27317 2001-09-13  Ravi Pratap  <ravi@ximian.com>
27318
27319         * class.cs (TypeContainer::EmitField): Remove and move into 
27320         (Field::Define): here and modify accordingly.
27321         (Field.FieldBuilder): New member.
27322         (TypeContainer::Populate): Update accordingly.
27323         (TypeContainer::FindMembers): Implement.
27324
27325 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
27326
27327         * statement.cs: (VariableInfo::VariableType): New field to be
27328         initialized with the full type once it is resolved. 
27329
27330 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
27331
27332         * parameter.cs (GetParameterInfo): Use a type cache to compute
27333         things only once, and to reuse this information
27334
27335         * expression.cs (LocalVariableReference::Emit): Implement.
27336         (OpcodeCast::Emit): fix.
27337
27338         (ParameterReference::Resolve): Implement.
27339         (ParameterReference::Emit): Implement.
27340
27341         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
27342         that are expressions need to stay as Expressions.
27343
27344         * typemanager.cs (CSharpName): Returns the C# name of a type if
27345         possible. 
27346
27347         * expression.cs (Expression::ConvertImplicit): New function that
27348         implements implicit type conversions.
27349
27350         (Expression::ImplicitReferenceConversion): Implements implicit
27351         reference conversions.
27352
27353         (EmptyCast): New type for transparent casts.
27354
27355         (OpcodeCast): New type for casts of types that are performed with
27356         a sequence of bytecodes.
27357
27358         (BoxedCast): New type used for casting value types into reference
27359         types.  Emits a box opcode.
27360
27361         (Binary::DoNumericPromotions): Implements numeric promotions of
27362         and computation of the Binary::Type.
27363
27364         (Binary::EmitBranchable): Optimization.
27365
27366         (Binary::Emit): Implement code emission for expressions.
27367
27368         * typemanager.cs (TypeManager): Added two new core types: sbyte
27369         and byte.
27370
27371 2001-09-12  Ravi Pratap  <ravi@ximian.com>
27372
27373         * class.cs (TypeContainer::FindMembers): Method which does exactly
27374         what Type.FindMembers does, only we don't have to use reflection. No
27375         implementation yet.
27376
27377         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
27378         typecontainer objects as we need to get at them.
27379         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
27380
27381         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
27382         typecontainer object.
27383
27384         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
27385         of just a Report object.
27386
27387 2001-09-11  Ravi Pratap  <ravi@ximian.com>
27388
27389         * class.cs (Event::Define): Go back to using the prefixes "add_" and
27390         "remove_"
27391         (TypeContainer::Populate): Now define the delegates of the type too.
27392         (TypeContainer.Delegates): Property to access the list of delegates defined
27393         in the type.
27394
27395         * delegates.cs (Delegate::Define): Implement partially.
27396
27397         * modifiers.cs (TypeAttr): Handle more flags.
27398
27399 2001-09-11  Ravi Pratap  <ravi@ximian.com>
27400
27401         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
27402         and not <=
27403         (Operator::Define): Re-write logic to get types by using the LookupType method
27404         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
27405         (Indexer::Define): Ditto.
27406         (Event::Define): Ditto.
27407         (Property::Define): Ditto.
27408
27409 2001-09-10  Ravi Pratap  <ravi@ximian.com>
27410
27411         * class.cs (TypeContainer::Populate): Now define operators too. 
27412         (TypeContainer.Operators): New property to access the list of operators
27413         in a type.
27414         (Operator.OperatorMethodBuilder): New member to hold the method builder
27415         for the operator we are defining.
27416         (Operator::Define): Implement.
27417
27418 2001-09-10  Ravi Pratap  <ravi@ximian.com>
27419
27420         * class.cs (Event::Define): Make the prefixes of the accessor methods
27421         addOn_ and removeOn_ 
27422
27423         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
27424         of the location being passed in too. Ideally, this should go later since all
27425         error reporting should be done through the Report object.
27426
27427         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
27428         (Populate): Iterate thru the indexers we have and define them too.
27429         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
27430         for the get and set accessors.
27431         (Indexer::Define): Implement.
27432
27433 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
27434
27435         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
27436         my previous implementation, did not work.
27437
27438         * typemanager.cs: Add a couple of missing types (the longs).
27439
27440         * literal.cs: Use TypeManager.bool_type instead of getting it.
27441
27442         * expression.cs (EventExpr): New kind of expressions.
27443         (Expressio::ExprClassFromMemberInfo): finish
27444
27445 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
27446
27447         * assign.cs: Emit stores to static fields differently.
27448
27449 2001-09-08  Ravi Pratap  <ravi@ximian.com>
27450
27451         * Merge in changes and adjust code to tackle conflicts. Backed out my
27452         code in Assign::Resolve ;-) 
27453
27454 2001-09-08  Ravi Pratap  <ravi@ximian.com>
27455
27456         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
27457         instead Report.Error and also pass in the location.
27458         (CSharpParser::Lexer): New readonly property to return the reference
27459         to the Tokenizer object.
27460         (declare_local_variables): Use Report.Error with location instead of plain 
27461         old error.
27462         (CheckDef): Ditto.
27463
27464         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
27465         (Operator.CheckBinaryOperator): Ditto.
27466
27467         * cs-parser.jay (operator_declarator): Update accordingly.
27468
27469         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
27470         (CheckBinaryOperator): Same here.
27471
27472         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
27473         on the name without any prefixes of namespace names etc. This is because we
27474         already might have something already fully qualified like 
27475         'System.Console.WriteLine'
27476
27477         * assign.cs (Resolve): Begin implementation. Stuck ;-)
27478
27479 2001-09-07  Ravi Pratap  <ravi@ximian.com>
27480
27481         * cs-tokenizer.cs (location): Return a string which also contains
27482         the file name.
27483
27484         * expression.cs (ElementAccess): New class for expressions of the
27485         type 'element access.'
27486         (BaseAccess): New class for expressions of the type 'base access.'
27487         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
27488         respectively.
27489
27490         * cs-parser.jay (element_access): Implement action.
27491         (base_access): Implement actions.
27492         (checked_expression, unchecked_expression): Implement.
27493
27494         * cs-parser.jay (local_variable_type): Correct and implement.
27495         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
27496
27497         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
27498
27499         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
27500         name and the specifiers.
27501
27502         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
27503
27504         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
27505         making them all public ;-)
27506
27507         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
27508         class anyways.
27509
27510 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
27511
27512         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
27513         PropertyExprs.
27514         (FieldExpr, PropertyExprs): New resolved expressions.
27515         (SimpleName::MemberStaticCheck): Perform static checks for access
27516         to non-static fields on static methods. Maybe this should be
27517         generalized for MemberAccesses. 
27518         (SimpleName::ResolveSimpleName): More work on simple name
27519         resolution. 
27520
27521         * cs-parser.jay (primary_expression/qualified_identifier): track
27522         the parameter index.
27523
27524         * codegen.cs (CodeGen::Save): Catch save exception, report error.
27525         (EmitContext::EmitBoolExpression): Chain to expression generation
27526         instead of temporary hack.
27527         (::EmitStatementExpression): Put generic expression code generation.
27528
27529         * assign.cs (Assign::Emit): Implement variable assignments to
27530         local variables, parameters and fields.
27531
27532 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
27533
27534         * statement.cs (Block::GetVariableInfo): New method, returns the
27535         VariableInfo for a variable name in a block.
27536         (Block::GetVariableType): Implement in terms of GetVariableInfo
27537
27538         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
27539         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
27540
27541 2001-09-06  Ravi Pratap  <ravi@ximian.com>
27542
27543         * cs-parser.jay (operator_declaration): Continue on my quest : update
27544         to take attributes argument.
27545         (event_declaration): Ditto.
27546         (enum_declaration): Ditto.
27547         (indexer_declaration): Ditto.
27548
27549         * class.cs (Operator::Operator): Update constructor accordingly.
27550         (Event::Event): Ditto.
27551
27552         * delegate.cs (Delegate::Delegate): Same here.
27553
27554         * enum.cs (Enum::Enum): Same here.
27555
27556 2001-09-05  Ravi Pratap  <ravi@ximian.com>
27557
27558         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
27559
27560         * ../tests/cs0658.cs : New file to demonstrate error 0658.
27561
27562         * attribute.cs (Attributes): New class to encapsulate all attributes which were
27563         being passed around as an arraylist.
27564         (Attributes::AddAttribute): Method to add attribute sections.
27565
27566         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
27567         (struct_declaration): Update accordingly.
27568         (constant_declaration): Update.
27569         (field_declaration): Update.
27570         (method_header): Update.
27571         (fixed_parameter): Update.
27572         (parameter_array): Ditto.
27573         (property_declaration): Ditto.
27574         (destructor_declaration): Ditto.
27575
27576         * class.cs (Struct::Struct): Update constructors accordingly.
27577         (Class::Class): Ditto.
27578         (Field::Field): Ditto.
27579         (Method::Method): Ditto.
27580         (Property::Property): Ditto.
27581         (TypeContainer::OptAttribute): update property's return type.
27582
27583         * interface.cs (Interface.opt_attributes): New member.
27584         (Interface::Interface): Update to take the extra Attributes argument.
27585
27586         * parameter.cs (Parameter::Parameter): Ditto.
27587
27588         * constant.cs (Constant::Constant): Ditto.
27589
27590         * interface.cs (InterfaceMemberBase): New OptAttributes field.
27591         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
27592         the attributes as a parameter.
27593         (InterfaceProperty): Update constructor call.
27594         (InterfaceEvent): Ditto.
27595         (InterfaceMethod): Ditto.
27596         (InterfaceIndexer): Ditto.
27597
27598         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
27599         pass the attributes too.
27600         (interface_event_declaration): Ditto.
27601         (interface_property_declaration): Ditto.
27602         (interface_method_declaration): Ditto.
27603         (interface_declaration): Ditto.
27604
27605 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
27606
27607         * class.cs (Method::Define): Track the "static Main" definition to
27608         create an entry point. 
27609
27610         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
27611         EntryPoint if we find it. 
27612
27613         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
27614         (EmitContext::ig): Make this variable public.
27615
27616         * driver.cs: Make the default output file be the first file name
27617         with the .exe extension.  
27618
27619         Detect empty compilations
27620
27621         Handle various kinds of output targets.  Handle --target and
27622         rename -t to --dumper.
27623
27624         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
27625         methods inherited from Expression return now an Expression.  This
27626         will is used during the tree rewriting as we resolve them during
27627         semantic analysis.
27628
27629         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
27630         the spec.  Missing entirely is the information about
27631         accessability of elements of it.
27632
27633         (Expression::ExprClassFromMemberInfo): New constructor for
27634         Expressions that creates a fully initialized Expression based on
27635         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
27636         a Type.
27637
27638         (Invocation::Resolve): Begin implementing resolution of invocations.
27639
27640         * literal.cs (StringLiteral):  Implement Emit.
27641
27642 2001-09-05  Ravi Pratap  <ravi@ximian.com>
27643
27644         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
27645         member.
27646
27647 2001-09-04  Ravi Pratap  <ravi@ximian.com>
27648
27649         * cs-parser.jay (attribute_arguments): Implement actions.
27650         (attribute): Fix bug in production. Implement action.
27651         (attribute_list): Implement.
27652         (attribute_target): Implement.
27653         (attribute_target_specifier, opt_target_specifier): Implement
27654         (CheckAttributeTarget): New method to check if the attribute target
27655         is valid.
27656         (attribute_section): Implement.
27657         (opt_attributes): Implement.
27658
27659         * attribute.cs : New file to handle attributes.
27660         (Attribute): Class to hold attribute info.
27661
27662         * cs-parser.jay (opt_attribute_target_specifier): Remove production
27663         (attribute_section): Modify production to use 2 different rules to 
27664         achieve the same thing. 1 s/r conflict down !
27665         Clean out commented, useless, non-reducing dimension_separator rules.
27666
27667         * class.cs (TypeContainer.attributes): New member to hold list
27668         of attributes for a type.
27669         (Struct::Struct): Modify to take one more argument, the attribute list.
27670         (Class::Class): Ditto.
27671         (Field::Field): Ditto.
27672         (Method::Method): Ditto.
27673         (Property::Property): Ditto.
27674
27675         * cs-parser.jay (struct_declaration): Update constructor call to
27676         pass in the attributes too.
27677         (class_declaration): Ditto.
27678         (constant_declaration): Ditto.
27679         (field_declaration): Ditto.
27680         (method_header): Ditto.
27681         (fixed_parameter): Ditto.
27682         (parameter_array): Ditto.
27683         (property_declaration): Ditto.
27684
27685         * constant.cs (Constant::Constant): Update constructor similarly.
27686         Use System.Collections.
27687
27688         * parameter.cs (Parameter::Parameter): Update as above.
27689
27690 2001-09-02  Ravi Pratap  <ravi@ximian.com>
27691
27692         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
27693         (TypeContainer.delegates): New member to hold list of delegates.
27694
27695         * cs-parser.jay (delegate_declaration): Implement the action correctly 
27696         this time as I seem to be on crack ;-)
27697
27698 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
27699
27700         * rootcontext.cs (RootContext::IsNamespace): new function, used to
27701         tell whether an identifier represents a namespace.
27702
27703         * expression.cs (NamespaceExpr): A namespace expression, used only
27704         temporarly during expression resolution.
27705         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
27706         utility functions to resolve names on expressions.
27707
27708 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
27709
27710         * codegen.cs: Add hook for StatementExpressions. 
27711
27712         * class.cs: Fix inverted test for static flag in methods.
27713
27714 2001-09-02  Ravi Pratap  <ravi@ximian.com>
27715
27716         * class.cs (Operator::CheckUnaryOperator): Correct error number used
27717         to make it coincide with MS' number.
27718         (Operator::CheckBinaryOperator): Ditto.
27719
27720         * ../errors/errors.txt : Remove error numbers added earlier.
27721
27722         * ../errors/cs1019.cs : Test case for error # 1019
27723
27724         * ../errros/cs1020.cs : Test case for error # 1020
27725
27726         * cs-parser.jay : Clean out commented cruft.
27727         (dimension_separators, dimension_separator): Comment out. Ostensibly not
27728         used anywhere - non-reducing rule.
27729         (namespace_declarations): Non-reducing rule - comment out.
27730
27731         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
27732         with TypeContainer::AddEnum.
27733
27734         * delegate.cs : New file for delegate handling classes.
27735         (Delegate): Class for declaring delegates.
27736
27737         * makefile : Update.
27738
27739         * cs-parser.jay (delegate_declaration): Implement.
27740
27741 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
27742
27743         * class.cs (Event::Define): Implement.
27744         (Event.EventBuilder): New member.
27745
27746         * class.cs (TypeContainer::Populate): Update to define all enums and events
27747         we have.
27748         (Events): New property for the events arraylist we hold. Shouldn't we move to using
27749         readonly fields for all these cases ?
27750
27751 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
27752
27753         * class.cs (Property): Revamp to use the convention of making fields readonly.
27754         Accordingly modify code elsewhere.
27755
27756         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
27757         the Define method of the Property class.
27758
27759         * class.cs : Clean up applied patch and update references to variables etc. Fix 
27760         trivial bug.
27761         (TypeContainer::Populate): Update to define all the properties we have. Also
27762         define all enumerations.
27763
27764         * enum.cs (Define): Implement.
27765
27766 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
27767
27768         * cs-parser.jay (overloadable_operator): The semantic value is an
27769         enum of the Operator class.
27770         (operator_declarator): Implement actions.
27771         (operator_declaration): Implement.
27772
27773         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
27774         validity of definitions.
27775         (Operator::CheckBinaryOperator): Static method to check for binary operators
27776         (TypeContainer::AddOperator): New method to add an operator to a type.
27777
27778         * cs-parser.jay (indexer_declaration): Added line to actually call the
27779         AddIndexer method so it gets added ;-)
27780
27781         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
27782         already taken care of by the MS compiler ?  
27783
27784 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
27785
27786         * class.cs (Operator): New class for operator declarations.
27787         (Operator::OpType): Enum for the various operators.
27788
27789 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
27790
27791         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
27792         ostensibly handle this in semantic analysis.
27793
27794         * cs-parser.jay (general_catch_clause): Comment out
27795         (specific_catch_clauses, specific_catch_clause): Ditto.
27796         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
27797         (catch_args, opt_catch_args): New productions.
27798         (catch_clause): Rewrite to use the new productions above
27799         (catch_clauses): Modify accordingly.
27800         (opt_catch_clauses): New production to use in try_statement
27801         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
27802         and re-write the code in the actions to extract the specific and
27803         general catch clauses by being a little smart ;-)
27804
27805         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
27806         Hooray, try and catch statements parse fine !
27807
27808 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
27809
27810         * statement.cs (Block::GetVariableType): Fix logic to extract the type
27811         string from the hashtable of variables.
27812
27813         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
27814         I end up making that mistake ;-)
27815         (catch_clauses): Fixed gross error which made Key and Value of the 
27816         DictionaryEntry the same : $1 !!
27817
27818 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
27819
27820         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
27821
27822         * cs-parser.jay (event_declaration): Correct to remove the semicolon
27823         when the add and remove accessors are specified. 
27824
27825 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
27826
27827         * cs-parser.jay (IndexerDeclaration): New helper class to hold
27828         information about indexer_declarator.
27829         (indexer_declarator): Implement actions.
27830         (parsing_indexer): New local boolean used to keep track of whether
27831         we are parsing indexers or properties. This is necessary because 
27832         implicit_parameters come into picture even for the get accessor in the 
27833         case of an indexer.
27834         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
27835
27836         * class.cs (Indexer): New class for indexer declarations.
27837         (TypeContainer::AddIndexer): New method to add an indexer to a type.
27838         (TypeContainer::indexers): New member to hold list of indexers for the
27839         type.
27840
27841 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
27842
27843         * cs-parser.jay (add_accessor_declaration): Implement action.
27844         (remove_accessor_declaration): Implement action.
27845         (event_accessors_declaration): Implement
27846         (variable_declarators): swap statements for first rule - trivial.
27847
27848         * class.cs (Event): New class to hold information about event
27849         declarations.
27850         (TypeContainer::AddEvent): New method to add an event to a type
27851         (TypeContainer::events): New member to hold list of events.
27852
27853         * cs-parser.jay (event_declaration): Implement actions.
27854
27855 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
27856
27857         * cs-parser.jay (dim_separators): Implement. Make it a string
27858         concatenating all the commas together, just as they appear.
27859         (opt_dim_separators): Modify accordingly
27860         (rank_specifiers): Update accordingly. Basically do the same
27861         thing - instead, collect the brackets here.
27862         (opt_rank_sepcifiers): Modify accordingly.
27863         (array_type): Modify to actually return the complete type string
27864         instead of ignoring the rank_specifiers.
27865         (expression_list): Implement to collect the expressions
27866         (variable_initializer): Implement. We make it a list of expressions
27867         essentially so that we can handle the array_initializer case neatly too.
27868         (variable_initializer_list): Implement.
27869         (array_initializer): Make it a list of variable_initializers
27870         (opt_array_initializer): Modify accordingly.
27871
27872         * expression.cs (New::NType): Add enumeration to help us
27873         keep track of whether we have an object/delegate creation
27874         or an array creation.
27875         (New:NewType, New::Rank, New::Indices, New::Initializers): New
27876         members to hold data about array creation.
27877         (New:New): Modify to update NewType
27878         (New:New): New Overloaded contructor for the array creation
27879         case.
27880
27881         * cs-parser.jay (array_creation_expression): Implement to call
27882         the overloaded New constructor.
27883
27884 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
27885
27886         * class.cs (TypeContainer::Constructors): Return member
27887         constructors instead of returning null.
27888
27889 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
27890
27891         * typemanager.cs (InitCoreTypes): Initialize the various core
27892         types after we have populated the type manager with the user
27893         defined types (this distinction will be important later while
27894         compiling corlib.dll)
27895
27896         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
27897         on Expression Classification.  Now all expressions have a method
27898         `Resolve' and a method `Emit'.
27899
27900         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
27901         generation from working.     Also add some temporary debugging
27902         code. 
27903
27904 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
27905
27906         * codegen.cs: Lots of code generation pieces.  This is only the
27907         beginning, will continue tomorrow with more touches of polish.  We
27908         handle the fundamentals of if, while, do, for, return.  Others are
27909         trickier and I need to start working on invocations soon.
27910
27911         * gen-treedump.cs: Bug fix, use s.Increment here instead of
27912         s.InitStatement. 
27913
27914         * codegen.cs (EmitContext): New struct, used during code
27915         emission to keep a context.   Most of the code generation will be
27916         here. 
27917
27918         * cs-parser.jay: Add embedded blocks to the list of statements of
27919         this block.  So code generation proceeds in a top down fashion.
27920
27921 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
27922
27923         * statement.cs: Add support for multiple child blocks.
27924
27925 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
27926
27927         * codegen.cs (EmitCode): New function, will emit the code for a
27928         Block of code given a TypeContainer and its ILGenerator. 
27929
27930         * statement.cs (Block): Standard public readonly optimization.
27931         (Block::Block constructors): Link children. 
27932         (Block::Child): Child Linker.
27933         (Block::EmitVariables): Emits IL variable declarations.
27934
27935         * class.cs: Drop support for MethodGroups here, delay until
27936         Semantic Analysis.
27937         (Method::): Applied the same simplification that I did before, and
27938         move from Properties to public readonly fields.
27939         (Method::ParameterTypes): Returns the parameter types for the
27940         function, and implements a cache that will be useful later when I
27941         do error checking and the semantic analysis on the methods is
27942         performed.
27943         (Constructor::GetCallingConvention): Renamed from CallingConvetion
27944         and made a method, optional argument tells whether this is a class
27945         or a structure to apply the `has-this' bit.
27946         (Method::GetCallingConvention): Implement, returns the calling
27947         convention. 
27948         (Method::Define): Defines the type, a second pass is performed
27949         later to populate the methods.
27950
27951         (Constructor::ParameterTypes): implement a cache similar to the
27952         one on Method::ParameterTypes, useful later when we do semantic
27953         analysis. 
27954
27955         (TypeContainer::EmitMethod):  New method.  Emits methods.
27956
27957         * expression.cs: Removed MethodGroup class from here.
27958
27959         * parameter.cs (Parameters::GetCallingConvention): new method.
27960
27961 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
27962
27963         * class.cs (TypeContainer::Populate): Drop RootContext from the
27964         argument. 
27965
27966         (Constructor::CallingConvention): Returns the calling convention.
27967         (Constructor::ParameterTypes): Returns the constructor parameter
27968         types. 
27969
27970         (TypeContainer::AddConstructor): Keep track of default constructor
27971         and the default static constructor.
27972
27973         (Constructor::) Another class that starts using `public readonly'
27974         instead of properties. 
27975
27976         (Constructor::IsDefault): Whether this is a default constructor. 
27977
27978         (Field::) use readonly public fields instead of properties also.
27979
27980         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
27981         track of static constructors;  If none is used, turn on
27982         BeforeFieldInit in the TypeAttributes. 
27983
27984         * cs-parser.jay (opt_argument_list): now the return can be null
27985         for the cases where there are no arguments. 
27986
27987         (constructor_declarator): If there is no implicit `base' or
27988         `this', then invoke the default parent constructor. 
27989
27990         * modifiers.cs (MethodAttr): New static function maps a set of
27991         modifiers flags into a MethodAttributes enum
27992         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
27993         MethodAttr, TypeAttr to represent the various mappings where the
27994         modifiers are used.
27995         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
27996
27997 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
27998
27999         * parameter.cs (GetParameterInfo): Fix bug where there would be no
28000         method arguments.
28001
28002         * interface.cs (PopulateIndexer): Implemented the code generator
28003         for interface indexers.
28004
28005 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
28006
28007         * interface.cs (InterfaceMemberBase): Now we track the new status
28008         here.  
28009
28010         (PopulateProperty): Implement property population.  Woohoo!  Got
28011         Methods and Properties going today. 
28012
28013         Removed all the properties for interfaces, and replaced them with
28014         `public readonly' fields. 
28015
28016 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
28017
28018         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
28019         initialize their hashtables/arraylists only when they are needed
28020         instead of doing this always.
28021
28022         * parameter.cs: Handle refs and out parameters.
28023
28024         * cs-parser.jay: Use an ArrayList to construct the arguments
28025         instead of the ParameterCollection, and then cast that to a
28026         Parameter[] array.
28027
28028         * parameter.cs: Drop the use of ParameterCollection and use
28029         instead arrays of Parameters.
28030
28031         (GetParameterInfo): Use the Type, not the Name when resolving
28032         types. 
28033
28034 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
28035
28036         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
28037         and instead use public readonly fields.
28038
28039         * class.cs: Put back walking code for type containers.
28040
28041 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
28042
28043         * class.cs (MakeConstant): Code to define constants.
28044
28045         * rootcontext.cs (LookupType): New function.  Used to locate types 
28046
28047
28048 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
28049
28050         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
28051         this System.Reflection code is.  Kudos to Microsoft
28052
28053         * typemanager.cs: Implement a type cache and avoid loading all
28054         types at boot time.  Wrap in LookupType the internals.  This made
28055         the compiler so much faster.  Wow.  I rule!
28056
28057         * driver.cs: Make sure we always load mscorlib first (for
28058         debugging purposes, nothing really important).
28059
28060         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
28061         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
28062
28063         * rootcontext.cs: Lookup types on their namespace;  Lookup types
28064         on namespaces that have been imported using the `using' keyword.
28065
28066         * class.cs (TypeContainer::TypeAttr): Virtualize.
28067         (Class::TypeAttr): Return attributes suitable for this bad boy.
28068         (Struct::TypeAttr): ditto.
28069         Handle nested classes.
28070         (TypeContainer::) Remove all the type visiting code, it is now
28071         replaced with the rootcontext.cs code
28072
28073         * rootcontext.cs (GetClassBases): Added support for structs. 
28074
28075 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
28076
28077         * interface.cs, statement.cs, class.cs, parameter.cs,
28078         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
28079         Drop use of TypeRefs, and use strings instead.
28080
28081 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
28082
28083         * rootcontext.cs: 
28084
28085         * class.cs (Struct::Struct): set the SEALED flags after
28086         checking the modifiers.
28087         (TypeContainer::TypeAttr): new property, returns the
28088         TypeAttributes for a class.  
28089
28090         * cs-parser.jay (type_list): Oops, list production was creating a
28091         new list of base types.
28092
28093         * rootcontext.cs (StdLib): New property.
28094         (GetInterfaceTypeByName): returns an interface by type name, and
28095         encapsulates error handling here.
28096         (GetInterfaces): simplified.
28097         (ResolveTree): Encapsulated all the tree resolution here.
28098         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
28099         types. 
28100
28101         * driver.cs: Add support for --nostdlib, to avoid loading the
28102         default assemblies.
28103         (Main): Do not put tree resolution here. 
28104
28105         * rootcontext.cs: Beginning of the class resolution.
28106
28107 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
28108
28109         * rootcontext.cs: Provide better error reporting. 
28110
28111         * cs-parser.jay (interface_base): set our $$ to be interfaces.
28112
28113         * rootcontext.cs (CreateInterface): Handle the case where there
28114         are no parent interfaces.
28115
28116         (CloseTypes): Routine to flush types at the end.
28117         (CreateInterface): Track types.
28118         (GetInterfaces): Returns an array of Types from the list of
28119         defined interfaces.
28120
28121         * typemanager.c (AddUserType): Mechanism to track user types (puts
28122         the type on the global type hash, and allows us to close it at the
28123         end). 
28124
28125 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
28126
28127         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
28128         RecordInterface instead.
28129
28130         * cs-parser.jay: Updated to reflect changes above.
28131
28132         * decl.cs (Definition): Keep track of the TypeBuilder type that
28133         represents this type here.  Not sure we will use it in the long
28134         run, but wont hurt for now.
28135
28136         * driver.cs: Smaller changes to accomodate the new code.
28137
28138         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
28139         when done. 
28140
28141         * rootcontext.cs (CreateInterface):  New method, used to create
28142         the System.TypeBuilder type for interfaces.
28143         (ResolveInterfaces): new entry point to resolve the interface
28144         hierarchy. 
28145         (CodeGen): Property, used to keep track of the code generator.
28146
28147 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
28148
28149         * cs-parser.jay: Add a second production for delegate_declaration
28150         with `VOID'.
28151
28152         (enum_body): Put an opt_comma here instead of putting it on
28153         enum_body or enum_member_declarations so we can handle trailing
28154         commas on enumeration members.  Gets rid of a shift/reduce.
28155
28156         (type_list): Need a COMMA in the middle.
28157
28158         (indexer_declaration): Tell tokenizer to recognize get/set
28159
28160         * Remove old targets.
28161
28162         * Re-add the parser target.
28163
28164 2001-07-13  Simon Cozens <simon@simon-cozens.org>
28165
28166         * cs-parser.jay: Add precendence rules for a number of operators
28167         ot reduce the number of shift/reduce conflicts in the grammar.
28168
28169 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
28170
28171         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
28172         and put it here.
28173
28174         Get rid of old crufty code.
28175
28176         * rootcontext.cs: Use this to keep track of the parsed
28177         representation and the defined types available to the program. 
28178
28179         * gen-treedump.cs: adjust for new convention.
28180
28181         * type.cs: Split out the type manager, and the assembly builder
28182         from here. 
28183
28184         * typemanager.cs: the type manager will live here now.
28185
28186         * cil-codegen.cs: And the code generator here. 
28187
28188 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
28189
28190         * makefile: Fixed up for easy making.
28191
28192 2001-07-13  Simon Cozens <simon@simon-cozens.org>
28193
28194         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
28195         the 
28196
28197         (unary_expression): Expand pre_increment_expression and
28198         post_decrement_expression to reduce a shift/reduce.
28199
28200 2001-07-11  Simon Cozens
28201
28202         * cs-tokenizer.cs: Hex numbers should begin with a 0.
28203
28204         Improve allow_keyword_as_indent name.
28205
28206 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
28207
28208         * Adjustments for Beta2. 
28209
28210 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
28211
28212         * decl.cs: Added `Define' abstract method.
28213         (InTransit): new property, used to catch recursive definitions. 
28214
28215         * interface.cs: Implement `Define'. 
28216
28217         * modifiers.cs: Map Modifiers.constants to
28218         System.Reflection.TypeAttribute flags.
28219
28220         * class.cs: Keep track of types and user-defined types.
28221         (BuilderInit): New method for creating an assembly
28222         (ResolveType): New function to launch the resolution process, only
28223         used by interfaces for now.
28224
28225         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
28226         that are inserted into the name space. 
28227
28228 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
28229
28230         * ARGH.  I have screwed up my tree so many times due to the use of
28231         rsync rather than using CVS.  Going to fix this at once. 
28232
28233         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
28234         load types.
28235
28236 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
28237
28238         * Experiment successful: Use System.Type rather that our own
28239         version of Type.  
28240
28241 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
28242
28243         * cs-parser.jay: Removed nsAliases from here.
28244
28245         Use new namespaces, handle `using XXX;' 
28246
28247         * namespace.cs: Reimplemented namespace handling, use a recursive
28248         definition of the class.  Now we can keep track of using clauses
28249         and catch invalid using clauses.
28250
28251 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
28252
28253         * gen-treedump.cs: Adapted for all the renaming.
28254
28255         * expression.cs (Expression): this class now has a Type property
28256         which returns an expression Type.
28257
28258         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
28259         `Type', as this has a different meaning now in the base
28260
28261 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
28262
28263         * interface.cs, class.cs: Removed from all the sources the
28264         references to signature computation, as we can not do method
28265         signature computation during the parsing time, as we are not
28266         trying to solve at that point distinguishing:
28267
28268         class X {
28269                 void a (Blah x) {}
28270                 void a (NS.Blah x) {}
28271         }
28272
28273         Which depending on the context might be valid or not, as we do not
28274         know if Blah is the same thing as NS.Blah at that point.
28275
28276         * Redid everything so the code uses TypeRefs now instead of
28277         Types.  TypeRefs are just temporary type placeholders, that need
28278         to be resolved.  They initially have a pointer to a string and the
28279         current scope in which they are used.  This is used later by the
28280         compiler to resolve the reference to an actual Type. 
28281
28282         * DeclSpace is no longer a CIR.Type, and neither are
28283         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
28284         are all DeclSpaces, but no Types. 
28285
28286         * type.cs (TypeRefManager): This implements the TypeRef manager,
28287         which keeps track of all the types that need to be resolved after
28288         the parsing has finished. 
28289
28290 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
28291
28292         * ARGH.  We are going to have to store `foreach' as a class rather
28293         than resolving it, as we need to verify error 1579 after name
28294         resolution.   *OR* we could keep a flag that says `This request to
28295         IEnumerator comes from a foreach statement' which we can then use
28296         to generate the error.
28297
28298 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
28299
28300         * class.cs (TypeContainer.AddMethod): we now add methods to the
28301         MethodGroup instead of the method hashtable.  
28302
28303         * expression.cs: Add MethodGroup abstraction, which gets us one
28304         step closer to the specification in the way we handle method
28305         declarations.  
28306
28307         * cs-parser.jay (primary_expression): qualified_identifier now
28308         tried to match up an identifier to a local variable reference or
28309         to a parameter reference.
28310
28311         current_local_parameters is now a parser global variable that
28312         points to the current parameters for the block, used during name
28313         lookup.
28314
28315         (property_declaration): Now creates an implicit `value' argument to
28316         the set accessor.
28317
28318 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
28319
28320         * parameter.cs: Do not use `param' arguments as part of the
28321         signature, per the spec.
28322
28323 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
28324
28325         * decl.cs: Base class for classes, structs and interfaces.  This
28326         is the "Declaration Space" 
28327
28328         * cs-parser.jay: Use CheckDef for checking declaration errors
28329         instead of having one on each function.
28330
28331         * class.cs: Factor out some code for handling error handling in
28332         accordance to the "Declarations" section in the "Basic Concepts"
28333         chapter in the ECMA C# spec.
28334
28335         * interface.cs: Make all interface member classes derive from
28336         InterfaceMemberBase.
28337
28338 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
28339
28340         * Many things: all interfaces are parsed and generated in
28341         gen-treedump.  Support for member variables, constructors,
28342         destructors, properties, constants is there.
28343
28344         Beginning of the IL backend, but very little done, just there for
28345         testing purposes. 
28346
28347 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
28348
28349         * cs-parser.jay: Fix labeled statement.
28350
28351         * cs-tokenizer.cs (escape): Escape " and ' always.
28352         ref_line, ref_name: keep track of the line/filename as instructed
28353         by #line by the compiler.
28354         Parse #line.
28355
28356 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
28357
28358         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
28359         to match the values in System.CodeDOM.
28360
28361         Divid renamed to Divide.
28362
28363         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
28364         statements. 
28365         (Statements.set): remove.
28366
28367         * System.CodeDOM/CodeCatchClause.cs: always have a valid
28368         statements. 
28369
28370         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
28371         falseStatements always have valid values. 
28372
28373         * cs-parser.jay: Use System.CodeDOM now.
28374