2008-03-12 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / mcs / ChangeLog
1 2008-03-12  Marek Safar  <marek.safar@gmail.com>
2
3         * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
4         crash when predefined field does not exist.
5         
6 2008-03-12  Marek Safar  <marek.safar@gmail.com>
7
8         * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
9         
10 2008-03-12  Marek Safar  <marek.safar@gmail.com>
11
12         * class.cs (FixedField): Don't crash when contructors are missing.
13
14 2008-03-11  Marek Safar  <marek.safar@gmail.com>
15
16         * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
17         convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
18         check internal types accessibility for internal and external types.
19         Replaced EnumToUnderlying by GetEnumUnderlyingType.
20
21 2008-03-11  Marek Safar  <marek.safar@gmail.com>
22
23         * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
24         convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
25         attribute.cs, statement: Use corect instance of predefined types (work
26         related to #364674).
27
28 2008-03-07  Marek Safar  <marek.safar@gmail.com>
29
30         * expression.cs (TypeOfVoid): Fixed predefined method initialization.
31         
32 2008-03-07  Marek Safar  <marek.safar@gmail.com>
33
34         * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, 
35         class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
36         expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
37         predefined types clean up, delayed predefined types members initialization
38         (work related to #364674).
39
40 2008-03-05  Marek Safar  <marek.safar@gmail.com>
41
42         * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
43         
44 2008-03-05  Marek Safar  <marek.safar@gmail.com>
45
46         * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
47         delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
48         predefined types clean up (work related to #364674).
49
50 2008-03-04  Marek Safar  <marek.safar@gmail.com>
51
52         * ecore.cs: Print an error message instead of throwing exception.
53         
54 2008-03-04  Marek Safar  <marek.safar@gmail.com>
55
56         * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
57         expression.cs, statement.cs: Unififed null literal representation.
58
59 2008-03-03  Marek Safar  <marek.safar@gmail.com>
60
61         * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
62         expression.cs: Refactored binary operators resolve phase and improved speed.
63         The nullable code is still missing and won't work correctly, more fixes
64         required.
65
66         It also fixes #323726, #324312, #324248, and many other unreported issues.
67
68 2008-02-29  Zoltan Varga  <vargaz@gmail.com>
69
70         * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs' 
71         instead of 'gmcs'.
72
73 2008-02-27  Marek Safar  <marek.safar@gmail.com>
74
75         * ecore.cs: Clean-up and split BetterConversion.
76         
77 2008-02-25  Raja R Harinath  <harinath@hurrynot.org>
78
79         Fix #363791
80         * enum.cs (EnumMember.Value): Only access 'value' if
81         ResolveValue says it's ok.
82         (EnumMember.DoResolveValue): Don't set prev_member.value.
83         (Enum.GetDefinition): Reverse arguments of Equals --
84         EnumMember.Value can return 'null'.
85
86         * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
87
88 2008-02-22  Marek Safar  <marek.safar@gmail.com>
89
90         * generic.cs, expression.cs: More ongoing work on expression trees.
91         
92 2008-02-21  Marek Safar  <marek.safar@gmail.com>
93
94         * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
95         handle missing matches when mutiple operators exist.
96         
97 2008-02-20  Marek Safar  <marek.safar@gmail.com>
98
99         A fix for bug #363218
100         * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
101         initializers.
102         
103 2008-02-20  Marek Safar  <marek.safar@gmail.com>
104
105         * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
106         update. This time to deal correctly with SideEffectConstant expression used
107         as an argument for another constant folding.
108
109 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
110
111         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
112         MethodBuilder.
113
114 2008-02-19  Marek Safar  <marek.safar@gmail.com>
115
116         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
117
118 2008-02-19  Marek Safar  <marek.safar@gmail.com>
119
120         A fix for bug #328136
121         * expression.cs: Do not fold immediately LogicalAnd operators when the left
122         side is a false constant, because we still need to evaluate the right-hand
123         side.
124
125         * statement.cs (If): Emit two types of boolean constants (simple constant,
126         side-effect constant).
127
128 2008-02-19  Marek Safar  <marek.safar@gmail.com>
129
130         * constant.cs (SideEffectConstant): Don't emit boolean constant.
131
132         * expression.cs: Fold immediately LogicalAnd operators when both sides are
133         constants.
134
135 2008-02-18  Marek Safar  <marek.safar@gmail.com>
136
137         A fix for bug #361457
138         * ecore.cs (IsApplicable): Params methods have lower priority.
139
140         * support.cs: Return correct parameter modifier for params types.
141
142 2008-02-18  Marek Safar  <marek.safar@gmail.com>
143
144         * generic.cs (TypeParameter): Cache attribute target name.
145
146         * support.cs: Removed unused variable.
147
148         * typemanager.cs: Removed debugging leftover.
149
150         * ecore.cs: Use local type instead of a property;
151
152         * class.cs (VerifyMembers): Consider also parent to test whether type member
153         is local or public.
154
155         * expression.cs (FullMethodDesc): Removed.
156
157         * attribute.cs (IsValidArgumentType): Made static.
158
159 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
160
161         Cleanup to be more readable.
162         * Makefile (GMCS_PROFILE): Remove.
163         (COMPILER_NAME): New helper.
164
165 2008-02-15  Miguel de Icaza  <miguel@novell.com>
166
167         * cs-tokenizer.cs: if a conditional expression happens inside a
168         (...) this also means that we do not need to de-ambiguate between
169         an parenthesized expression and a cast.
170
171         Fixes 346484.
172
173         * constant.cs (SideEffectConstant): a constant value that happens
174         to have a side effect.
175
176         Fixes the build regressions introduced by the fix for #359789
177
178 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
179
180         * expression.cs (Conditional.Emit): when emitting the ternary
181         operator, use local variables to generate code verifiable code.
182
183         The verifier cannot infer that the type on stack before the
184         stloc.0 is executed is of type ParentB. This happens because the
185         stack merge algorithm uses only parent types when deciding which
186         is the common type.  This is described in Part III 1.8.1.3 of ECMA
187         335.
188
189         This code compiled with mcs is not verifiable under MS. The MS
190         verifier picks the first common interface of Foo and Bar, which is
191         wrong, but doesn't use a full join type of the 2 interfaces.
192
193         CSC uses a clever hack to compile such code in a verifiable
194         way. It stores the intermediate values in a local variable with
195         the expected type.
196
197         Fixes: #358102
198
199 2008-02-14  Miguel de Icaza  <miguel@novell.com>
200
201         * expression.cs: Do not fold BitwiseAnd operators when the left
202         side is a false constant, because we still need to evaluate the
203         right-hand side.
204
205         Fixes #359789
206
207         * support.cs: Instead of throwing an InternalErrorException when
208         the position of the stream is outside the boundary of our buffer,
209         reset the state of the reader, and restart the reading from the
210         beginning of the file.
211
212 2008-02-14  Marek Safar  <marek.safar@gmail.com>
213
214         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
215
216 2008-02-14  Marek Safar  <marek.safar@gmail.com>
217
218         A fix for bug #361686
219         * decl.cs: A protected types used inside a private class which parents
220         derives from the protected class are accessible.
221
222 2008-02-13  Marek Safar  <marek.safar@gmail.com>
223
224         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
225         the parameterless constructor.
226
227 2008-02-13  Marek Safar  <marek.safar@gmail.com>
228
229         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
230         lookup methods to use standard member cache when doing member lookup.
231
232 2008-02-12  Marek Safar  <marek.safar@gmail.com>
233
234         * driver.cs: Don't report full path for referenced module as assembly error.
235
236 2008-02-12  Marek Safar  <marek.safar@gmail.com>
237
238         * Makefile: Fixed `qh' target to work on all machines.
239
240         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
241         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
242         and HasElementType with TypeManager implementation.
243
244 2008-02-08  Marek Safar  <marek.safar@gmail.com>
245
246         A fix for bugs #325134, #359749
247         * expression.cs, ecore.cs: Try to resolve an extension method even if the
248         first binds point to non-method member expression.
249
250 2008-02-08  Marek Safar  <marek.safar@gmail.com>
251
252         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
253
254 2008-02-08  Marek Safar  <marek.safar@gmail.com>
255
256         A fix for bugs #321394, #323028
257         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
258         Reworked naive IsAccessibleAs implementation to handle nested types.
259
260 2008-02-05  Jb Evain  <jbevain@novell.com>
261
262         * class.cs: use generic type comparison for parameters
263         as well.
264
265 2008-02-05  Marek Safar  <marek.safar@gmail.com>
266
267         A fix for bug #325372
268         * class.cs: Use generic type comparison when testing method signatures.
269
270 2008-02-05  Marek Safar  <marek.safar@gmail.com>
271
272         A fix for bug #357047
273         * ecore.cs: Applied C# 3.0 changes to better conversion.
274
275 2008-02-05  Marek Safar  <marek.safar@gmail.com>
276
277         A fix for bug #358374
278         * cs-parser.jay: Correctly set modifiers for all constructor types.
279
280 2008-02-04  Marek Safar  <marek.safar@gmail.com>
281
282         A fix for bug #355251
283         * generic.cs: Added base class constraint based type inference.
284
285 2008-02-01  Marek Safar  <marek.safar@gmail.com>
286
287         A fix for bug #357255
288         * decl.cs: One more missing visibility check.
289
290 2008-02-01  Marek Safar  <marek.safar@gmail.com>
291
292         * support.cs: Fixed broken return.
293
294 2008-01-25  Marek Safar  <marek.safar@gmail.com>
295
296         * report.cs: Correctly reset warnings count after probing.
297
298 2008-01-25  Martin Baulig  <martin@ximian.com>
299
300         * namespace.cs
301         (NamespaceEntry.SymbolFileID): Make this work again after
302         MemberName.ToString() is gone.
303
304 2008-01-25  Marek Safar  <marek.safar@gmail.com>
305
306         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
307         expressions.
308
309 2008-01-25  Marek Safar  <marek.safar@gmail.com>
310
311         * generic.cs: Use full implicit conversion for type inference fixing.
312
313 2008-01-24  Marek Safar  <marek.safar@gmail.com>
314
315         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
316         Fixed user operator conversions.
317
318 2008-01-24  Marek Safar  <marek.safar@gmail.com>
319
320         * generic.cs: Do nullable type to null comparison optimization during
321         resolve phase.
322
323 2008-01-24  Marek Safar  <marek.safar@gmail.com>
324
325         A fix for bug #355163
326         * generic.cs: Enabled l-value resolve on nullable expressions.
327
328 2008-01-24  Marek Safar  <marek.safar@gmail.com>
329
330         A fix for bug #353986
331         * class.cs: Ingore static ctors with parameters for any further checks.
332
333 2008-01-24  Marek Safar  <marek.safar@gmail.com>
334
335         A fix for bug #354310
336         * namespace.cs: Removed redundant check.
337
338 2008-01-24  Marek Safar  <marek.safar@gmail.com>
339
340         A fix for bug #354928
341         * expression.cs: ElementInitializers can be resolved only once.
342
343 2008-01-24  Marek Safar  <marek.safar@gmail.com>
344
345         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
346         Condition expressions.
347
348 2008-01-23  Marek Safar  <marek.safar@gmail.com>
349
350         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
351
352 2008-01-22  Marek Safar  <marek.safar@gmail.com>
353
354         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
355         not allowed.
356
357         * generic.cs: Implemented coalesce expression.
358
359 2008-01-22  Marek Safar  <marek.safar@gmail.com>
360
361         A fix for bug #355145
362         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
363         expression tree type inference.
364
365 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
366
367         Fix #354663
368         * expression.cs (Binary.IsUnsignedType): Fix typo.
369
370 2008-01-22  Marek Safar  <marek.safar@gmail.com>
371
372         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
373
374 2008-01-22  Marek Safar  <marek.safar@gmail.com>
375
376         A fix for bug #355161
377         * ecore.cs, expression.cs: Wider range of extension method supported
378         expressions.
379
380 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
381
382         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
383         AssemblyBuilder to operate in compiler context. Fixes mcs part of
384         bug #354970.
385
386 2008-01-22  Marek Safar  <marek.safar@gmail.com>
387
388         A fix for bug #355148
389         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
390
391 2008-01-22  Miguel de Icaza  <miguel@novell.com>
392
393         * expression.cs (CreateExpressionTree): Add support for or and
394         logical or, and indent following the coding conventions.
395
396         * typemanager.cs (LinqExpression): renamed from
397         ExpressionTreeManager, for a shorter name.
398
399         Use TypeManager.CoreLookupType to lookup types from our core
400         assemblies and turn those into "Type" variables.
401
402         Consumers that previously used "Namespace" and "Type" from this
403         class should instead use the TypeExpression which is a type that
404         is fully resolved (without involving the regular C# resolution
405         rules). 
406
407         This typically looks like this:
408
409         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
410         new MemberAccess (texpr, name, type_arguments, loc)
411
412         This avoids the problem in: #355178
413
414 2008-01-21  Marek Safar  <marek.safar@gmail.com>
415
416         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
417         feature in parser only as we do in other cases.
418         
419 2008-01-21  Marek Safar  <marek.safar@gmail.com>
420
421         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
422         typemanager.cs: A refactoring of params arguments to reuse existing
423         expressions (params -> array initializer) to emit params argument instead
424         of specialized handling.
425         It was required by expression tree implementation and it has other benefits
426         as well, we now apply same optimization for params arguments as we do for
427         array initializers.
428         
429 2008-01-18  Marek Safar  <marek.safar@gmail.com>
430
431         A fix for bug #353526
432         * generic.cs: A type inference of params arguments may not required any
433         temporary array creation.
434         
435 2008-01-18  Marek Safar  <marek.safar@gmail.com>
436
437         A fix for bug #353534
438         * generic.cs, ecore.cs, expression.cs: A method group type inference is
439         supported for delegates only.
440         
441 2008-01-18  Marek Safar  <marek.safar@gmail.com>
442
443         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
444         type for more than 1 candidates.
445         
446 2008-01-18  Marek Safar  <marek.safar@gmail.com>
447
448         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
449         expressions.
450         
451 2008-01-16  Marek Safar  <marek.safar@gmail.com>
452
453         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
454         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
455         operator) expressions. 
456                 
457 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
458
459         * statement.cs: Avoid declaring an IL variable for this_variable since it is
460         not accessed from the generated IL.
461
462 2008-01-14  Marek Safar  <marek.safar@gmail.com>
463
464         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
465         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
466         statement.cs: The first expression tree implementation drop, mostly
467         infrastructure work.
468
469 2008-01-14  Marek Safar  <marek.safar@gmail.com>
470
471         * ecore.cs (IsNestedChild): Refactored.
472
473 2008-01-11  Marek Safar  <marek.safar@gmail.com>
474
475         * lambda.cs: Don't use a cast on unknown expression statement.
476
477 2008-01-10  Geoff Norton  <gnorton@novell.com>
478
479         * cs-tokenizer.cs: One more token to distinguish between method and lambda
480         arguments
481
482 2008-01-09  Marek Safar  <marek.safar@gmail.com>
483
484         * doc.cs: Report better /doc crash details.
485         
486 2008-01-09  Marek Safar  <marek.safar@gmail.com>
487
488         A fix for bug #352536
489         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
490
491 2008-01-08  Marek Safar  <marek.safar@gmail.com>
492
493         A fix for bug #352287
494         * ecore.cs, expression.cs: Do `this' access checking in all member access
495         expressions.
496         
497 2008-01-08  Marek Safar  <marek.safar@gmail.com>
498
499         * rootcontext.cs, driver.cs: Switch to linq mode by default.
500         
501         * report.cs: Reset message stacks.
502         
503 2008-01-08  Marek Safar  <marek.safar@gmail.com>
504
505         * generic.cs (InferInPhases): Correctly calculate params position.
506         
507 2008-01-08  Marek Safar  <marek.safar@gmail.com>
508
509         * cs-tokenizer.cs: No need to parse full string when parsing lambda
510         arguments.
511
512 2008-01-07  Marek Safar  <marek.safar@gmail.com>
513
514         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
515         
516         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
517         
518         * driver.cs: Updated --help option.
519         
520 2008-01-07  Marek Safar  <marek.safar@gmail.com>
521
522         * generic.cs (InferParamsTypeArguments): Removed.
523         (InferInPhases): Add params type inference.
524         (LowerBoundInference): Fixed scoring mechanism.
525         
526         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
527         
528 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
529
530         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
531         byte array for unsigned "baked" assemblies.
532
533 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
534
535         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
536         array for assemblies that are not strongnamed.
537
538 2008-01-04  Marek Safar  <marek.safar@gmail.com>
539
540         A fix for bug #351481
541         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
542         declaring type for nested generic types.
543         
544 2008-01-04  Marek Safar  <marek.safar@gmail.com>
545
546         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
547         instead of ToString.
548         
549 2008-01-03  Marek Safar  <marek.safar@gmail.com>
550
551         A fix for bug #351047
552         * expression.cs (Binary.ResolveOperator): Allow equality operators between
553         null and structs only when equality and inequality operators are defined
554         either as an user-operators or predefined operators.
555         
556 2008-01-03  Marek Safar  <marek.safar@gmail.com>
557
558         A fix for bug #351047
559         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
560         
561 2008-01-03  Marek Safar  <marek.safar@gmail.com>
562
563         A fix for bug #351257
564         * cs-tokenizer.cs: Advance line number for '\r' correctly.
565         
566 2008-01-03  Marek Safar  <marek.safar@gmail.com>
567
568         A fix for bug #351157
569         * class.cs (Using): Fixed yet another broken cloning.
570         
571         (Block): Put back more sensible default value for statements.
572         
573 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
574
575         * codegen.cs: Allow AssemblyVersion with only major version component.
576         Fixes bug #351055.
577
578 2007-12-29  Marek Safar  <marek.safar@gmail.com>
579
580         A fix for bug #324654
581         * class.cs: Use FullName property as member name.
582
583 2007-12-28  Marek Safar  <marek.safar@gmail.com>
584
585         A fix for bug #342117
586         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
587         constructor constraint.
588
589 2007-12-28  Marek Safar  <marek.safar@gmail.com>
590
591         A fix for bug #338273
592         * class.cs (ProbertyBase): Access modifier checks are required for overrides
593         only.
594
595 2007-12-28  Marek Safar  <marek.safar@gmail.com>
596
597         A fix for bug #350839
598         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
599
600 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
601
602         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
603         GHOP:
604         
605         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
606
607         * statement.cs: Changed some Hashtables to use HybridDictionaries
608         instead. It was observed that some HashTables only contained a few
609         items in the vast majority of cases. Since HybridDictionary is
610         more efficient on small sets (<10 elements), "known_variables"
611         from class ExplicitBlock as well as "labels" and "constants " from
612         class Block were changed to HybridDictionaries. 
613
614         Atsai results: (56216kb->54987kb)
615
616         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
617
618
619 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
620
621         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
622         GHOP:
623         
624         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
625         
626         * expression.cs: foreach loop to for loop, saved on allocation of
627         enumerator (59333kb->59141kb)
628
629         * statement.cs. Changed foreach loops to for loops, saved on
630         allocation of enumerator (59141kb->59006kb)
631
632         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
633         when constructed with no specified capacity. This was causing a
634         few ArrayLists to allocate more memory than they would potentially
635         need in the Block class and MemberCache class. Setting the
636         ArrayLists to construct with a capacity of 1 saves some
637         memory. (56216kb->55585kb)
638
639 2007-12-27  Marek Safar  <marek.safar@gmail.com>
640
641         A fix for bug #347189 (2nd issue)
642         * expression.cs (MemberAccess): Nested type can be found in base non-generic
643         type.
644
645 2007-12-27  Miguel de Icaza  <miguel@novell.com>
646         
647         * report.cs: Do not use colors if stdout and stderr are not a
648         terminal.
649
650 2007-12-27  Marek Safar  <marek.safar@gmail.com>
651
652         A fix for bug #346998
653         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
654         overloads.
655
656 2007-12-27  Marek Safar  <marek.safar@gmail.com>
657
658         A fix for bug #343465
659         * class.cs: Explicit method name for nested types uses dots only.
660
661 2007-12-27  Marek Safar  <marek.safar@gmail.com>
662
663         A fix for bug #343707
664         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
665
666 2007-12-27  Marek Safar  <marek.safar@gmail.com>
667
668         * ecore.cs: Report type inference errors only when arguments count matches
669         parameter count.
670         
671         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
672         
673         * expression.cs, report.cs: New warning.
674         
675         * typemanager.cs: Catch anonymous method type too.
676
677 2007-12-23  Marek Safar  <marek.safar@gmail.com>
678
679         A fix for bug #346379
680         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
681
682 2007-12-23  Marek Safar  <marek.safar@gmail.com>
683
684         A fix for bug #347359
685         * expression.cs (Invocation): Don't resolve already resolved expression.
686
687 2007-12-23  Marek Safar  <marek.safar@gmail.com>
688
689         A fix for bug #347189
690         * class.cs (FixedField): Use non-dependent code only in the define phase.
691
692 2007-12-23  Marek Safar  <marek.safar@gmail.com>
693
694         A fix for bug #348076
695         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
696
697 2007-12-22  Marek Safar  <marek.safar@gmail.com>
698
699         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
700         discovered extension methods.
701
702 2007-12-22  Marek Safar  <marek.safar@gmail.com>
703
704         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
705         method.
706
707 2007-12-21  Miguel de Icaza  <miguel@novell.com>
708
709         * report.cs (ErrorMessage): Add support for using colors on
710         terminals that support it. 
711
712 2007-12-21  Marek Safar  <marek.safar@gmail.com>
713
714         * ecore.cs: Use information about expanded params for error reporting.
715
716 2007-12-21  Marek Safar  <marek.safar@gmail.com>
717
718         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
719         and logic for params overloads.
720         
721 2007-12-15  Miguel de Icaza  <miguel@novell.com>
722
723         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
724         as this is also created from the parser.  Fixes #349034
725
726 2007-12-12  Miguel de Icaza  <miguel@novell.com>
727
728         * statement.cs (Throw.CloneTo): it is valid to have empty
729         expressions for throw. 
730
731 2007-12-03  Marek Safar  <marek.safar@gmail.com>
732
733         * cs-parser.jay: Set delegate constraint parsing region correctly.
734
735 2007-12-03  Marek Safar  <marek.safar@gmail.com>
736
737         A fix for bug #345467
738         * typemanager.cs (IsEqual): Compare generic parameters position only.
739         
740 2007-11-28  Marek Safar  <marek.safar@gmail.com>
741
742         * expression.cs (BaseAccess): Type arguments can be null.
743
744 2007-11-27  Raja R Harinath  <harinath@gmail.com>
745
746         * statement.cs (Block.Resolve): Ensure flow-branching tree is
747         consistent even when an error has occured.
748         (Switch.Resolve): Likewise.
749
750 2007-11-22  Marek Safar  <marek.safar@gmail.com>
751
752         A fix for bug #334505
753         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
754         overrides.
755         
756 2007-11-22  Marek Safar  <marek.safar@gmail.com>
757
758         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
759         refactorings required to resolve extension methods correctly when mixing
760         generics and non-generics members.
761         
762 2007-11-20  Marek Safar  <marek.safar@gmail.com>
763
764         A fix for bug #342584
765         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
766         conversion.
767         
768 2007-11-19  Marek Safar  <marek.safar@gmail.com>
769
770         A fix for bug #342512
771         * delegate.cs: Use delegate argument expression when is available. Don't
772         emit virtual call when class is sealed.
773         
774 2007-11-16  Marek Safar  <marek.safar@gmail.com>
775
776         A fix for bug #325423
777         * assign.cs (FieldInitializer): Use resolved expression for emit.
778         
779         * class.cs: Print less confusing error message.
780         
781 2007-11-16  Marek Safar  <marek.safar@gmail.com>
782
783         * cs-tokenizer.cs: Removed GMCS ifdefs.
784         
785         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
786         mcs.
787         
788         * cs-parser.jay: Disabled nullable check.
789         
790         * generic-mcs: Copied more generic stuff.
791                 
792 2007-11-16  Marek Safar  <marek.safar@gmail.com>
793
794         * gcs-parser.jay: Merged to cs-parser.jay.
795         
796         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
797         * *.csproj, *.sources: Updated to use only jay parser file.
798
799 2007-11-16  Marek Safar  <marek.safar@gmail.com>
800
801         * gcs-parser.jay: Added nullable and default expression feature checks.
802         
803 2007-11-16  Marek Safar  <marek.safar@gmail.com>
804
805         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
806         it fixes many TODOs and hidden bugs.
807         
808         * expression: Removed duplicate error check.
809
810 2007-11-15  Marek Safar  <marek.safar@gmail.com>
811
812         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
813         implicitly type local variable only when it is used in a declaration.
814
815 2007-11-15  Marek Safar  <marek.safar@gmail.com>
816
817         * attribute.cs: Use CS0612 for empty strings.
818
819 2007-11-14  Marek Safar  <marek.safar@gmail.com>
820
821         * lambda.cs, statement.cs: Contextual return may act as a statement.
822
823 2007-11-14  Marek Safar  <marek.safar@gmail.com>
824
825         A fix for a regression cause by #324222
826         * class.cs: Don't report unused even when it implements an interface.
827         
828 2007-11-13  Marek Safar  <marek.safar@gmail.com>
829
830         A fix for bug #341205
831         * ecore.cs, expression.cs: Method group expression cannot do static
832         method access with an instance reference check before overloading takes
833         a place.
834         
835 2007-11-13  Marek Safar  <marek.safar@gmail.com>
836
837         A fix for bug #325359
838         * class.cs: Use predictable name for automatically generated property.
839         
840 2007-11-12  Marek Safar  <marek.safar@gmail.com>
841
842         A fix for bug #324996
843         * expression.cs (Is): Handle case where D is nullable and T is not
844         correctly.
845         
846         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
847         
848 2007-11-12  Marek Safar  <marek.safar@gmail.com>
849
850         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
851         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
852         Flush small error reporting changes.
853         
854 2007-11-09  Marek Safar  <marek.safar@gmail.com>
855
856         A fix for bug #324996
857         * expression.cs: Rewrote Is expression implementation to work with
858         generics, nullable types, anonymous method. A const result expression 
859         uses existing infrastructure instead of custom not fully-featured one.
860         
861 2007-11-08  Marek Safar  <marek.safar@gmail.com>
862
863         A fix for bug #340202
864         * class.cs: Consider generics for volatile field.
865
866 2007-11-08  Marek Safar  <marek.safar@gmail.com>
867
868         A fix for bug #335594
869         * expression.cs: Use conversion rules when handling string addition.
870         
871 2007-11-07  Marek Safar  <marek.safar@gmail.com>
872
873         A fix for bug #336651
874         * expression.cs: Fixed a crash when probing is on.
875         
876 2007-11-07  Marek Safar  <marek.safar@gmail.com>
877
878         A fix for bug #324242
879         * covert.cs: Added a conversion from any nullable-type with an 
880         underlying enum-type to the type System.Enum.
881         
882 2007-11-07  Marek Safar  <marek.safar@gmail.com>
883
884         A fix for bug #324222
885         * class.cs: Report all non-used event fields.
886         
887 2007-11-07  Marek Safar  <marek.safar@gmail.com>
888
889         A fix for bug #325161
890         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
891         qualifier for generic types.
892         
893 2007-11-07  Marek Safar  <marek.safar@gmail.com>
894
895         A fix for bug #322971
896         * expression.cs, ecore.cs: Added intermediate result value check for
897         indexers. 
898         
899 2007-11-07  Marek Safar  <marek.safar@gmail.com>
900
901         A fix for bug #324754
902         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
903         when it was requested.
904
905 2007-11-07  Marek Safar  <marek.safar@gmail.com>
906
907         A fix for bug #325101
908         * expression.cs: Do type not value comparison for `is' expression.
909
910 2007-11-07  Marek Safar  <marek.safar@gmail.com>
911
912         A fix for bug #320236
913         * convert.cs: Don't apply user conversion on underlying target type.
914
915 2007-11-06  Marek Safar  <marek.safar@gmail.com>
916
917         * expression.cs: Don't use unresolved expression for error reporting.
918  
919 2007-11-06  Marek Safar  <marek.safar@gmail.com>
920
921         A fix for bugs #337712, #324490
922         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
923         overloading resolution too.
924         
925         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
926         the process consistent and more robust.
927         
928         * expression.cs, linq.cs, report.cs: Update.
929
930 2007-11-02  Marek Safar  <marek.safar@gmail.com>
931
932         A fix for bug #332909
933         * attribute.cs: Resolve attributes in correct context using error
934         handling procedure.
935         
936         * rootcontext.cs: Define Obsolete attribute members as core members.
937         
938 2007-11-02  Marek Safar  <marek.safar@gmail.com>
939
940         * statement.cs: Removed unused methods.
941         
942 2007-10-31  Wade Berrier  <wberrier@novell.com>
943
944         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
945         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
946         during 'make dist')
947
948 2007-10-31  Marek Safar  <marek.safar@gmail.com>
949
950         A fix for bug #338102
951         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
952         methods registered as non-generics.
953         
954 2007-10-31  Marek Safar  <marek.safar@gmail.com>
955
956         A fix for bugs #337712, #324490
957         * delegate.cs: Delegate covariance and contravariance is not allowed for
958         value types.
959         
960 2007-10-31  Marek Safar  <marek.safar@gmail.com>
961
962         A fix for bug #337719 
963         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
964         `from' keyword.
965         
966 2007-10-30  Marek Safar  <marek.safar@gmail.com>
967  
968         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
969
970 2007-10-29  Marek Safar  <marek.safar@gmail.com>
971  
972         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
973         query expressions.
974
975 2007-10-29  Raja R Harinath  <rharinath@novell.com>
976
977         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
978
979 2007-10-29  Marek Safar  <marek.safar@gmail.com>
980  
981         A fix for bug #334652
982         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
983         extension methods when we have not found the best candidate in normal
984         container.
985
986 2007-10-27  Marek Safar  <marek.safar@gmail.com>
987
988         * AssemblyInfo.cs: Keep up-to-date.
989
990 2007-10-27  Marek Safar  <marek.safar@gmail.com>
991
992         * Makefile: Fixed generics compiler name.
993         
994 2007-10-27  Marek Safar  <marek.safar@gmail.com>
995
996         * lambda.test: removed, lambda parsing is done differently.
997         
998         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
999
1000 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
1001
1002         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
1003
1004 2007-10-27  Marek Safar  <marek.safar@gmail.com>
1005
1006         * Makefile, *.sources : All C# compilers are in mcs folder.
1007         
1008         * *.cs: Use existing 2_1 define for smcs.
1009
1010 2007-10-26  Marek Safar  <marek.safar@gmail.com>
1011
1012         A fix for bug #335847
1013         * assign.cs, expression.cs: Couple of changes to avoid creating a
1014         temporary variable for each object initializer assignment statement. It
1015         simplifies struct initialization too, otherwise two temporary variables
1016         would be required.
1017         Implemented optimization of redundant default element initializers.
1018         
1019 2007-10-25  Marek Safar  <marek.safar@gmail.com>
1020
1021         A fix for bug #336766
1022         * expression.cs (Class.CheckBase): Use generic name when method is
1023         generic.
1024         
1025 2007-10-25  Marek Safar  <marek.safar@gmail.com>
1026
1027         A fix for bug #334737
1028         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
1029         variable and not variable argument for prepared copies.
1030
1031 2007-10-24  Marek Safar  <marek.safar@gmail.com>
1032
1033         A fix for bug #325110
1034         * class.cs, expression.cs, attribute.cs: Use open generic method when
1035         checking conditional attribute.
1036         
1037 2007-10-24  Marek Safar  <marek.safar@gmail.com>
1038
1039         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
1040         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
1041         FeatureIsNotAvailable.
1042
1043 2007-10-24  Marek Safar  <marek.safar@gmail.com>
1044
1045         ** C# 3.0 Partial methods
1046         
1047         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
1048         methods support. Because of member cache issue with generics only
1049         non-generics partial methods are fully supported.
1050         
1051 2007-10-23  Marek Safar  <marek.safar@gmail.com>
1052         
1053         * class.cs, decl.cs: Rewrote member overloads check to cope with 
1054         generics and to use member cache for member checking. It also improves
1055         performance and fixes remaining overloads issues.
1056         
1057 2007-10-20  Marek Safar  <marek.safar@gmail.com>
1058         
1059         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
1060         roottypes.cs, typemanager.cs:
1061                 
1062         A member cache creation logic changed to add members immediately and
1063         not rely on fallback. The member cache is now only prefered way
1064         how to access and find type declaration members. It saves 5 MB of memory
1065         during MWF compilation and makes code ready for more optimizations and
1066         clean-ups, it's also a pre-requirement for partial methods.
1067         
1068 2007-10-18  Raja R Harinath  <harinath@gmail.com>
1069
1070         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
1071         handling for generic parameters.
1072
1073 2007-10-15  Marek Safar  <marek.safar@gmail.com>
1074         
1075         * class.cs (FixedField): Removed redundant volatile check.
1076         
1077 2007-10-15  Marek Safar  <marek.safar@gmail.com>
1078         
1079         * class.cs, decl.cs: Fixed overload members verification to do only one
1080         check per possible collision.
1081         
1082 2007-10-13  Marek Safar  <marek.safar@gmail.com>
1083         
1084         A fix for bug #325478
1085         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
1086         and create only one disposable flags container.
1087         
1088 2007-10-12  Marek Safar  <marek.safar@gmail.com>
1089         
1090         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
1091         * statement.cs (Fixed): Fixed variables cloning.
1092         
1093 2007-10-12  Marek Safar  <marek.safar@gmail.com>
1094         
1095         A fix for bug #333342
1096         * class.cs (EventField): Don't mark value type event as synchronized. 
1097         
1098 2007-10-12  Marek Safar  <marek.safar@gmail.com>
1099         
1100         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
1101         inference to identify best candidate method correctly.
1102         (ProperyExpr): A range variable is read only and cannot be modified.
1103         
1104 2007-10-11  Marek Safar  <marek.safar@gmail.com>
1105         
1106         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
1107         logic to identify best candidate method correctly.
1108         
1109 2007-10-11  Marek Safar  <marek.safar@gmail.com>
1110         
1111         * location.cs (Equals, GetHashCode): Removed.
1112         
1113 2007-10-11  Marek Safar  <marek.safar@gmail.com>
1114         
1115         * report.cs: Implemented message recorder. It is used mainly for lambda
1116         expressions to capture otherwise swallowed error messages.
1117         
1118         * anonymous.cs, lambda.cs.cs: Do full parameters check.
1119
1120         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
1121         and not at the top.
1122         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
1123                 
1124         * expression.cs (MemberAccess): Always report lookup failure.
1125         
1126         * location.cs: Implemented Equals, GetHashCode.
1127         
1128         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
1129         
1130 2007-10-10  Jb Evain  <jbevain@novell.com>
1131
1132         * codegen.cs: re-enable assembly version check.
1133
1134 2007-10-09  Marek Safar  <marek.safar@gmail.com>
1135         
1136         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
1137         checks.
1138         
1139         * namespace.cs (UsingAlias): Do correct version check.
1140         
1141 2007-10-08  Marek Safar  <marek.safar@gmail.com>
1142         
1143         * expresison.cs, ecore.cs: Issue extension method error message when
1144         appropriate.
1145         
1146         * rootcontext.cs: Added ISO_2 compiler mode option.
1147
1148 2007-10-08  Marek Safar  <marek.safar@gmail.com>
1149         
1150         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
1151          message.
1152         
1153 2007-10-08  Marek Safar  <marek.safar@gmail.com>
1154         
1155         * attribute.cs (GetString, GetBoolean): Work with both literal and
1156         constant.
1157         
1158         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
1159         Moved method overload specific methods to MethodGroupExpr.
1160         
1161         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
1162         it should be less memory consuming.
1163         
1164 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
1165
1166         * codegen.cs: remove the assembly version check until the buildbot is
1167         fixed.
1168
1169 2007-10-07  Jb Evain  <jbevain@novell.com>
1170
1171         * attribute.cs (Attribute.GetString): if the value
1172         expression is a StringConstant, return its string value.
1173
1174 2007-10-07  Jb Evain  <jbevain@novell.com>
1175
1176         * typemanager.cs: add `assembly_version_attribute_type`.
1177         * codegen.cs: on attribute emission, check that the
1178         AssemblyVersionAttribute doesn't overflow.
1179
1180 2007-10-05  Marek Safar  <marek.safar@gmail.com>
1181         
1182         A fix for bug #324677
1183         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
1184         parent container of a scope container with currently resolved one. 
1185         
1186 2007-10-05  Marek Safar  <marek.safar@gmail.com>
1187         
1188         A fix for bug #325534
1189         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
1190         only.
1191         
1192 2007-10-05  Marek Safar  <marek.safar@gmail.com>
1193         
1194         A fix for bug #327504
1195         * class.cs (Operator.Define): Refactored implicit and explicit user
1196         operator conversion rules.
1197         
1198 2007-10-05  Marek Safar  <marek.safar@gmail.com>
1199         
1200         A fix for bug #327520
1201         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
1202         
1203 2007-10-04  Marek Safar  <marek.safar@gmail.com>
1204         
1205         A fix for bug #328022
1206         * class.cs (MethodData.Define): Use correct method to check whether
1207         a method implementents an accessor.
1208         
1209 2007-10-04  Marek Safar  <marek.safar@gmail.com>
1210         
1211         A fix for bug #330069
1212         * statement.cs (Fixed.Resolve): Read the first array element only when
1213         an array is instantiated. 
1214         
1215 2007-10-04  Marek Safar  <marek.safar@gmail.com>
1216         
1217         * expression.cs, assign.cs, generics.cs: Print correct operator when
1218         compound assignment is used.
1219         
1220 2007-10-04  Marek Safar  <marek.safar@gmail.com>
1221         
1222         A fix for bug #325841
1223         * expression.cs (ArrayAccess): Use full argument cloning only for
1224         string compound concatenation.
1225         
1226 2007-10-03  Marek Safar  <marek.safar@gmail.com>
1227         
1228         A fix for bug #328774
1229         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
1230         assignment.
1231         (PropertyExpr.EmitAssign): Fixed string concatenation compound
1232         assignment.
1233
1234 2007-10-03  Raja R Harinath  <rharinath@novell.com>
1235
1236         Fix #328490
1237         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
1238         Event accessibility checks here.  Remove some bogus code that
1239         accidently made GenericMethods work.
1240         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
1241
1242 2007-09-25  Marek Safar  <marek.safar@gmail.com>
1243         
1244         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
1245         
1246         * statement.cs (Block): Refactored AddVariable to allow error handling
1247         customization.
1248         
1249         * generic.cs: New stub.
1250         
1251 2007-09-23  Marek Safar  <marek.safar@gmail.com>
1252         
1253         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
1254         flag.
1255         
1256 2007-09-17  Marek Safar  <marek.safar@gmail.com>
1257
1258         * class.cs: Use partial container to record whether any partial part
1259         contains static field initializer and therefore default contructor has
1260         to be defined.
1261         
1262 2007-09-14  Marek Safar  <marek.safar@gmail.com>
1263
1264         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
1265         mono-list when only one of two partial parts has defined accessibility
1266         modifier.
1267         
1268 2007-09-14  Marek Safar  <marek.safar@gmail.com>
1269
1270         A fix for bug #82845
1271         
1272         * class.cs (TypeContainer): Set correct resolve context for all field
1273         initializers.
1274         
1275 2007-09-13  Marek Safar  <marek.safar@gmail.com>
1276
1277         * assign.cs: Fixed a crash when field is resolved twice with an error.
1278         
1279         * codegen.cs: Changed InFieldInitializer to be flag.
1280         
1281         * anonymous.cs, ecore.cs, expression.cs: Update after
1282         IsInFieldInitializer rename.
1283         
1284         * const.cs: Removed unused parameter.
1285         
1286         * class.cs: Changed the way how we resolve and emit field initializers.
1287         The field initilizers have to have access to contructor block to emit
1288         compiler generated code.
1289
1290 2007-09-13  Marek Safar  <marek.safar@gmail.com>
1291
1292         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
1293         generics use TypeContainer instead.
1294         
1295 2007-09-12  Marek Safar  <marek.safar@gmail.com>
1296         
1297         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
1298
1299         * lambda.cs (ResolveParameters): Use more powerful
1300         InflateGenericArgument.
1301         
1302         * parameters.cs: Better exception message.
1303                 
1304 2007-09-10  Marek Safar  <marek.safar@gmail.com>
1305
1306         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
1307         correct expression block type. 
1308         
1309         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
1310         
1311         * expression.cs (Invocation): Extracted method group resolve to
1312         DoResolveOverload.
1313         
1314 2007-09-07  Marek Safar  <marek.safar@gmail.com>
1315
1316         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
1317         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
1318         
1319         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
1320         generic extension methods.
1321
1322 2007-09-06  Marek Safar  <marek.safar@gmail.com>
1323
1324         A fix for bug #82676 (Do I get it right now?)
1325         * convert.cs (Binary.ResolveOperator): An interface is converted to the
1326         object before a standard conversion is applied.
1327         
1328 2007-09-06  Marek Safar  <marek.safar@gmail.com>
1329
1330         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
1331         #82676.
1332         
1333 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1334
1335         A fix for bug #82676
1336         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
1337         non-generic interface types.
1338         
1339 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1340
1341         A fix for bug #82690
1342         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
1343         
1344 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1345
1346         A fix for bug #82571
1347         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
1348         modifier for container based methods.
1349         
1350 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1351
1352         A fix for bug #82676
1353         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
1354         any interface-type T means to any of interface type T.
1355
1356 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1357
1358         * namespace.cs: We have 2 versions of System.Core assembly.
1359
1360 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1361
1362         A fix for bug #82652
1363         * class.cs (Class.GetClassBases): Compare types and not expressions.
1364
1365 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1366
1367         A fix for bug #82620
1368         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
1369         actually never worked before.
1370         (IndexerAccess): Emit prepared arguments before they are modified.
1371         
1372 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1373
1374         A fix for bug #82563
1375         * assign.cs: Revert wrong fix.
1376         
1377         * expression.cs (VariableReference.EmitAssign): Handle ref reference
1378         correctly.
1379         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
1380         Instead of ldelema/stdind we have to use temporary variables to handle
1381         cases like String.Concat (params string[]).
1382         
1383 2007-08-31  Marek Safar  <marek.safar@gmail.com>
1384
1385         * class.cs: EmitAttributes to Emit rename.
1386         
1387         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
1388         null.
1389         (MemberCore.HasClsCompliantAttribute): Don't depend on 
1390         GetClsCompliantAttributeValue execution.
1391         
1392 2007-08-31  Marek Safar  <marek.safar@gmail.com>
1393
1394         * anonymous.cs: Use shorter type prefix.
1395         
1396         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
1397         when exist.
1398         
1399         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
1400         variables when probing is on.
1401         
1402         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
1403         unresolved variables.
1404         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
1405         handle transparent identifiers.
1406         
1407 2007-08-26  Marek Safar  <marek.safar@gmail.com>
1408
1409         * attribute.cs (IsClsCompliant): Add nullable types test.
1410         
1411 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
1412
1413         * doc.cs : catch other types of exception than XmlException to
1414           report CS1570. Fixed bug #82565.
1415
1416 2007-08-23  Marek Safar  <marek.safar@gmail.com>
1417
1418         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
1419         The number of delegate parameters has to match.
1420         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
1421         arrays.
1422
1423 2007-08-21  Marek Safar  <marek.safar@gmail.com>
1424
1425         * anonymous.cs (AnonymousMethod): Generate private anonymous method
1426         to fix problem with private arguments.
1427
1428 2007-08-20  Marek Safar  <marek.safar@gmail.com>
1429
1430         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
1431         
1432         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
1433         
1434         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
1435         empty. Add cloning suport.
1436         
1437         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
1438
1439 2007-08-20  Marek Safar  <marek.safar@gmail.com>
1440
1441         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
1442         to create EmptyCast. It handles EmptyConstantCast specialization for
1443         constants.
1444         
1445 2007-08-18  Marek Safar  <marek.safar@gmail.com>
1446
1447         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
1448         (EmitArrayArgument): One routine for array arguments.
1449         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
1450         
1451 2007-08-17  Marek Safar  <marek.safar@gmail.com>
1452
1453         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
1454
1455 2007-08-17  Marek Safar  <marek.safar@gmail.com>
1456
1457         * anonymous.cs: MemberLookupFinal update.
1458
1459         * class.cs (ConstructorInitializer): Is expression based.
1460         
1461         * delegate.cs: MethodGroupExpr update.
1462         
1463         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
1464         messages.
1465         (Error_MemberLookupFailed): Customizable error override.
1466         (MethodGroupExpr): Keep queried type for later usage.
1467         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
1468         resolve.
1469         
1470         * expression.cs: Error_MemberLookupFailed refactoring.
1471         (New.DoResolve): Resolve as much as possible.
1472         (ElementInitializer.Error_MemberLookupFailed): Object initializer
1473         customization for invalid member types.
1474
1475         * statement.cs: MethodGroupExpr update.
1476         
1477 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1478
1479         * modifier.cs (Check): Check all modifiers and not only accessibility
1480         ones.
1481
1482 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1483
1484         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
1485         type and not an expression.
1486
1487 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1488
1489         * statement.cs (Catch.Clone): Type and variable can be null.
1490
1491 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1492
1493         A fix for bug #81979
1494         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
1495         I am really not sure whether this is the best fix.
1496         
1497         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
1498         only once.
1499         
1500 2007-08-14  Marek Safar  <marek.safar@gmail.com>
1501
1502         ** C# 3.0 Object and collection initializers (major re-write)
1503         
1504         * assign.cs (DoResolve): Initializers are not assign related.
1505         
1506         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
1507         used during collection or object initialization.
1508         
1509         * expression.cs (Error_InvalidArguments): Add initializers specific
1510         messages. More will come later because it requires some general
1511         refactoring.
1512         (New.DoResolve): Better error handling for unsafe types.
1513         (EmptyExpressionStatement): New class.
1514         (ElementInitializer): An object initializer expression.
1515         (CollectionElementInitializer): A collection initializer expression.
1516         (CollectionOrObjectInitializers): A block of object or collection
1517         initializers.
1518         (NewInitialize): New expression with element/object initializers.
1519         
1520         * statement.cs: Reverted object/collection initializer hacks.
1521         
1522         * typemanager.cs (CSharpName): Filter __arglist type.
1523         
1524 2007-08-09  Marek Safar  <marek.safar@gmail.com>
1525
1526         ** C# 3.0 Anonymous Types (update to the latest standard)
1527         
1528         * expression.cs (Binary.ResolveOperator): Threat all null based types
1529         same.
1530         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
1531         (AnonymousTypeParameter): Updated.
1532         
1533         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
1534         (AnonymousTypeClass): New anonymous type container.
1535         
1536         * class.cs (AddField): Return operation result.
1537         
1538         * generic.cs: Another empty TypeArguments overload.
1539         
1540         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
1541         are stored at top of normal hierarchy.
1542         
1543         * typemanager.cs (CSharpName): Filter anonymous types.
1544         
1545 2007-08-09  Marek Safar  <marek.safar@gmail.com>
1546
1547         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
1548         as single Concat call. How could we miss that :-(
1549         
1550 2007-08-08  Marek Safar  <marek.safar@gmail.com>
1551
1552         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
1553         
1554 2007-08-07  Miguel de Icaza  <miguel@novell.com>
1555
1556         * expression.cs: Fix the previous commit, the creation of the
1557         arguments array list needs also to be conditional on the arguments
1558         not being null.
1559
1560         * class.cs: Add a little bit of help to help narrow down problems.
1561
1562         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
1563         not try to copy in that case. 
1564
1565         * driver.cs: When building SMCS, include a new different set of
1566         default assemblies here.   Do this here so we can control whether
1567         to include the default assemblies with /noconfig.
1568
1569 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1570
1571         A fix for bug #81979
1572         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
1573         only.
1574
1575 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1576
1577         A fix for bug #82300
1578
1579         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
1580         we are in probing scope.
1581
1582 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1583
1584         A fix for bug #82301
1585
1586         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
1587         (Statement.CloneTo): Clone and not map children blocks.
1588
1589 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1590
1591         A fix for bug #82299
1592
1593         * expression.cs (LocalVariableReference.CloneTo): Remap local info
1594         variable too.
1595         
1596         * statement.cs (Statement.CloneTo): Clone variables before statements
1597         to allow remaping of local variables.
1598
1599 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1600
1601         A fix for bug #82296
1602
1603         * anonymous.cs,
1604         * report.cs: Log crash details for future clone problems.
1605         
1606         * statement.cs (Return.Clone): Don't clone non-existent expression.
1607
1608 2007-08-03  Raja R Harinath  <harinath@gmail.com>
1609
1610         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
1611         (Class.AddBasesForPart): Move CS0537 check here from ...
1612         * cs-parser.jay (class_declaration): ... here.  Move calling of
1613         'AddBasesForPart' to ...
1614         (class_bases): ... here.
1615         (struct_declaration, interface_declaration): Update to changes.
1616
1617 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1618
1619         A fix for bug #81923
1620
1621         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
1622         conversion is allowed.
1623
1624 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1625
1626         A fix for bug #81564
1627
1628         * ecore.cs (EventExpr): Add IsBase handling.
1629
1630         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
1631         too.    
1632         
1633 2007-08-02  Raja R Harinath  <harinath@gmail.com>
1634
1635         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
1636         * cs-parser.jay: Some whitespace cleanups.
1637         (current_delegate): New.
1638         (type_name): New.
1639         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
1640         a dummy code block, and use 'type_name' instead of 'member_name'.
1641         (interface_declaration, class_declaration): Likewise.
1642         (delegate_declaration): Likewise.  Rearrange slightly and use
1643         'current_delegate'.
1644         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
1645         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
1646
1647 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1648
1649         A fix for bug #82039
1650
1651         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
1652         available.
1653
1654         * typemanager.cs (CSharpName): Split to string overload.
1655
1656 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1657
1658         * expression.cs,
1659         * report.cs: Updated warning CS0472.
1660
1661 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1662
1663         A fix for bug #82181
1664         * cs-parser.jay,
1665         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
1666
1667 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1668
1669         A fix for bug #82277
1670         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
1671
1672 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1673
1674         ** C# 3.0 Type Inference (major bits are working)
1675         
1676         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
1677         (.ImplicitStandardConversionExists): Uses compatible.
1678         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
1679         (.InferReturnType): New method.
1680         (.Compatible): Refactored.
1681         (.ResolveParameters): Uses factory to create resolved parameters.
1682         (.CompatibleMethod): Add probing mode support.
1683         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
1684         clearly distinguish between 2 different operations.
1685         (LambdaMethod): Moved to lambda.cs.
1686         (AnonymousMethod): Removed unused fields and methods.
1687         (AnonymousDelegate): Simplified.
1688         
1689         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
1690         
1691         * convert. cs (ImplicitConversionStandard): Compatible works differently.
1692         
1693         * delegate.cs (Delegate): New mehods to reduce code duplication.
1694         (.GetConstructor): New method.
1695         (.GetInvokeMethod): New method.
1696         (DelegateCreation): Updated.
1697         
1698         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
1699         does not exist.
1700         (OverloadResolve): Made probing little bit faster.
1701         
1702         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
1703         when probing is on.
1704         
1705         * generic.cs (TypeInferenceContext): Dummy implementation.
1706         
1707         * iterators.cs: Updated after Resolve/Define rename.
1708         
1709         * lambda.cs (LambdaExpression)
1710         (.ResolveParameters): Handles both type of arguments and type inference too.
1711         
1712         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
1713         (InflateTypes): Updated.
1714         
1715         * support.cs (InflateTypes): Changed signature and updated.
1716         
1717         * typemanager.cs (LookupMemberCache): Better dynamic type check.
1718         (MemberLookup_FindMembers): More MS tricks.
1719         (GetParameterData): Ditto.
1720         (GetDelegateParameters): Uses quick path for dynamic types.
1721         
1722 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1723
1724         * class.cs (MethodData.Define): EmitContext is required for generic stuff
1725         only.
1726
1727 2007-07-31  Marek Safar  <marek.safar@gmail.com>
1728
1729         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
1730         syntax.
1731         
1732 2007-07-26  Jb Evain  <jbevain@novell.com>
1733
1734         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
1735         which takes a boolean 'report_errors', similar to the GetMethod.
1736         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
1737         in .net 2.1, do not report errors here.
1738
1739         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
1740         System.Runtime.CompilerServices.RequiredAttributeAttribute and
1741         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
1742         in .net 2.1.
1743
1744         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
1745         of the type InternalsVisibleToAttribute before the first call
1746         to CoreLookupType which is allowed to fail (third boolean parameter
1747         to true). Because, during the resolution for a type that is not
1748         immediately found, we try to check if the type is not defined in
1749         a friend assembly, and to do so, we need the
1750         InternalVisibleToAttribute.
1751
1752 2007-07-23  Miguel de Icaza  <miguel@novell.com>
1753
1754         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
1755         feature that allows structs to be compared against null and inline
1756         the result as true or false.
1757
1758         Notice that the same code is not permitted inside a generic block
1759         of code that would do:
1760
1761         class Foo<T> where T : struct {
1762             bool Eval (T x)
1763             {
1764                  return x == null;
1765             }
1766         }
1767
1768         It is only allowed if the type of T is not bound (no where
1769         clause).   In my opinion, this CSC 2 behavior is broken but people
1770         seem to be using it (IronRuby does, a few bug reports on bugzilla
1771         have it and some people have complained about it).
1772
1773         All of the users that depend on this behavior have code that is
1774         very likely broken. 
1775         
1776         * report.cs (Warning, Error): make these take object arguments,
1777         not strings, as that allows us to take advantage of Format.
1778
1779 2007-07-20  William Holmes  <billholmes54@gmail.com>
1780
1781         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
1782           Left member variable for the Count.
1783         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
1784           MemberName.CountTypeArguments to avoid a NRE. 
1785
1786         This code is contributed under the MIT X11 license
1787
1788 2007-07-18  Marek Safar  <marek.safar@gmail.com>
1789
1790         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
1791
1792 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
1793
1794         * doc.cs : generic method arguments are written as ``x while generic
1795           type arguments are `x. Combined with the previous change, fixed bug
1796           #79706.
1797
1798 2007-07-18  Raja R Harinath  <rharinath@novell.com>
1799
1800         Fix #82120
1801         * expression.cs (Binary.ResolveOperator): When converting
1802         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
1803
1804 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
1805
1806         * doc.cs : when T: or whatever x: is specified, it does not really
1807           check the doc comment's syntax correctness. Fixed bug #82006.
1808
1809 2007-07-18  Marek Safar  <marek.safar@gmail.com>
1810
1811         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
1812         LambdaExpression better.
1813         
1814         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
1815         
1816         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
1817         
1818         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
1819         as it can be generated.
1820         
1821         * expression.cs (Invocation.Error_InvalidArguments): Show correct
1822         modifiers.
1823         
1824         * lambda.cs (LambdaExpression): Refactored to share same code with
1825         AnonymousMethodExpression.
1826         
1827 2007-07-17  Marek Safar  <marek.safar@gmail.com>
1828
1829         * anonymous.cs (MakeName): Include host name for easier debugging.
1830         (LambdaMethod): New class for lambda spcecific stuff.
1831         
1832         * attribute.cs: Set EmitContext return type.
1833
1834         * class.cs: Set EmitContext return type.
1835         
1836         * codegen.cs (EmitContext): Return type cannot be null to stop messing
1837         with null/void meaning.
1838         
1839         * iterators.cs (ContainerType): Implemented.
1840         
1841         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
1842         
1843         * statement.cs (Return): Updated to lambda expressions.
1844         (Block.CloneTo): Parent can be null.
1845                 
1846 2007-07-13  Marek Safar  <marek.safar@gmail.com>
1847
1848         A fix for bug #81917
1849         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
1850         
1851         * class.cs (FixedField): Check whether field is in unsafe scope.
1852
1853         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
1854         (FieldExpr.Emit): Fixed buffers cannot be volatile.
1855
1856         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
1857         FieldExpr.
1858         
1859         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
1860                 
1861 2007-07-13  Marek Safar  <marek.safar@gmail.com>
1862
1863         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
1864         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
1865         from Report class.
1866
1867 2007-07-13  Marek Safar  <marek.safar@gmail.com>
1868
1869         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
1870         
1871 2007-07-13  Marek Safar  <marek.safar@gmail.com>
1872
1873         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
1874         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
1875         
1876         * codegen.cs(EmitContext): Add ProbingMode flag.
1877         
1878         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
1879         
1880         * driver.cs: For now set both warning values.
1881         
1882         * ecore.cs (SimpleName): Name is readonly.
1883         (MethodGroup.OverloadResolve): One quick path for probing.
1884         
1885         * expression.cs (Unary): Set Oper r/o.
1886         (Binary): Set Oper r/o.
1887         (ParameterReference): Set few instance variables as r/o.
1888         (ParameterReference.DoResolveBase): Don't capture aruments when 
1889         the probing is on.
1890         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
1891         (Arglist): arguments are private.
1892         (SizeOf): type is private and r/o.
1893         (MemberAccess): arguments are private.
1894
1895         * report.cs: Enhanced reporting on/off capabilities.
1896         
1897         * lambda.cs: Uses ec.IsInProbingMode.
1898         (ContextualReturn): Derives from return.
1899         
1900         * rootcontext.cs: For now set both warning values.
1901         
1902         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
1903         copy if one exists.
1904         (Return.Resolve): Don't die immediately.
1905         (Block.Resolve): Speed-up probing.
1906         (Block.CloneTo): Clone only child blocks.
1907
1908 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
1909
1910         * iterators.cs: reverted Miguel's latest change (r81925) as it
1911         breaks the build in System.
1912
1913 2007-07-13  Miguel de Icaza  <miguel@novell.com>
1914
1915         * iterators.cs (Yield.CheckContext): Check for the iterator type
1916         also here as we can call into Yield even in codepaths that are not
1917         directly checked by
1918         (MethodOrOperator is the only path that was checked).
1919
1920         In addition to the standard check, use a more specific check for
1921         constructors to report a more verbose error. 
1922
1923 2007-07-12  Miguel de Icaza  <miguel@novell.com>
1924
1925         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
1926         report the warning and continue 
1927
1928         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
1929         values on the stack on the call to Emit.   Use EmitStatement if
1930         possible, or using Emit + Pop if not possible.   Fixes #82064
1931
1932 2007-07-12  Raja R Harinath  <rharinath@novell.com>
1933
1934         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
1935         avoid try...finally in some cases.
1936
1937 2007-07-10  Marek Safar  <marek.safar@gmail.com>
1938
1939         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
1940         
1941         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
1942         instead of method. Re-use standard error handling.
1943         (ConstructorInitializer.Emit): Simplified.
1944         
1945         * delegate.cs: Updated after Invocation.EmitCall change.
1946         
1947         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
1948         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
1949         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
1950         method and don't permanently changing input arguments.
1951         (MethodGroupExpr): Introduced resolved best_candidate, when method group
1952         is resolved it has one of the candidates is the best one which is later
1953         used to emit. Removed a few unused method.
1954         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
1955
1956         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
1957         (Binary.ResolveOperator): Ditto.
1958         (ConditionalLogicalOperator.DoResolve): Ditto.
1959         (Invocation): Uses method group.
1960         (Invocation.DoResolve): Simplified.
1961         (Invocation.EmitCall): Removed useless is_static.
1962         (Invocation.Emit): Delegate to method group.
1963         (Invocation.EmitStatement): Simplified.
1964         (New): Uses method group.
1965         (MemberAccess.DoResolve): Don't destroy original expression.
1966         
1967         * statement.cs (ForEach.Resolve): Use null for no method arguments.
1968         
1969 2007-07-04  Marek Safar  <marek.safar@gmail.com>
1970
1971         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
1972         
1973         * anonymous.cs,
1974         * lambda.cs: Add custom error message type.
1975
1976 2007-07-03  Marek Safar  <marek.safar@gmail.com>
1977
1978         * lambda.cs: Simplified little bit.
1979         
1980         * parameter.cs: Introduced ImplicitLambdaParameter.
1981         (Parameters.CreateFullyResolved): New factory instead of ctor.
1982         
1983         * anonymous.cs,
1984         * class.cs,
1985         * delegate.cs: Updated parameter creation.
1986         
1987 2007-07-03  Marek Safar  <marek.safar@gmail.com>
1988
1989         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
1990         arguments.
1991         
1992         * generic.cs: Synchronized with gmcs.
1993         
1994 2007-07-03  Marek Safar  <marek.safar@gmail.com>
1995
1996         * class.cs (Indexer): Check return type as soon as possible.
1997         
1998         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
1999         members too.
2000         
2001         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
2002         
2003         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
2004         
2005         * parameter.cs (Parameter): Use expression type when it is available.
2006         
2007         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
2008         method modifier for the first parameter only.
2009
2010 2007-06-24  Marek Safar  <marek.safar@gmail.com>
2011
2012         A fix for bug #81938
2013         * typemanager.cs (ChangeType): Fixed couple of char conversions.
2014         
2015         * constant.cs: Tide up an exception message.
2016
2017 2007-06-22  Marek Safar  <marek.safar@gmail.com>
2018
2019         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
2020         an uninitialized variable is used.
2021         
2022         * expression.cs (LocalVariableReference.DoResolve): Ditto.
2023
2024 2007-06-22  Marek Safar  <marek.safar@gmail.com>
2025
2026         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
2027         not found error handling.
2028
2029         * expression.cs (ArrayCreation): Removed redundant fields and little bit
2030         simplified.
2031         (ArrayCreation.ResolveArrayElement): To be ready to customization.
2032         (ArrayCreation.DoResolve): Simplified.
2033         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
2034         its own resolve process.
2035         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
2036
2037 2007-06-20  Marek Safar  <marek.safar@gmail.com>
2038
2039         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
2040         more error details.
2041         
2042 2007-06-20  Marek Safar  <marek.safar@gmail.com>
2043
2044         * cs-tokenizer.cs: Removed var related stuff.
2045         
2046         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
2047         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
2048         a type and a keyword at same time.
2049         
2050         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
2051         matches to "var".
2052         
2053         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
2054         implicitly typed arrays, more changes will follow.
2055         
2056         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
2057         
2058 2007-06-19  Marek Safar  <marek.safar@gmail.com>
2059
2060         * ecore.cs (VarExpr): Removed Handled field.
2061         
2062         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
2063         build-in assign functionality.
2064         (ForEach.Resolve): Removed all implicitly typed local variable code and
2065         simplified.
2066         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
2067         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
2068
2069 2007-06-18  Marek Safar  <marek.safar@gmail.com>
2070
2071         * assign.cs: Removed implicitly typed local variable check.
2072         
2073         * expression.cs (LocalVariableReference.DoResolve): Add check for self
2074         referencing implicitly typed local variable.
2075         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
2076         variable here.
2077         
2078         * statement.cs (Fixed): Removed unsupported implicitly typed local
2079         variable code.
2080
2081 2007-06-15  Marek Safar  <marek.safar@gmail.com>
2082
2083         * decl.cs (MemberName): Moved all Unbound stuff to parser.
2084
2085 2007-06-14  Marek Safar  <marek.safar@gmail.com>
2086
2087         A fix for bugs #81855 and #76274
2088         * attribute.cs (AttachTo): Always set owner for global attributes to
2089         prefined owner.
2090         
2091         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
2092         usefull too.
2093         
2094         * cs-parser.jay: Assembly and module attributes must precede all other
2095         elements except using clauses and extern alias declarations.
2096
2097 2007-06-13  Marek Safar  <marek.safar@gmail.com>
2098
2099         A fix for bug #81748
2100         * cs-tokenizer.cs,
2101         * expression.cs: More checks for non ISO-1 features.
2102
2103 2007-06-12  Marek Safar  <marek.safar@gmail.com>
2104
2105         A fix for bug #81807
2106         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
2107         present inside switch statement and it is required by nullable check.
2108
2109 2007-06-12  Marek Safar  <marek.safar@gmail.com>
2110
2111         A fix for bug #81840
2112         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
2113         when type matching fails.
2114         
2115         * namespace.cs: Tiny error message change.
2116
2117 2007-06-12  Marek Safar  <marek.safar@gmail.com>
2118
2119         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
2120         reporting. Added automatic property check.
2121         
2122         * class.cs: Updated after CheckAbstractAndExtern relocation.
2123         (AEventPropertyAccessor.GetSignatureForError): Customized.
2124         
2125 2007-06-11  Marek Safar  <marek.safar@gmail.com>
2126
2127         * class.cs (DefineBaseTypes): Base type can be undefined.
2128         
2129         * ecore.cs (TypeLookup): Minor refactoring.
2130         (DoResolveAsTypeStep): Removed redundant check.
2131
2132         * namespace.cs (Lookup): Removed redundant check.
2133                 
2134         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
2135         ResolveAsTypeTerminal step.
2136         (BootstrapCorlib_*): Simplified.
2137         (PopulateCoreType): Core types can be now external.
2138
2139 2007-06-07  Marek Safar  <marek.safar@gmail.com>
2140
2141         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
2142          verification only.
2143          (InferTypeArguments): Infers anonymous expression type arguments.
2144          (Compatible): Split to Compatible and InferTypeArguments. 
2145         
2146         * lambda.cs: Updated.
2147
2148 2007-06-08  Marek Safar  <marek.safar@gmail.com>
2149
2150         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
2151
2152 2007-06-07  Raja R Harinath  <harinath@gmail.com>
2153
2154         Fix #80477, cs0135-2.cs, cs0135-3.cs
2155         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
2156         names to the "known" variables list.
2157         (Block.CheckInvariantMeaningInBlock): Handle the fact the
2158         parameter names are also "known".
2159         (Block.CheckError136): Remove.
2160         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
2161         null.
2162
2163 2007-06-07  Marek Safar  <marek.safar@gmail.com>
2164
2165         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
2166
2167 2007-06-06  Marek Safar  <marek.safar@gmail.com>
2168
2169         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
2170         internal error not an user error.
2171          
2172         * expression.cs (IsApplicable): Refactored to make debugging easier.
2173
2174         * support.cs: More tricks for non-mono runtimes.
2175         
2176         * typemanager.cs (CoreLookupType): Made public.
2177         (InitSystemCore): All linq specific stuff moved to linq.cs
2178
2179 2007-06-05  Marek Safar  <marek.safar@gmail.com>
2180
2181         * typemanager.cs (CSharpSignature): One more missing build-in types
2182         replacement.
2183         More tricks for non-mono runtime.
2184
2185 2007-06-05  Raja R Harinath  <harinath@gmail.com>
2186
2187         * statement.cs (Block.CheckError136_InParents): Remove.
2188         (Block.AddVariable): Use GetParameterInfo instead.
2189         (ToplevelBlock.ProcessArguments): Likewise.
2190
2191 2007-06-04  Raja R Harinath  <rharinath@novell.com>
2192
2193         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
2194         information too.
2195         (ToplevelBlock.GetParameterInfo): Split out of ...
2196         (ToplevelBlock.GetParameterRefernce): ... this.
2197         (ToplevelBlock.ParameterMap): Remove.
2198         * expression.cs (ParameterReference): Update to use
2199         ToplevelParameterInfo.
2200
2201         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
2202         regression.
2203
2204         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
2205         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
2206
2207         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
2208         (ToplevelBlock.ProcessParameters) ... here.
2209         (ToplevelBlock..ctor): Invoke it.
2210
2211         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
2212         new parameters.
2213
2214         * statement.cs (IKnownVariable): New interface.
2215         (LocalInfo): Implement it.
2216         (ToplevelParameterInfo): New class.
2217         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
2218         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
2219         GetKnownVariableInfo.
2220
2221 2007-06-03  Raja R Harinath  <harinath@gmail.com>
2222
2223         Partly speed up CS0136 error checks.
2224         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
2225         'recurse' parameter.
2226         (Block.DoCheckError136): Only check errors in parameters.  Move
2227         local variable checks ...
2228         (Block.AddVariable): ... here, and ...
2229         (ToplevelBlock.ResolveMeta): ... here.
2230
2231 2007-06-02  Raja R Harinath  <harinath@gmail.com>
2232
2233         * statement.cs (Block.IsChildOf): Remove.
2234
2235         * statement.cs (Statement.Clone): Move special case code ...
2236         (Block.CloneTo): ... here.
2237
2238 2007-05-29  Raja R Harinath  <rharinath@novell.com>
2239
2240         * statement.cs (ToplevelBlock.container): Remove field.  It's
2241         redundant with 'Parent'.
2242         (ToplevelBlock.ContainerBlock): Remove accessor.
2243         (ToplevelBlock..ctor): Update to changes.  Register anonymous
2244         child with parent here, ...
2245         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
2246         current_block.
2247         (start_anonymous): Don't save current_block.
2248         (top_current_block): Remove.
2249
2250         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
2251         (Block.Resolve): Update to changes.
2252         (Block..ctor): Move setting of "correct" 'Toplevel'
2253         and 'Explicit' fields to ...
2254         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
2255
2256 2007-05-27  Raja R Harinath  <harinath@gmail.com>
2257
2258         Kill Block.Implicit
2259         * statement.cs (Block.Implicit): Remove.
2260         (Block): Update to changes.
2261         * flowanalysis.cs: Likewise.
2262
2263         Mildly speed up CheckInvariantMeaningInBlock
2264         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
2265         Recursively call AddKnownVariable to all enclosing blocks.
2266         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
2267         Remove recursive calls.
2268         (Block): Update to changes.
2269
2270         New ExplicitBlock invariants
2271         * statement.cs (Block.Explicit): New field.  It points to the
2272         immediately enclosing non-implicit block.
2273         (Block..ctor): Maintain the invariant.
2274         * cs-parser.jay: Take advantage of invariant.
2275
2276         Introduce ExplicitBlock
2277         * statement.cs (ExplicitBlock): New.
2278         (ToplevelBlock): Derive from it.
2279         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
2280         sense of flag.
2281         (Block.Implicit): Update to changes.
2282         * cs-parser.jay: Update to changes.
2283
2284         Remove unused field
2285         * codegen.cs (EmitContext.IsLastStatement): Remove.
2286         * statement.cs (Block.DoEmit): Update to changes.
2287
2288 2007-05-25  Raja R Harinath  <rharinath@novell.com>
2289
2290         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
2291         modifying current_block directly.
2292
2293 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
2294         
2295         * class.cs: Implemented automatic properties (C# 3.0)
2296           Thanks to Marek for the help.
2297
2298 2007-05-23  Raja R Harinath  <rharinath@novell.com>
2299
2300         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
2301         variable as assigned, note also that all its components are
2302         assigned too.
2303         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
2304
2305 2007-05-19  Marek Safar  <marek.safar@gmail.com>
2306
2307         * anonymous.cs, class.cs: Emit Compiler generated attribute when
2308         member is marked as compiler generated.
2309         
2310         * decl.cs (MemberCore): Refactored ModFlags into property.
2311
2312         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
2313         (Check): Check only accessibility modifiers.
2314
2315 2007-05-18  Raja R Harinath  <rharinath@novell.com>
2316
2317         Track all assignable slots in one bit array
2318         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
2319         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
2320         logic from VariableMap constructor here.  Use the same 'offset'
2321         variable that's later used for computing offsets of local
2322         variables.
2323         * flowanalysis.cs (UsageVector.parameters): Remove.
2324         (UsageVector): Update to changes.
2325         (VariableMap): Remove.
2326
2327         Avoid creating ParameterMap in every block
2328         * statement.cs (Block.ParameterMap): Move ...
2329         (ToplevelBlock.ParameterMap): ... here.
2330         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
2331         only once.
2332         * flowanalysis.cs (FlowBranching.param_map): Remove.
2333         (FlowBranching.UsageVector): Update to changes.
2334         (FlowBranchingToplevel.CheckOutParameters): Likewise.
2335
2336         * statement.cs (Block.CloneTo): Clone Toplevel field too.
2337
2338         * expression.cs (ParameterReference): Distinguish between block
2339         where parameter was referenced and declared.
2340
2341 2007-05-18  Marek Safar  <marek.safar@gmail.com>
2342
2343         * flowanalysis.cs, statement.cs: Put back improved error handling.
2344
2345 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
2346         
2347         * assign.cs:
2348         * expression.cs:
2349           Imporved object and collection initialization (C# 3.0).
2350
2351 2007-05-15  Marek Safar  <marek.safar@gmail.com>
2352
2353         A fix for bug #81380
2354         * expression.cs (Is.DoResolve): Only value types have constant `is'
2355         behaviour.
2356
2357 2007-05-15  Raja R Harinath  <rharinath@novell.com>
2358
2359         * statement.cs (ToplevelBlock.child): Remove.
2360
2361 2007-05-15  Raja R Harinath  <harinath@gmail.com>
2362
2363         Rationalize ResolveMeta: refactoring
2364         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
2365         out constant handling code into ...
2366         (Block.DoResolveConstants): ... this.
2367
2368         Rationalize ResolveMeta: kill local_map
2369         * statement.cs (Block.local_map, Block.LocalMap): Remove.
2370         (Block.AssignableSlots): New.
2371         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
2372         for locals -- move code from VariableMap here.  Avoid unnecessary
2373         allocations.
2374         * flowanalysis.cs (FlowBranching.local_map): Remove.
2375         (FlowBranching..ctor): Use Block.AssignableSlots.
2376         (VariableMap): Remove unused constructors.
2377
2378 2007-05-11  Raja R Harinath  <rharinath@novell.com>
2379
2380         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
2381
2382 2007-05-11  Marek Safar  <marek.safar@gmail.com>
2383
2384         * typemanager.cs (IsFriendAssembly): Should not be called for building
2385         assembly.
2386
2387 2007-05-09  Marek Safar  <marek.safar@gmail.com>
2388
2389         * literal.cs (NullConstant): Print null in all cases.
2390         
2391         * expression.cs (Binary.ResolveOperator): Implemented delegate
2392          comparison based on C# 2.0 changes.
2393
2394 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
2395
2396         This code is contributed under the MIT X11 license
2397         
2398         The following enables support for several C# 3.0 language features:
2399         
2400         * cs-tokenizer.cs: Added support for the "var" keyword.
2401         
2402         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
2403           Added VarExpr class to facilitate type inferencing.
2404         
2405         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
2406           to support anonymous types.
2407         
2408         * assign.cs: Added support for type inferencing and initialization.
2409         
2410         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
2411         
2412         * expression.cs: Added implicit array support to ArrayCreation.
2413           Added 5 types and 1 interface:
2414           
2415           IInitializable                Implementing classes can inject initializing
2416                                         statements after object instantiation.
2417           
2418           Initializer                   Stores data for object initialization.
2419           
2420           AnonymousType                 An expression for anonymous types.
2421           
2422           AnonymousTypeParameter        Stores data about an anonymous type's field.
2423           
2424           NewInitialize                 An expression for object initialization.
2425           
2426           CollectionInitialize          An expression for collection initialization.
2427         
2428         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
2429           statements.
2430
2431 2007-05-06  Marek Safar  <marek.safar@gmail.com>
2432
2433         A fix for bug #81500
2434         * cs-tokenizer.cs: Add special handling for coalescing operator.
2435
2436 2007-05-06  Marek Safar  <marek.safar@gmail.com>
2437
2438         A fix for bug #81529
2439         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
2440         its value from base class until it is redefined.
2441
2442 2007-05-02  Raja R Harinath  <rharinath@novell.com>
2443
2444         Fix regression in cs0631-3.cs
2445         * cs-parser.jay (operator_declarator): Add opt_attributes to error
2446         fallback.  Make error fallback catch more cases.
2447
2448 2007-05-01  Miguel de Icaza  <miguel@novell.com>
2449
2450         * cs-parser.jay: Allow parameters in operator declarations to have
2451         attributes. 
2452
2453 2007-04-27  Miguel de Icaza  <miguel@novell.com>
2454
2455         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
2456         exists. 
2457
2458         * lambda.cs (ContextualReturn.Resolve): An expression is valid
2459         inside the ContextualReturn, it does not have to be an
2460         ExpressionStatement. 
2461
2462 2007-04-24  Miguel de Icaza  <miguel@novell.com>
2463
2464         * lambda.cs (ContextualReturn.Resolve): if the return type is not
2465         set, set it.
2466
2467 2007-04-23  Miguel de Icaza  <miguel@novell.com>
2468
2469         * anonymous.cs (AnonymousContainer): split the virtual Resolve
2470         method in two methods: ResolveNoDefine and Resolve.
2471
2472         ResolveNoDefine will stop just after ResolveTopBlock has been
2473         called.   
2474
2475         Resolve will then continue by creating a method and issuing the
2476         call to method.Define ().
2477
2478         (AnonymousMethod): Split and implement the new Resolve and
2479         ResolveNoDefine as well.
2480
2481         * lambda.cs (LambdaExpression): Split the anonymous method
2482         resolution code into a separate routine (CoreCompatibilityTest)
2483         from DoCompatibleTest.
2484
2485         (LambdaExpression.TryBuild): New method, this method tries to
2486         build the LambdaExpression with the given set of types to be used
2487         as the types for the various parameters of the lambda expression. 
2488
2489         If the compilation succeed with the given types, the infered type
2490         of the Anonymous method is returned, otherwise null is returned.
2491
2492 2007-04-23  Marek Safar  <marek.safar@gmail.com>
2493
2494         A fix for bug #81414
2495         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
2496
2497 2007-04-22  Miguel de Icaza  <miguel@novell.com>
2498
2499         * cs-tokenizer.cs: Change various identifiers here from the
2500         camelCasing to the recommended Linux-like style for instance
2501         variables from the Coding Guidelines. 
2502
2503 2007-04-19  Martin Baulig  <martin@ximian.com>
2504
2505         * convert.cs
2506         (Convert.ImplicitReferenceConversionCore): Allow conversions from
2507         System.Enum to System.ValueType.
2508
2509 2007-04-13  Martin Baulig  <martin@ximian.com>
2510
2511         Rewrote implicit reference conversions.  We need to distinguish
2512         between implicit reference conversions (13.1.4) and implicit
2513         boxing conversions (13.1.5).
2514
2515         According to the spec, there's an an implicit conversion
2516         "From a one-dimensional array-type S[] to IList<T> and base
2517         interfaces of this interface, provided there is an implicit
2518         reference conversion from S to T."  Note that this does not
2519         include boxing conversions.
2520
2521         * convert.cs
2522         (Convert.ImplicitTypeParameterBoxingConversion): New method.
2523         (Convert.ImplicitReferenceConversion): Split into
2524         ImplicitReferenceConversionCore() and
2525         ImplicitBoxingConversionExist().
2526         (Convert.ImplicitReferenceConversionExists): Use the new
2527         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
2528
2529 2007-04-12  Martin Baulig  <martin@ximian.com>
2530
2531         * convert.cs (Convert.ImplicitReferenceConversion): Move the
2532         `TypeManager.null_type' checks up to the top of the method.
2533
2534 2007-04-11  Marek Safar  <marek.safar@gmail.com>
2535
2536         A fix for bug #81350
2537         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
2538         extension methods.
2539
2540 2007-04-11  Martin Baulig  <martin@ximian.com>
2541
2542         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
2543         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
2544         to make this work for generic classes; fixes #79561.
2545
2546 2007-04-11  Martin Baulig  <martin@ximian.com>
2547
2548         * expression.cs (As): Add support for nullable types; fixes #79371.
2549
2550 2007-04-11  Martin Baulig  <martin@ximian.com>
2551
2552         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
2553         `type.FullName' is null; fixes #80243.
2554
2555 2007-04-11  Martin Baulig  <martin@ximian.com>
2556
2557         * expression.cs (Invocation.IsApplicable): Don't modify the method
2558         if type inference succeeded, but the method was not applicable.
2559         Fixes #81250.
2560
2561 2007-04-10  Marek Safar  <marek.safar@gmail.com>
2562
2563         A fix for bug #81324
2564         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
2565         internal and external namespaces containers.
2566
2567 2007-04-10  Martin Baulig  <martin@ximian.com>
2568
2569         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
2570         TypeManager.DropGenericMethodArguments() so we also call
2571         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
2572
2573 2007-04-10  Martin Baulig  <martin@ximian.com>
2574
2575         * iterators.cs (Iterator.CreateIterator): Don't crash if
2576         `method.ReturnType' is null.  This happens if something went wrong
2577         while resolving that typ (we already reported an error in this case).
2578
2579 2007-04-10  Martin Baulig  <martin@ximian.com>
2580
2581         * expression.cs (New.DoResolve): Don't call CheckComImport() on
2582         generic interfaces; report the CS0144 directly.
2583
2584 2007-04-10  Martin Baulig  <martin@ximian.com>
2585
2586         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
2587         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
2588
2589 2007-04-10  Martin Baulig  <martin@ximian.com>
2590
2591         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
2592
2593 2007-04-09  Raja R Harinath  <rharinath@novell.com>
2594
2595         A better fix
2596         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
2597         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
2598
2599         Fix #81338
2600         * statement.cs (For.Resolve): If resolution fails, use
2601         KillFlowBranching.
2602
2603 2007-04-08  Marek Safar  <marek.safar@gmail.com>
2604
2605         * anonymous.cs (MakeName): Make faster and zero-based.
2606         (VerifyExplicitParameterCompatibility): Back to mode where generic
2607         parameter is ignored.
2608         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
2609
2610         * class.cs (EmitType): Method can emit another new method.
2611
2612         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
2613
2614         * driver.cs: Updated.
2615
2616         * lambda.cs: Reuse predefined empty parameters.
2617
2618         * parameter.cs: Updated
2619
2620         * support.cs: Implemented InflateTypes.
2621
2622         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
2623         (InitSystemCore): Introduced to isolate 3.0 dependencies.
2624
2625 2007-04-03  Martin Baulig  <martin@ximian.com>
2626
2627         Fix #80632.
2628
2629         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
2630         version of TypeManager.IsOverride() which also works with generic
2631         types.  
2632
2633 2007-04-03  Martin Baulig  <martin@ximian.com>
2634
2635         Fix #81044.
2636
2637         * convert.cs
2638         (Convert.ExplicitReferenceConversion): We need to cast when
2639         converting from IList<T> to S[].
2640
2641 2007-04-01  Marek Safar  <marek.safar@gmail.com>
2642
2643         * decl.cs (FindExtensionMethods): Consider all candidates with same name
2644         at this level.
2645         
2646         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
2647
2648 2007-03-31  Marek Safar  <marek.safar@gmail.com>
2649
2650         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
2651         argument and return type inferring.
2652
2653         * codegen.cs (InferReturnType): Flag whether return can be inferred.
2654         (ReturnType): Turned to property.
2655
2656         * statement.cs (Return): Implemented return type inferring.
2657
2658         * support.cs (ReflectionParameters): Use local types if possible.
2659
2660 2007-03-30  Raja R Harinath  <rharinath@novell.com>
2661
2662         * flowanalysis.cs (FlowBranching.Reachability): Remove.
2663         (FlowBranching.UsageVector): Update to changes.
2664
2665         Prepare to kill 'Reachability'
2666         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
2667         argument of constructor.
2668
2669 2007-03-29  Raja R Harinath  <rharinath@novell.com>
2670
2671         Prepare to kill 'Reachability'
2672         * flowanalysis.cs (UsageVector.is_unreachable): New.
2673         (UsageVector): Update to maintain 'is_unreachable' in parallel to
2674         'reachability', and verify they're consistent.
2675
2676         Fix #81121
2677         * expression.cs (New.EmitStatement): Handle type parameters here too.
2678
2679 2007-03-29  Martin Baulig  <martin@ximian.com>
2680
2681         Fix #79148.
2682
2683         * anonymous.cs
2684         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
2685         CompilerGeneratedClass.
2686         (ScopeInfo.EmitScopeInstance): Make this protected.
2687         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
2688         `ec.CurrentAnonymousMethod.Scope == Scope'.
2689
2690         * statement.cs (Block.ScopeInfo): Make this a property.
2691
2692 2007-03-27  Raja R Harinath  <harinath@gmail.com>
2693
2694         Prepare to kill 'Reachability'
2695         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
2696         (FlowBranching.UsageVector.Reachability): Remove property.
2697         (FlowBranching.UsageVector.IsUnreachable): New property.
2698         (FlowBranching.UsageVector.ResetBarrier): New.
2699         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
2700         * codegen.cs, statement.cs: Update to changes.
2701
2702 2007-03-27  Martin Baulig  <martin@ximian.com>
2703
2704         Fix #81209.
2705
2706         * decl.cs
2707         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
2708         generic types.
2709
2710 2007-03-26  Raja R Harinath  <rharinath@novell.com>
2711
2712         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
2713         instead of TriState.  Remove all mention of TriState.
2714
2715         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
2716         replaced by a boolean.  Add boolean 'is_unreachable' field, check
2717         and maintain invariants.
2718
2719 2007-03-25  Marek Safar  <marek.safar@gmail.com>
2720
2721         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
2722
2723 2007-03-25  Marek Safar  <marek.safar@gmail.com>
2724
2725         * expression.cs: Stop using obsolete 2.0 opcodes.
2726
2727 2007-03-25  Marek Safar  <marek.safar@gmail.com>
2728
2729         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
2730         one of the latests Martin's fixes.
2731
2732 2007-03-23  Miguel de Icaza  <miguel@novell.com>
2733
2734         * expression.cs: On BigEndian systems, swap the bytes, temporary
2735         solution until we get a new bitconverter class.
2736
2737 2007-03-23  Martin Baulig  <martin@ximian.com>
2738
2739         Fix #81158.
2740
2741         * decl.cs (MemberCache.AddMembers): Add generic methods both as
2742         "Method" and "Method`1".  Normally, a cache lookup is done on the
2743         "Method" form (ie. without the generic arity), but this one makes
2744         lookups on the full form work as well.
2745
2746 2007-03-22  Raja R Harinath  <rharinath@novell.com>
2747
2748         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
2749         unused properties.
2750
2751 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
2752         * class.cs: 
2753         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
2754         ordered_member_list, to TypeBuilder to store members to be defined
2755         in the order they were parsed in.
2756         - ordered_explicit_member_list contains all properties indexers
2757           and methods that are defined as explicit implementation of an
2758           interface or base class.
2759         - ordered_member_list contains all properties indexers and methods
2760           that are not defined as explicit implementation of an interface
2761           or base class.
2762
2763         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
2764         functionality in these removed classes has been replaced with 
2765         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
2766         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
2767
2768         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
2769         to CheckForDuplications inside GetMethod and SetMethod Define Method
2770         to handle method property and indexer name conflicts.
2771
2772         Fixes #79434
2773
2774         All code is contributed under the MIT/X11 license.
2775
2776 2007-03-20  Martin Baulig  <martin@ximian.com>
2777
2778         * class.cs (TypeContainer.Interfaces): Removed; they're now
2779         included in `TypeContainer.Types'.
2780
2781 2007-03-20  Martin Baulig  <martin@ximian.com>
2782
2783         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
2784
2785         * class.cs (TypeContainer.CreateType): New public method.  This is
2786         now called before DefineType() to create the TypeBuilders.
2787         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
2788         has already been created by CreateType().
2789         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
2790         don't resolve our base classes here; this has been moved into
2791         DefineBaseTypes().  We're now called from CreateType().
2792         (TypeContainer.DefineBaseTypes): New private method; resolve our
2793         base classes here.  We're now called from DefineType().
2794
2795         * rootcontext.cs
2796         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
2797         our types first to create all the TypeBuilders.  After that, call
2798         TypeContainer.DefineType() on all the types which'll resolve their
2799         base classes and setup the resolve order.
2800
2801 2007-03-20  Martin Baulig  <martin@ximian.com>
2802
2803         * class.cs (TypeContainer.Enums): Removed; they're now included in
2804         `TypeContainer.Types'.  
2805
2806 2007-03-20  Martin Baulig  <martin@ximian.com>
2807
2808         * class.cs
2809         (TypeContainer.DefineType): Don't call ResolveMembers() here.
2810         (TypeContainer.DoResolveMembers): Call DefineType() on our
2811         `compiler_generated' classes; moved here from DefineNestedTypes().
2812
2813         * rootcontext.cs
2814         (RootContext.ResolveTree): Call ResolveMembers() on all
2815         TypeContainer's in the `type_container_resolve_order'.
2816
2817 2007-03-19  Marek Safar  <marek.safar@gmail.com>
2818
2819         * class.cs: Use corlib to handle InternalMethodImplAttribute.
2820
2821 2007-03-17  Marek Safar  <marek.safar@gmail.com>
2822
2823         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
2824         implementation flags.
2825
2826 2007-03-17  Marek Safar  <marek.safar@gmail.com>
2827
2828         * class.cs: More optimizations for type parameters.
2829
2830 2007-03-15  Marek Safar  <marek.safar@gmail.com>
2831
2832         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
2833
2834         * ecore.cs, parameter.cs: More common code for both corlibs.
2835
2836         * typemanager.cs (IsGenericMethod): Simplified.
2837
2838 2007-03-15  Raja R Harinath  <rharinath@novell.com>
2839
2840         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2841         'returns'.
2842         * statement.cs, iterators.cs, lambda.cs: Update to changes.
2843
2844         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
2845         unconditionally.  Simplify explanation.
2846         (Try.Resolve, Using.Resolve): Likewise.
2847
2848 2007-03-15  Martin Baulig  <martin@ximian.com>
2849
2850         Fix #80731.
2851
2852         * decl.cs (DeclSpace): If we're a partial class, use our
2853         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
2854
2855 2007-03-15  Raja R Harinath  <rharinath@novell.com>
2856
2857         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2858         'throws'.
2859         (FlowBranching.UsageVector): Update to changes.
2860         (FlowBranching.MergeSiblings): Likewise.
2861         * statement.cs: Likewise.
2862
2863 2007-03-15  Martin Baulig  <martin@ximian.com>
2864
2865         Fix #79302.
2866
2867         * decl.cs
2868         (MemberCache): Added a special .ctor for type parameters.
2869
2870         * typemanager.cs
2871         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
2872         `MemberCache'.  
2873
2874 2007-03-09  Martin Baulig  <martin@ximian.com>
2875
2876         * enum.cs (Enum): Make this a TypeContainer.
2877         (EnumMember): Derive from `Const'.
2878
2879         * const.cs
2880         (Const.DoResolveValue): New protected virtual method; move most of
2881         the functionality of ResolveValue() here so we can override it in
2882         `EnumMember'.
2883         (Const.CreateConstantReference): Make this virtual.
2884
2885         * class.cs (Kind): Add `Kind.Enum'.
2886         (TypeContainer.Emit): Don't emit the enums here; they're already
2887         in the `RootContext.typecontainer_resolve_order'.
2888
2889         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
2890         here; they're already in the `typecontainer_resolve_order'.
2891
2892         * ecore.cs (EnumConstant.ConvertImplicitly): Add
2893         TypeManager.DropGenericTypeArguments().
2894
2895         * typemanager.cs
2896         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
2897         (TypeManager.IsEnumType): Likewise.
2898         (TypeManager.EnumToUnderlying): Likewise.
2899         (TypeManager.IsEqual): Add support for enums.
2900
2901 2007-03-12  Raja R Harinath  <rharinath@novell.com>
2902
2903         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
2904         DefaultParameterValueAttribute to be undefined, say if System.dll
2905         is not referenced.
2906
2907 2007-03-11  Marek Safar  <marek.safar@gmail.com>
2908
2909         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
2910         any mscorlib.
2911
2912 2007-03-10  Marek Safar  <marek.safar@gmail.com>
2913
2914         * class.cs, parameter.cs: Unified parameters verification.
2915
2916 2007-03-08  Martin Baulig  <martin@ximian.com>
2917
2918         * cs-parser.jay (constructor_header): Pass the location to the
2919         newly created TopLevelBlock.
2920
2921 2007-03-07  Martin Baulig  <martin@ximian.com>
2922
2923         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
2924
2925 2007-03-06  Miguel de Icaza  <miguel@novell.com>
2926
2927         * convert.cs (ExplicitReferenceConversionExists): Sync this method
2928         with the changes from David, fixes the build.
2929
2930 2007-03-05  David Mitchell  <dmitchell@logos.com>
2931
2932         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
2933         and its base interfaces to a one-dimensional array type S[],
2934         provided there is an implicit or explicit reference conversion
2935         from S to T.
2936
2937 2007-03-03  Marek Safar  <marek.safar@gmail.com>
2938
2939         * cs-tokenizer.cs: Implemented basic linq grammar.
2940
2941         * driver.cs: Set linq lang version on demand.
2942
2943 2007-02-26  Marek Safar  <marek.safar@gmail.com>
2944
2945         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
2946
2947 2007-02-25  Marek Safar  <marek.safar@gmail.com>
2948
2949         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
2950         (Fixes #80455)
2951
2952         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
2953         here.
2954         Check property and event extern attributes.
2955
2956         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
2957         charset.
2958
2959 2007-02-24  Marek Safar  <marek.safar@gmail.com>
2960
2961         A fix for bug #80407
2962         * ecore.cs: Don't report ambiguity error when methods have same parent.
2963
2964 2007-02-23  Marek Safar  <marek.safar@gmail.com>
2965
2966         A fix for bug #80878
2967         * class.cs, cs-parser.jay: Event property can host anonymous methods.
2968
2969 2007-02-22  Marek Safar  <marek.safar@gmail.com>
2970
2971         * attribute.cs: Enable ExtensionAttribute presence test.
2972
2973 2007-02-22  Marek Safar  <marek.safar@gmail.com>
2974
2975         * class.cs: Warn about missing GetHashCode only when Equals is override.
2976
2977         * decl.cs: Check accessibility of type arguments.
2978
2979         * typemanager.cs: Correctly report nullable array.
2980
2981 2007-02-20  Marek Safar  <marek.safar@gmail.com>
2982
2983         * class.cs, report.cs: Capture more details when things go wrong.
2984
2985 2007-02-20  Marek Safar  <marek.safar@gmail.com>
2986
2987         A fix for bug #80650
2988         * cs-parser.jay: Anonymous container starts at constructor declaration
2989         and not at block beginning because it has to be usable in constructor
2990         initializer.
2991
2992         * statement.cs: Use context location and not block one for error reporting.
2993
2994 2007-02-18  Marek Safar  <marek.safar@gmail.com>
2995
2996         A fix for bug #78712
2997         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
2998         too.
2999
3000 2007-02-18  Marek Safar  <marek.safar@gmail.com>
3001
3002         A fix for bug #80493 by Atsushi Enomoto
3003         * cs-parser.jay: Ignore invalid attribute target.
3004
3005 2007-02-18  Marek Safar  <marek.safar@gmail.com>
3006  
3007         * cs-tokenizer.cs: Ignore '\0' as white space character.
3008
3009 2007-02-17  Miguel de Icaza  <miguel@novell.com>
3010
3011         * cs-parser.jay: Add support for lambda expressions to the mcs
3012         compiler as well.
3013
3014         * lambda.cs: Only clone when we are probing, not on the final call
3015         (Compatible is the final call). 
3016
3017         * statement.cs (CloneContext): Introduce class to provide block
3018         remapping during clone.
3019
3020         All statements Clone themselves now.
3021
3022         (Clone): special handling for blocks, when we clone a block, we
3023         register the block inside this routine, as children of the block
3024         might trigger a lookup. 
3025         
3026         * expression.cs: Add support for CloneContext in all expressions. 
3027         
3028 2007-02-17  Marek Safar  <marek.safar@gmail.com>
3029  
3030         A fix for bug #80493
3031         * statement.cs: Report ambiguous warning when interfaces are not related.
3032
3033 2007-02-15  Marek Safar  <marek.safar@gmail.com>
3034
3035         C# 3.0 extension methods.
3036
3037         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
3038         cannot be used directly.
3039
3040         * class.cs (Class.Emit): Emit extension attribute if any class method
3041         is extension method.
3042         (Method.Define): Add basic extension method validation conditions.
3043         (Method.Emit): Emit extension attribute for method.
3044
3045         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
3046         extension method exists. Currently we follow same approach as Microsoft
3047         does, emit even if a method or a class are private but this can change
3048         later.
3049
3050         * cs-parser.jay: Add handling of `this' keyword in method parameters
3051         context.
3052
3053         * decl.cs (DeclSpace.IsStaticClass): New property.
3054         (MemberCache.FindExtensionMethods): Looks for extension methods with
3055         defined name and extension type.
3056
3057         * doc.cs: Updated after OverloadResolve changes.
3058
3059         * driver.cs: Add new soft reference to System.Core.dll.
3060
3061         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
3062         (ExtensionMethodGroupExpr): Represents group of extension methods.
3063
3064         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
3065         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
3066         to MethodGroupExpr and made non-static for easier customization.
3067         (Invocation.DoResolve): Add extension method lookup when no standard
3068         method was found.
3069         (MemberAccess.DoResolve): Try extension methods if no member exists.
3070
3071         * modifiers.cs: Add METHOD_EXTENSION modifier.
3072
3073         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
3074         as well as candidate extension type.
3075         (ComputeNamespaces): When assembly constains extension methods registers
3076         them.
3077         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
3078         extension method lookup.
3079         (Namespace.LookupExtensionMethod): Looks for extension method in this
3080         namespace.
3081         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
3082         find a method which matches name and extensionType.
3083
3084         * parameter.cs (Parameter): Add This modifer.
3085         (HasExtensionMethodModifier): New property.
3086         (Resolve): Add extension parameter check.
3087         (ModFlags): turned to property to exclude this modifier as it is not real
3088         parameter modifier.
3089         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
3090
3091         * support.cs (ParameterData): Add ExtensionMethodType.
3092         (ReflectionParameters): Implemented ExtensionMethodType interface property.
3093
3094         * typemanager.cs: Add type and ctor extension attribute type.
3095
3096 2007-02-15  Miguel de Icaza  <miguel@novell.com>
3097
3098         * report.cs (DisableErrors, EnableErrors): used to prevent error
3099         output when we are "trying" to compile various methods with
3100         different types. 
3101
3102         * ecore.cs (Expression): Add Clone method that calls the virtual
3103         CloneTo method.  The current CloneTo method in Expression throws
3104         an exception so we can track down all the places where this must
3105         be implemented (not using abstract, because that would be a lot of
3106         up-front-work before we can start testing the implementation
3107         idea). 
3108
3109         Important: we only need Clone capabilities for expressions created
3110         by the parser, as the expressions we will be cloning are
3111         expressions in the pre-resolved state.   This vastly simplifies
3112         the work required. 
3113         
3114         (SimpleName): Add CloneTo that does nothing.
3115         (EmptyCast): Add CloneTo.
3116         
3117         * expression.cs (Binary): Implement CloneTo.
3118         (Invocation.IsApplicable): Store the current ec in
3119         EmitContext.TempEc and restore it on return.  This is used so we
3120         do not have to sprinkle hundres of methods with an extra
3121         EmitContext, we know that the only user is the lambda expression
3122         ImplicitConversionExists code. 
3123         
3124         (Argument): Add Cloning capabilities.
3125         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
3126         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
3127         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
3128         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
3129         IndexerAccess): Add Clone capability.
3130
3131         (LocalVariableReference, This): TODO: needs cloned Block mapping.
3132
3133         (Argument): Add cloning capability.
3134
3135         * assign.cs (Assign): Implement CloneTo.
3136
3137         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
3138         
3139         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
3140         version by calling Convert with the EmitContext (that we are
3141         currently storing in ec, this is not great, but will do for now,
3142         to avoid passing EmitContext parameters to hundreds of functions
3143         that do not need them now).
3144
3145         (SetExpression): Remove, it is not needed.
3146         
3147         (ContextualReturn): Implement CloneTo.
3148
3149         * statement.cs (Statement): Implement cloning infrastructure,
3150         similar to expressions.
3151
3152         (Block): Partial implementation of Clone for statements.
3153
3154         (Return): Implement clone.
3155         
3156         * constant.cs (Constant.CloneTo): New method, does nothing.
3157
3158         * codegen.cs (TempEc): Add a static EmitContext as a temporary
3159         solution, until we decide how to exactly do this.  
3160         
3161 2007-02-14  Marek Safar  <marek.safar@gmail.com>
3162  
3163         A fix for bug #80493
3164         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
3165         a property is override we need to use second accessor.
3166
3167 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3168  
3169         A fix for bug #80418
3170         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
3171         methods.
3172
3173 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3174
3175         Another fix for bug #80749
3176         * pending.cs: Abstract class has priority over interfaces.
3177
3178 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3179
3180         Another fix for bug #80749
3181         * pending.cs: Abstract class has priority over interfaces.
3182
3183 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3184
3185         Another fix for bug #80749
3186         * pending.cs: Abstract class has priority over interfaces.
3187
3188 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3189
3190         Another fix for bug #80749
3191         * pending.cs: Abstract class has priority over interfaces.
3192
3193 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3194
3195         * class.cs Better error message.
3196
3197         * driver.cs: Add shorter versions of -optimize option.
3198
3199 2007-02-13  Martin Baulig  <martin@ximian.com>
3200
3201         * class.cs (Constructor.Emit): Check the return value of
3202         ec.ResolveTopBlock() and return on error.
3203
3204 2007-02-13  Raja R Harinath  <rharinath@novell.com>
3205
3206         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
3207         message to fix error message regression.
3208
3209 2007-02-12  Marek Safar  <marek.safar@gmail.com>
3210
3211         * delegate.cs: Delegate creation expression cannot be of Nullable type.
3212
3213 2007-02-12  Marek Safar  <marek.safar@gmail.com>
3214
3215         A fix for bug #80749
3216         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
3217         its parent container.
3218
3219         * class.cs (DefineFieldInitializers): Each initializer can has different
3220         resolve context.
3221
3222         * const.cs: Updated.
3223
3224 2007-02-11  Miguel de Icaza  <miguel@novell.com>
3225
3226         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
3227         now all the heavy lifting to check that embedded statements or
3228         expressions have the right form is done in the ContextualReturn.
3229
3230         (ContextualReturn): New class.  
3231
3232         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
3233         method that can be invoked to report 201, so we do not replicate
3234         this everywhere.
3235
3236         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
3237         
3238         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
3239         treating tabs as spaces. 
3240
3241 2007-02-09  Marek Safar  <marek.safar@gmail.com>
3242
3243         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
3244         * assign.cs: Use full implicit conversion for right side check.
3245
3246 2007-02-09  Marek Safar  <marek.safar@gmail.com>
3247
3248         * statement.cs (Switch): Switch over boolean type is not standardized.
3249
3250 2007-02-08  Marek Safar  <marek.safar@gmail.com>
3251
3252         A fix for bug #80755
3253         * decl.cs (FindBaseEvent): Don't use method cache for events.
3254
3255 2007-02-07  Marek Safar  <marek.safar@gmail.com>
3256
3257         * cs-parser.jay: Better syntax error handling.
3258
3259         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
3260         instead of underlying type value.
3261
3262 2007-02-06  Marek Safar  <marek.safar@gmail.com>
3263
3264         * driver.cs: Check define identifier before is registered.
3265
3266         * namespace.cs: Use existing error message.
3267
3268         * report.cs: New warning.
3269
3270 2007-02-06  Marek Safar  <marek.safar@gmail.com>
3271
3272         A fix for bug #80742
3273         * expression.cs: Delegate Invoke method can be called directly.
3274
3275 2007-02-06  Marek Safar  <marek.safar@gmail.com>
3276
3277         A fix for bug #80676
3278         * class.cs (IsEntryPoint): The Main method can have params modifier.
3279
3280 2007-02-04  Miguel de Icaza  <miguel@novell.com>
3281
3282         * parameter.cs (Parameter, Parameters): Add Clone method.
3283
3284         * anonymous.cs (Compatible): Turn method into virtual method, so
3285         LambdaExpression can implement a different behavior.
3286
3287         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
3288         out the basic checking here, so it can be used by
3289         LambdaExpressions.
3290         
3291         * lambda.cs: Introduce "Compatible" function that will do the
3292         heavy lifting.
3293
3294 2007-02-02  Marek Safar  <marek.safar@gmail.com>
3295
3296         * attribute.cs: Unified one error message.
3297
3298         * class.cs (Class): Use type attributes and not properties to test static
3299         class.
3300         (IsEntryPoint): Don's pass local variable.
3301
3302         * convert.cs: Removed duplicate check.
3303
3304         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
3305
3306         * driver.cs: Don't crash when soft reference does not exist.
3307
3308         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
3309         (UsingEntry): Removed redundant allocation.
3310
3311         * parameter.cs: Add fast path for type parameters.
3312
3313         * support.cs: Don't allocate attribute when it's not used.
3314
3315 2007-01-30  Miguel de Icaza  <miguel@novell.com>
3316
3317         * anonymous.cs
3318         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
3319         this into a virtual method, so we can override it in LambdaExpression.
3320
3321         * driver.cs: Improve diagnostics in case of failure. 
3322
3323         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
3324         write a function that is slightly more complex and that parses:
3325
3326         type identifier [, type identifier]* )
3327
3328         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
3329         this expression:
3330
3331                 (canEmpty ? i >= 0 : i > 0)
3332
3333 2007-01-30  Raja R Harinath  <rharinath@novell.com>
3334
3335         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
3336         exception on possibly valid code.
3337
3338 2007-01-29  Raja R Harinath  <rharinath@novell.com>
3339
3340         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
3341         Push/PopPosition.
3342         (parse_opt_type_arguments): Remove.  It's almost the same as
3343         parse_less_than.
3344         (parse_namespace_or_typename): Use parse_less_than.
3345
3346 2007-01-28  Miguel de Icaza  <miguel@novell.com>
3347
3348         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
3349         this bug took a few hours to find, because the state saved and
3350         restored by PushPosition and PopPosition was ignoring the state of
3351         parse_generic_less_than.
3352
3353         I can also now remove the handling of OP_LT and OP_GT, this solves
3354         the big mistery.
3355         
3356         * cs-tokenizer.cs: store the location for the ARROW token, we use
3357         that in the parser.
3358
3359         (PushPosition, PopPosition): save/restore also `current_token',
3360         restore `parse_generic_less_than' (was missing).
3361
3362         (parse_opt_type_arguments): use parse_type, not
3363         parse_namespace_or_typename to parse types.
3364
3365         * lambda.cs: Empty new file, will eventually have the lambda
3366         expression implementation.
3367
3368         * lambda.test: used to test the internal tokenizer. 
3369
3370         * report.cs (FeatureIsNotISO1): Rename from
3371         FeatureIsNotStandardized, because it was about the language level
3372         (1 vs 2) it was not about standarization.
3373
3374         (FeatureRequiresLINQ): New.
3375
3376         * support.cs (SeekableStreamReader): Only require that the reader
3377         is a TextReader, not a StreamReader, so we can plug StringReader. 
3378
3379         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
3380         given position in the input stream the following tokens can be
3381         parsed as a type followed by an identifier.
3382
3383         (is_punct): after a '(' if parse_type_and_parameter returns true,
3384         then return a special token OPEN_PARENS_LAMBDA which is used to
3385         avoid reduce/reduce errors in the grammar for the
3386         lambda_expression rules.
3387
3388         (parse_type): implement a type parser inside the
3389         tokenizer, the parser only returns true or false depending on
3390         whether the input at a given position can be parsed as a type.
3391
3392         (peek_token): new method used during type parsing.
3393
3394 2007-01-28  Raja R Harinath  <rharinath@novell.com>
3395
3396         Fix #80531
3397         * anonymous.cs (ScopeInfo.InflateParameters): New.
3398         (AnonymousContainer.Resolve): Use it to redirect types of
3399         delegate parameters.
3400
3401 2007-01-27  Raja R Harinath  <rharinath@novell.com>
3402
3403         Fix #80530
3404         * expression.cs (Error_InvalidArguments): Don't use two different
3405         messages for CS1503.  Use ExtraInformation and
3406         SymbolRelatedToPreviousError instead.
3407
3408         Fix #80358
3409         * decl.cs (DeclSpace.initialize_type_params): Don't access
3410         'type_params' of a partial class directly.
3411
3412 2007-01-26  Miguel de Icaza  <miguel@novell.com>
3413
3414         * constant.cs: Removed a handful of out-of-range checks that were
3415         not necessary. 
3416
3417 2007-01-25  Marek Safar  <marek.safar@gmail.com>
3418
3419         * expression.cs (CheckUselessComparison): Add additional check for char
3420         constants.
3421
3422         * namespace.cs: Fixed typo.
3423
3424 2007-01-23  Miguel de Icaza  <miguel@novell.com>
3425
3426         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
3427         gone, instead we inline the test, preventing the needless casts to
3428         longs, ulongs and doubles for the parameters, avoiding calls to
3429         methods that overchecked stuff, and instead inlined things
3430         nicely. 
3431
3432 2007-01-20  Marek Safar  <marek.safar@gmail.com>
3433
3434         * cs-parser.jay: Better parameter error handling.
3435
3436 2007-01-17  Marek Safar  <marek.safar@gmail.com>
3437
3438         A fix for bug #80368, #80522
3439         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
3440         whether array initializer contains constants only.
3441         (ArrayCreation.Emit): Use better formula to decide when
3442         are array initializers for static initialization.
3443         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
3444         have to emit even constants otherwise they are pre-initialized.
3445
3446 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
3447             Raja R Harinath  <rharinath@novell.com>
3448
3449         Fix emit order of 'get' vs. 'set'.
3450         * support.cs (Accessors): New.
3451         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
3452         Note the order in which accessors are declared in the source.
3453         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
3454         Refactored from Property.Define and Indexer.Define.
3455         (PropertyBase.DefineAccessors): New helper that calls the above in
3456         appropriate order as noted by the parser.
3457         (Property.Define, Indexer.Define): Update to changes.
3458         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
3459
3460 2007-01-17  Raja R Harinath  <rharinath@novell.com>
3461
3462         Fix cs0029-6.cs and gcs0029-2.cs (regression)
3463         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
3464         there's an implicit conversion from the current type to the target
3465         type before converting the underlying constant.
3466
3467 2007-01-16  Marek Safar  <marek.safar@gmail.com>
3468
3469         * const.cs (ResolveValue): Updated after constant conversion was made more
3470         generic.
3471
3472         * constant.cs (GetAttributableValue): constant to object conversion is
3473         used for attributes only.
3474         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
3475         constant conversions.
3476         (LongConstant.ConvertImplicitly): Ditto.
3477
3478         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
3479         (ImplicitConversionStandard): Handle constant conversion as extra step.
3480         It solves the issue when constant conversion was called indirectly like
3481         inside array initializer and constant folding was skipped.
3482
3483         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
3484         this change.
3485
3486         * statement.cs(ImplicitConversionStandard): Updated after constant
3487         conversion was made more generic.
3488
3489 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
3490
3491         * expression.cs (As.DoResolve): Use GenericConstraints instead of
3492         Constraints, solves the problem where the compiler incorrectly
3493         reported that a type parameter was not constrained to a class (Bug
3494         80518)
3495
3496 2007-01-14  Marek Habersack  <grendello@gmail.com>
3497
3498         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
3499
3500 2007-01-14  Marek Safar  <marek.safar@gmail.com>
3501
3502         A fix for bug #80368
3503         * assign.cs (FieldInitializer): New class implements field
3504         initializer statement.
3505
3506         * attribute.cs: Update after FieldMember rename.
3507
3508         * class.cs (PropertyBasedMember): New common class for property based
3509         types.
3510         (InterfaceMemberBase): New base class for all members which can be used as
3511         an interface members.
3512         (MethodCore): Moved really common code to InterfaceMemberBase.
3513         (Method.Define): Equal and GetHasCode detection is relevant for methods
3514         only.
3515         (MethodData.Define): Don't assume that public event implements an
3516         interface automatically.
3517         (MethodData.DefineMethodBuilder): Issue an error even if only extern
3518         modifier is used.
3519         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
3520         (FieldMember): Merged with FieldBase.
3521         (EventProperty.AEventPropertyAccessor): New specialization to check whether
3522         event extern modifier can be used.
3523         (EventField.EventFieldAccessor): Moved event field specific code here.
3524         (Event.AllowedModifiers): Even event can be extern.
3525         (Event.FindOutBaseMethod): New override specific to events.
3526         (Indexer.parameters): Reintroduce parameters because base class holds
3527         only properties common data.
3528         (Indexer.CheckForDuplications): Indexers are threated as methods so we
3529         need do extra parameters check.
3530
3531         * const.cs: Update after FieldMember rename.
3532
3533         * decl.cs (MemberCache.FindBaseEvent): New method.
3534
3535         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
3536         to reflect that indexer is now derived from PropertyBased.
3537
3538         * ecore.cs (GetMemberType): Made public.
3539         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
3540         obsolete event.
3541
3542         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
3543         
3544         * typemanager.cs (CSharpSignature): Correctly print event accessors.
3545         (RegisterEvent): Removed.
3546         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
3547         (GetPrivateFieldOfEvent): Renamed to GetEventField.
3548
3549 2007-01-11  Raja R Harinath  <rharinath@novell.com>
3550
3551         Fix #80249
3552         * statement.cs (CollectionForeach.TryType): Prefer generic
3553         GetEnumerator over non-generic variant.  Fix code to follow comments.
3554
3555 2007-01-09  Raja R Harinath  <rharinath@novell.com>
3556
3557         Fix #80446
3558         * support.cs (ReflectionParameter): Don't use an invalid index on
3559         the generic parameter data.
3560
3561 2007-01-08  Miguel de Icaza  <miguel@novell.com>
3562
3563         * driver.cs: Just add a tiny bit of infrastructure.
3564
3565 2007-01-02  Marek Safar  <marek.safar@gmail.com>
3566
3567         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
3568         where field type is struct from current assembly.
3569         
3570         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
3571         it is possible.
3572
3573 2007-01-02  Marek Safar  <marek.safar@gmail.com>
3574
3575         A fix for bug #80381
3576         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
3577         the core types.
3578
3579         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
3580         messages.
3581         (Namespace.LookupType): Always use core types from corlib when speficied.
3582
3583         * report.cs: A new warning.
3584
3585         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
3586         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
3587         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
3588
3589         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
3590         (InitCoreTypes): Set expression type of object_type and value_type
3591         immediately after lookup.
3592
3593 2007-01-01  Miguel de Icaza  <miguel@novell.com>
3594
3595         * cs-tokenizer.cs: Accept Pc class characters (Connector
3596         Punctuation) as valid identifiers.  Fixes #78259
3597
3598         * expression.cs (Invocation.DoResolve): Moved the check for the
3599         use of `this' for doing method calls to the Invocation resolution
3600         step, after overload resolution has taken place instead of doing
3601         the check at the low-level `This.DoResolve' level.
3602
3603         The `This.DoResolve'(appens before overload resolution, so it has
3604         no way of knowing if the method that will be called will be
3605         instace or static, triggering an erroneous report for cs0188 (Bug
3606         78113).
3607
3608         We now do the check for instance method invocations after we know
3609         what method will be called.
3610
3611         (This.CheckThisUsage): Move the actual use of this structure
3612         checking into its own method and expose it. 
3613
3614         * Everywhere that called Error_ValueCannotBeConverted: pass a new
3615         EmitContext.
3616
3617         Exceptions: Null.ConvertImplicitly,
3618         Constant.ImplicitConversionRequired as there are too many call
3619         sites for passing the ec. 
3620
3621         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
3622         EmitContext, if the value is null, then we do not try to provide
3623         the extra information from the error (If a userdefined conversion
3624         exists, as UserDefinedConversion requires a non null-EmitContext).
3625
3626         Fixes: #80347
3627
3628 2006-12-30  Raja R Harinath  <rharinath@novell.com>
3629
3630         * flowanalysis.cs (MyBitVector): Document some invariants.
3631         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
3632         introduced below, and add a couple of others, 
3633
3634 2006-12-30  Marek Safar  <marek.safar@gmail.com>
3635
3636         * attribute.cs (GetMethodObsoleteAttribute): Uses new
3637         GetPropertyFromAccessor and GetEventFromAccessor.
3638         
3639         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
3640         overrides non-obsolete one.
3641         (Indexer.Define): Error message has been moved to the parser.
3642
3643         * cs-parser.jay: Better syntax errors handling.
3644
3645         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
3646         when an invocation has no arguments.
3647
3648         * ecore.cs: Removed not used caching.
3649
3650         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
3651         implementation.
3652
3653         * report.cs: Add a new warning.
3654
3655         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
3656
3657         * typemanager.cs (enumeration_type): Removed.
3658         (CSharpSignature): Reuses IsSpecialMethod.
3659         (IsEqual): Hack for MS BCL.
3660         (GetPropertyFromAccessor): New method.
3661         (GetEventFromAccessor): New method.
3662         (IsSpecialMethod): Fixed to handle more cases.
3663
3664 2006-12-30  Marek Safar  <marek.safar@gmail.com>
3665
3666         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
3667         Made white spaces array static.
3668
3669         * ecore.cs (RemoveGenericArity): Optimized.
3670
3671         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
3672         10 times faster).
3673         (MyBitVector.initialize_vector): Simplified.
3674
3675 2006-12-22  Miguel de Icaza  <miguel@novell.com>
3676
3677         * ecore.cs: Am not entirely happy with this hack, but it seems to
3678         address the issue in 80257 (a small test case for
3679         CreativeDocs.NET). 
3680
3681         I set the MethodGroupExpr.Type to an internal compiler type
3682         (itself in this case) to force the resolution to take place.   Why
3683         it does not take place with a null is beyond me.
3684
3685 2006-12-20  Marek Safar  <marek.safar@gmail.com>
3686
3687         A fix for bug #80288
3688         * expression.cs (ResolveOperator): Consider user defined conversion for
3689         logical and operator too.
3690         (EmitBranchable): Optimization for logical and when full constant folding
3691         could not be applied but one operand is constant.
3692
3693 2006-12-19  Marek Safar  <marek.safar@gmail.com>
3694
3695         * class.cs (GetClassBases): Write 5 times every day, will never use
3696         FullName for error reporting.
3697
3698         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
3699
3700 2006-12-19  Martin Baulig  <martin@ximian.com>
3701
3702         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
3703         the symbol file info here.
3704
3705 2006-12-18  Marek Safar  <marek.safar@gmail.com>
3706
3707         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
3708         of `elseif' is taking then following sections are not taking.
3709         Fixes an issue reported on mono mailing list.
3710
3711 2006-12-18  Marek Safar  <marek.safar@gmail.com>
3712
3713         A fix for bug #80300
3714         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
3715         a caller is not taking.
3716
3717 2006-12-18  Raja R Harinath  <rharinath@novell.com>
3718
3719         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
3720         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
3721         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
3722         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
3723         * class.cs: Update to changes.
3724
3725 2006-12-17  Marek Safar  <marek.safar@gmail.com>
3726
3727         A fix for bug #79934
3728         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
3729         partial container.
3730
3731         * class.cs (ResolveMembers): Register an iterator in current container and
3732         not in shared one.
3733
3734 2006-12-16  Raja R Harinath  <rharinath@novell.com>
3735
3736         Fix test-543.cs
3737         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
3738         satisfy a params annotated parameter.
3739
3740 2006-12-16  Marek Safar  <marek.safar@gmail.com>
3741
3742         A fix for bug #77014
3743         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
3744         paramters correctly and not rely on hacks in Parameters class.
3745         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
3746         at any possition.
3747         (Invocation.VerifyArgumentsCompat): Ditto.
3748         (Invocation.EmitArguments): Changed to correctly emit params arguments at
3749         any possition.
3750
3751         * parameter.cs (HasParams): Don't assume that params is the last one.
3752
3753         * support.cs (ReflectionParameters.ctor): Look for params attribute
3754         correctly.
3755         (ReflectionParameters.ParameterType): Removed hack when we returned last
3756         parameter for out of range parameters.
3757         (ParameterName, ParameterModifier): Ditto.
3758
3759 2006-12-14  Marek Safar  <marek.safar@gmail.com>
3760
3761         A fix for bug #79987
3762         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
3763         when assembly is not CLS compliant but type is. I have no idea why is this
3764         allowed.
3765
3766         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
3767
3768 2006-12-13  Miguel de Icaza  <miguel@novell.com>
3769
3770         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
3771         in struct constructors, they are basically no-ops.
3772
3773 2006-12-12  Marek Safar  <marek.safar@gmail.com>
3774
3775         * cs-tokenizer.cs (Position): Save preprocessor status too.
3776
3777 2006-12-12  Marek Safar  <marek.safar@gmail.com>
3778
3779         A fix for bug #77794
3780         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
3781
3782 2006-12-12  Marek Safar  <marek.safar@gmail.com>
3783
3784         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
3785         Fixes #69299.
3786         (pp_expr): Report error for an invalid expression.
3787         (handle_preprocessing_directive): Simplified; add more error checking.
3788
3789 2006-12-11  Marek Safar  <marek.safar@gmail.com>
3790
3791         A fix for bug #74939
3792         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
3793         directives handling.
3794
3795 2006-12-10  Marek Safar  <marek.safar@gmail.com>
3796
3797         A fix for bugs #80093, and #75984
3798         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
3799         logic, it seems to me as it worked before "by coincidence".
3800         (xtoken): Simplified to use reworked handle_preprocessing_directive.
3801         (cleanup): Enabled endif check.
3802
3803 2006-12-09  Marek Safar  <marek.safar@gmail.com>
3804
3805         A fix for bug #80162
3806         * statement.cs (CollectionForeach.TryType): Generics and non-generics
3807         enumerators are never ambiguous.
3808
3809 2006-12-08  Raja R Harinath  <rharinath@novell.com>
3810
3811         Fix #80060
3812         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
3813
3814 2006-12-06  Marek Safar  <marek.safar@gmail.com>
3815
3816         A fix for bug #80144
3817         * class.cs (EventProperty.Define): Explicit implementation means
3818         that an even is used.
3819
3820 2006-12-06  Marek Safar  <marek.safar@gmail.com>
3821
3822         Fixes the operators implementation (part II)
3823
3824         * cfold.cs (DoConstantNumericPromotions): Renamed to
3825         DoBinaryNumericPromotions and simplified.
3826         (BinaryFold): Couple of conversion fixes; simplified.
3827
3828         * constant.cs, ecore.cs, literal.cs
3829         (ToType): Renamed to ConvertImplicitly.
3830         (Reduce): Renamed to ConvertExplicitly.
3831
3832         * class.cs, convert.cs: Updated.
3833
3834         * expression.cs: TryReduce doesn't throw an exception.
3835
3836 2006-12-01  Marek Safar  <marek.safar@gmail.com>
3837
3838         A fix for bug #80108
3839         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
3840         compatible.
3841
3842 2006-11-30  Marek Safar  <marek.safar@gmail.com>
3843
3844         Fixes unary operators implementation (part I)
3845         Also fixes #80026
3846
3847         * cfold.cs (Error_CompileTimeOverflow): Made internal
3848
3849         * const.cs (IConstant): Changed to use reference to constant and
3850         not constant itself.
3851         Updated IConstant implementations.
3852
3853         * constant.cs (CreateConstant): New factory method.
3854         Updated IConstant implementation.
3855
3856         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
3857
3858         * ecore.cs: Updated to use CreateConstantReference.
3859
3860         * enum.cs: Reflects IConstant changes.
3861
3862         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
3863
3864         * literal.cs (NullConstant): Change to be independently usable.
3865
3866 2006-11-29  Martin Baulig  <martin@ximian.com>
3867
3868         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
3869         we need to emit the scope initializer before calling the base .ctor.
3870
3871         * anonymous.cs: Merged back from the new anonymous methods branch.
3872         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
3873
3874         * expression.cs (ParameterReference.DoResolveBase): Create a
3875         "normal" ScopeInfo when capturing parameters rather than using the
3876         root scope; this makes things work with anonymous methods having
3877         parameters.
3878
3879         * statement.cs
3880         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
3881
3882 2006-11-22  Marek Safar  <marek.safar@gmail.com>
3883
3884         A fix for bug #79987
3885         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
3886         check to a base class.
3887         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
3888         only when assembly has missing attribute.
3889         * report.cs: Update.
3890
3891 2006-11-21  Marek Safar  <marek.safar@gmail.com>
3892
3893         * cs-tokenizer.cs: Merged with gmcs version.
3894
3895 2006-11-20  Marek Safar  <marek.safar@gmail.com>
3896
3897         * cs-tokenizer.cs,
3898         * cs-parser.jay: Better error message when partial keyword is misplaced.
3899
3900 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
3901
3902         A fix for bug #79810
3903         report.cs: CS1058 only applies to 2.0 profile (gmcs).
3904         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
3905         a RuntimeWrappedException by default.
3906
3907 2006-11-18  Marek Safar  <marek.safar@gmail.com>
3908
3909         A fix for bug #79843
3910         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
3911         implementation.
3912         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
3913
3914 2006-11-18  Marek Safar  <marek.safar@gmail.com>
3915
3916         * driver.cs, namespace.cs: Uses faster IndexOf version.
3917
3918 2006-11-17  Marek Safar  <marek.safar@gmail.com>
3919
3920         A fix for bug #79941
3921         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
3922         operators.
3923         (Operator.Define): Implicit/Explicit operator of same type is duplicate
3924         even if internal name is different.
3925         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
3926         (UserDefinedConversion): Simplified as the operators cannot be internal.
3927         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
3928         conversions.
3929         (MethodLookup): Replaced EmitContext with parentType.
3930         * expression.cs: Updated.
3931
3932 2006-11-09  Raja R Harinath  <rharinath@novell.com>
3933
3934         * driver.cs (BadAssembly): Handle all the ugliness of
3935         DefineDynamicAssembly.
3936
3937 2006-11-08  Raja R Harinath  <rharinath@novell.com>
3938
3939         Address parts of #58244 -- most of what's left is in the runtime
3940         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
3941         CS1509 error checks, and handle them for all assembly loads, not
3942         just the first invocation.
3943         (LoadModule): Likewise.  Move handling of 'adder_method' ...
3944         * codegen.cs (AssemblyClass.AddModule): ... here.
3945
3946 2006-11-02  Marek Safar  <marek.safar@gmail.com>
3947
3948         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
3949         IEnumerable<T> is ambiguous.
3950
3951 2006-10-31  Marek Safar  <marek.safar@gmail.com>
3952
3953         A fix for bug #67689
3954         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
3955         GetEnumerator is ambiguous.
3956
3957         * report.cs: Add new warning.
3958
3959 2006-10-29  Marek Safar  <marek.safar@gmail.com>
3960
3961         A fix for bug #78602
3962         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
3963         to protected member can be nested type.
3964
3965 2006-10-28  Marek Safar  <marek.safar@gmail.com>
3966
3967         A fix for bug #78965
3968         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
3969         to protected member must derive from current type.
3970
3971 2006-10-27  Marek Safar  <marek.safar@gmail.com>
3972
3973         assign.cs: Reuses error method.
3974
3975         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
3976         instead of type for constants.
3977         (Expression.Error_ValueAssignment): Common error method.
3978
3979         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
3980         for any assignment.
3981
3982 2006-10-27  Marek Safar  <marek.safar@gmail.com>
3983
3984         A fix for bug #79081
3985         * expression.cs (MemberAccess.DoResolve): Check nested type
3986         accessibility.
3987
3988 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
3989
3990         * doc.cs : nested delegates were not handled. Fixed bug #79754.
3991
3992 2006-10-26  Marek Safar  <marek.safar@gmail.com>
3993
3994         A fix for bug #76591
3995         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
3996
3997 2006-10-26  Marek Safar  <marek.safar@gmail.com>
3998
3999         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
4000         type forwarder of the same type multiple times.
4001
4002 2006-10-26  Raja R Harinath  <rharinath@novell.com>
4003
4004         Fix #78820
4005         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
4006         instance as an rvalue, even when we later resolve as an lvalue.
4007
4008 2006-10-25  Martin Baulig  <martin@ximian.com>
4009
4010         * anonymous.cs: Fix #79673.
4011
4012 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
4013
4014         A fix for bug #79666
4015         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
4016         ignored when is optimized (= default value) as its value is already set.
4017
4018 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
4019
4020         A fix for bug #79724
4021         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
4022         TypeContainer for type lookup.
4023
4024 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
4025
4026         A fix for bug #79231
4027         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
4028         * expression.cs (OverloadResolve): Always convert type name for
4029         an error message.
4030         (ResolveNamespaceOrType): Don't confuse a nested type with any 
4031         other member.
4032
4033 2006-10-18  Martin Baulig <martin@ximian.com>
4034
4035         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
4036
4037 2006-10-17  Miguel de Icaza  <miguel@novell.com>
4038
4039         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
4040         an int32, but requesting an int64 from the conversion
4041
4042 2006-10-12  Martin Baulig  <martin@ximian.com>
4043
4044         * anonymous.cs
4045         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
4046         
4047 2006-10-12  Martin Baulig  <martin@ximian.com>
4048
4049         * statement.cs
4050         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
4051
4052 2006-10-11  Miguel de Icaza  <miguel@novell.com>
4053
4054         * convert.cs: Remove broken code: I was doing the "Existance"
4055         tests for Implicit conversions.
4056
4057 2006-10-10  Miguel de Icaza  <miguel@novell.com>
4058
4059         * convert.cs: Added one missing case in
4060         ImplicitStandardConversionExists uint64 to intptr.
4061
4062         Fixes #59800
4063         
4064         * typemanager.cs (uintptr_type): another core known type.   
4065
4066         * ecore.cs (OperatorCast): routine used to do cast operations that
4067         depend on op_Explicit.  We could change some of the Decimal
4068         conversions to use this.
4069
4070         This one has a probe mechanism that checks both types for an op_
4071         which it coudl be used to eliminate two classes: CastToDecimal
4072         and CastFromDecimal.
4073
4074         * convert.cs: Implement the conversions documented in #59800
4075         
4076 2006-10-10  Martin Baulig  <martin@ximian.com>
4077
4078         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
4079         before RootScope.ResolveMembers().
4080
4081         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
4082         `CurrentType' if appropriate.
4083
4084 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
4085
4086         A fix for bug #78568
4087         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
4088         when contains binary operators.
4089         * cs-parser.jay: Updated.
4090
4091 2006-10-09  Martin Baulig  <martin@ximian.com>
4092
4093         * delegate.cs
4094         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
4095         moved that into Define() and also do the other type parameter
4096         checks there.  Fixes #79094.  Added gtest-292.cs.
4097
4098         * expression.cs
4099         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
4100         since that doesn't include type parameters; don't use `Ldelema'
4101         for type parameters.  Fixes #78980.  Added gtest-293.cs.
4102
4103 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
4104
4105         A fix for #77796
4106         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
4107         conversion is allowed.
4108
4109 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
4110
4111         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
4112         error reporting when no error occurs.
4113
4114 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
4115
4116         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
4117         does not exist.
4118
4119 2006-10-06  Raja R Harinath  <rharinath@novell.com>
4120
4121         Fix #79584
4122         * class.cs (DefineTypeBuilder): Check circular dependencies before
4123         setting the parent of the TypeBuilder.
4124         (CheckRecursiveDefinition): Don't use 'BaseType', since
4125         it may not be valid until after DefineTypeBuilder.  Use
4126         'base_type' instead.
4127
4128 2006-10-04  Martin Baulig  <martin@ximian.com>
4129
4130         Merged the Anonymous Methods patch.
4131
4132         * anonymous.cs, iterators.cs: The new anonymous methods code.
4133
4134         * statement.cs (Variable): New public abstract class.
4135         (LocalInfo.Variable): New public property.
4136         (LocalInfo.ResolveVariable): New public method.
4137         (Block.Flags): Add `IsIterator'.
4138         (Block.AddVariable): Improved the CS0136 check.
4139         (Block.AnonymousChildren): New public property.
4140         (Block.AddAnonymousChild): New public method.
4141         (ToplevelBlock): Update to use the new anonymous method framework.
4142         (ToplevelBlock.ctor): `container' is now a `Block' and not a
4143         `ToplevelBlock'; this is required to correctly implement the
4144         CS0136 check.
4145         (Fixed, Using): Use `TemporaryVariable' instead of directly
4146         creating the `LocalBuilder'.
4147
4148         * parameter.cs (Parameter.ResolveVariable): New public method.
4149         (Parameters.ResolveVariable): Likewise.
4150
4151         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
4152
4153         * class.cs (TypeContainer): Replaced the `iterators' list and
4154         corresponding methods with a list of `CompilerGeneratedClass'es.
4155         (TypeContainer.ResolveMembers): New public method.
4156         (Method): `IIteratorContainer' has been replaced by
4157         `IAnonymousHost'.
4158
4159         * expression.cs (VariableReference): New public abstract base
4160         class for `LocalVariableReference', `ParameterReference' and
4161         `This'.
4162
4163         * codegen.cs (EmitContext): Removed `capture_context',
4164         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
4165         (EmitContext.EmitThis): Removed.
4166
4167         * cs-parser.jay: Replace `iterator_container' with
4168         `anonymous_host'.       
4169
4170 2006-10-04  Martin Baulig  <martin@ximian.com>
4171
4172         * generic.cs (GenericMethod): Don't make this abstract.
4173         (Constraints.Clone): Added dummy implementation.
4174
4175 2006-10-04  Raja R Harinath  <harinath@gmail.com>
4176
4177         Fix #79577
4178         * namespace.cs (LookForAnyGenericType): Avoid nullref on
4179         'declspaces'.  Avoid allocating arrays willy-nilly.
4180
4181         Fix #79553
4182         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
4183         cases out of the switch.
4184
4185 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
4186
4187         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
4188         message when non-generic type is used with the type arguments.
4189         * expression.cs: Updated.
4190
4191 2006-09-28  Raja R Harinath  <rharinath@novell.com>
4192
4193         Fix #79013
4194         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
4195         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4196         Change semantics slightly.  Don't insist on having only one
4197         temporary EmptyExpression -- just throttle the creation of new ones.
4198
4199         Fix #79451
4200         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
4201         non-interfaces too.  If no methods are found, don't try to create
4202         a MethodGroupExpr.
4203
4204 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
4205
4206         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
4207         generic type.
4208
4209         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
4210         us produce better error message.
4211
4212 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
4213
4214         * expression.cs (Binary.ResolveOperator): Warn about a side effect
4215         of the `|' operator.
4216
4217         * report.cs: A new warning added.
4218
4219 2006-09-27  Martin Baulig  <martin@ximian.com>
4220
4221         * generic.cs (GenericMethod): Don't make this abstract.
4222
4223 2006-09-27  Martin Baulig  <martin@ximian.com>
4224
4225         * report.cs
4226         (InternalErrorException): Added overloaded ctor taking a params array.
4227
4228 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
4229
4230         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
4231         Fixed the cases when same error was reported twice.
4232
4233         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
4234         now report symbol information.
4235
4236 2006-09-25  Martin Baulig  <martin@ximian.com>
4237
4238         * class.cs: Completely unified with the gmcs version.
4239
4240 2006-09-25  Martin Baulig  <martin@ximian.com>
4241
4242         * typemanager.cs (TypeManager.IsNullableType): New public function.
4243         (TypeManager.IsNullableTypeOf): Likewise.
4244         (TypeManager.IsNullableValueType): Likewise.
4245
4246         * class.cs (MethodCore): Added the `GenericMethod' argument from
4247         gmcs and also unified all classes derived from `MethodCore' with gmcs.
4248
4249 2006-09-24  Raja R Harinath  <harinath@gmail.com>
4250
4251         * convert.cs: Unify with gmcs version.
4252
4253 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
4254
4255         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
4256         verify them as well.
4257
4258         * report.cs: New warning.
4259
4260 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
4261
4262         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
4263         for anonymous block with out argument.
4264
4265 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
4266
4267         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
4268         not used private events only.
4269
4270 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
4271
4272         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
4273
4274         * const.cs (Const.Define): Check for constant type.
4275         (Const.IsConstantTypeValid): Looks for valid constant types.
4276
4277         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
4278
4279         * ecore.cs (EmptyConstantCast): New common class for all constant based
4280         EmptyCast(s).
4281
4282         * expression.cs (Is.DoResolve): Handle null constant especially.
4283         (New.DoResolve): Check for new void().
4284         (MemberAccess.DoResolve): Cope with all kind of nulls.
4285
4286         * literal.cs (NullConstant): Uses EmptyConstantCast.
4287         (NullDefault): Based on EmptyConstantCast.
4288         (NullLiteral): Uses EmptyConstantCast.
4289
4290         * statement.cs (Block.ResolveMeta): Check for constant type.
4291
4292 2006-09-22  Martin Baulig  <martin@ximian.com>
4293
4294         * delegate.cs, attribute.cs: Merged with the gmcs versions.
4295
4296 2006-09-22  Raja R Harinath  <rharinath@novell.com>
4297
4298         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
4299         not the null type.
4300
4301         Fix part of #79451
4302         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
4303         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
4304         code slightly.
4305
4306 2006-09-22  Martin Baulig  <martin@ximian.com>
4307
4308         * ecore.cs: Merged with the gmcs version.
4309
4310         * generic.cs (ConstructedType): New dummy class.
4311         (TypeArguments): Don't make this abstract.
4312
4313         * typemanager.cs
4314         (TypeManager.IsGenericTypeDefinition): New method.
4315         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
4316
4317 2006-09-22  Raja R Harinath  <rharinath@novell.com>
4318
4319         * expression.cs (ComposedCast): Check for arrays of TypedReference
4320         before creating the type, not after.
4321
4322 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
4323
4324         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
4325         after ToType change.
4326
4327         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
4328         when constant must be implicitly convertible.
4329
4330         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
4331
4332         * ecore.cs (NullCast): Derives from NullConstant.
4333
4334         * expression.cs (Is.DoResolve): Removed useless variables.
4335         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
4336         (New.Constantify): Add enum support.
4337         (MemberAccess.DoResolve): Add warning when accessing null constant or
4338         variable.
4339
4340         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
4341         property.
4342
4343         * literal.cs (NullConstant): New abstract class with common
4344         functionality for all null specializations.
4345         (NullDefault): Represents default(X) when result can be
4346         reduced to null.
4347         (NullLiteral): Updated.
4348
4349         * report.cs: Add new warning.
4350
4351 2006-09-21  Martin Baulig  <martin@ximian.com>
4352
4353         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
4354
4355 2006-09-21  Martin Baulig  <martin@ximian.com>
4356
4357         * generic.cs (GenericConstraints): New dummy class.
4358         (Constraints): Likewise.
4359         (TypeParameter): Likewise.
4360         (TypeParameterName): Likewise.
4361         (GenericMethod): Likewise.
4362
4363         * typemanager.cs (TypeManager.GetGenericArguments): New method.
4364
4365         * decl.cs: Merged with the gmcs version.
4366
4367 2006-09-21  Raja R Harinath  <rharinath@novell.com>
4368
4369         * generic.cs (TypeParameter): Implement IMemberContainer.
4370         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
4371
4372         * rootcontext.cs: Unify with gmcs version.
4373
4374         * report.cs: Unify with gmcs version.
4375         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
4376         from gmcs/generics.cs.
4377         * generics.cs (TypeParameter): New dummy class.
4378
4379         * support.cs: Unify with gmcs version.
4380
4381 2006-09-20  Raja R Harinath  <rharinath@novell.com>
4382
4383         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
4384         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
4385
4386         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
4387         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
4388         * mcs.exe.sources: Add generic.cs.
4389
4390         * codegen.cs: Unify with gmcs version.
4391
4392         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
4393         (EmitContext): Add GenericDeclContainer implementation.
4394         * decl.cs (MemberCore, DeclSpace): Likewise.
4395         * namespace.cs: Remove #ifdef GMCS_SOURCE.
4396
4397         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
4398         MCS TypeManager has a corresponding dummy method.
4399
4400 2006-09-19  Martin Baulig  <martin@ximian.com>
4401
4402         * expression.cs: Completely merged with the gmcs version.
4403
4404 2006-09-19  Martin Baulig  <martin@ximian.com>
4405
4406         * expression.cs (Invocation): Merged with the gmcs version.
4407         (ArrayAccess.GetStoreOpcode): Likewise.
4408
4409 2006-09-19  Martin Baulig  <martin@ximian.com>
4410
4411         * typemanager.cs
4412         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
4413         (TypeManager.IsGenericMethodDefinition): Likewise.
4414
4415 2006-09-19  Martin Baulig  <martin@ximian.com>
4416
4417         * typemanager.cs
4418         (TypeManager.IsEqual): Moved the gmcs implementation here.
4419         (TypeManager.DropGenericTypeArguments): Likewise.
4420         (TypeManager.DropGenericMethodArguments): Likewise.
4421         (TypeManager.GetTypeArguments): Moved here from gmcs.
4422         (TypeManager.HasGenericArguments): Likewise.
4423
4424 2006-09-19  Martin Baulig  <martin@ximian.com>
4425
4426         * expression.cs (Binary): Merged with the gmcs version.
4427
4428 2006-09-19  Martin Baulig  <martin@ximian.com>
4429
4430         * expression.cs (Probe, As, Is): Merged with the gmcs version.
4431
4432 2006-09-19  Martin Baulig  <martin@ximian.com>
4433
4434         * typemanager.cs: Merged with the gmcs version.
4435
4436 2006-09-16  Raja R Harinath  <rharinath@novell.com>
4437
4438         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
4439         * driver.cs: Likewise.
4440
4441 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
4442
4443         A fix for #79401
4444         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
4445         only if parent type is class.
4446         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
4447         update.
4448
4449 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
4450
4451         * cs-parser.jay,
4452         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
4453         keywords are used.
4454         * typemanager.cs(CSharpName): Converts NullType to null.
4455
4456 2006-09-15  Martin Baulig  <martin@ximian.com>
4457
4458         * typemanager.cs
4459         (TypeManager.GetMethodName): Added mcs implementation.
4460         (TypeManager.IsEqual): Likewise.
4461
4462         * ecore.cs
4463         (SimpleName.RemoveGenericArity): Added dummy implementation.
4464
4465         * pending.cs: Merged with the gmcs version.     
4466
4467 2006-09-15  Martin Baulig  <martin@ximian.com>
4468
4469         * statement.cs: Merge with the gmcs version.
4470
4471 2006-09-15  Martin Baulig  <martin@ximian.com>
4472
4473         * statement.cs (Switch): Merge with the gmcs implementation
4474         (without nullables), which is newer.
4475
4476 2006-09-15  Martin Baulig  <martin@ximian.com>
4477
4478         * statement.cs (Block.Variables): Make this public.
4479         (ToplevelBlock.Parameters): Make this a property.
4480         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
4481
4482 2006-09-15  Martin Baulig  <martin@ximian.com>
4483
4484         * namespace.cs: Merge with the gmcs version.
4485
4486 2006-09-15  Martin Baulig  <martin@ximian.com>
4487
4488         * decl.cs (MemberName): Minor code cleanups.
4489
4490 2006-09-15  Martin Baulig  <martin@ximian.com>
4491
4492         * parameter.cs: Merge with the gmcs version.
4493
4494 2006-09-15  Martin Baulig  <martin@ximian.com>
4495
4496         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
4497         and an error in mcs.
4498
4499 2006-09-15  Martin Baulig  <martin@ximian.com>
4500
4501         * flowanalysis.cs: Merged from GMCS; added the generics code into
4502         a `GMCS_SOURCE' conditional so we can share this file.
4503
4504 2006-09-08  Martin Baulig  <martin@ximian.com>
4505
4506         * typemanager.cs (TypeManager.interlocked_type): New public field.
4507         (TypeManager.int_interlocked_compare-exchange): New public field.
4508         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
4509         enumerator types here and call InitGenericCoreTypes().
4510         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
4511         after calling InitEnumUnderlyingTypes().
4512
4513         * rootcontext.cs
4514         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
4515         `classes_second_stage'. 
4516
4517 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
4518
4519         * assign.cs, ecore.cs, expression.cs: Share error message text.
4520         * class.cs (FieldMember.Define): Check for varible of static type.
4521         * driver.cs (LoadAssembly): Uses error output for errors.
4522         * statement.cs: Updated.
4523
4524 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
4525
4526         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
4527         type instance.
4528
4529 2006-09-07  Martin Baulig  <martin@ximian.com>
4530
4531         * driver.cs
4532         (MainDriver): Revert r62663 from Marek; see #70506 for details.
4533
4534 2006-08-29  Miguel de Icaza  <miguel@novell.com>
4535
4536         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
4537         
4538 2006-08-17  Miguel de Icaza  <miguel@novell.com>
4539
4540         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
4541         #52019 and #79064, the use of the \uXXXX sequence in source code
4542         to represent unicode characters.
4543
4544 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
4545
4546         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
4547         support.
4548         * class.cs, ecore.cs, statement.cs: Merged to one error message.
4549
4550 2006-08-13  Miguel de Icaza  <miguel@novell.com>
4551
4552         * assign.cs: Catch attempts to assign to a method groups in += and
4553         report as 1656
4554
4555 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
4556
4557         A fix for #79056
4558         * cs-parser.jay: Don't destroy current array type by typeof of array's.
4559
4560 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
4561
4562         * class.cs (Method.Define): Issue a warning when generic method looks like
4563         an entry point.
4564         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
4565         as well.
4566
4567 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
4568  
4569         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
4570         looking for ctor.
4571         * decl.cs (MemberCache.FindMembers): When container is interface we need to
4572         search all base interfaces as a member can be ambiguous.
4573         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
4574         Constructor member type filter. 
4575         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
4576         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
4577         reporting for returned memberinfos.
4578         * report.cs: Updated.
4579         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
4580         version to work on all runtimes.
4581         (TypeManager.RealMemberLookup): Removed members filtering.
4582
4583 2006-08-08  Raja R Harinath  <rharinath@novell.com>
4584
4585         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
4586         (PropertyExpr.EmitAssign): Likewise.
4587         * expression.cs (Indirection.EmitAssign): Likewise.
4588         (LocalVariableReference.EmitAssign): Likewise.
4589         (ParameterReference.EmitAssign): Likewise.
4590         (Invocation.EmitArguments): Likewise.
4591         (ArrayAccess.EmitAssign): Likewise.
4592         (IndexerAccess.EmitAssign): Likewise.
4593         (This.EmitAssign): Likewise.
4594         (ConditionalLogicalOperator.Emit): Likewise.
4595
4596         Fix #79026
4597         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
4598         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
4599         leave it in after returning it.
4600         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
4601
4602 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
4603
4604         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
4605         message.
4606
4607 2006-08-03  Raja R Harinath  <rharinath@novell.com>
4608
4609         Fix cs0146-3.cs and cs0146-4.cs.
4610         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
4611         enclosing types don't depend on the current type.
4612
4613 2006-08-02  Raja R Harinath  <rharinath@novell.com>
4614
4615         Fix #77963
4616         * class.cs (TypeContainer.DoDefineMembers): Use
4617         FindBaseMemberWithSameName on Parent, since we're interested in
4618         whether we hide inherited members or not.
4619         (FindBaseMemberWithSameName): Make slightly more robust.
4620
4621         Fix the non-generic testcase from #77396
4622         * decl.cs (DeclSpace.DeclContainer): Remove override.
4623
4624         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
4625         declspaces for doppelgangers too.
4626         (UsingEntry): Implement IResolveContext.
4627         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
4628         'this' as the resolve context.
4629         (LocalAliasEntry): Likewise.
4630
4631         Implement parts of #77403
4632         * roottypes.cs (RootDeclSpace): New.  Used to represent the
4633         toplevel declaration space.  Each namespace declaration introduces
4634         a "partial" root declaretion space.
4635         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
4636         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
4637         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
4638         from 'current_namespace.SlaveDeclSpace'.
4639         (namespace_declaration): Likewise.
4640         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
4641         check.  It can't happen now.
4642         * decl.cs (DeclSpace.LookupType): Likewise.
4643         * driver.cs (MainDriver): Sanity check.
4644
4645 2006-08-01  Raja R Harinath  <rharinath@novell.com>
4646
4647         * decl.cs (DeclSpace.FindNestedType): Remove.
4648         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
4649         LookupTypeContainer to get the container of the nested type.
4650         * class.cs (TypeContainer.FindNestedType): Make non-override.
4651
4652 2006-07-31  Raja R Harinath  <rharinath@novell.com>
4653
4654         * decl.cs (DeclSpace.PartialContainer): Move field from ...
4655         * class.cs (TypeContainer.PartialContainer): ... here.
4656         (TypeContainer.AddBasesForPart): New helper.
4657         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
4658         instead.
4659         * cs-parser.jay (current_class): Convert to DeclSpace.
4660         (struct_declaration, interface_declaration, class_declaration):
4661         Use AddBasesForPart instead of .Bases directly.
4662         * const.cs, iterators.cs: Update to changes.
4663
4664 2006-07-28  Raja R Harinath  <rharinath@novell.com>
4665
4666         * class.cs (TypeContainer.AddMemberType): Rename from
4667         AddToTypeContainer.
4668         (TypeContainer.AddMember): Rename from AddToMemberContainer.
4669         (AddTypeContainer): New.  Combine AddClassOrStruct and
4670         AddInterface.
4671         (AddPartial): Update.  Add 'is_partial' argument.
4672         * roottypes.cs: Update to changes.
4673         * cs-parser.jay (push_current_class): New helper for handling
4674         current_container and current_class.
4675         (struct_declaration, interface_declaration, class_declaration):
4676         Use it.
4677
4678 2006-07-26  Raja R Harinath  <rharinath@novell.com>
4679
4680         * roottypes.cs: Rename from tree.cs.
4681
4682         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
4683         * tree.cs (Tree, ITreeDump): Remove types.
4684         * rootcontext.cs (tree, Tree): Remove fields.
4685         (root, ToplevelTypes): New.
4686         * *.cs: Update to rename.
4687
4688         * tree.cs (Tree.RecordDecl): Remove.
4689         (RootTypes.AddToTypeContainer): Record the toplevel type in its
4690         namespace here.
4691         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
4692
4693 2006-07-23  Raja R Harinath  <harinath@gmail.com>
4694
4695         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
4696         DoFlowAnalysis and OmitStructFlowAnalysis here.
4697         (ec.With): Rename from WithUnsafe and generalize.
4698         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
4699         (ec.WithFlowAnalyis): New.
4700         * ecore.cs, expression.cs, statement.cs: Update.
4701
4702 2006-07-22  Raja R Harinath  <harinath@gmail.com>
4703
4704         * statement.cs (Block.ResolveMeta): Simplify slightly.
4705
4706         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
4707         multiple boolean fields.  Convert InUnsafe, constant_check_state,
4708         check_state to flags.
4709         (CheckState, ConstantCheckState): Update.
4710         (InUnsafe): New read-only property.
4711         (FlagsHandle): Rename from CheckStateHandle and convert to handle
4712         arbitrary flags.
4713         (WithUnsafe): New helper similar to WithCheckState.
4714         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
4715         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
4716
4717 2006-07-21  Raja R Harinath  <rharinath@novell.com>
4718
4719         Make comparisons use the same IL irrespective of whether they're
4720         in a 'checked' or 'unchecked' context: one of the issues in #78899
4721         * codegen.cs (EmitContext.CheckState): Make read-only property.
4722         (EmitContext.ConstantCheckState): Likewise.
4723         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
4724         helper that implement a save/restore stack for CheckState
4725         values.  This is the only way to change check-state.
4726         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
4727         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
4728         (CheckedExpr.EmitBranchable): New forwarding method.
4729         (UnCheckedExpr): Likewise.
4730         * statement.cs (Block.ResolveMeta): Use WithCheckState.
4731         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
4732         (Checked.Resolve, checked.DoEmit): Likewise.
4733
4734 2006-07-20  Miguel de Icaza  <miguel@novell.com>
4735
4736         * anonymous.cs: Cache the resolved anonymous delegate, and return
4737         this so that the ResolveTopBlock is only triggered once, not
4738         twice.
4739
4740         Currently we trigger ResolvetopBlock twice due to a first pass of
4741         argument check compatibility, and a second pass that does the
4742         actual resolution.   
4743         
4744 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
4745
4746         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
4747         modifiers.
4748         * rootcontext.cs (Reset): Add helper_classes.
4749
4750 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
4751
4752         A fix for #78860
4753         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
4754         correctly.
4755
4756 2006-07-13  Miguel de Icaza  <miguel@novell.com>
4757
4758         * statement.cs (Lock): Handle expressions of type
4759         TypeManager.null_type specially.  Fixes #78770
4760
4761 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
4762
4763         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
4764         to an event.
4765
4766 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
4767
4768         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
4769         for accessors as well.
4770         * ecore.cs (EventExpr): Add AccessorTable.
4771
4772 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
4773
4774         A fix for #78738
4775         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
4776         for CS0122 where appropriate.
4777         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
4778         level attributes.
4779         (Filter): Assembly can be null in the case of top level attributes.
4780
4781 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
4782
4783         A fix for #78690
4784
4785         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
4786         is done at global level.
4787
4788 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
4789
4790         A fix for #77002, Implemented TypeForwarder support.
4791
4792         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
4793         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
4794         * typemanager.cs (): Add type_forwarder_attr_type.
4795
4796 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
4797
4798         * report.cs: Add CS0469 warning.
4799
4800 2006-06-21  Martin Baulig  <martin@ximian.com>
4801
4802         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
4803         the `try'-block, so we also report CS0016 etc. there.
4804
4805 2006-06-21  Martin Baulig  <martin@ximian.com>
4806
4807         * delegate.cs
4808         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
4809
4810 2006-06-21  Martin Baulig  <martin@ximian.com>
4811
4812         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
4813         also report CS1686 for parameters.
4814
4815 2006-06-21  Martin Baulig  <martin@ximian.com>
4816
4817         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
4818         instead of an error if the value is not implicitly convertible to
4819         the switch types; fixes #77964.
4820
4821 2006-06-21  Raja R Harinath  <rharinath@novell.com>
4822
4823         Fix #78673
4824         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
4825         FieldBuilder is null.
4826
4827         Fix #78662
4828         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
4829         'left' and 'right' before error-checking.
4830
4831 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
4832
4833         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
4834         Fixed bug #78601.
4835         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
4836         (FieldExpr.DoResolve): likewise.
4837         (PropertyExpr.InstanceResolve): likewise.
4838         (EventExpr.InstanceResolve): likewise. 
4839
4840 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
4841
4842         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
4843         attribute applicable tests for attribute argument.
4844
4845 2006-06-02  Raja R Harinath  <rharinath@novell.com>
4846
4847         Fix #78079
4848         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
4849         (Binary.OverloadResolve_PredefinedIntegral): New.
4850         (Binary.OverloadResolve_PredefinedFloating): New.
4851         (Binary.OverloadResolve_PredefinedString): New.
4852         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
4853         Follow the standard more closely, and treat numeric promotions in
4854         terms of overload resolution.
4855         (Binary.CheckShiftArguments): Simplify.
4856
4857 2006-06-01  Raja R Harinath  <rharinath@novell.com>
4858
4859         * flowanalysis.cs (MyBitVector): Simplify representation.
4860         (MyBitVector.Clone): Avoid allocating BitArray.
4861         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
4862         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
4863         (*): Update.  Change all references to MyBitVector.And and
4864         MyBitVector.Or to &= and |=.
4865
4866 2006-05-29  Raja R Harinath  <rharinath@novell.com>
4867
4868         Fix cs0231-[34].cs.
4869         * cs-parser.jay (formal_parameter_list): Extend the pattern below
4870         to param arguments too.
4871
4872 2006-05-26  Miguel de Icaza  <miguel@novell.com>
4873
4874         * cs-parser.jay: Catch another parsing form for arglist being
4875         followed by other arguments.  Fixes #78313.
4876
4877 2006-05-24  Raja R Harinath  <rharinath@novell.com>
4878
4879         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
4880         checking of out parameters to ...
4881         (FlowBranchingToplevel.Merge): ... here.
4882         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
4883         set, propagate the origin upward, and only complain if there was
4884         no other error.
4885         (FlowBranchingException.AddContinueOrigin): Likewise.
4886         (FlowBranchingException.AddReturnOrigin): Likewise.
4887         (FlowBranchingException.AddGotoOrigin): Likewise.       
4888
4889 2006-05-23  Raja R Harinath  <rharinath@novell.com>
4890
4891         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
4892         unreachable, skip it.
4893         (FlowBranchingException.Merge): Always propagate jumps, even if
4894         the finally block renders subsequent code unreachable.
4895
4896 2006-05-18  Raja R Harinath  <rharinath@novell.com>
4897
4898         Fix #77601
4899         * statement.cs (Goto.Resolve): Move responsibility for resolving
4900         'goto' to FlowBranching.AddGotoOrigin.
4901         (Goto.SetResolvedTarget): New.  Callback to set the
4902         LabeledStatement that's the target of the goto.
4903         (Goto.DoEmit): Use Leave instead of Br when crossing an
4904         unwind-protect boundary.
4905         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
4906         LookupLabel and adjust to new semantics.
4907         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
4908         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
4909         Goto.SetResolvedTarget to update target.
4910         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
4911         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
4912         AddBreakOrigin & co.  Delay propagation until ...
4913         (FlowBranchingException.Merge): ... this.
4914
4915         * statement.cs (Block.Resolve): Always depend on flow-branching to
4916         determine unreachability.  Kill workaround that originally emitted
4917         only one statement after an "unreachable" label (see infloop in
4918         test-515.cs).
4919
4920         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
4921         This is still "wrong", but anything better would probably need a
4922         multi-pass algorithm.
4923         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
4924         usage vector.  Force current usage vector to be reachable, to
4925         optimistically signify backward jumps.
4926         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
4927         detected.
4928         (FlowBranchingLabeled.Merge): New.  If no backward jump was
4929         detected, return the original salted-away usage vector instead,
4930         updated with appropriate changes.  Print unreachable warning if
4931         necessary.
4932         * statement.cs (Block.Resolve): Don't print unreachable warning on
4933         a labeled statement.
4934
4935 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
4936
4937         * driver.cs: Pass filename without path to AssemblyBuilder's 
4938         AddResourceFile. Fixes bug #78407.
4939
4940 2006-05-17  Raja R Harinath  <rharinath@novell.com>
4941
4942         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
4943         * flowanalysis.cs (FlowBranchingLabeled): ... here.
4944         (FlowBranching.MergeChild): Overwrite
4945         reachability information from Labeled branchings too.
4946
4947 2006-05-16  Raja R Harinath  <rharinath@novell.com>
4948
4949         * statement.cs (Goto.Resolve): Merge jump origins here ...
4950         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
4951
4952         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
4953         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
4954         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
4955         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
4956         here, ...
4957         * statement.cs (Goto.Resolve): ... not here.
4958         (Goto.Emit): Remove CS1632 check.
4959
4960 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
4961
4962         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
4963         error message.
4964
4965 2006-05-11  Raja R Harinath  <rharinath@novell.com>
4966
4967         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
4968         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
4969         (FlowBranchingException.Label): Likewise.
4970
4971         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
4972         given value.
4973         (MyBitVector.Or): Use it to avoid losing information (Count).
4974         (FlowBranching.MergeOrigins): Likewise.
4975
4976         * flowanalysis.cs (UsageVector.IsDirty): Remove.
4977         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
4978         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
4979         (UsageVector.ToString): Simplify.
4980         (UsageVector.MergeSiblings): Move here from ...
4981         (FlowBranching.Merge): ... here.
4982         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
4983         not a MyBitVector.
4984
4985 2006-05-10  Raja R Harinath  <rharinath@novell.com>
4986
4987         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
4988         null bitvector is treated as all-true.
4989
4990         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
4991         (MyBitVector): Rationalize invariants.  'vector != null' implies
4992         that we have our own copy of the bitvector.  Otherwise,
4993         'InheritsFrom == null' implies all inherited bits are true.
4994
4995 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
4996
4997         * statement.cs (LocalInfo): Add IsConstant.
4998         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
4999         local variable for constants.
5000
5001 2006-05-09  Raja R Harinath  <rharinath@novell.com>
5002
5003         * flowanalysis.cs (MyBitVector.Empty): New.
5004         (MyBitVector): Don't allow InheritedFrom to be null.
5005         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
5006         (UsageVector, FlowBranching): Update to changes.
5007
5008         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
5009         recursion.  The 'Parent == null' condition isn't sufficient for
5010         anonymous methods.
5011         (FlowBranching.AddBreakOrigin): Likewise.
5012         (FlowBranching.AddContinueOrigin): Likewise.
5013         (FlowBranching.AddReturnOrigin): Likewise.
5014         (FlowBranching.StealFinallyClauses): Likewise.
5015         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
5016         (FlowBranching.CheckOutParameters): Likewise.
5017         (FlowBranchingToplevel): Terminate all the above recursions here.
5018         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
5019         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
5020
5021         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
5022         toplevel block.
5023         (FlowBranchingToplevel): New.  Empty for now.
5024         (FlowBranching.MergeTopBlock): Update.
5025         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
5026         branching for the anonymous delegate.
5027         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
5028
5029         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
5030         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
5031         information at the start of the merge.  Reorganize.
5032
5033 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
5034
5035         * class.cs (MethodData.Define): Method cannot implement interface accessor.
5036
5037 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
5038
5039         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
5040         to newly introduced ctor.
5041
5042         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
5043         message to one place.
5044         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
5045         global namespace.
5046
5047 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
5048
5049         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
5050
5051         * ecore.cs (Expression.ResolveAsConstant): Updated.
5052
5053         * statement.cs (ResolveMeta): Updated.
5054
5055 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
5056
5057         * cs-parser.jay: __arglist cannot be used in initializer.
5058
5059 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
5060
5061         A fix for #77879
5062         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
5063         private types.
5064
5065 2006-05-05  Raja R Harinath  <rharinath@novell.com>
5066
5067         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
5068         (LabeledStatement): Add 'name' parameter.
5069         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
5070         (Block.AddLabel): Update to changes.
5071         * cs-parser.jay (labeled_statement): Likewise.
5072
5073         * flowanalysis.cs (BranchingType.Labeled): New.
5074         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
5075         (FlowBranchingLabeled): New.  Does nothing for now, but will
5076         eventually handle 'goto' flows.
5077         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
5078         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
5079         that's terminated ...
5080         (Block.Resolve): ... here.
5081
5082         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
5083         (UsageVector.MergeFinallyOrigins): Likewise.
5084         (FlowBranching.InTryOrCatch): Likewise.
5085         (FlowBranching.AddFinallyVector): Likewise.
5086         (FlowBranchingException): Update to changes.
5087
5088         Fix #78290
5089         * statement.cs (Return.Resolve): Move error checking to ...
5090         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
5091         (FlowBranchingException): Handle return origins like break and
5092         continue origins.
5093         (FlowBranching.UsageVector.CheckOutParameters): Remove.
5094
5095 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
5096
5097         A fix for #76122
5098         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
5099         filter.
5100
5101 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
5102
5103         A fix for #77543
5104         * class.cs (MethodData.Define): Do public accessor check only when method
5105         implements an interface.
5106
5107 2006-05-04  Raja R Harinath  <rharinath@novell.com>
5108
5109         Remove special handling of 'break'
5110         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
5111         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
5112         (UsageVector.Break): Remove.
5113         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
5114         reachability.
5115         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
5116
5117         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
5118         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
5119
5120 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
5121
5122         A fix for #75726
5123         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
5124         be the interface member.
5125
5126 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
5127
5128         A fix for #60069
5129         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
5130         for emitting small (int) values.
5131
5132 2006-05-03  Raja R Harinath  <rharinath@novell.com>
5133
5134         Fix #59427
5135         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
5136         control-flow passes through the 'finally' after merging-in all the
5137         control-flows from 'try' and the 'catch' clauses.
5138
5139         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
5140         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
5141         always true at the only non-recursive entry point.
5142         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
5143         FlowBranchingBreakable.
5144         (FlowBranchingLoop): Remove.
5145         * statement.cs (Return.DoResolve): Update to changes.
5146
5147         Fix #76471, #76665
5148         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
5149         (FlowBranching.CreateBranching): Handle it: create a
5150         FlowBranchingContinuable.
5151         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
5152         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
5153         except that it handles the 'continue' command.
5154         (FlowBranching.UsageVector.MergeOrigins): Rename from
5155         MergeBreakOrigins.
5156         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
5157         except that it overrides AddContinueOrigin.
5158         (FlowBranchingException): Override AddContinueOrigin, similar to
5159         AddBreakOrigin.
5160         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
5161         Create a new branching around the embedded statement.
5162         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
5163         control flow after the embedded statement.
5164         (Continue.Resolve): Move all error checking to AddContinueOrigin.
5165
5166         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
5167         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
5168         FlowBranchingBreakable.
5169         (FlowBranchingSwitch): Remove.
5170
5171         Fix test-503.cs
5172         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
5173         error reporting to ...
5174         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
5175         Rename from 'AddBreakVector'.  Add new location argument.  Return
5176         a bool indicating whether the 'break' crosses an unwind-protect.
5177         (FlowBranchingException.AddBreakOrigin): Add.
5178         (FlowBranchingException.Merge): Propagate 'break's to surrounding
5179         flowbranching after updating with the effects of the 'finally'
5180         clause.
5181         (FlowBranchingBreakable): New common base class for
5182         FlowBranchingLoop and FlowBranchingSwitch.
5183
5184         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
5185         embedded statement.
5186         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
5187
5188 2006-05-02  Raja R Harinath  <rharinath@novell.com>
5189
5190         * statement.cs (Do.Resolve): If the loop is infinite, set the
5191         barrier.
5192         (While.Resolve, For.Resolve): Set a barrier after the embedded
5193         statement.  There's no direct control flow that goes from the end
5194         of the embedded statement to the end of the loop.
5195         * flowanalysis.cs (FlowBranching.Infinite): Remove.
5196         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
5197         above ensure that the reachability is correctly computed.
5198
5199         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
5200         (UsageVector.MergeBreakOrigins): If the current path is
5201         unreachable, treat it as if all parameters/locals are initialized.
5202         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
5203         infinite loops before merging-in break origins.
5204
5205         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
5206         (Reachability.Reachable): Split part into ...
5207         (Reachability.Unreachable): ... this.  Simplify.
5208         (Reachability.IsUnreachable): Use 'Unreachable' instead.
5209
5210         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
5211         (Reachability.SetThrowsSometimes): Likewise.
5212         (FlowBranchingBlock.MergeTopBlock): Don't compare against
5213         TriState.Always, use corresponding property.
5214         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
5215         (Block.Resolve): Likewise.  Remove some redundant checks.
5216
5217 2006-05-02  Raja R Harinath  <harinath@gmail.com>
5218
5219         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
5220         (Reachability.Meet): Don't bother checking AlwaysThrows --
5221         barrier is always set.
5222         (FlowBranchingBlock.Merge): Likewise.
5223
5224 2006-05-01  Raja R Harinath  <harinath@gmail.com>
5225
5226         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
5227         checks for unreachable.
5228
5229 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
5230
5231         A fix for #77980
5232         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
5233
5234         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
5235         whether field is really assigned.
5236
5237 2006-04-30  Raja R Harinath  <harinath@gmail.com>
5238
5239         * flowanalysis.cs (Reachability): Make 4-argument constructor
5240         private.
5241         (Reachability.Meet): Rename from 'And'.  Remove static variant.
5242         (Reachability.Always): Rename from the highly misleading
5243         'Reachability.Never'.
5244         (FlowBranching.Merge): Update to changes.  Mark an impossible
5245         situation with a 'throw'.
5246         (*): Update to changes.
5247
5248 2006-04-29  Raja R Harinath  <harinath@gmail.com>
5249
5250         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
5251         Remove 'Undefined'.
5252         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
5253         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
5254         (*): Update to changes.
5255         * statement.cs: Update to changes.
5256
5257 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
5258
5259         A fix for #78049
5260         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
5261
5262 2006-04-28  Raja R Harinath  <harinath@gmail.com>
5263
5264         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
5265         dummy UsageVector.
5266
5267         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
5268         argument to two arguments: an usage-vector and a bool.  Move call
5269         to FlowBranching.Merge () ...
5270         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
5271
5272         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
5273         handling of loop and switch reachability to ...
5274         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
5275
5276 2006-04-27  Raja R Harinath  <harinath@gmail.com>
5277
5278         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
5279         handling to FlowBranchingLoop.InLoop.
5280         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
5281
5282 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
5283
5284         A fix for #78115
5285         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
5286         anonymous method is allowed from AnonymousContainer here.
5287
5288         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
5289
5290 2006-04-24  Raja R Harinath  <rharinath@novell.com>
5291
5292         Fix #78156
5293         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
5294
5295 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
5296
5297         A fix for #49011.
5298         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
5299         (DoubleConstant.Reduce): Ditto.
5300
5301 2006-04-23  Raja R Harinath  <rharinath@novell.com>
5302
5303         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
5304         Remove 'lvalue_right_side' argument.  Move parts to ...
5305         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
5306         (LocalVariable.DoResolveLValue): ... these.
5307
5308 2006-04-21  Raja R Harinath  <rharinath@novell.com>
5309
5310         Fix cs1655.cs
5311         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
5312         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
5313         (LocalVariableReference.DoResolveBase): Use it to implement new
5314         CS1655 check.
5315         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
5316         (Argument.Resolve): Simplify.  Move CS1510 check ...
5317         * ecore.cs (Expression.ResolveLValue): ... here.
5318         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
5319         (PropertyExpr.DoResolveLValue): Likewise.
5320         (FieldExpr.Report_AssignToReadonly): Likewise.
5321         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
5322         LValueMemberAccess or LValueMemberOutAccess on instance depending
5323         on it.
5324         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
5325         DoResolve as appropriate.
5326
5327 2006-04-20  Raja R Harinath  <rharinath@novell.com>
5328
5329         Fix #75800
5330         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
5331         implicit conversions on 'out' and 'ref' arguments.
5332
5333         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
5334         improve clarity.  Remove dead code.
5335
5336         Fix #66031
5337         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
5338         (Catch.Resolve): Resolve VarBlock if it exists.
5339
5340 2006-04-19  Miguel de Icaza  <miguel@novell.com>
5341
5342         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
5343         twice, this was some residual code, the enumerator was emitted
5344         properly in the two branche of if later.
5345
5346 2006-04-19  Raja R Harinath  <rharinath@novell.com>
5347
5348         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
5349         cast is never an lvalue.
5350         (Cast.DoResolve, Cast.ResolveRest): Combine.
5351         (Argument.Emit): Simplify slightly.  Move 'Expr is
5352         IMemoryLocation' check ...
5353         (Argument.Resolve): ... here.
5354         (Argument.Error_LValueRequired): Remove.  Inline into only user.
5355
5356         Simplifications.  Fix cs0191-2.cs
5357         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
5358         CS1649 and CS1651 to ...
5359         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
5360         the actual selection of the error code and message to a lookup
5361         table.  Add a dummy return value to simplify callsites.
5362         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
5363         readonly fields of other instances of the same type.  Move CS0197
5364         warning from ...
5365         * expression.cs (Argument.Resolve): ... here.  Simplify code.
5366         Ensure that ec.InRefOutArgumentResolving is only set during LValue
5367         resolution of an out or ref argument.  The code simplification
5368         above uses this invariant.
5369
5370 2006-04-18  Raja R Harinath  <rharinath@novell.com>
5371
5372         Possibly fix #77752.  Fix cs1690-[4-7].cs.
5373         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
5374         CheckMarshallByRefAccess.  Drop parameter.
5375         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
5376         warning.
5377         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
5378         InstanceExpression.
5379         * report.cs (AllWarnings): Add CS1690.
5380         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
5381         for ref access too.
5382         (LocalVariableReference.DoResolveBase): Update.
5383
5384 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5385
5386         * class.cs (MethodOrOperator): Moved common parts from method class.
5387         detect obsolete attributes.
5388         (Method.Define): Simplified as it reuses code from base.
5389         (Constructor.ValidAttributeTargets): Fixed issue found during
5390         refactoring.
5391         (Destructor.ValidAttributeTargets): Fixed issue found during
5392         refactoring.
5393         (Operator): Finished refactoring set off by #78020. Operator class is now
5394         ordinary method class.
5395
5396         * anonymous.cs: Updated.
5397
5398         * decl.cs (DeclSpace): Add IsGeneric
5399
5400 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5401
5402         * class.cs (Constructor.Emit): Don't emit the attributes twice.
5403
5404 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5405
5406         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
5407         detect obsolete attributes.
5408         (Method.CreateEmitContext): Moved to MethodOrOperator.
5409
5410 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5411
5412         A fix for #78048.
5413         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
5414         customized exception to make crash detection easier.
5415         (MethodOrOperator): Started to work on new base class for methods and
5416         operators.
5417         (Method): Derives from MethodOrOperator.
5418         (Constructor.Emit): Emits its own attributes.
5419         (AbstractPropertyEventMethod.Emit): Ditto.
5420         (Operator): Derives from MethodOrOperator, will refactor fully in extra
5421         patch.
5422         (Operator.Emit): It's temporary more tricky than should be.
5423         
5424         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
5425
5426         * report.cs (InternalErrorException): Add ctor with inner exception.
5427
5428 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
5429
5430         A fix for #76744.
5431         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
5432         only not visible.
5433
5434 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
5435
5436         A fix for #77916.
5437         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
5438         array.
5439
5440 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
5441
5442         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
5443         attribute is present and Guid not.
5444         (Interface.ApplyAttributeBuilder): Ditto.
5445
5446         * attribute.cs: Add error message.
5447
5448 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
5449
5450         A fix for #78020.
5451
5452         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
5453         sources (it's composite) so hold them in extra array as they are used in
5454         Emit phase only. It worked in the previous versions by mistake.
5455         (Attribute.Emit): Emit attribute for more owners when exist.
5456
5457         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
5458         it has now different behaviour.
5459
5460 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
5461
5462         * constant.cs (Constant.IsDefaultInitializer): New method.
5463
5464         * class.cs: Updated.
5465
5466         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
5467         re-initialize default values. It saves KBs almost for every assembly.
5468         Thanks Zoltan for the idea.
5469         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
5470         (ArrayCreation.DoResolve): Resolve only once.
5471         (ArrayCreation.Emit): Emit static initializer only when it is faster.
5472         (ArrayCreation.GetAttributableValue): Cope with optimized values.
5473
5474 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
5475
5476         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
5477         From #77961.
5478
5479 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
5480
5481         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
5482         in an embedded statement too.
5483
5484 2006-04-01  Raja R Harinath  <rharinath@novell.com>
5485
5486         Fix #77958
5487         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
5488
5489 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
5490
5491         A fix for #77966.
5492
5493         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
5494         was not specified.
5495
5496         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
5497
5498 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
5499
5500         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
5501         phase.
5502
5503         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
5504         LocalTemporary change.
5505
5506         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
5507         TypeContainer.
5508         (ClassOrStruct.DefineFieldInitializers): Implemented static field
5509         initializers optimization.
5510         (ClassOrStruct.TypeAttr): Moved from modifiers.
5511         (Constructor.CheckBase): Don't crash when static ctor has parameters.
5512         (FieldBase.ResolveInitializer): Resolves initializer.
5513         (FieldBase.HasDefaultInitializer): New property.
5514
5515         * cs-parser.jay: Removed message.
5516
5517         * expression.cs (CompilerGeneratedThis): New specialization.
5518
5519         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
5520
5521 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
5522
5523         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
5524
5525 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
5526
5527         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
5528         be now EnumConstants only.
5529
5530 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
5531
5532         * attribute.cs, driver.cs: Reset more caches.
5533
5534 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5535
5536         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
5537
5538 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5539
5540         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
5541         for easier reuse. Updated all overrides.
5542         (IntegralConstant): New base class for all integral constants.
5543         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
5544         of the constant range, report custom error.
5545         (UIntConstant.Reduce): Fixed uint conversion.
5546
5547         * ecore.cs, literal.cs: Reduce updates.
5548
5549 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5550
5551         A fix for #75813.
5552
5553         * class.cs (Constructor.Define): Removed extra if for default ctors.
5554         A patch from Atsushi Enomoto.
5555
5556 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5557
5558         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
5559         GetAttributableValue.
5560
5561         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
5562         when required.
5563
5564         * convert.cs (ImplicitConversionRequired): Error message moved to
5565         DoubleLiteral.
5566
5567         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
5568         automatic implicit conversion of an output value.
5569         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
5570
5571         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
5572         conversion.
5573         (TypeOf.GetAttributableValue): Add extra handling for object type.
5574
5575         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
5576         special error message.
5577
5578 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
5579
5580         * class.cs (Constructor.Emit): Don't crash when struct ctor is
5581         InternalCall.
5582         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
5583         compatible with MS runtime.
5584
5585 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
5586
5587         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
5588         attribute arguments here.
5589
5590         * class.cs (Indexer.Define): The check was moved to attribute class.
5591
5592 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
5593
5594         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
5595         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
5596         easier.
5597
5598 2006-03-22  Raja R Harinath  <rharinath@novell.com>
5599
5600         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
5601         mcs to keep code differences small.
5602         * attribute.cs (Attribute.GetParameterDefaultValue): New.
5603         * typemanager.cs (parameter_default_value_attribute_type): New.
5604         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
5605         CS1908 check.
5606
5607 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
5608
5609         * expression.cs (StringConcat.Append): Reverted back to no warning state.
5610
5611 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
5612
5613         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
5614
5615         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
5616         the blocks too.
5617
5618 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
5619
5620         * doc-bootstrap.cs : fix build.
5621
5622 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
5623
5624         * expression.cs (StringConcat.Append): Issue a warning when empty string
5625         is going to append.
5626
5627 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
5628
5629         * assign.cs (CompoundAssign.ResolveSource): Removed.
5630
5631         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
5632         clean up.
5633
5634         * class.cs (TypeContainer.FindMethods): Removed.
5635         (TypeContainer.CheckMemberUsage): Made static.
5636
5637         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
5638
5639         * constant.cs (CheckRange): Removed unused type argument.
5640         (CheckUnsigned): Removed unused type argument.
5641
5642         * cs-parser.jay: Updated after MemberAccess clean up.
5643         Uses Length for empty string test.
5644
5645         * cs-tokenizer.cs: Uses Length for empty string test.
5646         (IsCastToken): Made static.
5647         (is_hex): Made static.
5648         (real_type_suffix): Made static.
5649
5650         * decl.cs (SetupCache): Made static.
5651         (OnGenerateDocComment): Removed unused ds argument.
5652
5653         * delegate.cs (VerifyDelegate): Removed unused argument.
5654
5655         * doc.cs: Uses Length for empty string test.
5656
5657         * driver.cs: Uses Length for empty string test.
5658
5659         * enum.cs (IsValidEnumType): Made static
5660
5661         * expression.cs (EnumLiftUp): Removed unused argument.
5662         (ResolveMethodGroup): Ditto.
5663         (BetterConversion): Ditto.
5664         (GetVarargsTypes): Ditto.
5665         (UpdateIndices): Ditto.
5666         (ValidateInitializers): Ditto.
5667         (MemberAccess.ctor): Ditto.
5668         (GetIndexersForType): Ditto.
5669
5670         * flowanalysis.cs: (MergeFinally): Removed unused argument.
5671
5672         * iterators.cs: Updated after MemberAccess clean up.
5673
5674         * location.cs: Uses Length for empty string test.
5675
5676         * namespace.cs: Uses Length for empty string test.
5677
5678          * report.cs (CheckWarningCode): Made static.
5679
5680         * statement.cs (LabeledStatement): Removed unused argument.
5681
5682         * typemanager.cs (FilterNone): Removed.
5683
5684 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5685
5686         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
5687         obsolete.
5688
5689         * class.cs: Updated.
5690
5691 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5692
5693         * cs-parser.jay.cs: __arglist is not allowed for delegates.
5694
5695 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5696
5697         A fix for #77822.
5698
5699         * expression.cs (VerifyArgumentsCompat): Reverted to double error
5700         reporting, it's more tricky than I thought.
5701
5702 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5703
5704         A fix for #77816.
5705
5706         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
5707         host container.
5708         (AnonymousMethod.ImplicitStandardConversionExists): New method.
5709         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
5710         Add more error reporting; Fixed issue with params.
5711
5712         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
5713
5714         * cs-parser.jay: AnonymousMethod requires host container.
5715
5716         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
5717
5718 2006-03-18  Raja R Harinath  <harinath@gmail.com>
5719
5720         * class.cs: Change 'TypeContainer ds' constructor argument to
5721         'DeclSpace parent'.  Some classes were missed below due to
5722         different naming convention.
5723
5724         * class.cs (MemberCore.Parent): Delete.  This makes the
5725         ParentContainer changes below enforceable by the compiler.
5726
5727         Treat pointers to enclosing declaration space as 'DeclSpace', not
5728         'TypeContainer'.
5729         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
5730         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
5731
5732         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
5733         of TypeContainer.
5734         (Block.AddThisVariable): Likewise.
5735         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
5736         (AbstractPropertyEventMethod.Emit): Likewise.
5737         (AbstractPropertyEventMethod.EmitMethod): Likewise.
5738         (GetMethod.Define, SetMethod.Define): Likewise.
5739         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
5740         (DelegateMethod.EmitMethod): Likewise.
5741
5742         Fix regression test-partial-13.cs.
5743         Rationalize use of PartialContainer.  Ensure that the partial
5744         class semantics can be tied to type-correctness, i.e., any
5745         violation will cause a compile error.
5746         * class.cs, const.cs: Access all fields that belong to class
5747         TypeContainer via ParentContainer.  Arguments of EmitContexts and
5748         Resolve()-like functions still use 'Parent'.
5749
5750         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
5751         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
5752         (PropertyMethod.CheckModifiers): Remove unused argument.
5753         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
5754         DeclSpace.
5755
5756 2006-03-17  Raja R Harinath  <harinath@gmail.com>
5757
5758         Make semantics of PartialContainer simpler.
5759         * decl.cs (DeclSpace.IsPartial): Remove.
5760         * class.cs (TypeContainer.IsPartial): Likewise.
5761         (TypeContainer..ctor): Set PartialContainer to point to self.
5762         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
5763         (TypeContainer.FindNestedType): Likewise.
5764         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
5765
5766 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
5767
5768         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
5769
5770 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
5771
5772         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
5773         classes.
5774
5775 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
5776
5777         * class.cs (Operator.Define): An error for base conversion was not
5778         reported correctly.
5779
5780 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
5781
5782         * iterator.cs : yield break is allowed in try statement which has
5783           catch clauses. Fixed bug #77767.
5784
5785 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
5786
5787         A fix for #77593, #77574.
5788
5789         * class.cs (MethodCore.CheckBase): Another if for operator.
5790
5791 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
5792
5793         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
5794         were not resolved
5795
5796         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
5797         (DelegateCreation.ImplicitStandardConversionExists): New method for just
5798         conversion test.
5799         
5800         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
5801         not needed.
5802
5803         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
5804         Updated after another emitcontext usage was clean up. It should help us to
5805         synchronize with gmcs easier.
5806
5807 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
5808
5809         A fix for #77353.
5810
5811         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
5812         (Event.Define): ditto
5813         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
5814
5815         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
5816         Removed redundant code and set NewSlot for Invoke method too.
5817
5818         * parameter.cs (Parameters.ctor): Add custom, type ctor.
5819         (Parameters.MergeGenerated): New method. Use this method when you merge
5820         compiler generated argument with user arguments.
5821
5822 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
5823
5824         * attribute.cs (ResolveAsTypeTerminal): Removed.
5825
5826         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
5827         specialization for predefined types; 30% speed up.
5828         Finally placed obsolete check to right place.
5829         (Expression.ResolveType): Removed.
5830
5831         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
5832         Updated after ResolveType was removed.
5833
5834         * expression.cs (Cast.ctor): Check void cast.
5835         (Binary.ResolveAsTypeTerminal): Is never type.
5836         (Conditional.ResolveAsTypeTerminal): Is never type.
5837
5838         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
5839
5840 2006-03-01  Raja R Harinath  <rharinath@novell.com>
5841
5842         Fix #77679.
5843         * expression.cs (ParameterReference.DoResolveBase): Change return
5844         type to bool.
5845         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
5846         Update.
5847
5848         Fix #77628.
5849         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
5850
5851         Fix #77642.
5852         * typemanager.cs (GetFullNameSignature): Don't nullref on
5853         protected accessors.
5854
5855 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
5856
5857         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
5858         these two separated members to simplify the code.
5859         (Attribute.Resolve): Refactored to use new fields and methods.
5860         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
5861         implemented obsolete attribute checking.
5862         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
5863         implemented obsolete checking again. It look line never ending quest ;-)
5864         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
5865
5866         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
5867
5868         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
5869
5870         *class.cs (Property.Define): Add RegisterProperty call.
5871
5872         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
5873         argument groups (only 2).
5874
5875         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
5876         encoding expression to arguments.
5877         (Expression.ExprClassToResolveFlags): Just turned to property.
5878
5879         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
5880         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
5881         optimized as well as implemented support for zero-length attributes.
5882
5883         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
5884         Add caching of PropertyInfo's.
5885
5886 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
5887
5888         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
5889         error multiple times.
5890
5891 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
5892
5893         New partial class implementation.
5894         A fix for #77027, #77029, #77403
5895
5896         * attribute.cs (Attributable): Made attributes protected.
5897
5898         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
5899         the replacements of ClassPart and PartialContainer.
5900         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
5901         (TypeContainer.AddInterface): Ditto.
5902         (TypeContainer.AddPartial): The main method for partial classes. It checks
5903         for errors and merges ModFlags and attributes. At the end class is added to
5904         partial_parts list.
5905         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
5906         required here.
5907         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
5908         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
5909         from the rest of partial classes.
5910         (TypeContainer.GetClassBases): Simplified.
5911         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
5912         DefineType.
5913         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
5914         (TypeContainer.HasExplicitLayout): Uses Flags now.
5915         (PartialContainer): Removed.
5916         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
5917         (StaticClass): Was merged with Class.
5918         (Class.GetClassBases): class and static class bases are verified here.
5919         (Class.TypeAttr): Added static attributes when class is static.
5920         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
5921         (MemberBase): In some cases we need to call parent container for partial
5922         class. It should be eliminated but it's not easy now.
5923
5924         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
5925
5926         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
5927         partial classed to accumulate class comments.
5928         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
5929
5930         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
5931
5932         * driver.cs (MainDriver): Tree.GetDecl was removed.
5933
5934         * modifiers.cs (Modifiers): Add partial modifier.
5935
5936         * tree.cs (Tree.decl): Removed.
5937         (RootTypes): Started to use this class more often for root types
5938         specializations.
5939
5940 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
5941
5942         A fix for #77615
5943
5944         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
5945         external interface does not have an attribute.
5946
5947 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
5948
5949         Another prerequisites for new partial classs implementation.
5950         
5951         * attribute.cs (Attribute.Equal): Implemented.
5952         (Attribute.Emit): Changed as attributes can be applied more than twice.
5953         (Attributes.Emit): Check for duplicate attributes here.
5954
5955         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
5956         as a parameter, clean-up.
5957
5958 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
5959
5960         A fix for #77485
5961
5962         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
5963         contains obsolete attribute check which can in some cases look for base
5964         type of current class which is not initialized yet.
5965         (TypeContainer.BaseType): Replacement of ptype.
5966
5967         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
5968
5969 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
5970
5971         First of prerequisites for new partial classs implemention.
5972         
5973         * attribute.cs (Attributable): Extended by ResolveContext;
5974         Attributes finally have correct context for resolving in all cases.
5975         (AttachTo): Attribute owner is assigned here.
5976
5977         * codegen.cs (IResolveContext): Introduce new interface to hold
5978         all information needed in resolving phase.
5979         (EmitContext): Implements IResolveContext; more clean-up needed here.
5980         
5981         * decl.cs (MemberCore): Implemented IResolveContext.
5982
5983         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
5984         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
5985         parameter.cs, statement.cs, tree.cs, typemanager.cs:
5986         Refactored to use new IResolveContext instead of EmitContext; cleanup
5987
5988 2006-02-06  Miguel de Icaza  <miguel@novell.com>
5989
5990         * codegen.cs (EmitScopeInitFromBlock): check here the
5991         capture_context, there is no need to make two calls to the
5992         EmitContext. 
5993
5994         * anonymous.cs: Add some debugging messages that might help me
5995         track other instances of this problem in the future (the
5996         regression of test 467).
5997
5998         * cs-parser.jay: track the variable block, as we need to initalize
5999         any captured variables declared in this block for the "catch"
6000         portion of the "Try" statement.
6001
6002         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
6003         scope initialization for captured variables. 
6004
6005         Also, move the emit for the variables after the block location has
6006         been marked.
6007
6008 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
6009
6010         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
6011
6012 2006-02-02  Miguel de Icaza  <miguel@novell.com>
6013
6014         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
6015         commit yesterday, the initialization for the roots is necessary.
6016         What is not necessary is the scope activation.
6017
6018 2006-02-02  Raja R Harinath  <rharinath@novell.com>
6019
6020         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
6021         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
6022         CS0206 checks.
6023         (Argument.Resolve): Remove CS0206 checks.
6024
6025 2006-02-01  Miguel de Icaza  <miguel@novell.com>
6026
6027         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
6028         scopes for all the roots, the scopes will now be emitted when the
6029         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
6030
6031         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
6032         code.  This reduces a lot of existing cruft.
6033         
6034         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
6035         that the ScopeInfo is generated as we enter the scope, not at the
6036         time of use, which is what we used to do before.
6037
6038         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
6039         every time a Block is about to be emitted if we have a
6040         CaptureContext. 
6041
6042 2006-02-01  Raja R Harinath  <rharinath@novell.com>
6043
6044         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
6045         (Reset): Update.
6046         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
6047
6048         * typemanager.cs (cons_param_array_attribute): Make private.
6049         (Reset): Set it to null.
6050         (InitCoreHelpers): Don't initialize it.
6051         (ConsParamArrayAttribute): New.  Initialize it as needed.
6052         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
6053
6054 2006-01-31  Miguel de Icaza  <miguel@novell.com>
6055
6056         * expression.cs: There might be errors reported during the
6057         selection of applicable methods.  If there are errors, do not
6058         continue execution as it will lead the compiler to crash.
6059
6060 2006-01-30  Miguel de Icaza  <miguel@novell.com>
6061
6062         * expression.cs: Member access is not allowed on anonymous
6063         methods.  Fixes #77402.
6064
6065 2006-01-30  Raja R Harinath  <rharinath@novell.com>
6066
6067         Fix #77401
6068         * cs-parser.jay (VariableDeclaration): Don't set
6069         current_array_type to null.
6070         (field_declaration, event_declaration, declaration_statement):
6071         Set it to null here.
6072
6073 2006-01-28  Raja R Harinath  <harinath@gmail.com>
6074
6075         * typemanager.cs (GenericParameterPosition): New.
6076         * doc.cs: Use it.
6077
6078 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
6079
6080         * doc.cs : To process "include" elements, first we should create
6081           another list than XmlNodeList, because it could result in node
6082           removal, which could result in that the XmlNodeList gives up
6083           yielding next node.
6084
6085           (Also made code identical to gmcs again.)
6086
6087 2006-01-25  Miguel de Icaza  <miguel@novell.com>
6088
6089         * ecore.cs: Introduce an error report that we were not catching
6090         before, if not silent, we must report the error.  Gonzalo ran into
6091         it.
6092
6093 2006-01-23  Miguel de Icaza  <miguel@novell.com>
6094
6095         A fix for bug: #76957
6096         
6097         * iterators.cs (MoveNextMethod.CreateMethodHost): call
6098         ComputeMethodHost before creating the method, this is a new
6099         requirement. 
6100
6101         * anonymous.cs (AnonymousContainer): Now we track all the scopes
6102         that this method references (RegisterScope).  The actual scope
6103         where the method is hosted is computed with the ComputeMethodHost
6104         before we create the method.
6105
6106         Moved the Deepest routine here.
6107
6108         (AnonymousContainer.ComputeMethodHost): New routine used to
6109         compute the proper ScopeInfo that will host the anonymous method.
6110
6111         (ScopeInfo): Deal with multiple roots.  The problem was that we
6112         did not have a unique root where all ScopeInfos could be hanged
6113         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
6114         of roots.  
6115
6116         Remove AdjustMethodScope which is now computed at the end.  Remove
6117         LinkScope which did a partial link, instead link all ScopeInfos
6118         before code generation from the new "LinkScopes" routine. 
6119
6120         Simplify all the Add* routines as they no longer need to maintain
6121         the tree, they just need to record that they are using variables
6122         from a ScopeInfo.
6123
6124         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
6125         routines to produce the forest of ScopeInfo trees.
6126
6127         * class.cs (TypeContainer.AppendMethod): This is just like
6128         AddMethod, but ensures that an interface implementation method
6129         (IEnumerable.XXX) is not inserted at the beginning of the queue of
6130         methods, but at the end.
6131
6132         We use this functionality to ensure that the generated MoveNext
6133         method in the iterator class is resolved/emitted before the
6134         enumerator methods created.   
6135
6136         This is required because the MoveNext method computes the right
6137         ScopeInfo for the method.  And the other methods will eventually
6138         need to resolve and fetch information computed from the anonymous
6139         method. 
6140
6141 2006-01-21  Raja R Harinath  <harinath@gmail.com>
6142             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
6143
6144         Fix rest of #76995.
6145         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
6146         the 'aliases' hash.
6147         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
6148         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
6149
6150 2006-01-18  Raja R Harinath  <rharinath@novell.com>
6151
6152         Fix #76656, cs0231-2.cs.
6153         * cs-parser.jay (formal_parameter_list): Make error case catch
6154         more issues.
6155         (parenthesized_expression_0): Add CS1026 check.
6156         (invocation_expression): Remove unused { $$ = lexer.Location }.
6157
6158 2006-01-17  Raja R Harinath  <rharinath@novell.com>
6159
6160         Fix #76824.
6161         * cs-parser.jay (statement_expression): Don't list out the
6162         individual statement-expressions.  Convert syntax error into
6163         CS0201 check.
6164
6165 2006-01-16  Raja R Harinath  <rharinath@novell.com>
6166
6167         Fix #76874.
6168         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
6169         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
6170         CheckIntermediateModification.
6171         (FieldExpr.DoResolve): Add new two-argument version that
6172         allows us to resolve the InstanceExpression as an lvalue.
6173         The one-argument variant is now just a wrapper.
6174         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
6175         Resolve the lhs as an lvalue if the it has a value type.
6176         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
6177         from Assign.DoResolve.
6178         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
6179         resolved as an lvalue.
6180         (PropertyExpr.DoResolve): Update.
6181         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
6182         has a value type.  Move CS1612 check here from
6183         CheckIntermediateModification.
6184         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
6185         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
6186         'right_side' of a ResolveLValue on an 'out' argument.
6187         (EmptyExpression.LValueMemberAccess): New.  Used as the
6188         'right_side' of a propagated ResolveLValue on a value type.
6189         (LocalVariableReference.DoResolveBase): Recognize
6190         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
6191         Add CS1654 check.
6192         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
6193         EmptyExpression.Null.
6194
6195 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
6196
6197         * typemanager.cs : added IsGenericParameter(). In mcs it always
6198           return false.
6199         * doc.cs : for generic parameters, use GenericParameterPosition,
6200           not FullName.
6201
6202 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
6203
6204         * expression.cs: Fix Console.WriteLine ((this = x).foo);
6205
6206 2006-01-12  Miguel de Icaza  <miguel@novell.com>
6207
6208         This fixes the problem where we used ldfld instead of ldflda to
6209         load the "THIS" pointer on captured parameters, when THIS is a
6210         value type.  See bug #77205.
6211         
6212         * iterators.cs (CapturedThisReference.Emit): Pass false to
6213         EmitThis (we do not need the address).
6214
6215         * codegen.cs (EmitThis): it needs to know whether we need the
6216         address of `this' or not.  This is used by value types.  
6217
6218         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
6219         every other call passes false.
6220
6221 2006-01-12  Raja R Harinath  <rharinath@novell.com>
6222
6223         Fix #77221.
6224         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
6225         GetOverride.
6226         * expression.cs (Invocation.OverloadResolve): Update.
6227         (Invocation.DoResolve): Avoid double resolution of invocation.
6228
6229 2006-01-11  Raja R Harinath  <rharinath@novell.com>
6230
6231         Fix #77180.
6232         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
6233         unary negation of floating point types as 0-expr; negation cannot
6234         overflow in floating point types.
6235
6236         Fix #77204.
6237         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
6238         on operands of 'void' type.
6239
6240         Fix #77200.
6241         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
6242         and ExclusiveOr for boolean constants too.
6243
6244 2006-01-09  Raja R Harinath  <rharinath@novell.com>
6245
6246         Fix #75636.
6247         * expression.cs (Invocation.OverloadResolve): Replace reflected
6248         override methods with their base virtual methods, rather than
6249         skipping over them.
6250         * typemanager.cs (TypeManager.GetOverride): New.
6251
6252 2006-01-05  Jb Evain  <jbevain@gmail.com>
6253
6254         * class.cs (Property.Define, Indexer.Define): do not tag the
6255         properties as SpecialName | RTSpecialName.
6256
6257 2006-01-04  Miguel de Icaza  <miguel@novell.com>
6258
6259         * class.cs (MethodCore.IsDuplicateImplementation): This method was
6260         doing a low-level comparission of parameter types.  It was lacking
6261         a check for __argslist. 
6262
6263 2005-12-30  Miguel de Icaza  <miguel@novell.com>
6264
6265         * expression.cs (ParameterReference.DoResolveBase): Allow
6266         reference parameters if they are local to this block. 
6267
6268         This allows the ref and out parameters of a delegate to be used in
6269         an anonymous method, for example:
6270
6271         delegate void set (out int x);
6272
6273         set s = delegate (out int x){
6274                 x = 0;
6275         };
6276
6277         This is used by functionality introduced late in the C# language.
6278         
6279         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
6280         method that take ref and out parameters. 
6281
6282         Fixes #77119 which was a late change in the spec.
6283
6284 2005-12-23  Miguel de Icaza  <miguel@novell.com>
6285
6286         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
6287         parent if its the same scope.  Fixes #77060.
6288
6289 2005-12-21  Miguel de Icaza  <miguel@novell.com>
6290
6291         * driver.cs: Report the case of no source files and no -out:
6292         argument provided.
6293
6294 2005-12-20  Raja R Harinath  <rharinath@novell.com>
6295
6296         Fix #77035.
6297         * expression.cs (ComposedCast.GetSignatureForError): Define.
6298
6299 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6300
6301         Fix #76995
6302
6303         * namespace.cs (NamespaceEntry): Add extern_aliases as a
6304         ListDictionary, to contain the ExternAliasEntry entries (in
6305         addition to the NamespaceEntry.aliases hashtable). This field is
6306         shared between the original entry and its doppelganger (bodyless 
6307         copy of it).
6308         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
6309         extern_aliases field.
6310         (NamespaceEntry.Lookup): Move the IsImplicit check after the
6311         lookup in extern_aliases.
6312
6313 2005-12-16  Raja R Harinath  <rharinath@novell.com>
6314
6315         Fix #77006.
6316         * class.cs (TypeContainer.Mark_HasEquals): New.
6317         (TypeContainer.Mark_HasGetHashCode): New.
6318         (ClassPart): Override them.
6319         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
6320
6321         Fix #77008.
6322         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
6323         'parent' argument to the base constructor.
6324
6325         Remove all mention of TypeContainer from decl.cs.
6326         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
6327         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
6328         (DeclSpace.DeclSpace): Likewise.
6329         (DeclSpace.DefineMembers): Remove unused argument.
6330         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
6331         debugging check -- we don't care if the debug code throws an
6332         InvalidCastException instead of an InternalErrorException.
6333         * class.cs (TypeContainer.DefineMembers): Update to changes.
6334         (TypeContainer.DoDefineMembers): Likewise.
6335         (TypeContainer.GetMethods): Likewise.
6336         (PropertyMember.Define): Likewise.
6337         (MemberBase.Parent): New property that forwards to
6338         MemberCore.Parent, but ensures that we get a TypeContainer.
6339         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
6340         (RootContext.PopulateTypes): Likewise.  Remove special case code
6341         for !RootContext.StdLib: DefineMembers is idempotent.
6342
6343 2005-12-14  Miguel de Icaza  <miguel@novell.com>
6344
6345         * convert.cs (ExplicitConversionCore): Check the return value from
6346         ExplicitConversionCore which can return null on failure.  Fixes #76914
6347
6348 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
6349
6350         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
6351
6352 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
6353
6354         * doc.cs : The search for referenced namespace was insufficient to
6355           get global one as it used to do. Fixed bug #76965.
6356
6357 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
6358
6359         * doc.cs : check name in cref in the last phase that whether it is
6360           namespace or not.
6361
6362 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
6363
6364         * cs-tokenizer.cs : reverted the latest change: it somehow broke
6365           Mono.C5.
6366
6367 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
6368
6369         * doc.cs : so it turned out that we cannot skip override check for 
6370           interface members. Fixed bug #76954.
6371
6372 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
6373
6374         * cs-tokenizer.cs : fixed bug #75984:
6375           - #warning and #error should not be handled when the source line
6376             is disabled.
6377           - #line is not checked strictly when the source line is disabled.
6378           - #define and #undef is on the other hand checked strictly at any
6379             state.
6380
6381 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
6382
6383         * cs-tokenizer.cs : missing Location (actually, filename) in one of
6384           CS1027 report.
6385
6386 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
6387
6388         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
6389
6390         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
6391         event initializers.
6392         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
6393         (FieldBase.Initializer): Initializer is now optional.
6394         (EventField.Define): Only event field can have initializer.
6395
6396         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
6397
6398         * const.cs (Const): Reuse initializer.
6399
6400         * cs-parser.jay: Updated after FieldBase changes.
6401         Added current_array_type to simplify array initializers.
6402
6403         * ecore.cs (NullCast.IsDefaultValue): Implemented.
6404
6405         * expression.cs, iterators.cs: Updated.
6406
6407         * namespace.cs (NamespaceEntry): Made UsingFound private.
6408
6409 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
6410
6411         * parameterCollection.cs: Obsolete, removed.
6412         * parser.cs: Obsolete, removed.
6413
6414 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
6415
6416         Fix #76849.
6417         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
6418
6419         * enum.cs (Enum.Define): Set obsolete context here.
6420
6421 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
6422
6423         * doc.cs :
6424           - FindDocumentedMember() now expects 1) paramList as null
6425             when "we don't have to check the number of parameters" and
6426             2) Type.EmptyTypes when "there is no arguments".
6427           - Introduced FoundMember struct to hold the exact type which was
6428             used to find the documented member (the above change broke
6429             test-xml-044; it might be better just to use DeclaringType than
6430             what MS does, like this change does, but it depends on usage.)
6431
6432 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
6433
6434         * doc.cs : documented member might be from DeclaringType for nested
6435           types. Fixed bug #76782.
6436
6437 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
6438
6439         * anonymous.cs: Have the param code handle leaving copies on the
6440         stack etc. Allows anonymous params to take part in the assignment
6441         code (++, +=, etc). Fixes bug #76550
6442
6443         * expression.cs: Handle the prepare_for_load/leave_copy by passing
6444         it down to the anon code.
6445
6446         * iterators.cs: Use dummy var here
6447
6448         * codegen.cs: Handle new vars
6449
6450 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
6451
6452         Fix #76849.
6453         * class.cs (MethodData.Define): Set proper Obsolete context.
6454
6455         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
6456         obsolete context.
6457         (FieldExpr.DoResolve): Ditto.
6458
6459 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
6460
6461         Fix #76849.
6462         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
6463         parent is not obsolete.
6464
6465 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
6466
6467         * doc.cs : (FindDocumentedMember) find parameterless members first
6468           and get CS0419 in the early stage. Fixed first case of bug #76727.
6469
6470 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
6471
6472         Fix #76859.
6473         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
6474         no error was reported.
6475
6476         *expression.cs (Binary.DoResolve): left can be null.
6477
6478 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
6479
6480         Fix #76783.
6481         * class.cs (MethodData.Emit): Parameters should be labeled first.
6482
6483 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
6484
6485         Fix #76761.
6486         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
6487
6488 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
6489
6490         * attribute.cs (AreParametersCompliant): Moved to Parameter.
6491
6492         * class.cs (MethodCore): Parameter clean up.
6493         (IMethodData): Added ParameterInfo.
6494         (MethodData): Parameter clean up.
6495         (Indexer.Define): Parameter clean up.
6496
6497         * anonymous.cs,
6498         * codegen.cs,
6499         * cs-parser.jay,
6500         * decl.cs,
6501         * doc.cs,
6502         * ecore.cs,
6503         * flowanalysis.cs,
6504         * iterators.cs,
6505         * pending.cs,
6506         * statement.cs,
6507         * typemanager.cs: Parameter clean up.
6508
6509         * delegate.cs (Define): Get rid of duplicated code.
6510
6511         * expression.cs (ParameterReference): Removed useless parameters
6512         and simplified.
6513         (Invocation): Ditto.
6514
6515         * parameter.cs (ParamsParameter): New class, params specialization.
6516         (ArglistParameter): Attemp to separate arglist.
6517         (Parameter): Refactored to be reusable and faster.
6518         (Parameter.Modifier): Made understandable.
6519         (Parameters): Changed to be used as a class for `this' assembly
6520         parameters. Refactored to use new specialized classes.
6521
6522         * support.cs (ParameterData): Added Types property.
6523         (InternalParameters): Deleted.
6524
6525 2005-08-20  Martin Baulig  <martin@ximian.com>
6526
6527         Merging this patch from GMCS to fix #75867.
6528
6529         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
6530         scope if we don't already have it.
6531
6532 2005-11-17  Martin Baulig  <martin@ximian.com>
6533
6534         * anonymous.cs
6535         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
6536         inherit the scope from our parent.  Fixes #76653.
6537
6538 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
6539
6540         * doc.cs : the previous patch does not actually fix the bug.
6541           PropertyInfo override check is now implemented and really fixed it.
6542         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
6543
6544 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
6545
6546         * doc.cs : apply "override filter" also to properties.
6547           Fixed bug #76730.
6548
6549 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
6550
6551         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
6552           no need to check overrides. For classes, omit those results from 
6553           interfaces since they must exist in the class. Fixed bug #76726.
6554
6555 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
6556
6557         * typemanager.cs : (GetFullNameSignature) differentiate indexers
6558           with different parameters. Fixed the second problem in #76685.
6559
6560 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
6561
6562         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
6563           get expected 'protected' access in CheckValidFamilyAccess()).
6564           Fixed bug #76692.
6565
6566 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
6567
6568         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
6569           Fixed bug #76705.  CS1569 was incorrectly commented out.
6570
6571 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
6572
6573         * doc.cs : use Invocation.IsOverride() to do real override check.
6574         * expression.cs : made Invocation.IsOverride() internal.
6575
6576 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
6577
6578         * doc.cs : use TypeManager.FindMembers() instead of (possible)
6579           TypeBuilder.FindMembers() and filter overriden base members out.
6580           Fixed bug #76990.
6581
6582 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6583
6584         * doc.cs : ref/out parameters are represented as '@' (instead of
6585           '&' in type FullName). Fixed bug #76630 (additionally crefs).
6586
6587 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6588
6589         * doc.cs : when there was no '.' in cref to methods in doc comment,
6590           then parameters were missing in the output. Fixed bug #76691.
6591
6592 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6593
6594         * driver.cs : don't output docs when there is an error.
6595           Fixed bug #76693.
6596
6597 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6598
6599         * doc.cs :
6600           Now it should detect indexers. Fixed primary concern in bug #76685.
6601           Fixed CS0419 message to not show the identical member signature in
6602           the message.
6603
6604 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6605
6606         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
6607           instead of Type.FindMembers() since it does not handle events.
6608           Fixed bug #71604.
6609
6610 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
6611
6612         * codegen.cs: Fixed typo (speficied -> specified).
6613
6614 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
6615
6616         Fix #76369.
6617         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
6618
6619 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
6620
6621         * attribute.cs: Changed error message.
6622
6623         * cs-tokenizer.cs: One more check.
6624
6625 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
6626
6627         * statement.cs (Block.Resolve): Ignore empty statement.
6628
6629 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
6630
6631         * report.cs: Made error/warning methods more strict to avoid
6632         their misuse.
6633
6634         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
6635         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
6636         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
6637         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
6638
6639 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
6640
6641         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
6642         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
6643
6644         * class.cs (TypeContainer.IsComImport): New property.
6645         (Constructor.Define): Create proper ctor for ComImport types.
6646
6647         * expression.cs (New.CheckComImport): Fixed.
6648
6649 2005-11-07  Miguel de Icaza  <miguel@novell.com>
6650
6651         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
6652         that a parameter has been captured does not mean that we do not
6653         have to do the rest of the processing.  This fixes the second part
6654         of #76592.  If there was another anonymous method capturing
6655         values in the past, the Scope would never be set for the second
6656         method that captured the same parameter.
6657
6658         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
6659         properly manipulate the stack.   Second part of fix for #76592.
6660
6661         * expression.cs (New): Add support for invoking "new" on
6662         interfaces that have been flagged with the ComImport attribute and
6663         the CoClass.  Fixes #76637 
6664
6665         * statement.cs (Try.DoEmit): When a variable is captured, do not
6666         try to emit the vi.LocalBuilder variable as it has been captured.
6667         Create a temporary variable and store the results on the
6668         FieldBuilder.  Fixes #76642
6669
6670 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
6671
6672         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
6673
6674         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
6675
6676         * expression.cs (Binary.DoResolve): Added && optimalization.
6677     
6678         * typemanager.cs (AddUserType): Removed useless argument.
6679
6680 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
6681
6682         * statement.cs (Block.variables): Uses ListDictionary.
6683
6684 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
6685
6686         Fix #75969.
6687         * class.cs (PartialContainer.EmitType): Customized to emit
6688         security attributes.
6689         (ClassPart.ApplyAttributeBuilder): Transform security attribute
6690         for partial classes.
6691
6692 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
6693
6694         Fix #76599.
6695         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
6696         access has to be fixed.
6697         
6698         * typemanager.cs (IsUnmanagedType): Wrong common field type.
6699
6700 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
6701
6702         Fix #76590.
6703         * ecore.cs (NullCast.Reduce): Implemented.
6704
6705         * expression.cs (ArrayCreation.CheckIndices): Correcly check
6706         constant type.
6707         
6708         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
6709         properly.
6710         (Foreach.Resolve): Catch null properly.
6711
6712 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
6713  
6714         * cs-tokenizer.cs: Warning text fix.
6715
6716         * driver.cs: AllWarningNumbers exposed on public interface.
6717
6718         * report.cs (): Reviewed warning numbers.
6719         (IsValidWarning): Use binary search.
6720
6721 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
6722  
6723         * driver.cs: Implemeted resource visibility.
6724         (Resources): New class for code sharing between /res: and
6725         /linkres:
6726  
6727 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
6728
6729         Fix #76568.
6730         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
6731         folding.
6732         
6733         * convert (Convert.ImplicitReferenceConversion): NullCast holds
6734         contants only.
6735         
6736         * ecore.cs (NullCast): Child is contant only.
6737         
6738         * literal.cs (NullLiteral.Reduce): null can be converted to any
6739         reference type.
6740
6741 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
6742
6743         * driver.cs: Use Encoding.Default as default code page instead
6744           of ISO-28591.
6745
6746 2005-10-27  Raja R Harinath  <rharinath@novell.com>
6747
6748         Fix #76085.
6749         * expression.cs (Invocation.Error_InvalidArguments): Handle
6750         __arglist parameters.
6751         (Invocation.VerifyArgumentsCompat): Likewise.
6752         * support.cs (ReflectionParameters.GetSignatureForError): Print
6753         __arglist parameters.
6754         (InternalParamters.GetSignatureForError): Likewise.
6755         * parameter.cs (Parameters.GetSignatureForError): Likewise.
6756
6757 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
6758
6759         * attribute.cs (GetPropertyValue): Made public.
6760
6761         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
6762         Resolve.
6763         Add new property WrapNonExceptionThrows to handle 2.0 assembly
6764         attribute.
6765         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
6766         is not defined.
6767         
6768         * driver.cs: Reflect method name change.
6769         
6770         * statement.cs (Try.Resolve): Warn when try has both general
6771         exception handlers.
6772         
6773         * typemanager.cs: runtime_compatibility_attr_type new predefined
6774         type.
6775
6776 2005-10-26  Raja R Harinath  <harinath@gmail.com>
6777
6778         Fix #76419.
6779         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
6780         treat it as an empty parameter list.
6781
6782 2005-10-26  Raja R Harinath  <rharinath@novell.com>
6783
6784         Fix #76271.     
6785         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
6786         ResolveAsTypeStep silent.
6787         * statement.cs (Block.AddConstant): Mark block as used.
6788         (Block.ResolveMeta): Avoid piling on error messages
6789         if a constant initializer resolution fails.
6790
6791 2005-10-25  Raja R Harinath  <rharinath@novell.com>
6792
6793         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
6794         Remove.
6795         (NamespaceEntry.VerifyAllUsing): New.
6796         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
6797         behaviour.  Delegates actual resolution of alias to ...
6798         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
6799         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
6800         Update.
6801         * driver.cs (Driver.MainDriver): Update.
6802         
6803         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
6804         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
6805         property.
6806         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
6807         Remove.
6808         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
6809         RootNamespace.DefineNamespacesForAll.
6810
6811 2005-10-24  Raja R Harinath  <harinath@gmail.com>
6812
6813         * typemanager.cs (assemblies, external_aliases, modules)
6814         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
6815         (ComputeNamespaces, GetRootNamespace): Remove extra staging
6816         overhead.  Move resposibility ...
6817         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
6818         * driver.cs, attribute.cs, codegen.cs: Update to changes.
6819
6820 2005-10-23  Raja R Harinath  <harinath@gmail.com>
6821
6822         * namespace.cs (RootNamespace.all_namespaces): Renamed from
6823         cached_namespaces.  Improve usage.
6824         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
6825         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
6826         Move from GlobalRootNamespace and simplify.
6827         (RootNamespace.Global): Make instance variable.
6828         (RootNamespace.RootNamespace): Add "alias name" parameter.
6829         (GlobalRootNamespace): Simplify drastically.
6830         (Namespace.Lookup): Don't use GetNamespace.
6831         * typemanager.cs (GetRootNamespace): Rename from
6832         ComputeNamespaceForAlias.
6833         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
6834
6835 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
6836
6837         * anonymous.cs (AnonymousContainer): Don't crash when container
6838         doesn't exist.
6839
6840 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
6841
6842         * expression.cs (Binary.DoResolve): Warn when comparing same
6843         values.
6844
6845 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
6846
6847         Fix #76486.
6848         * expression.cs (Binary.DoResolve): It looks like there are no
6849         convetsion rules in enum context.
6850
6851 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6852
6853         Add support for extern alias qualifiers.
6854         * typemanager.cs: Move some LookupTypeReflection code
6855         to namespace.cs, to have cleaner code. Added some methods
6856         to help us keep track of the extern aliased references.
6857         * driver.cs: Add suport for extern alias assemblies on command
6858         line and check for their warnings/errors. Also keep track of the
6859         extern aliased assemblies.
6860         * namespace.cs: Move the global functionality of Namespace
6861         to GlobalRootNamespace/RootNamespace. Now the global namespace
6862         is GlobalRootNamespace.Globa. Also the code moved from 
6863         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
6864         Finally added LocalAliasEntry (AliasEntry before) and
6865         ExternAliasEntry, to handle alias statements.
6866         * cs-parser.jay: Add support in the grammar for extern alias
6867         statement.
6868         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
6869         Update callings to Namespace (now in GlobalRootNamespace).
6870
6871 2005-10-18  Raja R Harinath  <rharinath@novell.com>
6872
6873         Fix #76371.
6874         * class.cs (TypeContainer.DefineType): Move updating of
6875         topological sort earlier in the code.
6876         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
6877
6878 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
6879
6880         Fix #76273.
6881         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
6882         
6883         * constant.cs (Constant.TryReduce): Moved from Cast class.
6884         (Reduce): Made little bit more OO and fixed missing conversions.
6885         
6886         * ecore.cs (Reduce): Implemented.
6887         (Binary.EnumLiftUp): New method to upgrade values to enum values.
6888         
6889         * literal.cs (Reduce): Implemented.
6890         
6891         * class.cs: Reverted Miguel's wrong commit.
6892
6893 2005-10-14  Miguel de Icaza  <miguel@novell.com>
6894
6895         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
6896
6897 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
6898
6899         * cs-parser.jay, expression.cs : CS0214 was missing error location
6900           for constants. Fixed bug #76404.
6901
6902 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
6903
6904         Fix #76370.
6905         * convert.cs (ExplicitConversionCore): Fixed object->enum
6906         conversion.
6907
6908 2005-10-10  Raja R Harinath  <rharinath@novell.com>
6909
6910         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
6911         InstanceExpression.
6912         (PropertyExpr.EmitCall): Likewise.
6913         * expression.cs (Invocation.EmitArguments): Handle case where
6914         arguments == null.
6915         (Invocation.EmitCall): Avoid allocating temporary variable if
6916         there are no arguments.
6917
6918 2005-10-07  Raja R Harinath  <rharinath@novell.com>
6919
6920         Fix #76323.
6921         * convert.cs (ImplicitConversionStandard): Move conversion of
6922         void* to arbitrary pointer types ...
6923         (ExplicitConversionStandard): .. here.
6924         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
6925         error to always print typenames.
6926
6927 2005-10-07  Raja R Harinath  <rharinath@novell.com>
6928
6929         * convert.cs (GetConversionOperator): Rename from
6930         GetConversionOperators.  Move operator selection code from ...
6931         (UserDefinedConversion): ... here.
6932
6933 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
6934
6935         * convert.cs (ExplicitConversionCore): Removed duplicate enum
6936         conversion.
6937
6938 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
6939
6940         * assign.cs (Assign.DoResolve): Error method changed.
6941
6942         * cfold.cs (DoConstantNumericPromotions): Error method changed.
6943         
6944         * const.cs (ResolveValue): Reset in_transit immediately.
6945         
6946         * constant.cs: Error method changed.
6947         
6948         * convert.cs: Removed useless location parameter.
6949         (ExplicitNumericConversion): Don't do double enum check.
6950         (ExplicitConversionCore): Renamed from ExplicitConversion.
6951         (ExplicitUnsafe): Extracted from ExplicitConversion.
6952         (ExplicitConversion): Uses for error reporting.
6953         
6954         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
6955         error messages.
6956         (ResolveBoolean): Uses common error method.
6957         (CastToDecimal): Get rid of ec.
6958         (CastFromDecimal): Optimized.
6959         (ConvCast): Get rid of ec.
6960         
6961         * enum.cs (ResolveValue): Reset in_transit immediately.
6962         (Emit): Return after first error.
6963         
6964         * expression.cs: Convert changes.
6965         
6966         * literal.cs: Error method changed.
6967         
6968         * statement.cs: Error method changed.
6969
6970 2005-10-03  Raja R Harinath  <rharinath@novell.com>
6971
6972         * support.cs (SeekableStreamReader.Position): Don't error out when
6973         the requested position is just beyond the end of the current
6974         buffered data.
6975
6976 2005-09-28  Raja R Harinath  <rharinath@novell.com>
6977
6978         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
6979         try to keep in sync with the byte count of the underlying Stream.
6980         However, this limits us to a window size of 2048 characters: i.e.,
6981         the maximum lookahead of our lexer/parser can be 2048 characters.
6982
6983 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
6984
6985         Fix #76255.
6986         * driver.cs: Fix compilation files with full root path.
6987
6988 2005-09-25  Miguel de Icaza  <miguel@novell.com>
6989
6990         * report.cs (SymbolRelatedToPreviousError): Format the output so
6991         it does not use an open parenthesis that is never closed. 
6992
6993         * driver.cs: Follow coding guidelines
6994
6995 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
6996
6997         Fix #72930.
6998         * const.cs (Const.ResolveValue): Check for assigning non-null
6999         value to reference type.
7000
7001 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
7002
7003         * anonymous.cs: Implemented ExprClassName.
7004         
7005         * assign.cs (Assign.DoResolve): Don't chrash when type is not
7006         delegate.
7007         
7008         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
7009         check.
7010         
7011         * class.cs (StaticClass.DefineContainerMembers): Report protected
7012         members as error.
7013         
7014         * codegen.cs: if(ed) PRODUCTION.
7015         
7016         * convert.cs (Error_CannotImplicitConversion): Better error
7017         distinction.
7018         
7019         * cs-parser.jay: More error checks.
7020         
7021         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
7022         
7023         * driver.cs (CSCParseOption): Enabled wrong option check.
7024         
7025         * ecore.cs (Expression.ExprClassName): Turned to property.
7026         (MemberExpr.CheckIntermediateModification): For checking boxed
7027         value types     modification.
7028         
7029         * statement.cs (Fixed.Resolve): Expression type must be
7030         convertible to fixed type.
7031         (CollectionForeach.GetEnumeratorFilter,TryType):
7032         Small refactoring for easier error checking.
7033
7034 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
7035
7036         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
7037         attributes.
7038         
7039         * class.cs (GeneratedBaseInitializer): New class for customization
7040         compiler generated initializers.
7041         (MemberBase.DoDefine): Check Obsolete attribute here.
7042         (FieldMember.DoDefine): Ditto.
7043         
7044         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
7045         constants.
7046         
7047         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
7048         (MemberCore.GetObsoleteAttribute): Removed argument.
7049         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
7050         (MemberCore.CheckObsoleteType): New helper.
7051         
7052         * delegate.cs,
7053         * enum.cs,
7054         * statement.cs: Updates after MemberCore changes.
7055         
7056         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
7057         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
7058         
7059         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
7060         obsolete attribute for compiler construct.
7061         (As.DoResolve): Cache result.
7062         
7063         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
7064
7065 2005-09-26  Raja R Harinath  <rharinath@novell.com>
7066
7067         Fix #76133.
7068         * expression.cs (This.VerifyFixed): In a value type T, the type of
7069         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
7070         value type R, 'this' is treated as a value parameter.
7071
7072 2005-09-22  Miguel de Icaza  <miguel@novell.com>
7073
7074         * statement.cs (Lock): Use the TemporaryVariable class instead of
7075         manually using local variables as those do not work when variables
7076         are captured.
7077
7078         * ecore.cs: Moved the TemporaryVariable class from being a nested
7079         class inside Foreach to be a public class that can be employed in
7080         other places. 
7081
7082 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
7083
7084         * cs-parser.jay: interface_accessors replaced by
7085         accessor_declarations.
7086
7087         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
7088         location.
7089         
7090         * statement.cs (GotoCase.Resolve): Convert null constant to
7091         null case.
7092         (SwitchLabel.ResolveAndReduce): Ditto.
7093         (SwitchLabel.NullStringCase): Custom null stamp.
7094         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
7095         
7096         typemanager.cs (CSharpSignature): Don't skip first argument
7097         for full names.
7098
7099 2005-09-18  Miguel de Icaza  <miguel@novell.com>
7100
7101         * driver.cs: Set InEmacs based on the environment variable EMACS. 
7102
7103         * location.cs (InEmacs): in this mode, do not report column
7104         location as it confuses Emacs.
7105
7106 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
7107
7108         * cfold.cs, constant.cs, convert.cs, ecore.cs,
7109         expression.cs, iterators.cs, literal.cs: Store constants and
7110         literals location.
7111         
7112         * class.cs (MemberBase.ShortName): Pass location.
7113         
7114         * cs-parser.jay: Some location fixes.
7115         
7116         * ecore.cs (Expression.Location): Made virtual.
7117
7118 2005-09-05  Miguel de Icaza  <miguel@novell.com>
7119
7120         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
7121         if the underlying types are the same, otherwise we need to produce
7122         code that will do the proper cast.
7123
7124         This was exposed by Marek's constant rewrite which produced
7125         invalid code for the call site:
7126
7127         enum X : long { a }
7128         void Method (X v) {}
7129
7130         Method ((X) 5)
7131
7132         This fixes test-49.cs
7133
7134 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
7135
7136         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
7137           Type/Object should be allowed as well. Fixed bug #75968.
7138
7139 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
7140
7141         * expression.cs : (Binary.DoResolve): when one is enum constant and
7142           another is constant 0, then return enum one *as enum type*.
7143           Fixed bug 74846.
7144
7145 2005-09-02  Raja R Harinath  <rharinath@novell.com>
7146
7147         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
7148         internal.
7149
7150         Fix #75941.
7151         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
7152         flow-branching for LocalVariableReferences in case we were invoked
7153         from a MemberAccess.
7154         * expression.cs (LocalVariableReference.VerifyAssigned): New.
7155         Carved out of ...
7156         (LocalVariableReference.DoResolveBase): ... this.
7157         (MemberAccess.Resolve): Do the check that was disabled during
7158         SimpleNameResolve.
7159
7160 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
7161
7162         * class.cs :
7163           (PartialContainer.Create): check abstract/sealed/static strictly
7164           but abstract/sealed can exist only at one side. Fixed bug #75883.
7165
7166 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
7167
7168         Fix #75945.
7169         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
7170         specified, don't default to UnmanagedType.I4.
7171
7172 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
7173
7174         * expression.cs : conditional operator should check possibly
7175           incorrect assign expression. Fixed bug #75946.
7176
7177 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
7178
7179         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
7180           Reverting the change. gmcs is much complex than mcs on this matter.
7181
7182 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
7183
7184         * cs-tokenizer.cs : To read another token ahead of the actual 
7185           consumption, use new SavedToken and cache token instead of moving
7186           back the stream with SeekableStreamReader (it seemed problematic).
7187         * cs-parser.jay,
7188           driver.cs : Thus use StreamReader directly.
7189         * support.cs : Thus removed SeekableStreamReader.
7190
7191 2005-08-30  Raja R Harinath  <rharinath@novell.com>
7192
7193         Fix #75934.
7194         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
7195         (ScopeInfo.EmitScopeType): Use it to construct field names from
7196         names of captured locals.
7197
7198         Fix #75929.
7199         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
7200         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
7201         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
7202         (ExplicitConversion): Remove enum cases already handled by
7203         implicit conversion.  Move implicit conversion check to the beginning.
7204         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
7205         * expression.cs (ArrayCreation.EmitDynamicInitializers):
7206         Don't treat System.Enum as a struct.
7207
7208 2005-08-30  Jb Evain  <jbevain@gmail.com>
7209
7210         * attribute.cs: handles as expression in parameters.
7211
7212 2005-08-30  Raja R Harinath  <rharinath@novell.com>
7213
7214         Fix #75802.
7215         * class.cs (TypeContainer.VerifyClsName): Don't use a
7216         PartialContainer when verifying CLS compliance.
7217         (AbstractPropertyEventMethod): Set Parent here, ...
7218         (PropertyMethod): ... not here.
7219
7220 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
7221
7222         * attribute.cs : escaped attribute name should not be allowed to be
7223           resolved (e.g. @class as classAttribute). Fixed bug #75930.
7224
7225 2005-08-29  Raja R Harinath  <rharinath@novell.com>
7226
7227         Fix #75927.
7228         * convert.cs (ImplicitStandardConversionExists): Allow zero also
7229         when converting a long constant to unsigned long.
7230         * expression.cs (Invocation.OverloadResolve): Add sanity check to
7231         detect where IsApplicable and VerifyArgumentsCompat disagree.
7232
7233 2005-08-29  Raja R Harinath  <rharinath@novell.com>
7234         and Carlos Alberto Cortez  <carlos@unixmexico.org>
7235
7236         Fix #75848.
7237         * class.cs (TypeContainer.CanElideInitializer): New helper.
7238         (TypeContainer.EmitFieldInitializers): Use it to determine if we
7239         can safely emitting the initializer of a field.
7240
7241 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
7242
7243         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
7244           allowed inside a switch (without loop). Fixed bug #75433.
7245
7246 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
7247
7248         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
7249         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
7250
7251 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
7252
7253         * driver.cs : kinda reverting the default encoding changes (not exact 
7254           revert since I noticed that "codepage:reset" might not work fine).
7255
7256 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
7257
7258         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
7259           Location. Now getter and setter store location correctly.
7260           (errors/cs0111-12.cs now reports the expected location.)
7261
7262 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
7263
7264         * driver.cs : Use default encoding on the environment.
7265           Removed (now that) extra parameter for SeekableStreamReader.
7266         * support.cs : (SeekableStreamReader) third .ctor() argument for
7267           StreamReader is not required (always true). preamble size could
7268           be acquired in simpler and safe way.
7269
7270 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
7271
7272         * cs-parser.jay: report CS0642 at warning level 3
7273           and report CS0642 for an if else statement also
7274           fixes bug #74745. Patch by John Luke (and a bit
7275           modified by me).
7276           Removed extra CS0642 warning check for "while",
7277           "for" and "fixed".
7278         * statement.cs: In Block.Resolve(), CS0642 check
7279           is reimplemented to check a sequence of an empty
7280           statement and a block.
7281
7282           Both fix bug #66777.
7283
7284 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
7285
7286         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
7287         detection until I fix it.
7288         
7289         * cs-tokenizer.cs: Changed error message.
7290         
7291         * cs-parser.jay: Fixed 2 error locations.
7292         
7293         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
7294         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
7295         properties.
7296         
7297         * enum.cs (GetSignatureForError): Fixed.
7298         
7299         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
7300         method detection.
7301         
7302         * class.cs,
7303         * typemanager.cs (RegisterProperty): Removed.
7304         
7305         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
7306
7307 2005-08-24  Raja R Harinath  <rharinath@novell.com>
7308
7309         Fix #75874.
7310         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
7311         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
7312
7313 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7314
7315         * expression.cs : tiny fix is required for not warning positive ulong.
7316           See test-441.cs.
7317
7318 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7319
7320         * expression.cs : add CS0652 check for constant and integral
7321           expression. Fixed bug #53974.
7322
7323 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7324
7325         * expression.cs : in DoNumericPromotions(), check if there is implicit
7326           conversion overload for string (to check CS0034). Fixed bug #52492.
7327
7328 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7329
7330         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
7331
7332 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7333
7334         * ecore.cs : report location when it is *not* Null.
7335
7336 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7337
7338         * codegen.cs,
7339           ecore.cs,
7340           flowanalysis.cs,
7341           expression.cs:
7342           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
7343           correctly. Fixed bug #75721.
7344
7345 2005-08-23  Raja R Harinath  <rharinath@novell.com>
7346
7347         * support.cs (SeekableStreamReader.Position): Avoid an expensive
7348         loop that performs 'min (pos, char_count)'.
7349
7350         Fix #75862.
7351         * expression.cs (Unary.ResolveOperator): Don't discard implicit
7352         converted value in Operator.OnesComplement.
7353
7354 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
7355
7356         * anonymous.cs: If the anon method is pulled into a helper class,
7357         it needs to be `internal' not `private'. Fixes runtime behavior on
7358         msft. bug #75704
7359
7360 2005-08-20  Martin Baulig  <martin@ximian.com>
7361
7362         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7363         scope if we don't already have it.
7364
7365         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
7366         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
7367         fixes #75867.
7368
7369 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
7370
7371         Fix #75803
7372         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
7373         is a partial class.
7374
7375 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
7376
7377         The big constants rewrite
7378         Fix #75746, #75685 and more
7379         As a side effect saved 1MB for MWF ;-)
7380         
7381         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
7382         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
7383         enum based for corlib compilation.
7384         
7385         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
7386         subtractions.
7387         
7388         * class.cs (FixedField.Define): Use ResolveAsConstant.
7389         
7390         * const.cs (IConstant): Interface constants and enums.
7391         (Const.ResolveValue): New method for constant resolvning.
7392         (ExternalConstant): Constants from imported assemblies.
7393         
7394         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
7395         conversion; like enums.
7396         (Constant.ToType): Converts this constant to different type.
7397         (Constant.Increment): Adds 1.
7398         
7399         * convert.cs (ImplicitConversionRequired): Simplified.
7400         
7401         * cs-parser.jay: Create EnumMember directly.
7402         
7403         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
7404         
7405         * doc.cs (GenerateEnumDocComment): Removed.
7406         
7407         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
7408         (ConvertIntLiteral): Removed.
7409         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
7410         
7411         * enum.cs (EnumMember): Implement IConstant.
7412         (Enum.IsValidEnumConstant): Removed.
7413         (Enum.GetNextDefaultValue): Removed.
7414         (Enum.FindMembers): Updated.
7415         (Enum.GenerateDocComment): Iterate enum members.
7416         
7417         * expression.cs (Cast.TryReduce): Handle enums correctly.
7418         (New.Constantify): Made public.
7419         (MemberAccess.DoResolve): Removed contant specific if(s).
7420         
7421         * literal.cs (NullLiteral): Implement new abstract methods.
7422         
7423         * statement.cs (GotoCase.Resolve): Use new constant methods.
7424         (SwitchLabel.ResolveAndReduce): Use new constant methods.
7425         
7426         * typemanager.cs (LookupEnum): Removed.
7427         (IsEnumType): Fixed to work with corlib.
7428         (RegisterConstant): Removed.
7429         (LookupConstant): Removed.
7430         (GetConstant): Changed to work with IConstant.
7431
7432 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
7433
7434         * location.cs : Fixed overflown (>255) column number.
7435
7436 2005-08-03  Raja R Harinath  <rharinath@novell.com>
7437
7438         First cut of the qualified-alias-member feature.
7439         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
7440         token.
7441         * cs-parser.jay (DOUBLE_COLON): New token.
7442         (namespace_or_type_name): Add rule for recognizing
7443         qualified-alias-members.
7444         (primary_expression): Likewise.
7445         (element_access): Allow QualifiedAliasMember as a possible
7446         type-bearing expression.
7447         (local_variable_type, local_variable_pointer_type): Likewise.
7448         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
7449         aliases in the current and enclosing namespace declarations.
7450         (NamespaceEntry.UsingAlias): Add CS0440 warning.
7451         * decl.cs (MemberName.is_double_colon): New.
7452         (MemberName.MemberName): Add new constructor for alias-member.
7453         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
7454         * expression.cs (QualifiedAliasMember): New expression type.
7455
7456 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7457
7458         * location.cs : it borked when no argument was specified.
7459
7460 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7461
7462         * location.cs : tiny ToString() format fix.
7463
7464 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7465
7466         * statement.cs : oops, it was missing.
7467
7468 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7469
7470         A set of fixes for precise line/column location.
7471
7472         * location.cs :
7473           "token" field now holds a file/line "delta", a line number offset 
7474           from the segment, and a column number. See also:
7475           http://lists.ximian.com/pipermail/mono-devel-list/2004-
7476           December/009508.html
7477           Removed static IsNull. Use instance IsNull property instead.
7478         * cs-tokenizer.cs :
7479           For some tokens it stores Location. For Identifier it stores
7480           LocatedToken which is a pair of string name and location.
7481           Column numbers are adjusted only at getChar().
7482         * report.cs :
7483           Use Location.ToString() for reporting (it now contains column).
7484         * cs-parser.jay :
7485           Largely modified to use LocatedToken instead of
7486           string (IDENTIFIER), and to acquire Location from some tokens.
7487         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
7488           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
7489           codegen.cs :
7490           Now MemberName holds Location. DeclSpace.ctor() receives Location
7491           as a parameter. Removed extra parameters to all derived classes.
7492           Replaced Location.IsNull() with instance property.
7493         * assign.cs, expression.cs :
7494           Added .ctor() overload that omits Location.
7495         * attribute.cs :
7496           Added "nameEscaped" flag that indicates the identifier was escaped
7497           in the source file. This fixes bug #57047.
7498
7499 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
7500
7501         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
7502         New method, looking for lo-case imported cls type.
7503
7504         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
7505         here.
7506
7507         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
7508
7509         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
7510
7511         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
7512         all_imported_types.
7513         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
7514
7515         Optimized to save 3.5 MB for SWF compilation.
7516
7517 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
7518
7519         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
7520         (PartialContainer.Create): Moved logic AddToContainer.
7521         (PartialContainer.MarkForDuplicationCheck): Shares name.
7522         
7523         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
7524         place.
7525         
7526         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
7527         initialization.
7528         (Namespace.GetSignatureForError): New method.
7529         
7530         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
7531         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
7532
7533 2005-08-01  Raja R Harinath  <rharinath@novell.com>
7534
7535         Fix #75669.
7536         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
7537         member lookup rather than qualifier_type, since qualifier_type can
7538         be null.
7539
7540 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
7541
7542         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
7543         enum member.
7544
7545 2005-07-31  Miguel de Icaza  <miguel@novell.com>
7546
7547         * statement.cs: Copy the local exception into the exception
7548         captured local.  Fixes 75674
7549
7550 2005-07-31  Raja R Harinath  <harinath@gmail.com>
7551
7552         Fix #75658.
7553         * expression.cs (Invocation.OverloadResolve): Don't report error
7554         CS1501 if error CS1502 has been reported.
7555         (New.DoResolve): Delegate CS1501 reporting to
7556         Invocation.OverloadResolve.
7557
7558         Fix #75656.
7559         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
7560         invariant-meaning-in-block property in an enclosing block if
7561         necessary.
7562
7563 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
7564
7565         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
7566         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
7567         (Switch.CheckSwitch): Just save 50kb for SWF.
7568
7569 2005-07-27  Martin Baulig  <martin@ximian.com>
7570
7571         * anonymous.cs (CaptureContext.AddField): Added
7572         `AnonymousContainer am' argument; compute its toplevel scope if
7573         it's not already computed.  Fixes #75649.
7574
7575 2005-07-26  Raja R Harinath  <rharinath@novell.com>
7576
7577         Fix #75628.
7578         * class.cs (Constructor.Emit): Reset block to null if the block
7579         resolve fails.
7580
7581 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
7582
7583         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
7584
7585 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
7586
7587         * class.cs (MethodData.Define): Check whether accessor implementing
7588         interface is public.
7589
7590         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
7591
7592 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
7593
7594         Fix #57245
7595         * namespace.cs (LookupType): Moved same type check to...
7596         
7597         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
7598         with the same name.
7599
7600 2005-07-21  Raja R Harinath  <rharinath@novell.com>
7601
7602         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
7603         already found a typebuilder.
7604         * class.cs (MethodCore.IsDuplicateImplementation): Compare
7605         MemberNames, not strings.
7606
7607         * const.cs (Error_ExpressionMustBeConst): 
7608         Rename from Error_EpressionMustBeConst.
7609         * const.cs, class.cs, statement.cd: Update.
7610
7611 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
7612
7613         Fix #65573
7614
7615         * const.cs (Const.LookupConstantValue): Report missing contant expression
7616         everytime.
7617         (Error_EpressionMustBeConstant): Only one error method.
7618
7619         * class.cs, statement.c: Updated.
7620
7621 2005-07-20  Raja R Harinath  <rharinath@novell.com>
7622
7623         * statement.cs (Block.Flags): Add back HasVarargs.
7624         (Block.flags): Make protected.
7625         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
7626
7627         * typemanager.cs (types, typecontainers, user_types): Remove.
7628         (UserTypes, TypeContainers): Likewise.
7629         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
7630         (CleanUp, Reset): Update.
7631         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
7632         (GetNestedType): Use Type.GetNestedType.
7633         (CoreLookupType): Take two arguments, the namespace and the
7634         basename of the type.  Update to use the Namespace.Lookup
7635         mechanism.
7636         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
7637         (RealMemberLookup): Use IsNestedChildOf instead of playing with
7638         string concatenation and substring matches.
7639         * class.cs, enum.cs, delegate.cs: Update to changes.
7640
7641 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
7642
7643         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
7644         Expression and made virtual.
7645
7646         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
7647         (ImplicitStandardConversionExists): Fixed `byte' typo ?
7648
7649         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
7650
7651         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
7652         error message.
7653
7654         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
7655         change.
7656
7657 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
7658
7659         Fix #57707
7660         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
7661         AssemblyCultureAttribute is not used on executable.
7662
7663         * rootcontext.cs,
7664         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
7665
7666 2005-07-16  Raja R Harinath  <rharinath@novell.com>
7667
7668         Fix #60638.
7669         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
7670         New.  Reports CS0252/CS0253.
7671         Mostly taken from preliminary patch by Duncak Mak.
7672         (Binary.DoResolveOperator): Store results of operator lookup.
7673         Use them to detect if we need to warn about unintended reference
7674         comparisons.
7675
7676 2005-07-15  Raja R Harinath  <rharinath@novell.com>
7677
7678         Fix #72969.
7679         * namespace.cs (Namespace.Lookup): Add back location parameter.
7680         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
7681         * delegate.cs, ecore.cs, expression.cs: Update to changes.
7682
7683         * codegen.cs (EmitContext.DeclSpace): Make readonly.
7684         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
7685         (Namespace.LookupType): ... this.
7686         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
7687         of namespaces.
7688         * typemanager.cs (LookupTypeReflection): Remove buggy code that
7689         purported to handle pointers.
7690         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
7691         CoreLookupType.
7692
7693 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
7694
7695         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
7696         type as namespace.
7697
7698 2005-07-15  Raja R Harinath  <rharinath@novell.com>
7699
7700         * namespace.cs (Namespace.Lookup): Drop location parameter.
7701         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
7702         (NamespaceEntry.Lookup): ... this.
7703         (NamespaceEntry.Error_AmbiguousTypeReference):
7704         Move here from DeclSpace.
7705         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
7706         names ...
7707         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
7708         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
7709         Move to NamespaceEntry.
7710         * delegate.cs, expression.cs: Update to changes.
7711
7712 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
7713
7714         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
7715         CheckAttributeType and refactored.
7716         (Attribute.ResolvePossibleAttributeType): Changed to reuse
7717         ResolveAsTypeTerminal error handling.
7718         (ResolveAsTypeTerminal): Introduced because of global attributes extra
7719         handling.
7720         (GetSignatureForError): Print errors in same way.
7721
7722         * class.cs,
7723         * codegen.cs: Reflect attribute GetSignatureForError change.
7724
7725         * ecore.cs,
7726         * expression.cs: Add silent parameter to ResolveAsTypeStep.
7727
7728         * namespace.cs (UsingEntry): Refactored to make fields private.
7729
7730         * assign.cs,
7731         statement.cs: Error_UnexpectedKind has extra parameter.
7732
7733 2005-07-14  Raja R Harinath  <rharinath@novell.com>
7734
7735         * ecore.cs (IAlias): Remove.
7736         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
7737         that implement the interface.
7738         * namespace.cs (Namespace): Likewise.
7739         (Namespace.declspaces): Renamed from 'defined_names'.
7740         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
7741         DeclSpace instead of an IAlias.
7742         * tree.cs (Tree.AddDecl): Update.
7743
7744 2005-07-12  Raja R Harinath  <rharinath@novell.com>
7745
7746         * statement.cs (Block.Flags); Remove HasVarargs.
7747         (Block.HasVarargs): Move to ToplevelBlock.
7748         (Block.ThisVariable, Block.AddThisVariable): Likewise.
7749         (Block.Variables): Make protected.  Initialize variable hashtable
7750         if necessary.
7751         (Block.AddVariable): Update.
7752         (Block.Resolve): Update to changes.
7753         (ToplevelBlock.HasVarargs): New boolean.
7754         (ToplevelBlock.ThisVariable): Move here from Block.
7755         (ToplevelBlock.AddThisVariable): Likewise.
7756         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
7757         * expression.cs (This.ResolveBase): Update to changes.
7758         (ArglistAccess.DoResolve): Likewise.
7759
7760 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
7761
7762         Fix #75321
7763         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
7764
7765         * class.cs (TypeContainer.VerifyMembers): Distinguish between
7766         not used and not used & assigned.
7767         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
7768
7769 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
7770
7771         Fix #75053
7772         * expression.cs (Is.DoResolve): null is never provided type.
7773
7774 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
7775
7776         Fix #52496
7777         * cs-parser.jay: Less strict event error rule to catch more errors.
7778
7779 2005-07-08  Martin Baulig  <martin@ximian.com>
7780
7781         Fix test-iter-10.cs - distinguish whether we `yield' in a property
7782         gettter (allowed) or setter (not allowed).
7783
7784         * class.cs (Accessor): Implement IIteratorContainer.
7785         (Accessor.Yields): New public field.
7786         (PropertyBase.PropertyMethod.Define): Handle iterators on a
7787         per-accessor basis.
7788
7789         * cs-parser.jay
7790         (get_accessor_declaration, set_accessor_declaration): Set the
7791         `yields' flag on the accessor, not the property.
7792         (property_declaration): Do the iterators check on a per-accessor
7793         basis and not for the whole property.
7794
7795 2005-07-08  Martin Baulig  <martin@ximian.com>
7796
7797         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
7798         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
7799
7800 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
7801
7802         Fix #74975
7803         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
7804         (ExtractSecurityPermissionSet): Cope with self referencing security
7805         attributes properly.
7806
7807         * driver.cs (SetOutputFile): Made public property OutputFile.
7808
7809 2005-07-07  Raja R Harinath  <rharinath@novell.com>
7810
7811         Fix #75486.
7812         * class.cs (TypeContainer.first_nonstatic_field): Rename from
7813         has_nonstatic_fields.  Make into a FieldBase pointer.
7814         (TypeContainer.AddField): Add CS0282 check.
7815         (TypeContainer.EmitType): Update.
7816
7817 2005-07-06  Miguel de Icaza  <miguel@novell.com>
7818
7819         * cs-tokenizer.cs (consume_identifier): Do not create strings to
7820         compare if they start with __.
7821
7822 2005-07-06  Raja R Harinath  <rharinath@novell.com>
7823
7824         * statement.cs (Switch.SwitchGoverningType): Only look at
7825         UserCasts that don't need implicit standard conversions to one of
7826         the allowed switch types (Fixes test-322.cs).
7827         (LocalInfo.Resolve): Re-enable sanity-test.
7828
7829 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
7830
7831         * cs-tokenizer.cs (consume_identifier): Detect double undescores
7832         
7833         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
7834         
7835         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
7836
7837 2005-07-06  Raja R Harinath  <rharinath@novell.com>
7838
7839         Fix #75472.
7840         * ecore.cs (SimpleName.GetSignatureForError): Add.
7841         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
7842         (MemberAccess.GetSignatureForError): Add.
7843
7844 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
7845  
7846         The big error and warning messages review.
7847         
7848         * anonymous.cs,
7849         * assign.cs,
7850         * attribute.cs,
7851         * class.cs,
7852         * codegen.cs,
7853         * convert.cs,
7854         * cs-parser.jay,
7855         * cs-tokenizer.cs,
7856         * decl.cs,
7857         * delegate.cs,
7858         * doc.cs,
7859         * driver.cs,
7860         * ecore.cs,
7861         * enum.cs,
7862         * expression.cs,
7863         * flowanalysis.cs,
7864         * iterators.cs,
7865         * literal.cs,
7866         * location.cs,
7867         * modifiers.cs,
7868         * namespace.cs,
7869         * parameter.cs,
7870         * pending.cs,
7871         * report.cs,
7872         * rootcontext.cs,
7873         * statement.cs,
7874         * support.cs,
7875         * tree.cs,
7876         * typemanager.cs: Updated.
7877         
7878         * class.cs: (MethodCore.SetYields): Moved here to share.
7879         (PropertyMethod.Define): Moved iterator setup here.
7880         
7881         * iterators.cs: Add orig_method to have full access to parent
7882         container.
7883
7884 2005-07-05  Raja R Harinath  <rharinath@novell.com>
7885
7886         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
7887         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
7888         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
7889         variable of struct type.
7890         * expression.cs (Unary.ResolveOperator): Update to change.
7891         (Indirection.VerifyFixed): Likewise.
7892         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
7893         (ParameterReference.VerifyFixed): Value parameters are fixed.
7894         (This.VerifyFixed): Treat 'this' as a value parameter.
7895         * statement.cs (LocalInfo.IsFixed): Remove.
7896
7897 2005-07-01  Martin Baulig  <martin@ximian.com>
7898
7899         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
7900         `ec.EmitThis ()' to get the correct scope.
7901
7902 2005-07-01  Martin Baulig  <martin@ximian.com>
7903
7904         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
7905         instance is a ParameterReference; fixes #75299.
7906
7907 2005-07-01  Martin Baulig  <martin@ximian.com>
7908
7909         Reverted Marek's latest patch (r46725):
7910         - it contains structural changes which are neither mentioned in
7911           the ChangeLog nor explained anywhere; for example the additional
7912           argument of EmitContext's and Iterator's .ctor's and the
7913           TypeContainer.DefineMembers() change.
7914         - structural changes like this should go in in seperate patches
7915           and not be hidden in a huge patch which just seems to affect
7916           warnings and errors.
7917           a big and hard to understand patch.
7918         - it breaks iterators and causes regressions, for instance in
7919           test-iter-03.cs.      
7920
7921 2005-06-30  Raja R Harinath  <rharinath@novell.com>
7922
7923         Fix #75412.
7924         * expression.cs (Indexers.map): Remove.
7925         (Indexers.Append): Filter out inaccessible setters and getters.
7926         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
7927
7928         Fix #75283.
7929         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
7930         Refactored from ...
7931         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
7932         (FieldExpr.Emit, PropertyExpr.Emit): Update.
7933         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
7934         * expression.cs (Invocation.EmitCall): Add CS0120 check.
7935
7936 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
7937
7938         Fix #75322
7939         * class.cs (FieldBase.GetInitializerExpression): One more field
7940         for backup.
7941
7942 2005-06-28  Miguel de Icaza  <miguel@novell.com>
7943
7944         * pending.cs: Do not define a proxy if the base method is virtual,
7945         it will be picked up by the runtime (bug 75270).
7946
7947 2005-06-08  Martin Baulig  <martin@ximian.com>
7948
7949         The big Iterators rewrite :-)
7950
7951         * iterators.cs: Rewrite this to use the anonymous methods framework.
7952
7953         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
7954         before the TypeContainers; see 2test-21.cs.
7955
7956         * class.cs
7957         (TypeContainer.DefineType): Don't create a new EmitContext if we
7958         already have one (this only happens if we're an Iterator).
7959         (TypeContainer.Define): Also call Define() on all our iterators.
7960         (Method.CreateEmitContext): Added support for iterators.
7961
7962         * anonymous.cs
7963         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
7964         (AnonymousContainer.CreateMethodHost): Moved here from
7965         AnonymousMethod and made abstract.
7966         (AnonymousContainer.CreateScopeType): New abstract method.
7967         (AnonymousContainer.IsIterator): New public property.
7968         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
7969         get the ScopeTypeBuilder rather than manually defining it here. 
7970         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
7971         iterators here.
7972
7973         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
7974         before RootContext.DefineTypes().
7975
7976         * codegen.cs (EmitContext.RemapToProxy): Removed.
7977         (EmitContext.CurrentAnonymousMethod): Changed type from
7978         AnonymousMethod -> AnonymousContainer.
7979         (EmitContext.ResolveTopBlock): Protect from being called twice.
7980         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
7981         (EmitContext.EmitThis): Removed the iterators hacks; use the
7982         anonymous methods framework for that.
7983
7984         * statement.cs
7985         (ToplevelBlock.Container): Make this a property, not a field.
7986         (ToplevelBlock.ReParent): New public method; move the
7987         ToplevelBlock into a new container.
7988         (Foreach.TemporaryVariable): Simplify.
7989
7990 2005-06-05  Martin Baulig  <martin@ximian.com>
7991
7992         * statement.cs (LocalInfo.CompilerGenerated): New flag.
7993         (Block.AddTemporaryVariable): New public method; creates a new
7994         `LocalInfo' for a temporary variable.
7995         (Block.EmitMeta): Create the LocalBuilders for all the temporary
7996         variables here.
7997         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
7998         non-iterator variables.
7999
8000 2005-06-05  Martin Baulig  <martin@ximian.com>
8001
8002         * statement.cs (Foreach.TemporaryVariable): Create the
8003         LocalBuilder in the Emit phase and not in Resolve since in some
8004         situations, we don't have an ILGenerator during Resolve; see
8005         2test-19.cs for an example.
8006
8007 2005-06-04  Martin Baulig  <martin@ximian.com>
8008
8009         **** Merged r45395 from GCS ****
8010
8011         The big Foreach rewrite - Part II.
8012
8013         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
8014         with `PropertyInfo ienumerator_getcurrent'.
8015
8016         * codegen.cs (VariableStorage): Removed.
8017
8018         * statement.cs
8019         (Foreach): Derive from Statement, not ExceptionStatement.
8020         (Foreach.CollectionForeach): New nested class.  Moved all the code
8021         dealing with collection foreach here.
8022         (Foreach.ForeachHelperMethods): Removed.
8023         (Foreach.TemporaryVariable): Implement IMemoryLocation.
8024
8025 2005-05-23  Martin Baulig  <martin@ximian.com>
8026
8027         * statement.cs (Try.DoResolve): Don't create a `finally' if we
8028         don't need to.  Fix #75014.
8029
8030 2005-05-20  Martin Baulig  <martin@ximian.com>
8031
8032         Merged r44808 from GMCS.
8033
8034         * class.cs (TypeContainer.CircularDepException): Removed.
8035         (TypeContainer.DefineType): Removed the `InTransit' stuff.
8036         (TypeContainer.CheckRecursiveDefinition): Check for circular class
8037         (CS0146) and interface (CS0529) dependencies here.
8038
8039 2005-06-21  Raja R Harinath  <rharinath@novell.com>
8040
8041         * expression.cs (Invocation.EmitCall): Fix initialization
8042         'this_call' to reflect current behaviour.  Fix indentation.
8043
8044         * convert.cs (FindMostEncompassedType): Add two trivial special
8045         cases (number_of_types == 0 || number_of_types == 1).
8046         (FindMostEncompasingType): Likewise.
8047
8048 2005-06-17  Raja R Harinath  <rharinath@novell.com>
8049
8050         Some cleanups preparing for the fix of #75283.
8051         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
8052         error testing.
8053         (EventExpr.InstanceResolve): Likewise.
8054         (EventExpr.DoResolve): Remove redundant checks.
8055
8056 2005-06-10  Duncan Mak  <duncan@novell.com>
8057
8058         * cs-tokenizer.cs (process_directives): New flag for controlling
8059         the processing of preprocessor directives.
8060         (x_token): After seeing a '#', return Token.NONE instead of going
8061         to handle_preprocessing_directive() when not processing
8062         directives. This avoids unnecessary processing during the token peek in
8063         is_punct().
8064
8065         This fixes #74939.
8066
8067         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
8068         the existing error reporting methods instead of Report.Error.
8069
8070         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
8071         after Raja's rewrite.
8072
8073 2005-06-08  Miguel de Icaza  <miguel@novell.com>
8074
8075         * class.cs: Small fix.
8076
8077 2005-06-08  Raja R Harinath  <rharinath@novell.com>
8078
8079         Fix #75160.
8080         * class.cs (GetPartialBases): Fix return value check of
8081         part.GetClassBases.
8082
8083 2005-06-07  Raja R Harinath  <rharinath@novell.com>
8084
8085         Ensure that partial classes are registered in their enclosing
8086         namespace.  Initial part of fix of #75160.
8087         * tree.cs (Tree.RecordDecl): Add new namespace argument.
8088         Register declspace with namespace here, not in
8089         DeclSpace.RecordDecl.
8090         * cs-parser.jay: Pass namespace to RecordDecl.
8091         * class.cs (PartialContainer.Create): Likewise.
8092         (ClassPart.DefineType): New sanity-check.  Throws an exception if
8093         called.
8094         * decl.cs (Declspace.RecordDecl): Remove.
8095         * namespace.cs (NamespaceEntry.DefineName): Remove.
8096
8097 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
8098
8099         * rootcontext.cs: Reset TargetExt as well.
8100
8101 2005-06-03  Raja R Harinath  <rharinath@novell.com>
8102
8103         * ecore.cs (Expression.Resolve): Emit CS0654 error when
8104         -langversion:ISO-1.
8105
8106 2005-06-02  Raja R Harinath  <rharinath@novell.com>
8107
8108         Fix #75080, cs0119.cs.
8109         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
8110         of ...
8111         (Expression.Resolve): ... this.  Use it.  Remove bogus code
8112         allowing ExprClass.Type and ExprClass.Namespace for
8113         ResolveFlags.VariableOrValue.
8114         (Expression.Resolve) [1-argument variant]: Change default resolve
8115         flags based on language version.
8116         (Expression.Error_UnexpectedKind): Use a simple string array
8117         rather than an ArrayList.
8118         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
8119         not ExprClass.Type.
8120         (TypeOfVoid.DoResolve): Likewise.
8121         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
8122         flags argument -- it always has the same value.
8123
8124 2005-05-31  Raja R Harinath  <rharinath@novell.com>
8125
8126         Fix #75081.
8127         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
8128         Use it in the error message.
8129         * assign.cs, expression.cs, statement.cs: Update.
8130
8131 2005-05-30  Raja R Harinath  <rharinath@novell.com>
8132
8133         Fix #75088.
8134         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
8135         the "almostMatchedMember" case too.
8136         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
8137         that failed the accessibility checks to 'almost_match'.
8138
8139 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
8140
8141         * attribute.cs: Use internal MethodBuilder methods to set
8142         ExactSpelling and SetLastError on PInvoke methods, instead
8143         of passing them via charset.  Fixes #75060.
8144
8145 2005-05-27  Raja R Harinath  <rharinath@novell.com>
8146
8147         * parameter.cs (Parameter): Remove TODO comment.
8148         (Parameter.DefineParameter): Remove Location parameter.
8149         (Parameters.LabelParameters): Likewise.
8150         * class.cs (Constructor.Emit): Update to change.
8151         (MethodData.Emit): Likewise.
8152         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
8153         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
8154
8155 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
8156
8157         * parameter.cs,
8158           Removed Parameters.Location and added Parameter.Location instead.
8159           Removed Location parameter from Emit() and GetSignature().
8160         * anonymous.cs,
8161           class.cs,
8162           cs-parser.jay,
8163           delegate.cs,
8164           iterators.cs,
8165           statement.cs :
8166           Modified all related calls.
8167
8168 2005-05-26  Raja R Harinath  <rharinath@novell.com>
8169
8170         Improve user-defined conversion handling.
8171         * convert.cs (GetConversionOperators): Rewrite.  Return only the
8172         applicable operators.
8173         (AddConversionOperators): New.  Helper for GetConversionOperators.
8174         (FindMostEncompassedType, FindMostEncompassingType): Verify that
8175         there is only one most encompassed/encompassing type.
8176         (FindMostSpecificSource, FindMostSpecificTarget): Remove
8177         "applicable operator" handling.
8178         (UserConversion): Move cache here from GetConversionOperators.
8179         Directly cache the chosen operator, rather than the whole
8180         MethodGroup.
8181         (ExplicitNumericConversion): Fix buggy implementation of Decimal
8182         case.  Allow conversion of decimal to sbyte and byte too.
8183         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
8184         New static methods.  Used to avoid allocating EmptyExpressions in
8185         convert.cs.
8186
8187 2005-05-24  Duncan Mak  <duncan@novell.com>
8188
8189         * ecore.cs (CastFromDecimal): New class for casting a decimal to
8190         another class, used in Convert.ExplicitNumericConversion.
8191         (CastToDecimal): New class, similar to above, but casts to
8192         System.Decimal, used in Convert.ImplicitNumericConversion and also
8193         in explicit convesion from double/float to decimal.
8194
8195         * convert.cs (ImplicitNumericConversion): Handle implicit
8196         conversions to System.Decimal.
8197         (ExplicitNumericConversion): handle explicit conversions to
8198         System.Decimal.
8199
8200         This fixes #68711.
8201         
8202 2005-05-20  Miguel de Icaza  <miguel@novell.com>
8203
8204         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
8205         know the type at this stage, just break through.   Fixes #75008 
8206
8207 2005-05-19  Martin Baulig  <martin@ximian.com>
8208
8209         * delegate.cs
8210         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
8211         to disable error reporting.
8212
8213         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
8214         here since we don't want to report an error; see the new test-336.cs.
8215
8216 2005-05-19  Raja R Harinath  <rharinath@novell.com>
8217
8218         * statement.cs (ToplevelBlock.GetParameterReference)
8219         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
8220         Move here from class Block.
8221         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
8222         * expression.cs (ParameterReference.DoResolveBase): Likewise.
8223
8224 2005-05-18  Martin Baulig  <martin@ximian.com>
8225
8226         Fix #74978.
8227
8228         * flowanalysis.cs
8229         (FlowBranching.Reachability): Add non-static public And() and Or()
8230         methods.
8231         (FlowBranchingSwitch): New class; do the `break_origins' thing
8232         like in FlowBranchingLoop.
8233         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
8234         reachability, not just locals and parameters.
8235         (FlowBranching.MergeChild): Remove some of the hacks for loop and
8236         switch; MergeBreakOrigins() now takes care of that.
8237
8238 2005-05-18  Martin Baulig  <martin@ximian.com>
8239
8240         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8241         a loop and may leave it, reset the barrier; fixes #74974.
8242
8243 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
8244         
8245         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
8246         is back.
8247         
8248         * cs-parser.jay: Catch more lexical errors.
8249         
8250         * report.cs: Add one more Error method.
8251         
8252         * rootcontext.cs,
8253         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
8254
8255 2005-05-17  Martin Baulig  <martin@ximian.com>
8256
8257         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
8258         #70970. 
8259
8260 2005-05-16  Raja R Harinath  <rharinath@novell.com>
8261
8262         Fix test-382.cs.  Emit values of decimal constants.
8263         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
8264         Carved out of ...
8265         (TypeContainer.AddField): ... this.
8266         (TypeContainer.EmitFieldInitializers): Allow the list of fields
8267         with initializers to include 'Const's.
8268         (ClassPart.RegisterFieldForInitialization): Forward to
8269         PartialContainer.
8270         * const.cs (Const.Const): Pass initializer to base class.
8271         (Const.Define): In case of decimal constants, register them for
8272         initialization in a static constructor.
8273
8274 2005-05-14  Martin Baulig  <martin@ximian.com>
8275
8276         * statement.cs (Block.Resolve): Correctly handle unreachable code;
8277         do not call ResolveUnreachable() on unreachable statements in
8278         here, see the comment in the source code.
8279
8280 2005-05-13  Raja R Harinath  <rharinath@novell.com>
8281
8282         Fix #74934.
8283         * expression.cs (BinaryResolveOperator): If one of the operands of
8284         an equality comparison is 'null' and the other is a pointer type,
8285         convert the null to a NullPointer.
8286         * convert.cs (ImplicitReferenceConversion): If the expression is a
8287         NullLiteral and the target type is a pointer type, return a
8288         NullPointer instead.
8289         (ImplicitConversionStandard): Likewise.
8290
8291 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
8292         
8293         * cs-parser.jay: Set readonly context based on special constructs.
8294         
8295         * expression.cs (LocalVariableReference.DoResolveBase): Improved
8296         readonly variable error handling.
8297         
8298         * rootcontext.cs (EmitCode): Don't verify members when error
8299         occurred.
8300         
8301         * statement.cs (LocalInfo): Add reaodnly context information.
8302         (SetReadOnlyContext, GetReadOnlyContext): New methods.
8303
8304 2005-05-13  Raja R Harinath  <rharinath@novell.com>
8305
8306         * statement.cs (Block.Resolve): Revert change below.  Modify fix
8307         for #74041 to initialize 'resolved' to false only for explicit
8308         blocks.  Fixes #74873.
8309
8310 2005-05-12  Raja R Harinath  <harinath@gmail.com>
8311
8312         Fix #74920.
8313         * typemanager.cs (unmanaged_enclosing_types): New.
8314         (IsUnmanagedType): Avoid infloops by using
8315         'unmanaged_enclosing_types' to talk with recursive invocations.
8316
8317 2005-05-13  Martin Baulig  <martin@ximian.com>
8318
8319         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
8320         instance variable, not a local.  Fix #74873.
8321         (Block.ResolveUnreachable): Set it to true here.
8322
8323 2005-05-11  Duncan Mak  <duncan@novell.com>
8324
8325         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
8326         continuing to process for 'arg'.
8327         (handle_preprocessing_directive): Check the argument of the #endif
8328         directive and report error CS1025 if there are any trailing
8329         characters.
8330
8331         According to the C# spec, having even whitespace after the #endif
8332         directive is illegal; however, because we call arg.TrimEnd ()
8333         beforehand, we have the same behavior as csc, allowing whitespace
8334         after the directive.
8335
8336         Fixes #74892.
8337
8338 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
8339
8340         Fix #74863.
8341         
8342         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
8343         (Constructor.GetObsoleteAttribute): Implemented correctly.
8344
8345 2005-05-10  Martin Baulig  <martin@ximian.com>
8346
8347         * support.cs (ReflectionParameters.ParameterModifier): Use
8348         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
8349         and `ParameterAttributes.In'.  Fixes #74884.
8350
8351 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
8352
8353         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
8354         
8355         * expression.cs (Argument.GetParameterModifier): Turned to property.
8356         (Invocation.Error_InvalidArguments): Add more descriptive errors.
8357         
8358         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
8359         its C# equivalent.
8360         
8361 2005-05-09  Raja R Harinath  <rharinath@novell.com>
8362
8363         Fix #74852.
8364         * decl.cs (MemberCache.AddMethods): Register override methods,
8365         rather than non-override methods.
8366         * typemanager.cs (RegisterOverride): New.
8367         (IsOverride): Update.
8368
8369 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
8370
8371         Fix #73105.
8372         
8373         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
8374         recursive declaration.
8375         
8376         * statement.cs (Block.ResolveMeta): Report any error in resolving.
8377         
8378 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
8379
8380         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
8381         
8382         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
8383
8384 2005-05-05  Raja R Harinath  <rharinath@novell.com>
8385
8386         Fix #74797.
8387         * decl.cs (DeclSpace.FamilyAccessible): 
8388         Use TypeManager.IsNestedFamilyAccessible.
8389
8390         Fix reopened #64812.
8391         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
8392         internal'.
8393
8394 2005-05-04  Raja R Harinath  <rharinath@novell.com>
8395             Abin Thomas  <projectmonokochi@rediffmail.com>
8396             Anoob V E  <projectmonokochi@rediffmail.com>
8397             Harilal P R  <projectmonokochi@rediffmail.com>
8398
8399         Fix #64812.
8400         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
8401         allow access to all static members.
8402
8403 2005-05-04  Martin Baulig  <martin@ximian.com>
8404
8405         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
8406
8407 2005-05-04  Martin Baulig  <martin@ximian.com>
8408
8409         Fix #74655.
8410
8411         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
8412         section at the end; make things work if `default' is not the last
8413         section.        
8414
8415 2005-05-04  Martin Baulig  <martin@ximian.com>
8416
8417         Fix #70400.
8418
8419         * statement.cs (Switch): Replaced the `got_default' field with a
8420         `default_section' one.
8421         (Switch.CheckSwitch): Set `default_section' here.
8422         (Switch.Resolve): If we're a constant switch and the constant is
8423         not found, use the default section.
8424
8425 2005-05-03  Martin Baulig  <martin@ximian.com>
8426
8427         * expression.cs (ArrayAccess.EmitGetLength): New public method.
8428
8429         * statement.cs (Foreach.ArrayForeach): New nested class.
8430         (Foreach.TemporaryVariable): New nested class.
8431         (Foreach.EmitArrayForeach): Removed; this is now in the new
8432         ArrayForeach class.
8433
8434 2005-05-03  Raja R Harinath  <rharinath@novell.com>
8435
8436         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
8437         more conservative.
8438         (VerifyPendingMethods): Revert change below.
8439
8440         * typemanager.cs (IsOverride, RegisterNonOverride): New.
8441         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
8442         that used to trigger warning -28.  Remove warning -28.
8443         * expression.cs (Invocation.OverloadResolve): Use
8444         TypeManager.IsOverride to distinguish override methods.
8445
8446         Fix #74773.
8447         * pending.cs (VerifyPendingMethods): If a base type implements the
8448         requested interface, don't bother checking individual methods of
8449         the base type.  As a side-effect, this prevents the creation of
8450         unnecessary proxies.
8451
8452 2005-05-02  Martin Baulig  <martin@ximian.com>
8453
8454         Fix #70182.
8455
8456         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8457         Also `And' the locals if the old vector is null.
8458         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
8459         null; in this case we basically reset all the variables.        
8460
8461 2005-05-02  Martin Baulig  <martin@ximian.com>
8462
8463         Fix #74529.
8464
8465         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
8466         Added `FlowBranching branching' argument; always `and' the
8467         variables instead of `or'ing them unless we're an infinite loop.
8468
8469         * statement.cs (While.Resolve): Create a new sibling unless we're
8470         infinite.       
8471
8472 2005-05-02  Martin Baulig  <martin@ximian.com>
8473
8474         Fix #70140.
8475
8476         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
8477         arguments; use it instead of creating a new TopLevelBlock.
8478         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
8479         our ConstructorInitializer.
8480
8481         * statement.cs
8482         (TopLevelBlock.TopLevelBranching): New public property.
8483         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
8484         and create our `TopLevelBranching'.
8485
8486         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
8487         anonymous method host, use `block.TopLevelBranching' rather than
8488         creating a new branching.
8489
8490 2005-04-20  Miguel de Icaza  <miguel@novell.com>
8491
8492         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
8493         a ScopeInfo, if any of the current children is a child of the new
8494         entry, move those children there.
8495
8496 2005-04-30  Martin Baulig  <martin@ximian.com>
8497
8498         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
8499         at the beginning of a SwitchSection.  Fix #73335.
8500
8501 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
8502
8503         Fix #74378
8504         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
8505         
8506         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
8507         (FieldExpr.DoResolve): Obsolete members are ignored for field
8508         initializers.
8509         
8510 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
8511
8512         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
8513         of arrays detection.
8514
8515         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
8516         verification.
8517         (Field.VerifyClsCompliance): Volatile fields are not compliant.
8518
8519         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
8520         arrays report.
8521
8522 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
8523
8524         * cs-parser.jay: Use the prefered version of -unsafe in error
8525         message.
8526
8527 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
8528
8529         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
8530         circumstances.
8531
8532 2005-04-20  John Luke  <john.luke@gmail.com>
8533
8534         * driver.cs: fix typo in error message, --outout to --output
8535
8536 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
8537
8538         * codegen.cs (InRefOutArgumentResolving): New field.
8539         
8540         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
8541         fields outside contructor.
8542         
8543         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
8544         
8545 2005-04-19  Miguel de Icaza  <miguel@novell.com>
8546
8547         * anonymous.cs (CaptureContext.EmitParameterInstance): The
8548         parameter code was not completed ever, so it was not as up-to-date
8549         as local variables.  Must finish it.
8550
8551         The bug fix was to compare the Toplevel of the block, not the
8552         current block.  Thanks for Ben for pointing this out. 
8553
8554 2005-04-19  Raja R Harinath  <rharinath@novell.com>
8555
8556         * decl.cs (AddMethods): Use the declaring type of the problem
8557         method to determine if we want to squash a warning.
8558
8559 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
8560
8561         * attribute.cs: Removed debug output.
8562
8563         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
8564         
8565         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
8566         Report.Stderr.
8567         
8568 2005-04-18  Raja R Harinath  <rharinath@novell.com>
8569
8570         Fix #74481.
8571         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
8572         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
8573         all null comparisons against reference types.
8574
8575 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
8576
8577         Fix# 74565
8578         * class.cs (TypeContainer.CircularDepException) New nested
8579         exception class.
8580         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
8581         (TypeContainer.DefineType): Removed error, reset InTransit before
8582         exit.
8583         (Class.DefineType): Throw exception when is in Transit.
8584         Catch exception and report error.
8585         (Struct.DefineType): Throw exception when is in Transit.
8586         Catch exception and report error.
8587         (Interface.DefineType): Throw exception when is in Transit.
8588         Catch exception and report error.
8589
8590         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
8591         handle nested exception handlers.
8592
8593         * flowanalysis.cs (InTryWithCatch): New method, search for try with
8594         a catch.
8595
8596         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
8597         InFinally and InCatch storage.
8598
8599         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
8600         (Catch.Resolve): Set and Restore ec.InCatch.
8601         (Try.Resolve): Set and Restore ec.InFinally.
8602         (Try.HasCatch): True when try has catch.
8603
8604 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
8605
8606         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
8607           for the same event member, so exclude such cases from warning 419.
8608           Fixed bug #74633.
8609
8610 2005-04-16  Miguel de Icaza  <miguel@novell.com>
8611
8612         * expression.cs (Binary.ResolveOperator): Apply patch from John
8613         Luke to fix bug 59864: operators &, | and ^ on enumerations
8614         require that the same enum type on both sides.
8615
8616         * driver.cs: Add warnings to old flag usage, this is to assist
8617         people who produce Makefiles and hope that the Makefiles will be
8618         used on Windows.
8619
8620         * class.cs (TypeContainer.EmitType): Moved the definition of the
8621         special $PRIVATE$ field from the resolve phase to the Emit phase.
8622         During resolve we do not know if we are a struct with
8623         HasExplicitLayout, we know this only after the attributes for the
8624         type are emitted.
8625
8626         Set the FieldOffset to zero on the dummy field that we create for
8627         the class.   Fixes 74590.
8628
8629 2005-04-16  Raja R Harinath  <rharinath@novell.com>
8630
8631         Fix #73834.
8632         * ecore.cs (PropertyExpr.resolved): New.
8633         (DoResolve): Use it to handle a case of double resolution here.
8634         Handle a case of identical-name-and-type-name.
8635         * expression.cs (ArrayCreation.CheckIndices): Avoid double
8636         resolution by storing the results of expression resolution back
8637         into the "probes" array.
8638
8639 2005-04-15  Raja R Harinath  <rharinath@novell.com>
8640
8641         Fix cs0208-7.cs and cs0208-8.cs.
8642         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
8643         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
8644         error reporting to point out the reason a struct is not unmanaged.
8645
8646 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
8647
8648         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
8649           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
8650
8651 2005-04-13  Raja R Harinath  <rharinath@novell.com>
8652
8653         Fix #74528.
8654         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
8655         IdenticalNameAndTypeName here.
8656         (EventExpr.InstanceResolve): Likewise.
8657
8658 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
8659
8660         C# 2.0 DefaultCharSetAttribute implementation
8661         
8662         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
8663         which allows us to set GlobalNamespace for every resolve.
8664         (Attribute.ResolveArguments): Cut from Resolve.
8665         (Attribute.GetCharSetValue): Returns CharSet named argument.
8666         (Attribute.DefinePInvokeMethod): Gets default charset from
8667         module settings.
8668         (GlobalAttribute.ResolveAsTypeStep): Override.
8669         (GlobalAttribute.ResolveArguments): Override.
8670         
8671         * class.cs (TypeAttr): Is protected.
8672         
8673         * codegen.cs (ModuleClass.DefaultCharSet): New member.
8674         (ModuleClass.DefaultCharSetType): New memeber.
8675         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
8676         
8677         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
8678         charset from module.
8679         
8680         * delegate.cs (TypeAttr): Override.
8681         (Delegate.DefineType): Use this TypeAttr.
8682         
8683         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
8684         at very early stage (before types are defined) to resolve model
8685         module attributes. It will probably not work with corlib but it
8686         should be ok.
8687         
8688         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
8689         charset from module.
8690         
8691         * typemanager.cs (default_charset_type): New type.
8692
8693 2005-04-13  Raja R Harinath  <rharinath@novell.com>
8694
8695         * decl.cs (MemberCache.AddMethods): Don't warn if
8696         System.Object.Finalize has buggy MethodAttributes.
8697
8698         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
8699         removed below.
8700
8701 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
8702
8703         * doc.cs : detect ambiguous reference to overloaded members.
8704           Fixed bug #71603. MS 1.1 csc does not detect it.
8705
8706 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
8707
8708         * doc.cs : delegates must not be referenced with parameters.
8709           Fixed bug #71605.
8710
8711 2005-04-12  Miguel de Icaza  <miguel@novell.com>
8712
8713         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
8714
8715 2005-04-10  Miguel de Icaza  <miguel@novell.com>
8716
8717         * driver.cs (MainDriver): Stop processing if the CLS stage found
8718         errors. 
8719
8720         (CompilerCallableEntryPoint.InvokeCompiler): Always
8721         reset after execution;   Take a TextWriter argument for the
8722         output.
8723
8724         * report.cs: Use the error stream instead of hardcoding stderr. 
8725
8726 2005-04-09  Miguel de Icaza  <miguel@novell.com>
8727
8728         * class.cs: Reduce code paths to test, too small of an
8729         optimization to make it worth the extra testing.  Always perform
8730         it. 
8731
8732 2005-04-08  Raja R Harinath  <rharinath@novell.com>
8733
8734         Fix #74510.
8735         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
8736         operators that had errors reported on them.
8737
8738 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
8739
8740         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
8741         argument types.
8742         (Attribute.Resolve): Add named argument type checking.
8743         
8744         * class.cs (FixedField.Define): Use IsPrimitiveType
8745         
8746         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
8747         
8748         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
8749         unsafe parameter types.
8750         
8751         * statement.cs (Using.ResolveExpression): Add better error description.
8752         
8753         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
8754         
8755 2005-04-08  Raja R Harinath  <rharinath@novell.com>
8756
8757         Fix #74484.
8758         * attribute.cs (Attribute.GetAttributeUsage): Resolve
8759         AttributeUsageAttribute in the emitcontext of the attribute class,
8760         not in the emitcontext of the attributable entity it was attached to.
8761         * cs-parser.jay: Use 'current_class', not 'current_container',
8762         when creating a GlobalAttribute.
8763
8764 2005-04-08  Alp Toker  <alp@atoker.com>
8765
8766         * pending.cs: The fix to #58413 failed to compile methods implementing
8767         interfaces with/without params modifiers and vice versa, even though
8768         params modifiers aren't part of the signature. Make the modifier check
8769         less strict as in csc.
8770
8771 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
8772             Anoob V E  <projectmonokochi@rediffmail.com>
8773             Harilal P R  <projectmonokochi@rediffmail.com>
8774
8775         Fix #58413.
8776         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
8777         modifiers of pending methods.
8778         (PendingImplementation.PendingImplementation): Initialize it.
8779         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
8780         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
8781         with ParameterData.  Add check for modifiers.
8782         * class.cs (MethodData.Define): Update to changes.
8783
8784 2005-04-07  Raja R Harinath  <rharinath@novell.com>
8785
8786         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
8787
8788 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
8789
8790         * class.cs (PropertyMethod.Define): Check private accessor in abstract
8791         property.
8792         
8793         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
8794         
8795         * rootcontext.cs,
8796         * typemanager.cs: Registered RequiredAttributeAttribute.
8797         
8798 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
8799
8800         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
8801         Warning CS0169 is back at level 3.
8802         (IMethodData.SetMemberIsUsed): New method.
8803         
8804         * decl.cs (IsUsed): New value; moved from FieldBase.Status
8805         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
8806         
8807         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
8808
8809         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
8810         contants.
8811         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
8812         is used.
8813         
8814         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
8815         is used.
8816         
8817         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
8818         to avoid the problems with nested types.
8819
8820 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
8821             Anoob V.E  <projectmonokochi@rediffmail.com>
8822             Harilal P.R  <projectmonokochi@rediffmail.com>
8823             Raja R Harinath  <rharinath@novell.com>
8824
8825         Fix #73820.
8826         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
8827         attribute.
8828         * typemanager (GetConstructor): Make public.
8829
8830 2005-04-05  John Luke  <john.luke@gmail.com>
8831             Raja R Harinath  <rharinath@novell.com>
8832
8833         Fix #62232.
8834         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
8835         struct too.  Return false quicker in a few cases.
8836         (VerifyUnManaged): Use it.
8837
8838 2005-04-05  Raja R Harinath  <rharinath@novell.com>
8839
8840         Fix #74041.
8841         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
8842         not 'unreachable_seen'.
8843
8844 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
8845
8846         * attribute.cs (Attribute.GetValue): Removed unused.
8847         
8848         * codegen.cs (CodeGen.TrimExt): Removed unused.
8849         
8850         * cs-parser.jay (output): Removed unused.
8851         
8852         * cs-tokenizer.cs (hex_digits): Removed unused.
8853         
8854         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
8855         
8856         * expression.cs (Indirection.LoadExprValue): Removed unused.
8857         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
8858         
8859         * iterators.cs (Iterator.param_types): Removed unused.
8860         
8861         * statement.cs (Goto.block): Removed unused.
8862         (ToplevelBlock.did): Removed unused.
8863         (Switch.ResolveConstantSwitch): Removed unused.
8864
8865 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
8866
8867         * rootcontext.cs: Allow mcs to bootstrap with the compilation
8868         resetting thingy.
8869
8870 2005-04-01  Raja R Harinath  <rharinath@novell.com>
8871
8872         Fix #74232 and cs0208-3.cs.
8873         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
8874         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
8875         unmanaged type.  Don't use FieldBuilders when 't' is a
8876         TypeBuilder.  Use ModFlags and MemberType fields.
8877         * class.cs (MemberBase.member_type): Rename from MemberType.
8878         (MemberBase.MemberType): New property.  Determines member_type on
8879         demand.
8880         (MemberBase.DoDefine): Don't initialize MemberType here.
8881         (FieldMember.Define): Likewise.
8882
8883 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
8884
8885         Fix #74241
8886         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
8887         Attributes are emitted there.
8888         
8889 2005-04-01  Raja R Harinath  <rharinath@novell.com>
8890
8891         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
8892         keyword in 'partial enum' too.
8893         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
8894         is not allowed).
8895         Report from Kamil Skalski <nazgul@omega.pl>.
8896
8897         Fix #74309.
8898         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
8899         have partial containers too.
8900
8901         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
8902         in block' checks to Block.CheckInvariantMeaningInBlock.
8903         * statement.cs (Block.GetKnownVariableInfo): Make private.
8904         (Block.IsVariableUsedInChildBlock): Remove.
8905         (Block.IsVariableUsedInBlock): Likewise.
8906         (Block.CheckInvariantMeaningInBlock): New.  Show location of
8907         conflicting declaration.
8908         (Block.AddVariable): Make error messages less long-winded and more
8909         specific.  Show location of conflicting declaration.
8910         * parameter.cs (Parameters.Location): New readonly property.
8911
8912 2005-03-31  Raja R Harinath  <rharinath@novell.com>
8913
8914         Clean up semantics of invoking ResolveMemberAccess.
8915         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
8916         can have an instance, ensure that we pass in a non-TypeExpression
8917         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
8918         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
8919         argument.  Update to changes and simplify.
8920         (FieldExpr.Emitinstance): Remove CS0120 check.
8921         (PropertyExpr.EmitInstance): Likewise.
8922         * expression.cs (Argument.Resolve): Likewise.
8923         (Invocation.DoResolve): Update to changes in semantics of
8924         InstanceExpression.
8925
8926 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
8927
8928         Fix #74241
8929         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
8930         customization.
8931         
8932         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
8933
8934 2005-03-31  Raja R Harinath  <rharinath@novell.com>
8935
8936         Fix difference in behaviour with commandline invocation.
8937         * driver.cs (Driver.Reset): New.
8938         (CompilerCallableEntryPoint): Call it.
8939
8940         * statement.cs (If.Resolve): Avoid spurious "uninitialized
8941         variable" warnings if the boolean expression failed to resolve.
8942
8943 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
8944
8945         * attribute.cs: Fix the union of several permissions when some of them
8946         are unrestricted (so the result isn't an unrestricted permission set).
8947         Fix #74036.
8948
8949 2005-03-30  Raja R Harinath  <rharinath@novell.com>
8950
8951         * ecore.cs (MemberExpr): New class.  Convert from interface
8952         IMemberExpr.
8953         (MemberExpr.ResolveMemberAccess): Refactor and move here from
8954         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
8955         error checks.
8956         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
8957         (MethodGroupExpr.IsExplicitImpl): Remove.
8958         (Expression.GetFieldFromEvent): Remove.
8959         (SimpleName.MemberStaticCheck): Remove.
8960         (SimpleName.DoSimpleNameResolve): Update to changes.
8961         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
8962         (MemberAccess.IdenticalNameAndTypeName): Remove.
8963         (MemberAccess.error176): Move to MemberExpr.
8964         (MemberAccess.DoResolve): Update to changes.
8965         (BaseAccess.DoResolve): Likewise.
8966
8967 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
8968
8969         C# 2.0 Conditional attribute class implementation
8970         
8971         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
8972         Analyzes class whether it has attribute which has ConditionalAttribute
8973         and its condition is not defined.
8974         
8975         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
8976         (Class.IsExcluded): New method. Search for at least one defined
8977         condition in ConditionalAttribute of attribute class.
8978
8979 2005-03-30  Raja R Harinath  <rharinath@novell.com>
8980
8981         * ecore.cs (PropertyExpr): Derive from Expression, not
8982         ExpressionStatement.
8983         (PropertyExpr.EmitStatement): Remove.
8984
8985 2005-03-29  Raja R Harinath  <rharinath@novell.com>
8986
8987         Fix #74060.
8988         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
8989         internal field "value__" of an enum be private.  The examples for
8990         "value__" that I found on MSDN all used FieldAttributes.Private.
8991
8992         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
8993         Don't mention IL method attribute names.
8994
8995         Fix #47991.  Remove a TODO.
8996         * statement.cs (Block.Toplevel): Make into a field.
8997         (Block.Parameters): Move into ToplevelBlock.
8998         (Block.known_variables): Rename from child_variable_names.
8999         (Block.Block): Remove variants that take Parameters.  Initialize
9000         'Toplevel' with the immediately surrounding toplevel block.
9001         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
9002         LocalInfo parameter.
9003         (Block.GetKnownVariableInfo): New.
9004         (Block.IsVariableNameUsedInChildBlock): Update.
9005         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
9006         the block, even though it may not be in scope.
9007         (Block.AddVariable): Remove Parameters parameter.  Use
9008         Toplevel.Parameters instead.
9009         (Block.AddConstant): Remove Parameters parameter.
9010         (Block.GetParameterReference): Update to use Toplevel.Parameters.
9011         (Block.IsParamaterReference): Likewise.
9012         (Block.IsLocalParameter): Likewise.  Simplify a lot.
9013         (ToplevelBlock.Parameters): New.  Moved from Block.
9014         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
9015         initialize Parameters to a non-null value.
9016         * cs-parser.jay: Update to changes.
9017         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
9018         simple names that mean different things in the same block.  Use
9019         Block.IsVariableNameUsedInBlock.
9020
9021 2005-03-28  Raja R Harinath  <rharinath@novell.com>
9022
9023         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
9024         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
9025         GetTypeHandle.  It is possible for a reflected type to derive from
9026         a TypeBuilder (e.g., int[] derives from the TypeBuilder
9027         System.Array during mscorlib compilation).
9028         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
9029         contain a method_hash, don't create one either.  Don't create a
9030         deep copy of the base cache's method_hash.
9031         (MemberCache.SetupCache): Rename back from DeepCopy.
9032         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
9033         already initialized.  If we see an override function, add its
9034         underlying base virtual function to the member_hash too.
9035
9036         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
9037
9038 2005-03-26  Raja R Harinath  <harinath@acm.org>
9039
9040         Fix #73038.
9041         * assign.cs (Assign.DoResolve): When the RHS of an assignment
9042         fails to resolve, ensure that the LHS is still resolved as an
9043         lvalue.
9044
9045 2005-03-25  Raja R Harinath  <harinath@acm.org>
9046
9047         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
9048         ec.ContainerType.
9049         (Enum.current_ec): Remove.
9050         (Enum.LookupEnumValue): Remove EmitContext argument.
9051         Just uses the one created during DefineType.
9052         (Enum.FindMembers): Update.
9053         * expression.cs (MemberAccess.DoResolve): Update.
9054
9055 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
9056
9057         * assign.cs (Assign.DoResolve): Check for CS1717 when
9058         source and target are same (uses Equals).
9059
9060         * expression.cs (LocalVariableReference, ParameterReference,
9061         This): Implemented Equals, GetHashCode.
9062
9063         * statement.cs (Block.GetParameterReference): Removed useless
9064         local variable.
9065
9066 2005-03-22  Raja R Harinath  <rharinath@novell.com>
9067
9068         Fix cs0128.cs
9069         * statement.cs (Block.AddVariable): Ensure that we skip implicit
9070         blocks before deciding whether the error is cs0136 or cs0128.
9071
9072         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
9073         (using_alias_directive, using_namespace_directive): Pass
9074         MemberName, not an expression to Namespace.UsingAlias and
9075         Namespace.Using.
9076         (MakeName): Use the MemberName of the namespace.
9077         * namespace.cs (Namespace.MemberName): New.
9078         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
9079         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
9080         Likewise.
9081         * decl.cs (MemberName.Name): Make readonly.
9082         (MemberName.FromDotted): New "constructor".
9083         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
9084         (MemberCore.Name): Compute from MemberName on demand.
9085         (MemberCore.SetMemberName): Provide a way to change the
9086         MemberName.
9087         (MemberCore.AddToContainer): Don't take a fullname parameter.
9088         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
9089         fully qualified name of the container to the member name.
9090         (TypeContainer.AddToTypeContainer): Use a fully qualified name
9091         only if the type is a member of the root container.
9092         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
9093         MemberName.Left rather than searching for an embedded ".".
9094         (PartialContainer.CreatePart): Update to changes in RootContext.
9095         (MemberBase.ShortName): Turn into a property.  Use
9096         MemberCore.SetMemberName.
9097         (MemberBase.ExplicitInterfaceName): Remove.
9098         (MemberBase.UpdateMemberName): Remove.
9099         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
9100         (PropertyBase.SetMemberName): New override.
9101         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
9102         (Tree.GetDecl): New.
9103         (Tree.AllDecls): Rename from Decls.
9104         * attribute.cs, enum.cs, report.cs: Update to changes.
9105         * driver.cs (MainDriver): Use MemberName.FromDotted on
9106         RootContext.MainClass.
9107
9108 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
9109
9110         * class.cs (FixedField.Define): Check for CS1664 and more sanity
9111         checks.
9112
9113         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
9114
9115 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
9116
9117         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
9118         property accessor modifiers.
9119
9120         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
9121         fixed buffer attribute (CS1716).
9122         (PropertyMethod.HasCustomAccessModifier): When property accessor
9123         has custom modifier.
9124
9125         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
9126         modifiers.
9127         (PropertyExpr.DoResolveLValue): Add CS0272.
9128
9129 2005-03-17  Miguel de Icaza  <miguel@novell.com>
9130
9131         * convert.cs: When converting to a pointer, use the proper Conv.U
9132         or Conv.I depending on the source data type.
9133
9134         * cs-tokenizer.cs: Make the size for large decimal constants,
9135         fixes #72957.
9136
9137 2005-03-17  Martin Baulig  <martin@ximian.com>
9138
9139         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
9140         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
9141
9142 2005-03-17  Martin Baulig  <martin@ximian.com>
9143
9144         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
9145         to bool so we can return an error condition.
9146         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
9147         returned an error.
9148
9149 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
9150
9151         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
9152         attributes.
9153
9154 2005-03-16  Raja R Harinath  <rharinath@novell.com>
9155
9156         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
9157         Refactor to avoid traversing the list of assemblies, and to avoid
9158         string concatenation.
9159         * typemanager.cs (guid_attr_type): Remove.
9160         (negative_hits, pointers, references): Remove hashes.
9161         (type_hash): New.
9162         (GetConstructedType): New.  Uses type_hash to handle constructed
9163         types (arrays, references, pointers).
9164         (GetReferenceType, GetPointerType): Use it.
9165         (GetNestedType): New.  Uses type_hash to handle nested types of
9166         reflected types.
9167         (LookupType, LookupTypeDirect): Remove.
9168         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
9169         'types' hash and LookupTypeReflection directly.
9170         (params_string, params_object): Use GetConstructedType.
9171         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
9172         top-level types.
9173         (Namespace.Lookup): Use cached_types.
9174         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
9175         provided by old TypeManager.LookupType.
9176         * rootcontext.cs (MakeFQN): Remove.
9177         * decl.cs (DeclSpace.MakeFQN): Likewise.
9178         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
9179         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
9180         TypeManager.GetConstructedType.
9181         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
9182
9183 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
9184
9185         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
9186         indexers.
9187
9188         * cs-parser.jay: Reports CS1527 for any namespace element.
9189
9190         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
9191         Added CS0407.
9192
9193         * expression.cs (ParameterReference.IsAssigned): Changed error to
9194         CS0269.
9195         (Error_WrongNumArguments): Moved CS0245 detection here.
9196
9197         * statement.cs (Return.Resolve): Add CS1622 report.
9198
9199 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
9200
9201         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
9202
9203 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
9204
9205         * attribute.cs expression.cs: Get rid of some allocations.
9206
9207 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
9208
9209         * doc.cs : just eliminate the latest change.
9210
9211 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
9212
9213         * doc.cs : commented out the latest change. It breaks xml-030.cs
9214
9215 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
9216
9217         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
9218           fail. So invoke CreateType() in FindDocumentedType().
9219
9220 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
9221
9222         * cs-tokenizer.cs : added IsKeyword().
9223         * doc.cs : Detect keyword incorrectly used as identifier.
9224           Allow identifiers prefixed by @.
9225
9226 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
9227
9228         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
9229         It caused exception in namespace resolving (again!).
9230         
9231         * class.cs (Class.ctor): Removed exit.
9232         (PropertyMethod.ctor): ditto.
9233         
9234         * codegen.cs (Codegen.Reset): Reset static data.
9235         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
9236         
9237         * cs-tokenizer.cs (Cleanup): Removed.
9238         
9239         * driver.cs (GetSystemDir): Rewrote to one line command.
9240         It caused problem with unloaded dynamic modules.
9241         (UnixParseOption): Removed Exit.
9242         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
9243         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
9244         Now can be mcs used as library.
9245         
9246         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
9247         empty location.
9248         
9249         * location.cs (Reset): Reset static data.
9250         
9251         * namespace.cs (Reset): Reset static data.
9252         
9253         * report.cs (Report.Reset): Reset static data.
9254         
9255         * rootcontext.cs (RootContext.Reset): Reset static data.
9256         
9257         * tree.cs (RootTypes.ctor): Use Location.Null
9258         
9259         * typemanager.cs (TypeManager.Reset): Reset static data.
9260         (CoreLookupType): Removed Exit.
9261         (TypeHandle.Reset): Reset static data.
9262         
9263 2005-03-10  Raja R Harinath  <rharinath@novell.com>
9264
9265         Fix #73516.
9266         * typemanager.cs (ComputeNamespaces): Import namespaces from
9267         referenced modules too.
9268
9269 2005-03-09  Raja R Harinath  <rharinath@novell.com>
9270
9271         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
9272         than '.'.
9273
9274 2005-03-09  Raja R Harinath  <rharinath@novell.com>
9275
9276         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
9277         enclosing DeclSpace.  This ensures that a name-lookup populates
9278         more caches and there are fewer 'TypeExpression's.  Carve out
9279         nested type lookup into ...
9280         (LookupNestedTypeInHierarchy): ... this.
9281
9282 2005-03-09  Raja R Harinath  <rharinath@novell.com>
9283
9284         Clean up a few partial-class semantics.  
9285         Fixes test-357.cs and cs1618-2.cs.
9286         * cs-parser.jay (struct_declaration): Use 'current_class' as
9287         parent of newly-created struct.  Remove call to Register ().
9288         Use 'pop_current_class' to complete handing the current struct.
9289         (interface_declaration): Likewise.
9290         (class_declaration): Likewise.
9291         (enum_declaration): Use 'current_class' as parent of newly created
9292         enum.
9293         (delegate_declaration): Likewise.
9294         (pop_current_class): New function.  This is used to handle closing
9295         up the 'current_class' and 'current_container', and pointing them
9296         to the enclosing class/container.
9297         (CSharpParser): Initialize 'current_class' too.
9298         * decl.cs (MemberCore): Add check for invariant: a partial
9299         container is not a parsed entity, and thus does not enclose any
9300         parsed members.
9301         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
9302         (DeclSpace.BaseTypeExpr): Use it.
9303         (DeclSpace.LookupType): Add check for invariant.
9304         * class.cs (TypeContainer): Add check for invariant: a nested
9305         class should have the same NamespaceEntry as its enclosing class.
9306         (TypeContainer.EmitFieldInitializers): Make virtual.
9307         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
9308         MemberCore.
9309         (TypeContainer.Register): Remove.
9310         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
9311         null.  Use TypeResolveEmitContext for resolving base types and
9312         interfaces.  Move initialization of Parts.TypeBuilder here from
9313         ...
9314         (TypeContainer.DefineNestedTypes): ... here.
9315         (PartialContainer): Take a Namespace not a NamespaceEntry.
9316         (PartialContainer.Create): Don't use Register.  Call the
9317         appropriate Add... function directly.
9318         (ClassPart): Take both the PartialContainer and the enclosing
9319         class as constructor arguments.
9320         (ClassPart.EmitFieldInitializers): Override.
9321         (ClassPart.PartFindNestedTypes): Remove.
9322         (FieldBase.GetInitializerExpression): Resolve the initializer
9323         expression in the emit context of the enclosing class.
9324         * tree.cs (RootTypes): Remove Register ().
9325         
9326 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
9327
9328         * cs-parser.jay: Removed CS0134.
9329         
9330         * driver.cs: Removed CS1901.
9331         
9332         * expression.cs (SizeOf.DoResolve): Don't report CS0233
9333         for predefined types.
9334
9335 2005-03-07  Duncan Mak  <duncan@novell.com>
9336
9337         * codegen.cs (Save):  Catch UnauthorizedAccessException as
9338         well. Fixes bug #73454.
9339
9340 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
9341
9342         * cs-tokenizer.cs (xtoken): Add CS1035.
9343         
9344         * class.cs (MethodData.Define): Add CS0683.
9345         (FieldMember.ctor): Add CS0681.
9346
9347 2005-03-07  Raja R Harinath  <rharinath@novell.com>
9348
9349         * ecore.cs (SimpleName.DoResolve): Rename from
9350         SimpleName.DoResolveAllowStatic.
9351         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
9352         Pass 'intermediate' flag to MemberStaticCheck.
9353         (SimpleName.MemberStaticCheck): Skip "static check" only in case
9354         of "intermediate" lookups via MemberAccess.
9355         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
9356         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
9357
9358 2005-03-07  Raja R Harinath  <rharinath@novell.com>
9359
9360         Fix #73394.
9361         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
9362         slipped in because of variable names that are identical to a
9363         builtin type's BCL equivalent ('string String;', 'int Int32;').
9364         (PropertyExpr.EmitInstance): Likewise.
9365
9366 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
9367
9368         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
9369         
9370         * report.cs (warning_ignore_table): Made public.
9371
9372 2005-03-04  Raja R Harinath  <rharinath@novell.com>
9373
9374         Fix #73282.
9375         * class.cs (MethodData.Emit): Pass 'container' to
9376         container.GetObsoleteAttribute instead of 'container.Parent'.
9377
9378 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
9379
9380         * cs-parser.jay: Add 1534 error test.
9381
9382         * iterators.cs (Yield.CheckContext): Add error 1629.
9383         (Iterator.ctor): Save unsafe modifier.
9384         (MoveNextMethod.DoEmit): Restore unsafe context.
9385
9386         * namespace.cs (UsingAlias): Better error message.
9387
9388 2005-03-03  Dan Winship  <danw@novell.com>
9389
9390         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
9391         the warning message [#73219]
9392
9393 2005-03-03  Raja R Harinath  <rharinath@novell.com>
9394
9395         Fix compile with MCS 1.0.0.0.
9396         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
9397         w_restore to not depend on string constant folding.
9398
9399 2005-03-03  Raja R Harinath  <rharinath@novell.com>
9400
9401         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
9402         CS0246 check to users who passed 'silent = false'.
9403         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
9404         check.
9405         (SimpleName.SimpleNameResolve): Update.
9406         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
9407         (MemberAccess.IdenticalNameAndTypeName): Update.
9408         * doc.cs (FindDocumentedTypeNonArray): Update.
9409
9410 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
9411
9412         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
9413         * parameters.cs (ComputeAndDefineParameters): Remove.
9414         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
9415         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
9416         Use GetParameterInfo.
9417
9418 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
9419
9420         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
9421
9422 2005-03-02  Raja R Harinath  <rharinath@novell.com>
9423
9424         Unify DeclSpace.LookupType and DeclSpace.FindType.
9425         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
9426         is in charge of defining nested types on demand.
9427         (DeclSpace.LookupType): Use it when the current_type is a
9428         TypeBuilder.  Use LookupTypeDirect for reflected types.
9429         (DeclSpace.FindType): Remove.
9430         (DeclSpace.LookupInterfaceOrClass): Likewise.
9431         (DeclSpace.DefineTypeAndParents): Likewise.
9432         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
9433         DeclSpace.LookupType.
9434         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
9435         * typemanager.cs (LookupType): Simplify.
9436         (AddUserType): Remove type from negative_hits.
9437         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
9438         * class.cs (TypeContainer.FindMembers): Move handling of nested
9439         types ...
9440         (TypeContainer.FindMembers_NestedTypes): ... here.
9441         (TypeContainer.FindNestedType): Implement override.
9442         (ClassPart.FindNestedType): Delegate to PartialContainer.
9443         (ClassPart.PartFindNestedType): Looks up the nested types of the
9444         part alone.
9445
9446 2005-03-02  Martin Baulig  <martin@ximian.com>
9447
9448         * class.cs (TypeContainer.DoDefineMembers): We also need a default
9449         static constructor in static classes.
9450
9451 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
9452
9453         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
9454         sizeParamIndex is not specified.
9455
9456 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
9457
9458         Fix #73117
9459         * report.cs (WarningMessage.IsEnabled): Missing null check.
9460
9461 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
9462
9463         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
9464         in the fields and not in the properties.
9465
9466 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
9467
9468         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
9469         fields as well.
9470
9471 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
9472
9473         * attribute.cs: Small refactoring (improved robustness).
9474         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
9475         (ValidateGuid): Removed.
9476         (Resolve): Removed referenced to above mentioned.
9477         (GetAttributeUsage): Made private and changed to work without
9478         class assistance.
9479         (GetIndexerAttributeValue): Don't crash.
9480         (GetConditionalAttributeValue): Ditto.
9481         (GetClsCompliantAttributeValue): Ditto.
9482         (ExtractSecurityPermissionSet): All attributes exceptions are
9483         error 648.
9484         (GetPropertyValue): New helper.
9485         (GetMethodImplOptions): New method.
9486         (DefinePInvokeMethod): Reuse common code. Implemented handling of
9487         some missing properties.
9488         
9489         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
9490         (Method.ApplyAttributeBuilder): Updated.
9491         
9492         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
9493         exception.
9494
9495 2005-02-28  Raja R Harinath  <rharinath@novell.com>
9496
9497         Fix #73052.
9498         * report.cs (Report.SymbolRelatedToPreviousError): Handle
9499         non-simple types (array, pointer, reference).
9500
9501 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
9502
9503         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
9504
9505         * class.cs (MethodCore.IsDuplicateImplementation): Special error
9506         for operators.
9507         (Method.CheckBase): Catch wrong destructor here.
9508         (MethodData.Define): Add errors 550, 668.
9509
9510         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
9511
9512         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
9513
9514         * pending.cs (VerifyPendingMethods): Add error 551.
9515
9516         * typemanager.cs (CSharpName): Next error report helper.
9517
9518 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
9519
9520         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
9521         attributes. Removed useless attribute double check.
9522         It saves almost 2MBs for corlib.
9523
9524 2005-02-25  Raja R Harinath  <rharinath@novell.com>
9525
9526         Fix #72924.
9527         * statement.cs (ExpressionStatement.Resolve): Make robust to being
9528         called twice in case of error.
9529
9530 2005-02-23  Chris Toshok  <toshok@ximian.com>
9531
9532         Fix compiler portions of #72827.
9533         * statement.cs (Block.Emit): call Begin/EndScope on the
9534         EmitContext instead of the ILGenerator.
9535
9536         * codegen.cs (EmitContext.BeginScope): new method, call
9537         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
9538         we have one.)
9539         (EmitContext.BeginScope): same, but EndScope and CloseScope
9540
9541         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
9542         offset and call the superclass's OpenScope(int) with it.
9543         (SymbolWriter.CloseScope): get the current il
9544         offset and call superclass's CloseScope(int) with it.
9545
9546 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
9547
9548         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
9549         CS1677 for out and ref as well.
9550
9551         * class.cs (Method.Define): Add error CS1599 detection.
9552         
9553         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
9554         
9555         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
9556         
9557         * delegate.cs (Delegate.Define): Add error CS1599 detection.
9558         
9559         * support.cs.cs (ModifierDesc): New helper method.
9560
9561 2005-02-23  Raja R Harinath  <rharinath@novell.com>
9562             Abin Thomas  <projectmonokochi@rediffmail.com>
9563             Anoob V E  <projectmonokochi@rediffmail.com>
9564             Harilal P R  <projectmonokochi@rediffmail.com>
9565
9566         Fix #57851, #72718.
9567         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
9568         MemberLookup (used for error reporting) actually returns a result.
9569         Fix error report number (122, not 112).
9570
9571 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
9572             Anoob V E  <projectmonokochi@rediffmail.com>
9573             Harilal P R  <projectmonokochi@rediffmail.com>
9574
9575         Fix #71134.
9576         * pending.cs (PendingImplementation.GetAbstractMethods):
9577         Find NonPublic members too.
9578
9579 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
9580
9581         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
9582         Fixed error 217.
9583         
9584         * class.cs (MethodCore.CheckMethodAgainstBase):
9585         Add error 239 report.
9586
9587 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9588
9589         Fix #68955.
9590         * expression.cs (Invocation.IsApplicable): Make public.
9591         (Invocation.IsParamsMethodApplicable): Likewise.
9592         * delegate.cs (Delegate.VerifyApplicability): Don't use
9593         Invocation.VerifyArgumentCompat for parameter applicability
9594         testing.  Use Invocation.IsApplicable and
9595         Invocation.IsParamsMethodApplicable.
9596
9597 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
9598
9599         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
9600         
9601         * class.cs (Operator.Define): Add error 217 report.
9602         
9603 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9604
9605         * namespace.cs (UsingEntry.Resolve): Undo change below.
9606
9607 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9608
9609         Fix #72756.
9610         * ecore.cs (Expression.MemberLookupFailed): Add argument to
9611         disable the error message when the extended MemberLookup also
9612         fails.
9613         (Expression.MemberLookupFinal): Update.
9614         (SimpleName.DoSimpleNameResolve): Update.
9615         * expression.cs (MemberAccess.ResolveNamespaceOrType):
9616         Don't use MemberLookupFinal.
9617         (New.DoResolve): Update.
9618         (BaseAccess.CommonResolve): Update.
9619
9620 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9621
9622         Fix #72732.
9623         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
9624         occured previously, don't resolve again.
9625
9626 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
9627
9628         Fix #69949
9629         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
9630         argument. Call ResolveAttributeUsage for unresolved.
9631         when types doesn't match ctor arguments.
9632         
9633         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
9634         for nested attribute classes.
9635         (Class.attribute_usage): Removed.
9636         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
9637         for attribute class.
9638         
9639         * ecore.cs (IsAttribute): Removed.
9640         
9641         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
9642         
9643         * rootcontext.cs (RegisterAttribute): Removed, attributes are
9644         now normal types.
9645         (attribute_types): Removed.
9646         (EmitCode): Global attributes are emited as the latest.
9647
9648 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
9649
9650         * class.cs (EmitFieldInitializers): Don't emit field initializer
9651         for default values when optimilization is on.
9652         
9653         * constant.cs (Constant.IsDefaultValue): New property.
9654         
9655         * driver.cs: Add /optimize handling.
9656         
9657         * constant.cs,
9658         * ecore.cs,
9659         * literal.cs: Implement new IsDefaultValue property.
9660         
9661         * rootcontext.cs (Optimize): New field, holds /optimize option.
9662
9663 2005-02-18  Raja R Harinath  <rharinath@novell.com>
9664
9665         Fix crasher in re-opened #72347.
9666         * namespace.cs (Namespace.Lookup): Return null if
9667         DeclSpace.DefineType returns null.
9668
9669         Fix #72678.
9670         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
9671
9672 2005-02-18  Raja R Harinath  <rharinath@novell.com>
9673
9674         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
9675         now returns null if it cannot resolve to an lvalue.
9676         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
9677         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
9678         returned null.  Remove check for SimpleName.
9679         (EventExpr.DoResolveLValue): New.
9680         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
9681         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
9682         error from ...
9683         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
9684         avoid CS0131 error.
9685         (Unary.ResolveOperator): Move CS0211 check ...
9686         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
9687         CS0131 error.
9688         (Unary.DoResolveLValue): Simplify.
9689         (AddressOf.DoResolveLValue): New.
9690         (ArrayAccess.DoResolveLValue): New.
9691
9692 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
9693
9694         * attribute.cs (Attribute.Resolve): Add arguments casting for
9695         when types doesn't match ctor arguments.
9696
9697 2005-02-16  Raja R Harinath  <rharinath@novell.com>
9698
9699         Fix parts of #63202.
9700         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
9701         lookup of operator in base type.  Ensure that all checks happen
9702         when the operator resolves to an "op_..." method.
9703
9704 2005-02-15  Raja R Harinath  <rharinath@novell.com>
9705
9706         Fix #71992.
9707         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
9708         'ignore_cs0104' parameter.  Pass it to ...
9709         (NamespaceEntry.Lookup): ... this.
9710         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
9711         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
9712         (TypeLookupExpression.DoResolveAsTypeStep): Update.
9713         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
9714         Update.  Request that cs0104 errors be ignored.
9715         (ComposedCast.ResolveAsTypeStep): Update.
9716
9717 2005-02-14  Raja R Harinath  <rharinath@novell.com>
9718
9719         Fix #59209.
9720         * expression.cs (Invocation.BetterFunction): Remove support for
9721         comparing virtual functions and their overrides.
9722         (Invocation.IsOverride): New.
9723         (Invocation.OverloadResolve): Don't consider 'override' functions
9724         during candidate selection.  Store them in a lookaside list.
9725         If the selected method is a 'virtual' function, use the list to
9726         find any overrides that are closer to the LHS type.
9727
9728 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
9729
9730         * expression.cs (New.DoResolve): Add complex core type reduction.
9731         (New.Constantify): Converts complex core type syntax like 'new int ()'
9732         to simple constant.
9733         
9734 2005-02-14  Raja R Harinath  <rharinath@novell.com>
9735
9736         * decl.cs (EntryType.EntryType): New constructor to create an
9737         updated copy of a cache entry.
9738         (MemberCache.AddMethods): Use it.
9739         (MemberCache.ClearDeclaredOnly): Remove.
9740         (MemberCache.MemberCache): Update.
9741
9742 2005-02-11  Miguel de Icaza  <miguel@novell.com>
9743
9744         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
9745         variable.  This one is represents the actual low-level declaration
9746         of the method, as opposed to the semantic level `IsStatic'.   
9747
9748         An anonymous method which is hosted into a static method might be
9749         actually an instance method.  IsStatic would reflect the
9750         container, while MethodIsStatic represents the actual code
9751         generated.
9752
9753         * expression.cs (ParameterReference): Use the new MethodIsStatic
9754         instead of IsStatic.
9755
9756         * anonymous.cs (AnonymousMethod.Compatible): Pass the
9757         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
9758         set on the current EmitContext. 
9759
9760         * expression.cs (Cast): Overload DoResolveLValue so we can pass
9761         resolve our casted expression as an LValue.  This triggers the
9762         proper LValue processing that is later required by Assign.
9763
9764         This fixes 72347.
9765
9766         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
9767
9768 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
9769
9770         C# 2.0 Fixed buffer implementation
9771
9772         * anonymous.cs: Update after RegisterHelperClass renaming.
9773
9774         * attribute.cs (AttributeTester.fixed_buffer_cache):
9775         Cache of external fixed buffers.
9776         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
9777         implementation if field is fixed buffer else null.
9778
9779         * class.cs
9780         (TypeContainer.AddField): Accept FieldMember instead of Field.
9781         (FieldBase.IsFieldClsCompliant): Extracted code from
9782         VerifyClsCompliance descendant customization.
9783         (FixedField): New class handles fixed buffer fields.
9784         (FixedFieldExternal): Keeps information about imported fixed
9785         buffer.
9786         (IFixedField): Make access to internal or external fixed buffer
9787         same.
9788
9789         * cs-parser.jay: Add fixed buffer parsing.
9790
9791         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
9792         buffer.
9793
9794         * expression.cs (Indirection): Extended implementation to accept
9795         fixed buffer field.
9796         (PointerArithmetic.Emit): Get element from fixed buffer as well.
9797         (ElementAccess.MakePointerAccess): Get type as parameter.
9798         (DoResolve): Add fixed buffer field expression conversion.
9799         (DoResolveLValue): Ditto.
9800         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
9801         (ArrayPtr): Derives from FixedBufferPtr.
9802         (ArrayPtr.Emit): Add extra emit for array elements.
9803
9804         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
9805
9806         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
9807         for compiler generated types.
9808         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
9809
9810         * statement.cs (Fixed): Refactored to be easier add fixed buffer
9811         and consume less memory.
9812         (Fixed.Resolve): Add fixed buffer case.
9813
9814         * typemanager.cs (compiler_generated_attr_ctor,
9815         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
9816         (HasElementType): Add our own implementation to work on every
9817         runtime.
9818
9819 2005-02-11  Miguel de Icaza  <miguel@novell.com>
9820
9821         * anonymous.cs (CaptureContext): Track whether `this' has been
9822         referenced.   
9823
9824         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
9825         only captured `this' if it was implicitly done (instance
9826         methods/variables were used). 
9827
9828         * codegen.cs (EmitContext.CaptureThis): New method to flag that
9829         `this' must be captured.
9830
9831 2005-01-30  Miguel de Icaza  <miguel@novell.com>
9832  
9833         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
9834         is null it means that there has been no need to capture anything,
9835         so we just create a sibling.
9836
9837         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
9838
9839         Just a partial fix.  The other half is fairly elusive.
9840         
9841 2005-02-10  Raja R Harinath  <rharinath@novell.com>
9842
9843         Fix #52586, cs0121-4.cs.
9844         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
9845         and return a hashtable.
9846         (MemberCache.ClearDeclaredOnly): New.
9847         (MemberCache.MemberCache): Update to change.  Make a deep copy of
9848         the method_hash of a base type too.
9849         (MemberCache.AddMethods): Adapt to having a deep copy of the base
9850         type methods.  Overwrite entries with the same MethodHandle so
9851         that the ReflectedType is correct.  The process leaves in base
9852         virtual functions and their overrides as distinct entries.
9853         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
9854         matters since it was boxed in a ArrayList before.
9855         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
9856         modifier.
9857         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
9858         case of a virtual function and its override (choose the overload
9859         as better).
9860         (Invocation.OverloadResolve): Avoid 'override' members during
9861         'applicable_type' calculation.
9862
9863 2005-02-09  Raja R Harinath  <rharinath@novell.com>
9864
9865         Combine two near-redundant caches.
9866         * typemanager.cs (method_params): Rename from method_internal_params.
9867         (TypeManager.GetParameterData): New.  Replace
9868         Invocation.GetParameterData.
9869         (TypeManager.LookupParametersByBuilder): Remove.
9870         * expression.cs (Invocation.method_parameter_cache): Remove.
9871         (Invocation.GetParameterData): Remove.
9872         Update to changes.
9873         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
9874         Update to changes.
9875
9876 2005-02-08  Raja R Harinath  <rharinath@novell.com>
9877
9878         Fix #72015.
9879         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
9880         TypeManager.multicast_delegate_type is null, resolve it by looking
9881         up "System.MulticastDelegate".
9882         * rootcontext.cs (RootContext.ResolveCore): Simplify.
9883
9884 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
9885             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
9886             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
9887
9888         Fix cs0164.cs.
9889         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
9890         (LabeledStatement.AddReference): New.  Set 'referenced'.
9891         (Goto.Resolve): Use it.
9892
9893 2005-02-05  John Luke  <john.luke@gmail.com>
9894
9895         * driver.cs: remove duplicate -doc line in Usage ()
9896
9897 2005-02-04  Raja R Harinath  <rharinath@novell.com>
9898
9899         * location.cs (Location.AddFile): Fix CS2002 error report.
9900
9901 2005-02-02  Martin Baulig  <martin@ximian.com>
9902
9903         * delegate.cs (Delegate.DefineType): Report an internal error if
9904         TypeManager.multicast_delegate_type is null.  See bug #72015 for
9905         details.        
9906
9907 2005-02-02  Raja R Harinath  <rharinath@novell.com>
9908
9909         Fix a crasher in a variant of #31984.
9910         * const.cs (Constant.CheckBase): New override that defers the
9911         new-or-override check in case the base type hasn't been populated
9912         yet.
9913         (Constant.Define): Ensure the new-or-override check is performed.
9914
9915 2005-02-01  Duncan Mak  <duncan@ximian.com>
9916
9917         * const.cs (LookupConstantValue): Check that `ce' is not null
9918         before calling GetValue ().
9919
9920 2005-02-01  Raja R Harinath  <rharinath@novell.com>
9921
9922         Fix test-334.cs (#69519).
9923         * cs-parser.jay (using_alias_directive): Pass in an expression to
9924         NamespaceEntry.UsingAlias.
9925         (using_namespace_directive): Pass in an expression to
9926         NamespaceEntry.Using.
9927         (namespace_name): Don't flatten to a string.
9928         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
9929         (NamespaceEntry.AliasEntry.Resolve): Lookup using
9930         ResolveAsTypeStep.
9931         (NamespaceEntry.UsingEntry): Likewise.
9932         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
9933         changes.
9934         (NamespaceEntry.LookupForUsing): Remove.
9935         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
9936         names.
9937         (NamespaceEntry.Lookup): Remove support for dotted names.
9938
9939 2005-02-01  Raja R Harinath  <rharinath@novell.com>
9940
9941         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
9942         split into two.
9943         (NamespaceEntry.ImplicitParent): Compute on demand.
9944         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
9945         parallels the current.
9946         (NamespaceEntry.LookupForUsing): Use it.
9947         (NamespaceEntry.Lookup): If the current namespace-entry is
9948         implicit, don't search aliases and using tables.
9949
9950 2005-02-01  Raja R Harinath  <rharinath@novell.com>
9951
9952         Fix #31984.
9953         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
9954         BaseCache here.
9955         (TypeContainer.BaseCache): Compute on demand.
9956         (TypeContainer.FindMembers): Define constants and types if they're
9957         not already created.
9958         (FieldMember.Define): Move resetting of ec.InUnsafe before error
9959         check.
9960         * const.cs (Constant.Define): Make idempotent.
9961
9962 2005-01-29  Miguel de Icaza  <miguel@novell.com>
9963
9964         * pending.cs: Produce better code (no nops produced by using Ldarg
9965         + value).
9966         
9967         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
9968         i - 1' it should be arg + 1.
9969
9970         Fixes bug #71819.
9971
9972 2005-01-28  Raja R Harinath  <rharinath@novell.com>
9973
9974         * attribute.cs (Attribute.CheckAttributeType): Make private
9975         non-virtual.
9976         (Attribute.ResolveType): Make virtual.
9977         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
9978         handling of RootContext.Tree.Types.
9979
9980 2005-01-27  Raja R Harinath  <rharinath@novell.com>
9981
9982         Update attribute-handling to use the SimpleName/MemberAccess
9983         mechanisms.
9984         * cs-parser.jay (attribute): Pass in an expression to the
9985         constructors of Attribute and GlobalAttribute.
9986         * attribute.cs (Attribute): Take an expression for the name.
9987         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
9988         passed in attribute name expression.
9989         (Attribute.CheckAttributeType): Use it.
9990         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
9991         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
9992         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
9993         argument to prevent error messages if the lookup fails.
9994
9995 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
9996
9997         * expression.cs (Indirection): Implemented IVariable interface
9998         to support indirection in AddressOf operator.
9999         (PointerArithmetic.Emit): Add optimalization for case where
10000         result can be precomputed.
10001
10002 2005-01-26  Martin Baulig  <martin@ximian.com>
10003
10004         * class.cs (TypeContainer.AttributeTargets): Return the correct
10005         AttributeTargets depending on our `Kind' instead of throwing an
10006         exception; fixes #71632.
10007
10008 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
10009
10010         Fix #71257
10011         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
10012         constant members.
10013
10014 2005-01-25  Raja R Harinath  <rharinath@novell.com>
10015
10016         Fix #71602.
10017         * expression.cs (MemberAccess.DoResolve): Don't complain with
10018         cs0572 when the LHS of a member access has identical name and type
10019         name.
10020
10021 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
10022
10023         Fix #71651, #71675
10024         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
10025         CreatePermission.
10026         Create custom PermissionSet only for PermissionSetAttribute.
10027
10028 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
10029
10030         Fix #71649
10031         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
10032         delegates in static class.
10033
10034 2005-01-24  Martin Baulig  <martin@ximian.com>
10035
10036         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10037         merging an implicit block, just use its reachability.
10038
10039         * statement.cs (Block.Resolve): Make the unreachable code check
10040         work wrt. implicit blocks; see test-337 from #63842.
10041
10042 2005-01-21  Alp Toker  <alp@atoker.com>
10043  
10044         * cs-parser.jay: destructor_declaration's container is PartialContainer
10045         not Class when partial types are used, so use Kind prop instead of
10046         'is'.
10047         
10048 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
10049
10050         * cs-parser.jay: Improve error reporting when an interface
10051         declares new types.
10052
10053 2005-01-20  Dick Porter  <dick@ximian.com>
10054
10055         * support.cs: SeekableStreamReader fix from Sandor Dobos
10056         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
10057         chars are read.  Fixes bug 70369.
10058
10059 2005-01-20  Raja R Harinath  <rharinath@novell.com>
10060
10061         * cs-parser.jay (catch_clause): Simplify current_block handling
10062         somewhat.
10063
10064 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
10065
10066         * convert.cs (ImplicitStandardConversionExists): Synchronize the
10067         code with ImplicitStandardConversion to handle the implicit
10068         conversion of method groups into valid delegate invocations. 
10069
10070         The problem is that in parameter handling we were using this code
10071         path.  Fixes bug #64698
10072
10073 2005-01-19  Raja R Harinath  <rharinath@novell.com>
10074
10075         * cs-parser.jay: Fix several infelicities.
10076         - Avoid assigning to the parser value stack.  Code like 
10077           '$3 = null' is unclean.  Synthesize a value for the code block
10078           instead. 
10079         - Avoid using oob_stack for storing location information.  Use ...
10080         (_mark_): ... this.  New (empty) rule.  Saves the current location
10081         in $$.
10082         (foreach_statement): Avoid using oob_stack for current_block
10083         handling.  Use technique used in for_statement and
10084         using_statement.  Synthesize a value for the code block to store
10085         additional intermediate information.
10086
10087 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
10088
10089         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
10090         of a different type is only allowed to private fields of a
10091         containing type, not on fields of a base class.
10092
10093         See test-174.cs and error cs0122-9.cs
10094
10095 2005-01-13  Raja R Harinath  <rharinath@novell.com>
10096
10097         Fix test-335.cs (bug #58126).
10098         * cs-parser.jay (argument): Split out non-expression parts of the
10099         rule into 'non_simple_argument'.
10100         (invocation_expression): Support parenthesized invocations with
10101         multiple arguments, and with single non-simple arguments.
10102
10103 2005-01-13  Raja R Harinath  <rharinath@novell.com>
10104
10105         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
10106         places.
10107
10108 2005-01-12  Raja R Harinath  <rharinath@novell.com>
10109
10110         Fix cs0038-1.cs, cs1640-6.cs.
10111         * ecore.cs (Expression.Resolve): Remove special-case for
10112         SimpleName in error-handling.
10113         (Expression.almostMatchedMembers): Relax access permission to
10114         protected.
10115         (Expression.MemberLookupFailed): Handle duplicates in
10116         almostMatchedMembers list.
10117         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
10118         * expression.cs (New.DoResolve): Report CS1540 for more cases.
10119         * typemanager.cs (GetFullNameSignature): Use the MethodBase
10120         overload if the passed in MemberInfo is a MethodBase.
10121
10122 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
10123
10124         Fix #70749
10125         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
10126         for non-CAS & merge permission sets properly.
10127
10128 2005-01-11  Raja R Harinath  <rharinath@novell.com>
10129
10130         Improve standard-compliance of simple name and member access 
10131         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
10132         * ecore.cs (FullNamedExpression): New abstract base class 
10133         for Namespaces and TypeExpressions.
10134         (ResolveFlags.SimpleName): Remove.
10135         (SimpleName): Remove support for dotted names.
10136         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
10137         DeclSpace.FindType and DeclSpace.LookupType.
10138         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
10139         (Expression.ExprClassName): Make member function.
10140         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
10141         a namespace.  Remove creation of dotted "SimpleName"s.
10142         (MemberAccess.DoResolve): Likewise.
10143         * decl.cs (DeclSpace.Cache): Make private.
10144         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
10145         (DeclSpace.FindType): Update.
10146         (DeclSpace.LookupType): Move here from RootContext.  Return a 
10147         FullNamedExpression.
10148         * namespace.cs (Namespace): Derive from FullNamedExpression
10149         so that it can be part of expression resolution.
10150         (Namespace.Lookup): Return an FullNamedExpression.
10151         (NamespaceEntry.LookupAlias): Lookup aliases only in current
10152         namespace.
10153         * rootcontext.cs (NamespaceLookup): Remove.
10154         (LookupType): Move to DeclSpace.
10155         * attribute.cs (CheckAttributeType): Update.
10156         * doc.cs (FindDocumentedType): Remove allowAlias argument.
10157         (FindDocumentedTypeNonArray): Likewise.
10158
10159 2005-01-11  Raja R Harinath  <rharinath@novell.com>
10160
10161         Fix cs0509.cs, cs1632.cs.
10162         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
10163         is the same as IsInterface.
10164         (TypeContainer.GetClassBases): Likewise.
10165         * statement.cs (LabeledStatement.ig): New field.
10166         (LabeledStatement.LabelTarget): Save ILGenerator which created the
10167         label.
10168         (LabeledStatement.DoEmit): Check that the label was created with
10169         the same ILGenerator.
10170
10171 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
10172
10173         Fix #71058
10174         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
10175         accessors to its properties.
10176
10177         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
10178         from accessors to property.
10179         
10180 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
10181
10182         Fix #70722
10183         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
10184         only for overrides.
10185         
10186 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
10187
10188         * attribute.cs: Check for null and empty strings.  
10189
10190         I have lost another battle to Paolo.
10191
10192 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
10193
10194         Fix #70942
10195         * class.cs (PropertyMethod): Set Parent field in ctors.
10196         (SetMethod.InternalParameters): Add unsafe switch hack.
10197         Override MarkForDuplicationCheck where it is appropriate.
10198
10199         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
10200         It says whether container allows members with the same name.
10201         Base default is no.
10202         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
10203         Removed is_method parameter.
10204
10205 2005-01-06  Duncan Mak  <duncan@ximian.com>
10206
10207         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
10208         because the previous change led to incorrect reporting of CS1032
10209         ("Cannot define/undefine preprocessor symbols after first token in
10210         file"). Instead of using `tokens_seen' as the only flag that
10211         triggers CS1040, introduce `comments_seen'. This new flag is used
10212         to signify having seen comments on the current line, so it is
10213         unset after a newline.
10214
10215 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
10216
10217         * doc.cs : When searching for a type, find nested type too.
10218           This fixes bug #71040.
10219
10220 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
10221
10222         * doc.cs :
10223           - Warn missing member comment on those classes which also does not
10224             have doc comments. Fixed bug #71041.
10225           - Don't warn missing doc comment on default constructor.
10226             Fixed bug #71042.
10227
10228 2005-01-06  Duncan Mak  <duncan@ximian.com>
10229
10230         * cs-tokenizer.cs (xtoken): After handling traditional C-style
10231         comments, set `tokens_seen' to true. This allows us to detect
10232         misplaced preprocessor directives (i.e. not at the beginning of
10233         the a line, nor after whitespaces). In that case, report error
10234         CS1040. This fixes bug #56460.
10235
10236         * cs-parser.jay (interface_member_declaration): Add checks for
10237         IsExplicitImpl, and report CS0541 error if an interface member is
10238         defined as an explicit interface declaration.
10239
10240 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
10241
10242         Fix #70817
10243         * class.cs (PropertyMethod): Set Parent field in ctors.
10244         (SetMethod.InternalParameters): Add unsafe switch hack.
10245         
10246         * decl.cs (MemberCore.Parent): Cannot be readonly.
10247
10248 2005-01-06  Raja R Harinath  <rharinath@novell.com>
10249
10250         * decl.cs (DeclSpace.ResolveType): Remove.
10251         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
10252         Merge in code from ...
10253         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
10254         * class.cs, enum.cs: Update to changes.
10255
10256 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
10257
10258         * anonymous.cs: Ensure that we init the scope of our parent if it
10259         has not been initialized yet.
10260
10261 2004-12-30  Duncan Mak  <duncan@ximian.com>
10262
10263         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
10264         if field.FieldBuilder is null. Fixes #70758.
10265
10266         * convert.cs: Fixed some typos and updated some of the comments.
10267         (ImplicitStandardConversionExists):
10268         (TryImplicitIntConversion): If `target_type' is an interface and
10269         the type of `ic' implements this interface, return true or a new
10270         BoxedCast instead of null. This fixes #70468.
10271
10272 2004-12-29  Duncan Mak  <duncan@ximian.com>
10273
10274         * expression.cs (Argument.Emit): Check that Expr is
10275         IMemoryLocation before casting to it, and report CS1510 otherwise.
10276
10277         This fixes #70402.
10278
10279 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
10280
10281         * statement.cs (Block.ThisVariable): remove the recursion here, to
10282         make the --profile more sane.
10283
10284 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
10285
10286         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
10287         assembly, by JB Evain.
10288
10289 2004-12-17  Raja R Harinath  <rharinath@novell.com>
10290
10291         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
10292           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
10293         "parent" refers to enclosing type/class.  "base" refers to superclass.
10294
10295 2004-12-17  Raja R Harinath  <rharinath@novell.com>
10296
10297         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10298         Ensure that we only have GlobalAttributes.
10299         * attribute.cs (Attribute.Emit): Make non-virtual.
10300         (GlobalAttribute.Emit): Remove.
10301         (Attribute.Resolve): Make virtual.
10302         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
10303         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
10304         the argument. Don't create one.
10305         (Attribute.GetObsoleteAttribute): Likewise.
10306         (Attribute.GetClsCompliantAttributeValue): Likewise.
10307         * class.cs, decl.cs: Update to changes.
10308
10309 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
10310
10311         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
10312         
10313         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
10314         
10315         * statement.cs (Foreach.Resolve): Add error 186 report.
10316
10317 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
10318
10319         * expression.cs (Conditional.DoResolve): Add warning 429.
10320         
10321         * statement.cs (If.Resolve): Add warning 665.
10322
10323 2004-12-16  Raja R Harinath  <rharinath@novell.com>
10324
10325         New invariant: RootContext.Tree.Types.NamespaceEntry == null
10326         except when in the parser, and in GlobalAttribute.
10327         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
10328         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
10329         RootContext.Tree.Types.NamespaceEntry once work is done.
10330         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
10331         and resets RootContext.Tree.Types.NamespaceEntry.
10332
10333 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
10334
10335         * cs-parser.jay: Don't create a block for every variable.
10336
10337 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
10338
10339         * location.cs: Provide extra information.
10340
10341         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
10342         variables from the captured environment, it is the ldarg_0.
10343
10344 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
10345
10346         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
10347         find a conclusion.
10348         
10349         * class.cs: Changed warning level for 169 to avoid developer
10350         displeasure from warning flooding. It will be changed back when they
10351         fix most of current BCL warnings.
10352         
10353         * RootContext.cs: Pushed default WarningLevel to 3.
10354         
10355         * statement.cs: Removed unused variable.
10356
10357 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
10358
10359         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
10360         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
10361         Add error 502 report.
10362         (StaticClass.DefineType): Add error 441 report.
10363         (Class.AllowedModifiersProp): New virtual property as temporary
10364         extension to AllowedModifiers.
10365         (Class.DefineType): Add error 418 report. Moved ModFlags check here
10366         to share implementation with StaticClass and don't call virtual
10367         methods from ctor.
10368         
10369         * driver.cs (MainDriver): Add error 1558 test.
10370
10371         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
10372         report. Moved error 36 test here.
10373
10374         * statement.cs (Throw.Resolve): Add error 724 report.
10375
10376         * typemanager.cs: Add out_attribute_type core type.
10377         
10378 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
10379
10380         * class.cs (TypeContainer.VerifyClsCompliance): Add error
10381         3018 report.
10382         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
10383
10384         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
10385         3017 report.
10386         
10387         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
10388
10389         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
10390         Add error 3023 report.
10391         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
10392
10393         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
10394         implementation.
10395
10396 2004-12-12  John Luke  <john.luke@gmail.com>
10397
10398         * driver.cs (AddArgs): take -- into account when
10399         adding arguments, fixes bug 65710 
10400
10401 2004-12-12  Martin Baulig  <martin@ximian.com>
10402
10403         * expression.cs (Unary.TryReduceNegative): Added support for
10404         SByteConstant and ByteConstant.
10405         (Unary.Reduce): Check error values from TryReduceNegative().
10406
10407 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
10408
10409         * attributes.cs (Attribute.Resolve): Avoid multiple error report
10410         and report exception as error 182.
10411
10412 2004-12-10  Raja R Harinath  <rharinath@novell.com>
10413
10414         * driver.cs (Main): Fix message when there are warnings.
10415
10416 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
10417
10418         * delegate.cs: Fixed my fix from yesterday, sorry about that.
10419
10420 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
10421
10422         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
10423         Reduced number of warnings.
10424         
10425         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
10426
10427 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
10428
10429         * driver.cs: Removed message.
10430
10431         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
10432
10433 2004-12-08    <vargaz@freemail.hu>
10434
10435         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
10436
10437 2004-12-08  Martin Baulig  <martin@ximian.com>
10438
10439         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
10440         instead of a CS3002 for properties and indexer.
10441
10442 2004-12-08  Martin Baulig  <martin@ximian.com>
10443
10444         * decl.cs (MemberName.ToString): Make this work again.
10445
10446 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
10447
10448         * attribute.cs (Resolve): Add error 591 detection.
10449
10450         * class.cs (FieldMember.Define): Add error 1547 detection.
10451         (Indexer.Define): Add error 620 detection.
10452         (Operator.Define): Add error 590 detection.
10453
10454         * ecore.cs: Missing argument for error 79.
10455
10456         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
10457         detection.
10458
10459 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
10460
10461         Fix #70106
10462         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
10463         only.
10464
10465 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
10466
10467         * cs-parser.jay : handle doc comments on implicit/explicit operators.
10468           Some operator comments were suppressed.
10469         * doc.cs : Implicit/explicit operator name in doc comments are like
10470           "op_Explicit(type)~returnType", so added suffix handling.
10471
10472 2004-12-07  Martin Baulig  <martin@ximian.com>
10473
10474         * decl.cs
10475         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
10476         (MemberCore.GetClsCompliantAttributeValue): Likewise.
10477         (DeclSpace.ec): New protected field; store the EmitContext here.
10478         (DeclSpace.EmitContext): New public property; moved here from
10479         `TypeContainer'.
10480         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
10481         EmitContext.
10482
10483         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
10484         (Enum.Emit): Don't create a new EmitContext.
10485
10486         * delegate.cs (Delegate.DefineType): Always create the
10487         EmitContext.
10488
10489         * iterators.cs (Iterators.DefineIterator): Create a new
10490         EmitContext and store it in `ec'.
10491
10492 2004-08-24  Martin Baulig  <martin@ximian.com>
10493
10494         * typemanager.cs
10495         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
10496         this for accessibility checks.
10497         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
10498         IsNestedFamilyAccessible.
10499         (TypeManager.IsSubclassOf): New method, do what the name actually
10500         says.   
10501
10502 2004-12-06  Raja R Harinath  <rharinath@novell.com>
10503
10504         Fix crash on cs0657-17.cs.
10505         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10506         Use RootContext.Tree.Types, not 'new RootTypes ()'.
10507         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
10508         the case where the NamespaceEntry gets overwritten.
10509
10510 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
10511
10512         Fixed #69195, #56821
10513         * ecore.cs (ResolveBoolean): Tiny refactoring.
10514
10515         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
10516         of right expression resolving when left is false constant and
10517         operator is LogicalAnd OR true constant and operator is LogicalOr.
10518
10519         * statement.cs (ResolveUnreachable): Always reports warning.
10520
10521 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
10522
10523         * class.cs: Distinguish between 1721 and 1722 (just a little help
10524         for the programmer).
10525
10526 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
10527
10528         * delegate.cs: Only allow this on new versions of the language. 
10529
10530 2004-12-02  Duncan Mak  <duncan@ximian.com>
10531
10532         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
10533         Expression class.
10534         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
10535         here as a static method. Take an additional bool out parameter
10536         `must_do_cs1540_check' for signaling to InstanceResolve.
10537         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
10538         member field from PropertyExpr class and made it an argument of
10539         the method instead.
10540         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
10541         check for MarshalByRefObject, and report CS0122 instead of CS1540.
10542         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
10543         and `remove_accessor' as well as InstanceResolve: report CS0122
10544         where applicable.
10545
10546         Fixes #70129.
10547
10548 2004-12-03  Raja R Harinath  <rharinath@novell.com>
10549
10550         Fix test-327.cs, test-328.cs, and put in early infrastructure
10551         for eventually fixing #52697.
10552         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
10553         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
10554         from other methods.
10555         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
10556         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
10557         (VerifyUsing, error246): Update.
10558         * rootcontext.cs (RootContext.NamespaceLookup): Just use
10559         'NamespaceEntry.LookupNamespaceOrType'.
10560
10561 2004-12-03  Martin Baulig  <martin@ximian.com>
10562
10563         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10564         method as our child, call AnonymousMethod.Compatible() on it.
10565
10566 2004-12-03  Raja R Harinath  <rharinath@novell.com>
10567
10568         Disable XML documentation support in 'basic' profile.
10569         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
10570         Redirect XmlElement to System.Object.
10571         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
10572         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
10573         * mcs.exe.sources: Add doc-bootstrap.cs.
10574         * doc-bootstrap.cs: New file.  Contains empty stub implementation
10575         of doc.cs.
10576
10577 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
10578
10579         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
10580           comments are allowed.
10581
10582 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10583
10584         * delegate.cs: Add checks for subtypes in paramaters and return values
10585         in VerifyMethod () to add support for Covariance/Contravariance
10586         in delegates.
10587         
10588 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
10589
10590         * report.cs: Remove extra closing parenthesis.
10591
10592         * convert.cs (Error_CannotImplicitConversion): If the name of the
10593         types are the same, provide some extra information.
10594
10595         * class.cs (FieldBase): Use an unused bit field from the field to
10596         encode the `has_offset' property from the FieldMember.  This saves
10597         a couple of Ks on bootstrap compilation.
10598
10599         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10600         method as our child, return the AnonymousMethod resolved
10601         expression.
10602
10603         * expression.cs (New.DoResolve): Allow return values from
10604         NewDelegate to also include AnonymousMethods.
10605
10606         Fixes #70150.
10607
10608 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
10609
10610         Fix bug #70102
10611         * attribute.cs (Resolve): Improved implementation of params
10612         attribute arguments.
10613
10614         * support.cs (ParameterData): Add HasParams to be faster.
10615
10616 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
10617
10618         all things are for /doc support:
10619
10620         * doc.cs: new file that supports XML documentation generation.
10621         * mcs.exe.sources: added doc.cs.
10622         * driver.cs:
10623           Handle /doc command line option.
10624           Report error 2006 instead of 5 for missing file name for /doc.
10625           Generate XML documentation when required, after type resolution.
10626         * cs-tokenizer.cs:
10627           Added support for picking up documentation (/// and /** ... */),
10628           including a new XmlCommentState enumeration.
10629         * cs-parser.jay:
10630           Added lines to fill Documentation element for field, constant,
10631           property, indexer, method, constructor, destructor, operator, event
10632           and class, struct, interface, delegate, enum.
10633           Added lines to warn incorrect comment.
10634         * rootcontext.cs :
10635           Added Documentation field (passed only when /doc was specified).
10636         * decl.cs:
10637           Added DocComment, DocCommentHeader, GenerateDocComment() and
10638           OnGenerateDocComment() and some supporting private members for
10639           /doc feature to MemberCore.
10640         * class.cs:
10641           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
10642         * delegate.cs:
10643           Added overriden DocCommentHeader.
10644         * enum.cs:
10645           Added overriden DocCommentHeader and GenerateDocComment().
10646
10647 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
10648
10649         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
10650         unwrapping the enumeration values, chain to
10651         DoConstantNumericPromotions again, so we can promote things to the
10652         fundamental types (takes care of enums that are bytes, sbytes).
10653
10654         Fixes bug #62054.
10655
10656 2004-12-01  Raja R Harinath  <rharinath@novell.com>
10657
10658         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
10659         Fix long-standing bug in type-lookup.  Use FindType instead of
10660         LookupType when ec.ResolvingTypeTree.
10661         (Attribute.ResolveType, Attribute.Resolve)
10662         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
10663         Update to changes.
10664         (Attributes.Search): Remove internal version.  Update.
10665         (Attributes.SearchMulti): Update.
10666         (Attributes.GetClsCompliantAttribute): Remove.
10667         (Attributes.GetIndexerNameAttribute): Remove.
10668         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
10669         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
10670         * class.cs (Indexer.Define): Likewise.
10671
10672 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
10673
10674         Fix bug #68790
10675         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
10676         MarshallByReference members access.
10677
10678         * expression.cs: Use CheckMarshallByRefAccess;
10679         Better error CS0197 message.
10680
10681         * report.cs: Print whole related error message.
10682
10683 2004-11-30  Raja R Harinath  <rharinath@novell.com>
10684
10685         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
10686         the current directory to help debugging.
10687
10688 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
10689
10690         * class (GetClassBases): Better error 60 report.
10691         (EventProperty): Disabled warning 67 detection.
10692
10693 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
10694
10695         Fix bug #60324
10696         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
10697
10698         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
10699         precise values.
10700
10701 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
10702
10703         Fix bug #49488
10704         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
10705
10706         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
10707
10708 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
10709
10710         * attribute.cs (Attribute.Resolve): Refine error reporting and
10711         report a cs0117 if the identifier does not exist, to distinguish
10712         from 0617 which is a miss-use of the actual identifier.
10713
10714         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
10715         between cs0070 and cs0079.
10716
10717         * class.cs (MemberBase.DoDefine): When reporting a wrong
10718         accessibility level, we use MethodCore to compare instead of
10719         Method (this was a regression in some refactoring effort).
10720
10721         So now we correctly report cs0056 again.
10722
10723         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
10724         testing the target_type (which was known to be object_type) and
10725         not the source type (which is anonymous_method).
10726
10727         Fixed reporting of error cs1660.
10728
10729         * expression.cs (UserCast.Source): Expose the underlying cast.
10730
10731         * statement.cs (Switch.SwitchGoverningType): Sort the list of
10732         allowed types to find a match to int32 first (most common).
10733
10734         In addition, it ignores any ImplicitUserConversions that did an
10735         internal implicit conversion (as the switch statement allows only
10736         one integral conversion to exist).
10737
10738         * class.cs (PartialContainer.Create): rename `name' to
10739         `member_name' for clarity.  Then replace the string calls with a
10740         call to MemberName.GetPartialName, as now using
10741         MemberName.ToString is an error (this is due to the side effects
10742         it had, that were fixed in the past).
10743
10744         This will restore the error reporting on a number of partial class
10745         errors that were missusing this (and getting an exception as a
10746         results, which is now just a plain textual warning, because
10747         yyparse debug output would crash otherwise).
10748
10749 2004-11-26  Raja R Harinath  <rharinath@novell.com>
10750
10751         * Makefile (PROGRAM_INSTALL_DIR): Remove.
10752
10753 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
10754
10755         * rootcontext.cs (LookupType): Make sure to cache lookups that
10756         don't give us a negative result. This saves about 5% of corlib
10757         compilation time.
10758
10759 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
10760
10761         * report.cs (AbstractMessage.Print): messages are sent to stderr
10762
10763         * class.cs (TypeContainer.GetClassBases): It is an error to have a
10764         non-interface in the list of interfaces (at this point, either
10765         parent was properly set, or a base class is being listed in the
10766         interfaces section).
10767
10768         This flags error 1722, and resolves the crash from bug 69259.
10769
10770 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
10771
10772         * statement.cs (Using.EmitExpressionFinally): make this work right
10773         for valuetypes. Fixes 69926.
10774
10775 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
10776
10777         * const.cs (Const.ChangeType): Cope with the "0 literal can be
10778         converted to an enum" here, before we try to change the underlying
10779         type.  This code exists, but it is a different code path than the
10780         one used while encoding constants.
10781
10782         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
10783         old bug: when converting from the null literal to a pointer,
10784         return an EmptyCast, not the NullLiteral.
10785
10786         This fixes #69921, the recent null_type changes probably made this
10787         bug more prominent.
10788
10789         (ImplicitReferenceConversionExists): In addition, resynchronized
10790         the code here, so it matches the same code in
10791         ImplicitReferenceConversionExists for the `from any class-type S
10792         to any interface-type T'.
10793         
10794
10795 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
10796
10797         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
10798
10799 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
10800
10801         * cs-parser.jay: Use verbosity accordingly. 
10802
10803 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
10804
10805         * expression.cs (Unary.ResolveOperator): Do not report warning;
10806         AddressOf reads from variable.
10807         
10808         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
10809
10810 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
10811
10812         Fix bug #69462
10813
10814         * attribute.cs (Attributable): Removed CheckTargets.
10815         (Attributes.Emit): Explicit attribute targets are tested here.
10816
10817         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
10818         not enabled for interfaces.
10819
10820         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
10821         (GetAssemblyName): Ouch next bug there.
10822
10823 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10824
10825         * expression.cs: Error 275 added.
10826         
10827 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
10828
10829         Fix bug #69177 (Implemented decimal constant support)
10830
10831         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
10832         (BinaryFold): Add DecimalConstant.
10833
10834         * const.cs (Define): Decimal constant 
10835         (is not constant.
10836         (ChangeType): Add decimal type handling.
10837         (LookupConstantValue): Don't set value for decimal type but
10838         emit DecimalConstantAttribute. Needed for constant optimization.
10839
10840         * constant.cs (ToDecimal): New method.
10841         (ConvertToDecimal): New method.
10842         (IntConstant): Implemented ConvertToDecimal.
10843         (DecimalConstant.Emit): Emit optimized version for decimals in
10844         int range.
10845
10846         * expression.cs (ResolveOperator): Changed order of constant
10847         reduction to work correctly with native types which have
10848         overloaded operators.
10849         (ResolveMemberAccess): Extract constant value from attribute
10850         for decimal type.
10851
10852         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
10853
10854         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
10855         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
10856         (ChangeType): Decimal is special.
10857         (TypeToCoreType): Add decimal type.
10858
10859 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
10860
10861         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
10862         decimal types.
10863
10864 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
10865
10866         * class.cs (EventField.ApplyAttributeBuilder): Fix error
10867         test cs1667-5.cs.
10868
10869 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
10870
10871         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
10872
10873         * pending.cs (PendingImplementation): Grab only interfaces.
10874
10875 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
10876
10877         * statement.cs (ForeachHelperMethods): Add location member and
10878         error 202 detection.
10879
10880 2004-11-19  Raja R Harinath  <rharinath@novell.com>
10881
10882         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
10883         automatically handled by executable.make.
10884         (PROGRAM): Make profile-specific.
10885
10886 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
10887
10888         * expression.cs (DoResolveBase): Fixed wrong warning for out
10889         variables.
10890
10891 2004-11-18  Martin Baulig  <martin@ximian.com>
10892
10893         Merged latest changes into gmcs.  Please keep this comment in
10894         here, it makes it easier for me to see what changed in MCS since
10895         the last time I merged.
10896
10897 2004-11-17  Raja R Harinath  <rharinath@novell.com>
10898
10899         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
10900         (TypeHandle.GetMemberCache): New.
10901         (TypeHandle.TypeHandle): Update.
10902         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
10903         (TypeManager.LookupParentInterfacesCache):
10904         Rename from LookupInterfaceCache.  Optimize slightly.
10905         (TypeManager.MemberLookup_FindMembers): Update.
10906         * decl.cs (MemberCache.MemberCache): Set Container to null in the
10907         multi-type variant.
10908         (AddCacheContents): Rename from AddHashtable.
10909         * class.cs (TypeContainer.parent_container): Remove.
10910         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
10911         (TypeContainer.DoDefineMembers): Don't initialize it.
10912         Update to name changes.
10913         
10914 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
10915
10916         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
10917         that factors the code to check access modifiers on override.  
10918
10919         (PropertyBase): Use the code here.
10920
10921         Patch from Lluis S'anchez, fixes bug #69361.
10922
10923 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
10924
10925         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
10926         routine that is used to report the use of a captured variable
10927         whose address has been taken.
10928
10929         There are two checks: one when variables are being captured and
10930         the other check is when the address of a variable is taken. 
10931         
10932         (because an anonymous methods might be resolved before *or* after
10933         the address has been taken) and 
10934
10935         * expression.cs (Conditional.DoResolve): Remove the special
10936         casing that Martin added to trueExpr and falseExpr being both
10937         NullLiteral.  We get the right behavior now just by introducing
10938         the null_type into the compiler. 
10939
10940         * convert.cs (ExplicitConversion): Change the code to use
10941         null_type instead of testing `expr is NullLiteral'.
10942         (ImplicitConversionStandard): use null_type too.
10943         (ImplicitReferenceConversionExists): use null_type too.
10944         (ImplicitReferenceConversion): use null_type too.
10945
10946         * literal.cs: The type of `NullLiteral' is now null_type instead
10947         of object_type. 
10948         (Resolve): Set the type here.
10949
10950         * typemanager.cs: Introduce null_type.
10951
10952 2004-11-17  Martin Baulig  <martin@ximian.com>
10953
10954         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
10955         direction, like FindMembers() does.  Fixes #69546, testcase is in
10956         test-315.cs.    
10957
10958 2004-11-16  Martin Baulig  <martin@ximian.com>
10959
10960         This is based on a patch from Marek Safar, see bug #69082.
10961         Fixes bugs #63705 and #67130.
10962
10963         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
10964         method; create a MemberCache for an interface type and cache the
10965         result.
10966
10967         * decl.cs (IMemberContainer.ParentContainer): Removed.
10968         (IMemberContainer.ParentCache): New property.
10969         (MemberCache.SetupCacheForInterface): Removed.
10970         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
10971         to create a cache for an interface's "parent".
10972
10973         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
10974         interfaces too.
10975
10976 2004-11-16  Martin Baulig  <martin@ximian.com>
10977
10978         Merged back from gmcs; these changes already went into gmcs a
10979         couple of weeks ago.
10980
10981         * typemanager.cs
10982         (TypeManager.AddUserType): Removed the `ifaces' argument.
10983         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
10984         `TypeExpr []'.
10985         (TypeManager.AddUserInterface): Removed.
10986         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
10987         `TypeExpr []'.
10988         (TypeManager.GetInterfaces): Likewise.
10989         (TypeManager.GetExplicitInterfaces): Likewise.
10990
10991         * ecore.cs (TypeExpr.GetInterfaces): Removed.
10992
10993         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
10994         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
10995
10996 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
10997
10998         * statement.cs: Avoid adding bools to a hashtable.
10999
11000 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
11001
11002         * expression.cs (Invocation.OverloadResolve): Flag error if we are
11003         calling an unsafe method from a safe location.
11004
11005 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
11006
11007         Fix #69167
11008         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
11009
11010 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
11011
11012         * namespace.cs (VerifyUsing): use GetPartialName instead of
11013         ToString. 
11014
11015 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
11016
11017         * statement.cs (Return.Resolve): Fix regression in typo: if
11018         `in_exc', we have to request a NeedReturnLabel, this was a typo
11019         introduced in the anonymous method check-in.  Fixes #69131.
11020
11021         * Indexers were using the ShortName when defining themselves,
11022         causing a regression in the compiler bootstrap when applying the
11023         patch from 2004-11-02 (first part), now they use their full name
11024         and the bug is gone.
11025
11026 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
11027
11028         * driver.cs: Strip the path from the names of embedded resources. Fixes
11029         #68519.
11030
11031 2004-11-04  Raja R Harinath  <rharinath@novell.com>
11032
11033         Fix error message regression: cs0104-2.cs.
11034         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
11035         (AliasEntry.Resolve): Update.
11036         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
11037         'silent' flag.
11038         (RootContext.LookupType): Update.
11039
11040 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
11041
11042         * cs-parser.jay: Add support for handling accessor modifiers
11043         * class: Add support port accessor modifiers and error checking,
11044         define PropertyMethod.Define as virtual (not abstract anymore)
11045         * ecore.cs: Add checking for proeprties access with access modifiers
11046         * iterators.cs: Modify Accessor constructor call based in the modified
11047         constructor
11048 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
11049
11050         * expression.cs (StringConcat): Handle being called twice,
11051         as when we have a concat in a field init with more than two
11052         ctors in the class
11053
11054 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
11055
11056         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
11057         special case explicit implementations, we should always produce
11058         the .property or .event declaration.
11059         
11060         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
11061         since it will not return correct data if people use this
11062         unresolved in the presence of using statements (see test-313).
11063
11064         * class.cs (MethodData.Define): If we are an explicit interface
11065         implementation, set the method name to the full name of the
11066         interface plus the name of the method.  
11067
11068         Notice that using the method.MethodName.GetFullName() does not
11069         work, as it will only contain the name as declared on the source
11070         file (it can be a shorthand in the presence of using statements)
11071         and not the fully qualifed type name, for example:
11072
11073         using System;
11074
11075         class D : ICloneable {
11076                 object ICloneable.Clone ()  {
11077                 }
11078         }
11079
11080         Would produce a method called `ICloneable.Clone' instead of
11081         `System.ICloneable.Clone'.
11082
11083         * namespace.cs (Alias.Resolve): Use GetPartialName.
11084         
11085 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
11086
11087         * cs-parser.jay: Add error 1055 report.
11088
11089 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
11090
11091         * assign.cs (Assign.DoResolve): Only do the transform of
11092         assignment into a New if the types are compatible, if not, fall
11093         through and let the implicit code deal with the errors and with
11094         the necessary conversions. 
11095
11096 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
11097
11098         * cs-parser.jay: Add error 1031 report.
11099
11100         * cs-tokenizer.cs: Add location for error 1038.
11101
11102 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11103
11104         * cs-parser.jay: Add error 1016 report.
11105
11106 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11107
11108         * cs-parser.jay: Add errors 1575,1611 report.
11109
11110 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11111
11112         * cs-parser.jay: Add error 1001 report.
11113
11114 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11115
11116         Fix #68850
11117         * attribute.cs (GetMarshal): Add method argument for
11118         caller identification.
11119
11120         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
11121         agument for GetMarshal and RuntimeMissingSupport.
11122
11123 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11124
11125         * attribute.cs (ExtractSecurityPermissionSet): Removed
11126         TypeManager.code_access_permission_type.
11127
11128         * typemanager.cs: Removed TypeManager.code_access_permission_type.
11129
11130 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
11131
11132         * expression.cs (LocalVariableReference.DoResolveLValue): Check
11133         for obsolete use of a variable here.   Fixes regression on errors
11134         cs0619-25 and cs0619-26.
11135
11136 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
11137
11138         Fix #62358, implemented security attribute encoding.
11139
11140         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
11141         Tests permitted SecurityAction for assembly or other types.
11142         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
11143         data from SecurityPermissionAttribute to PermisionSet class.
11144
11145         * class.cs (ApplyAttributeBuilder): Added special handling
11146         for System.Security.Permissions.SecurityAttribute based types.
11147
11148         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
11149         special handling for System.Security.Permissions.SecurityAttribute
11150         based types.
11151
11152         * enum.cs (ApplyAttributeBuilder): Added special handling
11153         for System.Security.Permissions.SecurityAttribute based types.
11154
11155         * parameter.cs (ApplyAttributeBuilder): Added special handling
11156         for System.Security.Permissions.SecurityAttribute based types.
11157
11158         * rootcontext.cs: Next 2 core types.
11159
11160         * typemanager.cs (TypeManager.security_permission_attr_type):
11161         Built in type for the SecurityPermission Attribute.
11162         (code_access_permission_type): Build in type.
11163
11164 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
11165
11166         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
11167         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
11168         all of this information into
11169         EmitContext.EmitCapturedVariableInstance.
11170         
11171         * codegen.cs (EmitCapturedVariableInstance): move here the
11172         funcionality of emitting an ldarg.0 in the presence of a
11173         remapping.   This centralizes the instance emit code.
11174
11175         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
11176         then emit a load of this: it means that we have reached the
11177         topmost ScopeInfo: the one that contains the pointer to the
11178         instance of the class hosting the anonymous method.
11179
11180         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
11181         captures to the topmost CaptureContext.
11182
11183 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
11184
11185         * expression.cs (LocalVariableReference): Move the knowledge about
11186         the iterators into codegen's EmitCapturedVariableInstance.
11187
11188 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
11189
11190         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
11191         all code paths return a value from an anonymous method (it is the
11192         same as the 161 error, but for anonymous methods).
11193
11194 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
11195
11196         The introduction of anonymous methods in the compiler changed
11197         various ways of doing things in the compiler.  The most
11198         significant one is the hard split between the resolution phase
11199         and the emission phases of the compiler.
11200
11201         For instance, routines that referenced local variables no
11202         longer can safely create temporary variables during the
11203         resolution phase: they must do so from the emission phase,
11204         since the variable might have been "captured", hence access to
11205         it can not be done with the local-variable operations from the runtime.
11206         
11207         * statement.cs 
11208
11209         (Block.Flags): New flag `IsTopLevel' to indicate that this block
11210         is a toplevel block.
11211
11212         (ToplevelBlock): A new kind of Block, these are the blocks that
11213         are created by the parser for all toplevel method bodies.  These
11214         include methods, accessors and anonymous methods.
11215
11216         These contain some extra information not found in regular blocks:
11217         A pointer to an optional CaptureContext (for tracking captured
11218         local variables and parameters).  A pointer to the parent
11219         ToplevelBlock.
11220         
11221         (Return.Resolve): Catch missmatches when returning a value from an
11222         anonymous method (error 1662).
11223         Invoke NeedReturnLabel from the Resolve phase instead of the emit
11224         phase.
11225
11226         (Break.Resolve): ditto.
11227
11228         (SwitchLabel): instead of defining the labels during the
11229         resolution phase, we now turned the public ILLabel and ILLabelCode
11230         labels into methods called GetILLabelCode() and GetILLabel() that
11231         only define the label during the Emit phase.
11232
11233         (GotoCase): Track the SwitchLabel instead of the computed label
11234         (its contained therein).  Emit the code by using
11235         SwitchLabel.GetILLabelCode ().
11236
11237         (LocalInfo.Flags.Captured): A new flag has been introduce to track
11238         whether the Local has been captured or not.
11239
11240         (LocalInfo.IsCaptured): New property, used to tell whether the
11241         local has been captured.
11242         
11243         * anonymous.cs: Vastly updated to contain the anonymous method
11244         support.
11245
11246         The main classes here are: CaptureContext which tracks any
11247         captured information for a toplevel block and ScopeInfo used to
11248         track the activation frames for various local variables.   
11249
11250         Each toplevel block has an optional capture context associated
11251         with it.  When a method contains an anonymous method both the
11252         toplevel method and the anonymous method will create a capture
11253         context.   When variables or parameters are captured, they are
11254         recorded on the CaptureContext that owns them, for example:
11255
11256         void Demo () {
11257              int a;
11258              MyDelegate d = delegate {
11259                  a = 1;
11260              }
11261         }
11262
11263         Here `a' will be recorded as captured on the toplevel
11264         CapturedContext, the inner captured context will not have anything
11265         (it will only have data if local variables or parameters from it
11266         are captured in a nested anonymous method.
11267
11268         The ScopeInfo is used to track the activation frames for local
11269         variables, for example:
11270
11271         for (int i = 0; i < 10; i++)
11272                 for (int j = 0; j < 10; j++){
11273                    MyDelegate d = delegate {
11274                         call (i, j);
11275                    }
11276                 }
11277
11278         At runtime this captures a single captured variable `i', but it
11279         captures 10 different versions of the variable `j'.  The variable
11280         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
11281         recorded on a child.  
11282
11283         The toplevel ScopeInfo will also track information like the `this'
11284         pointer if instance variables were referenced (this is necessary
11285         as the anonymous method lives inside a nested class in the host
11286         type of the method). 
11287
11288         (AnonymousMethod): Expanded to track the Toplevel, implement
11289         `AnonymousMethod.Compatible' to tell whether an anonymous method
11290         can be converted to a target delegate type. 
11291
11292         The routine now also produces the anonymous method content
11293
11294         (AnonymousDelegate): A helper class that derives from
11295         DelegateCreation, this is used to generate the code necessary to
11296         produce the delegate for the anonymous method that was created. 
11297
11298         * assign.cs: API adjustments for new changes in
11299         Convert.ImplicitStandardConversionExists.
11300
11301         * class.cs: Adjustments to cope with the fact that now toplevel
11302         blocks are of type `ToplevelBlock'. 
11303
11304         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
11305         insteda of standard blocks.
11306
11307         Flag errors if params arguments are passed to anonymous methods.
11308
11309         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
11310         `CurrentAnonymousMethod' which points to the current Anonymous
11311         Method.  The variable points to the AnonymousMethod class that
11312         holds the code being compiled.  It is set in the new EmitContext
11313         created for the anonymous method.
11314
11315         (EmitContext.Phase): Introduce a variable and an enumeration to
11316         assist in enforcing some rules about when and where we are allowed
11317         to invoke certain methods (EmitContext.NeedsReturnLabel is the
11318         only one that enfonces this right now).
11319
11320         (EmitContext.HaveCaptureInfo): new helper method that returns
11321         whether we have a CapturedContext initialized.
11322
11323         (EmitContext.CaptureVariable): New method used to register that a
11324         LocalInfo must be flagged for capturing. 
11325
11326         (EmitContext.CapturedParameter): New method used to register that a
11327         parameters must be flagged for capturing. 
11328         
11329         (EmitContext.CapturedField): New method used to register that a
11330         field must be flagged for capturing. 
11331
11332         (EmitContext.HaveCapturedVariables,
11333         EmitContext.HaveCapturedFields): Return whether there are captured
11334         variables or fields. 
11335
11336         (EmitContext.EmitMethodHostInstance): This is used to emit the
11337         instance for the anonymous method.  The instance might be null
11338         (static methods), this (for anonymous methods that capture nothing
11339         and happen to live side-by-side with the current method body) or a
11340         more complicated expression if the method has a CaptureContext.
11341
11342         (EmitContext.EmitTopBlock): Routine that drives the emission of
11343         code: it will first resolve the top block, then emit any metadata
11344         and then emit the code.  The split is done so that we can extract
11345         any anonymous methods and flag any captured variables/parameters.
11346         
11347         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
11348         during this phase, the ILGenerator should not be used as labels
11349         and local variables declared here might not be accessible to any
11350         code that is part of an anonymous method.  
11351
11352         Exceptions to this include the temporary variables that are
11353         created by some statements internally for holding temporary
11354         variables. 
11355         
11356         (EmitContext.EmitMeta): New routine, in charge of emitting all the
11357         metadata for a cb
11358
11359         (EmitContext.TemporaryReturn): This method is typically called
11360         from the Emit phase, and its the only place where we allow the
11361         ReturnLabel to be defined other than the EmitMeta.  The reason is
11362         that otherwise we would have to duplicate a lot of logic in the
11363         Resolve phases of various methods that today is on the Emit
11364         phase. 
11365
11366         (EmitContext.NeedReturnLabel): This no longer creates the label,
11367         as the ILGenerator is not valid during the resolve phase.
11368
11369         (EmitContext.EmitThis): Extended the knowledge in this class to
11370         work in anonymous methods in addition to iterators. 
11371
11372         (EmitContext.EmitCapturedVariableInstance): This emits whatever
11373         code is necessary on the stack to access the instance to a local
11374         variable (the variable will be accessed as a field).
11375
11376         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
11377         EmitContext.EmitAddressOfParameter): Routines to support
11378         parameters (not completed at this point). 
11379         
11380         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
11381         will also remove the parameters.
11382
11383         * convert.cs (Convert): Define a `ConstantEC' which points to a
11384         null.  This is just to prefity some code that uses
11385         ImplicitStandardConversion code and do not have an EmitContext
11386         handy.
11387
11388         The idea is to flag explicitly that at that point in time, it is
11389         known that the conversion will not trigger the delegate checking
11390         code in implicit conversions (which requires a valid
11391         EmitContext). 
11392
11393         Everywhere: pass new EmitContext parameter since
11394         ImplicitStandardConversionExists now requires it to check for
11395         anonymous method conversions. 
11396
11397         (Convert.ImplicitStandardConversionExists): If the type of an
11398         expression is the anonymous_method_type, and the type is a
11399         delegate, we invoke the AnonymousMethod.Compatible method to check
11400         whether an implicit conversion is possible. 
11401
11402         (Convert.ImplicitConversionStandard): Only do implicit method
11403         group conversions if the language level is not ISO_1.
11404
11405         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
11406         MethodInfo for the Invoke method.  used by Delegate and
11407         AnonymousDelegate.
11408
11409         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
11410         method conversions if the target type is a delegate.
11411
11412         Removed extra debugging nops.
11413
11414         (LocalVariableReference): Turn the `local_info' into a public
11415         field. 
11416
11417         Add `prepared' field, the same hack used for FieldExprs to cope
11418         with composed assignments, as Local variables do not necessarily
11419         operate purely on the stack as they used to: they can be captured
11420         fields. 
11421
11422         Add `temp' for a temporary result, like fields.
11423
11424         Refactor DoResolve and DoResolveLValue into DoResolveBase.
11425
11426         It now copes with Local variables that are captured and emits the
11427         proper instance variable to load it from a field in the captured
11428         case. 
11429
11430         (ParameterReference.DoResolveBase): During the resolve phase,
11431         capture parameters if we are in an anonymous method.
11432
11433         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
11434         anonymous method, use the EmitContext helper routines to emit the
11435         parameter reference.
11436
11437         * iterators.cs: Set RemapToProxy to true/false during the
11438         EmitDispose class.
11439
11440         * parameters.cs (GetParameterByName): New helper method. 
11441
11442         * typemanager.cs (anonymous_method_type) a new type that
11443         represents an anonyous method.  This is always an internal type,
11444         used as a fencepost to test against the anonymous-methodness of an
11445         expression. 
11446         
11447 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
11448
11449         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
11450         561 report.
11451         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
11452
11453 2004-10-18  Martin Baulig  <martin@ximian.com>
11454
11455         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
11456         `Type' directly, but call ResolveType() on it.
11457         (Catch.Resolve): Likewise.
11458         (Foreach.Resolve): Likewise.
11459
11460 2004-10-18  Martin Baulig  <martin@ximian.com>
11461
11462         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
11463         `Type' directly, but call ResolveType() on it.
11464         (Probe.DoResolve): Likewise.
11465         (ArrayCreation.LookupType): Likewise.
11466         (TypeOf.DoResolve): Likewise.
11467         (SizeOf.DoResolve): Likewise.
11468
11469 2004-10-18  Martin Baulig  <martin@ximian.com>
11470
11471         * expression.cs (Invocation.BetterFunction): Put back
11472         TypeManager.TypeToCoreType().
11473
11474 2004-10-18  Raja R Harinath  <rharinath@novell.com>
11475
11476         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
11477         the ResolveType.
11478
11479 2004-10-18  Martin Baulig  <martin@ximian.com>
11480
11481         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
11482         `Type' directly, but call ResolveType() on it.
11483
11484 2004-10-18  Martin Baulig  <martin@ximian.com>
11485
11486         * class.cs (FieldMember.Define): Don't access the TypeExpr's
11487         `Type' directly, but call ResolveType() on it.
11488         (MemberBase.DoDefine): Likewise.
11489
11490         * expression.cs (New.DoResolve): Don't access the TypeExpr's
11491         `Type' directly, but call ResolveType() on it.
11492         (ComposedCast.DoResolveAsTypeStep): Likewise.
11493
11494         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
11495         `Type' directly, but call ResolveType() on it.
11496
11497 2004-10-17  John Luke  <john.luke@gmail.com>
11498
11499         * class.cs (Operator.GetSignatureForError): use CSharpName
11500
11501         * parameter.cs (Parameter.GetSignatureForError): Returns
11502         correct name even if was not defined.
11503
11504 2004-10-13  Raja R Harinath  <rharinath@novell.com>
11505
11506         Fix #65816.
11507         * class.cs (TypeContainer.EmitContext): New property.
11508         (DefineNestedTypes): Create an emitcontext for each part.
11509         (MethodCore.DoDefineParameters): Use container's emitcontext.
11510         Pass type array to InternalParameters.
11511         (MemberBase.DoDefine): Use container's emitcontext.
11512         (FieldMember.Define): Likewise.
11513         (Event.Define): Likewise.
11514         (SetMethod.GetParameterInfo): Change argument to EmitContext.
11515         Pass type array to InternalParameters.
11516         (SetIndexerMethod.GetParameterInfo): Likewise.
11517         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
11518         * delegate.cs (Define): Pass emitcontext to
11519         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
11520         array to InternalParameters.
11521         * expression.cs (ParameterReference.DoResolveBase): Pass
11522         emitcontext to GetParameterInfo.
11523         (ComposedCast.DoResolveAsTypeStep): Remove check on
11524         ec.ResolvingTypeTree.
11525         * parameter.cs (Parameter.Resolve): Change argument to
11526         EmitContext.  Use ResolveAsTypeTerminal.
11527         (Parameter.GetSignature): Change argument to EmitContext.
11528         (Parameters.ComputeSignature): Likewise.
11529         (Parameters.ComputeParameterTypes): Likewise.
11530         (Parameters.GetParameterInfo): Likewise.
11531         (Parameters.ComputeAndDefineParameterTypes): Likewise.
11532         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
11533         * support.cs (InternalParameters..ctor): Remove variant that takes
11534         a DeclSpace.
11535         * typemanager.cs (system_intptr_expr): New.
11536         (InitExpressionTypes): Initialize it.
11537
11538 2004-10-12  Chris Toshok  <toshok@ximian.com>
11539
11540         * cs-parser.jay: fix location for try_statement and catch_clause.
11541
11542 2004-10-11  Martin Baulig  <martin@ximian.com>
11543
11544         * report.cs: Don't make --fatal abort on warnings, we have
11545         -warnaserror for that.
11546
11547 2004-10-07  Raja R Harinath  <rharinath@novell.com>
11548
11549         More DeclSpace.ResolveType avoidance.
11550         * decl.cs (MemberCore.InUnsafe): New property.
11551         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
11552         with newly created EmitContext.
11553         (FieldMember.Define): Likewise.
11554         * delegate.cs (Delegate.Define): Likewise.
11555         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
11556         only if normal name-lookup fails.
11557         (TypeExpr.DoResolve): Enable error-checking.
11558         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
11559         (SizeOf.DoResolve): Likewise.
11560         (ComposedCast.DoResolveAsTypeStep): Likewise.
11561         (StackAlloc.DoResolve): Likewise.
11562         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
11563         (Block.Unsafe): New property.
11564         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
11565         (Unsafe): Set 'unsafe' flag of contained block.
11566         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
11567         (Fixed.Resolve): Likewise.
11568         (Catch.Resolve): Likewise.
11569         (Using.ResolveLocalVariableDecls): Likewise.
11570         (Foreach.Resolve): Likewise.
11571
11572 2004-10-05  John Luke <john.luke@gmail.com>
11573
11574         * cs-parser.jay: add location to error CS0175
11575
11576 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
11577
11578         * ecore.cs (Expression.Constantity): Add support for turning null
11579         into a constant.
11580
11581         * const.cs (Const.Define): Allow constants to be reference types
11582         as long as the value is Null.
11583
11584 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
11585
11586         * namespace.cs (NamespaceEntry.Using): No matter which warning
11587         level is set, check if this namespace name has already been added.
11588
11589 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
11590
11591         * expression.cs: reftype [!=]= null should always use br[true,false].
11592         # 67410
11593
11594 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
11595
11596         Fix #67108
11597         * attribute.cs: Enum conversion moved to 
11598         GetAttributeArgumentExpression to be applied to the all
11599         expressions.
11600
11601 2004-10-01  Raja R Harinath  <rharinath@novell.com>
11602
11603         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
11604         * class.c (TypeContainer.DefineType): Flag error if
11605         base types aren't accessible due to access permissions.
11606         * decl.cs (DeclSpace.ResolveType): Move logic to
11607         Expression.ResolveAsTypeTerminal.
11608         (DeclSpace.ResolveTypeExpr): Thin layer over
11609         Expression.ResolveAsTypeTerminal.
11610         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
11611         Refactor code into NestedAccess.  Use it.
11612         (DeclSpace.NestedAccess): New.
11613         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
11614         argument to silence errors.  Check access permissions.
11615         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
11616         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
11617         (Cast.DoResolve): Likewise.
11618         (New.DoResolve): Likewise.
11619         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
11620         (TypeOf.DoResolve): Likewise.
11621
11622         * expression.cs (Invocation.BetterConversion): Return the Type of
11623         the better conversion.  Implement section 14.4.2.3 more faithfully.
11624         (Invocation.BetterFunction): Make boolean.  Make correspondence to
11625         section 14.4.2.2 explicit.
11626         (Invocation.OverloadResolve): Update.
11627         (Invocation): Remove is_base field.
11628         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
11629         (Invocation.Emit): Likewise.
11630
11631 2004-09-27  Raja R Harinath  <rharinath@novell.com>
11632
11633         * README: Update to changes.
11634
11635 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
11636
11637         * cs-parser.jay: Reverted 642 warning fix.
11638
11639 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11640
11641         Fix bug #66615
11642         * decl.cs (FindMemberWithSameName): Indexer can have more than
11643         1 argument.
11644
11645 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11646
11647         * expression.cs (LocalVariableReference.DoResolveLValue):
11648         Do not report warning 219 for out values.
11649         (EmptyExpression.Null): New member to avoid extra allocations.
11650
11651 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11652
11653         * cs-parser.jay: Fix wrong warning 642 report.
11654
11655         * cs-tokenizer.cs (CheckNextToken): New helper;
11656         Inspect next character if is same as expected.
11657
11658 2004-09-23  Martin Baulig  <martin@ximian.com>
11659
11660         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
11661         (Convert.ImplicitReferenceConversionExists): Likewise.
11662
11663 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11664
11665         * class.cs (Operator.Define): Add error 448 and 559 report.
11666
11667 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
11668
11669         * class.cs (MemberBase.IsTypePermitted): New protected
11670         method for checking error CS0610.
11671
11672 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
11673
11674         * class.cs (TypeContainer.HasExplicitLayout): New property
11675         Returns whether container has StructLayout attribute set Explicit.
11676         (FieldMember): New abstract class for consts and fields.
11677         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
11678         (Field): Reuse FieldMember.
11679
11680         * const.cs (Const): Reuse FieldMember.
11681
11682         * rootcontext.cs: EmitConstants call moved to class.
11683
11684 2004-09-22  Martin Baulig  <martin@ximian.com>
11685
11686         Thanks to Peter Sestoft for this bug report.
11687
11688         * expression.cs (Conditional): If both the `trueExpr' and the
11689         `falseExpr' is a NullLiteral, return a NullLiteral.
11690
11691 2004-09-22  Martin Baulig  <martin@ximian.com>
11692
11693         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
11694         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
11695         for the "get_Current" call.
11696
11697 2004-09-22  Martin Baulig  <martin@ximian.com>
11698
11699         Marek and me just fixed one of our oldest bugs: #28562 :-)
11700
11701         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
11702
11703         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
11704         we're an EnumConstant, just return that.
11705         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
11706         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
11707         to get the value which'll actually be written into the attribute.
11708         However, we have to use GetValue() to access the attribute's value
11709         in the compiler.        
11710
11711 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
11712
11713         * constant.cs (Constant.IsNegative): New abstract property
11714         IsNegative.
11715
11716         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
11717         (StackAlloc.DoResolve): Reused IsNegative.
11718
11719 2004-09-21  Martin Baulig  <martin@ximian.com>
11720
11721         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
11722         if we're used in an iterator, we may be called from different
11723         methods.
11724
11725         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
11726         we actually have an exception block.
11727
11728 2004-09-20  John Luke <jluke@cfl.rr.com>
11729
11730         * class.cs, cs-parser.jay: Improve the error report for 1520:
11731         report the actual line where the error happens, not where the
11732         class was declared.
11733
11734         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
11735         Pass location information that was available elsewhere.
11736
11737 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
11738
11739         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
11740         runtime to delay sign assemblies.
11741
11742 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
11743
11744         * cs-parser.jay: Do not report the stack trace, this is barely
11745         used nowadays.
11746
11747 2004-08-22  John Luke  <john.luke@gmail.com>
11748  
11749         * driver.cs : check that a resource id is not already used
11750         before adding it, report CS1508 if it is, bug #63637
11751
11752 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
11753
11754         * ecore.cs: Removed dead code.
11755
11756 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
11757
11758         * class.cs: Do not report warning CS0067 on the interfaces.
11759
11760 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
11761
11762         * cs-parser.jay: Add error 504 report.
11763
11764 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
11765
11766         * rootcontext.cs: WarningLevel is 4 by default now.
11767
11768         * statement.cs (Fixed.Resolve): Do not null
11769         VariableInfo.
11770
11771 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
11772
11773         Fixed bug #55780
11774         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
11775         deep search when property is not virtual.
11776         (PropertyExpr.ResolveAccessors): Make one call for both
11777         accessors.
11778
11779 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11780
11781         Fixed bug #65766
11782         * statement.cs: Error 152 report constains also location.
11783
11784 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11785
11786         Fixed bug #65766
11787         * const.cs: Explicitly set constant as static.
11788
11789 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11790
11791         Fixed bug #64226
11792         * cs-parser.jay: Add error 1017 report.
11793
11794 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11795
11796         Fixed bug #59980, #64224
11797         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
11798
11799         * typemanager.cs (IsSpecialMethod): Simplified
11800
11801 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
11802
11803         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
11804         condition with better params.
11805
11806 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
11807
11808         Fixed bug #65238
11809         * attribute.cs (Resolve): Property has to have both
11810         accessors.
11811
11812 2004-09-14  Martin Baulig  <martin@ximian.com>
11813
11814         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
11815
11816 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
11817
11818         Fixed bug #61902
11819         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
11820         called and is obsolete then this member suppress message
11821         when call is inside next [Obsolete] method or type.
11822
11823         * expression.cs: Use TestObsoleteMethodUsage member.
11824
11825 2004-09-14  Martin Baulig  <martin@ximian.com>
11826
11827         * cs-parser.jay: Sync a bit with the GMCS version.
11828
11829 2004-09-14  Martin Baulig  <martin@ximian.com>
11830
11831         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
11832         (CSharpParser.yacc_verbose_flag): New public field.
11833
11834         * genericparser.cs: Removed.
11835
11836 2004-09-14  Raja R Harinath  <rharinath@novell.com>
11837
11838         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
11839
11840 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
11841
11842         * class.cs (MethodCore.CheckBase): Fix bug #65757.
11843
11844 2004-09-10  Martin Baulig  <martin@ximian.com>
11845
11846         Backported my MemberName changes from GMCS into MCS.
11847
11848         - we are now using a special `MemberName' class instead of using
11849         strings; in GMCS, the `MemberName' also contains the type
11850         arguments.
11851
11852         - changed the grammar rules a bit:
11853           * the old `member_name' is now a `namespace_or_type_name':
11854             The rule is that we use `namespace_or_type_name' everywhere
11855             where we expect either a "member name" (GetEnumerator) or a
11856             "member name" with an explicit interface name
11857             (IEnumerable.GetEnumerator).
11858             In GMCS, the explicit interface name may include type arguments
11859             (IEnumerable<T>.GetEnumerator).
11860           * we use `member_name' instead of just `IDENTIFIER' for
11861             "member names":
11862             The rule is that we use `member_name' wherever a member may
11863             have type parameters in GMCS.       
11864
11865         * decl.cs (MemberName): New public class.
11866         (MemberCore.MemberName): New public readonly field.
11867         (MemberCore.ctor): Take a `MemberName' argument, not a string.
11868         (DeclSpace): Likewise.
11869
11870         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
11871         * enum.cs (Enum.ctor): Likewise.
11872
11873         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
11874         MemberName.     
11875         (AliasEntry.ctor): Take a MemberName, not an Expression.
11876         (AliasEntry.UsingAlias): Likewise.
11877
11878         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
11879         (IMethodData.MemberName): Changed type from string to MemberName.
11880         (MemberBase.ExplicitInterfaceName): Likewise.
11881         (AbstractPropertyEventMethod.SetupName): Make this private.
11882         (AbstractPropertyEventMethod.ctor): Added `string prefix'
11883         argument; compute the member name here.
11884         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
11885         on the `member.MemberName' and the `prefix'.
11886
11887         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
11888         not `type_name'.
11889         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
11890         thus, we get a `MemberName' instead of a `string'.  These
11891         declarations may have type parameters in GMCS.
11892         (interface_method_declaration, delegate_declaration): Likewise.
11893         (class_declaration, interface_declaration): Likewise.
11894         (method_header): Use `namespace_or_type_name' instead of
11895         `member_name'.  We may be an explicit interface implementation.
11896         (property_declaration, event_declaration): Likewise.
11897         (member_name): This is now just an `IDENTIFIER', not a
11898         `namespace_or_type_name'.
11899         (type_name, interface_type): Removed.
11900         (namespace_or_type_name): Return a MemberName, not an Expression.
11901         (primary_expression): Use `member_name' instead of `IDENTIFIER';
11902         call GetTypeExpression() on the MemberName to get an expression.
11903         (IndexerDeclaration.interface_type): Changed type from string to
11904         MemberName.
11905         (MakeName): Operate on MemberName's instead of string's.
11906
11907 2004-09-13  Raja R Harinath  <rharinath@novell.com>
11908
11909         Fix bug #55770.
11910         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
11911         (NamespaceEntry.Lookup): Add new argument to flag if we want the
11912         lookup to avoid symbols introduced by 'using'.
11913         * rootcontext.cs (NamespaceLookup): Update.
11914
11915 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
11916
11917         * class.cs (TypeContainer.DoDefineMembers): Do not call
11918         DefineDefaultConstructor for static classes.
11919
11920 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
11921
11922         * attribute.cs (Attribute.Resolve): Add error 653 report.
11923
11924         * class.cs (Class.ApplyAttributeBuilder): Add error 641
11925         report.
11926         (Method.ApplyAttributeBuilder): Add error 685 report.
11927         (Operator.Define): Add error 564 report.
11928
11929         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
11930
11931         * expression.cs (Invocation.DoResolve): Add error
11932         245 and 250 report.
11933
11934         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
11935         error 674 report.
11936
11937 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
11938
11939         * class.cs (ConstructorInitializer.Resolve):
11940         Wrong error number (515->516).
11941
11942 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
11943
11944         * class.cs (Indexer.Define): Add error 631 report.
11945
11946 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
11947
11948         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
11949
11950 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
11951
11952         * expression.cs (Probe.DoResolve): Add error CS0241 report.
11953
11954 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
11955
11956         * cs-parser.jay: Added error CS0241 report.
11957
11958 2004-09-10  Raja R Harinath  <rharinath@novell.com>
11959
11960         * cs-parser.jay (fixed_statement): Introduce a scope for the
11961         declaration in the 'fixed' statement.
11962
11963 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
11964
11965         * cs-parser.jay: Added CS0230 error report.
11966
11967 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
11968
11969         * cs-parser.jay: Added errors CS0231 and CS0257 report.
11970
11971 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
11972
11973         * expression.cs (Argument.Resolve): Added error CS0192 and
11974         CS0199 report.
11975
11976 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
11977
11978         C# 2.0 #pragma warning feature
11979
11980         * cs-tokenizer.cs (PreProcessPragma): New method; 
11981         Handles #pragma directive.
11982
11983         * report.cs (WarningRegions): New class; Support
11984         class for #pragma warning directive. It tests whether
11985         warning is enabled for a given line.
11986
11987 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
11988
11989         * const.cs: Add more descriptive error report, tahnks to
11990         Sebastien. 
11991
11992 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
11993
11994         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
11995
11996 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
11997
11998         * expression.cs: Apply patch from Ben: Remove dead code from
11999         ArrayCreation, and remove the TurnintoConstant call in const.cs,
12000         as that code just threw an exception anwyays.
12001
12002         * const.cs: Remove the call to the turnintoconstant, for details
12003         see bug: #63144
12004         
12005         * literal.cs: The type of the null-literal is the null type;  So
12006         we use a placeholder type (literal.cs:System.Null, defined here)
12007         for it.
12008
12009         * expression.cs (Conditional.DoResolve): Remove some old code that
12010         is no longer needed, conversions have been fixed.
12011
12012         (ArrayCreationExpression.DoResolve): Return false if we fail to
12013         resolve the inner expression.
12014
12015 2004-09-07  Raja R Harinath  <rharinath@novell.com>
12016
12017         Fix test-290.cs.
12018         * cs-parser.jay (delegate_declaration): Record a delegate
12019         declaration as a type declaration.
12020         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
12021
12022 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
12023
12024         * parameter.cs: Do not crash if the type can not be resolved. 
12025
12026         * expression.cs: Report errors with unsafe pointers, fixes #64896
12027
12028 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
12029
12030         * expression.cs: Pointer arith always needs to do a conv.i
12031         if the operand is a long. fix 65320
12032
12033 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
12034
12035         Fixed cs0619-37.cs, cs0619-38.cs
12036
12037         * enum.cs (GetObsoleteAttribute): Removed.
12038
12039         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
12040         on Enum member is double staged. The first is tested member
12041         and then enum.
12042
12043 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
12044
12045         Fixed #56986, #63631, #65231
12046
12047         * class.cs: (TypeContainer.AddToMemberContainer): New method,
12048         adds member to name container.
12049         (TypeContainer.AddToTypeContainer): New method, adds type to
12050         name container.
12051         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
12052         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
12053         AddOperator): Simplified by reusing AddToMemberContainer.
12054         (TypeContainer.UserDefinedStaticConstructor): Changed to property
12055         instead of field.
12056         (Method.CheckForDuplications): Fixed implementation to test all
12057         possibilities.
12058         (MemberBase): Detection whether member is explicit interface
12059         implementation is now in constructor.
12060         (MemberBase.UpdateMemberName): Handles IndexerName.
12061         (Accessor): Changed to keep also location information.
12062         (AbstractPropertyEventMethod): Is derived from MemberCore.
12063         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
12064         will be emited or not.
12065         (PropertyBase.AreAccessorsDuplicateImplementation):
12066         Tests whether accessors are not in collision with some method.
12067         (Operator): Is derived from MethodCore to simplify common
12068         operations.
12069
12070         * decl.cs (Flags.TestMethodDuplication): Test for duplication
12071         must be performed.
12072         (DeclSpace.AddToContainer): Adds the member to defined_names
12073         table. It tests for duplications and enclosing name conflicts.
12074
12075         * enum.cs (EnumMember): Clean up to reuse the base structures
12076
12077 2004-09-03  Martin Baulig  <martin@ximian.com>
12078
12079         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
12080         into TypeContainer, to make partial classes work again.
12081
12082 2004-09-03  Martin Baulig  <martin@ximian.com>
12083
12084         * rootcontext.cs (RootContext.V2): Removed.
12085
12086 2004-03-23  Martin Baulig  <martin@ximian.com>
12087
12088         * expression.cs (Invocation.OverloadResolve): Added `bool
12089         may_fail' argument and use it instead of the Location.IsNull() hack.
12090
12091 2004-09-03  Martin Baulig  <martin@ximian.com>
12092
12093         Merged latest changes into gmcs.  Please keep this comment in
12094         here, it makes it easier for me to see what changed in MCS since
12095         the last time I merged.
12096
12097 2004-09-03  Raja R Harinath  <rharinath@novell.com>
12098
12099         Fix #61128.
12100         * expression.cs (BetterConversion): Don't allow either conversion 
12101         to be null.  Remove redundant implicit conversion test when 'q ==
12102         null' -- when this function is invoked, we already know that the
12103         implicit conversion exists.
12104         (BetterFunction): Assume that 'best' is non-null.  Remove
12105         redundant reimplementation of IsApplicable when 'best' is null.
12106         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
12107         number of arguments.
12108         (IsAncestralType): Extract from OverloadResolve.
12109         (OverloadResolve): Make robust to the MethodGroupExpr being
12110         unsorted.  Implement all the logic of Section 14.5.5.1, and
12111         support overloading of methods from multiple applicable types.
12112         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
12113
12114         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
12115         (RealError, Warning): Append type of report to related symbol.
12116
12117 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
12118
12119         * enum.cs: Fixed CLS-Compliance checks for enum members.
12120         Error tests cs3008-8.cs, cs3014-8.cs
12121
12122 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
12123
12124         Fixed bug #62342, #63102
12125         * class.cs: ImplementIndexer uses member.IsExplicitImpl
12126         like ImplementMethod.
12127
12128 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
12129
12130         * attribute.cs (Attribute.GetAttributeArgumentExpression):
12131         Fixed bug #65170.
12132
12133 2004-09-02  Martin Baulig  <martin@ximian.com>
12134
12135         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
12136         TypeManager.GetArgumentTypes() rather than calling GetParameters()
12137         on the MethodBase.
12138
12139 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
12140
12141         C# 2.0 Static classes implemented
12142
12143         * class.cs (TypeContainer): instance_constructors,
12144         initialized_fields, initialized_static_fields,
12145         default_constructor, base_inteface_types are protected to be
12146         accessible from StaticClass.
12147         (TypeContainer.DefineDefaultConstructor): New virtual method
12148         for custom default constructor generating
12149         (StaticClass): New class to handle "Static classes" feature.
12150
12151         * cs-parser.jay: Handle static keyword on class like instance
12152         of StaticClass.
12153
12154         * driver.cs: Added "/langversion" command line switch with two
12155         options (iso-1, default).
12156
12157 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
12158
12159         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
12160
12161 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
12162
12163         * delegate.cs: Style.
12164
12165 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12166
12167         * delegate.cs: Add seperate instance expr field for miguel.
12168
12169 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12170
12171         * PointerArithmetic (Resolve): make sure we are not doing
12172         pointer arith on void*. Also, make sure we are resolved
12173         by not setting eclass until resolve.
12174
12175         All callers: Make sure that PointerArithmetic gets resolved.
12176
12177 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12178
12179         * ArrayCreation (LookupType): If the type does not resolve 
12180         to an array, give an error.
12181
12182 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
12183
12184         * statement.cs (Try.Resolve): Fixed bug #64222
12185
12186 2004-08-27  Martin Baulig  <martin@ximian.com>
12187
12188         * class.cs
12189         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
12190         crash here.     
12191
12192 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
12193
12194         * ecore.cs (Constantify): Get underlying type via
12195         System.Enum.GetUnderlyingType to avoid StackOverflow on the
12196         Windows in special cases.
12197
12198 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
12199
12200         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
12201         for obtaining also private methods.
12202         (GetRemoveMethod): Used GetRemoveMethod (true)
12203         for obtaining also private methods.
12204
12205 2004-08-24  Martin Baulig  <martin@ximian.com>
12206
12207         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
12208         MethodAttributes.HideBySig for operators.
12209
12210 2004-08-23  Martin Baulig  <martin@ximian.com>
12211
12212         Back to the old error reporting system :-)
12213
12214         * report.cs (Message): Removed.
12215         (Report.MessageData, ErrorData, WarningData): Removed.
12216         (Report.Error, Warning): Back to the old system.
12217
12218 2004-08-23  Martin Baulig  <martin@ximian.com>
12219
12220         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
12221
12222         * class.cs (TypeContainer.ParentContainer): New public virtual
12223         method; replaces the explicit interface implementation.
12224         (ClassPart.ParentContainer): Override.
12225
12226 2004-08-23  Martin Baulig  <martin@ximian.com>
12227
12228         * statement.cs (Switch): Added support for constant switches; see
12229         #59428 or test-285.cs.
12230
12231 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
12232
12233         Fixed bug #62740.
12234         * statement.cs (GetEnumeratorFilter): Removed useless
12235         logic because C# specs is strict. GetEnumerator must be
12236         public.
12237
12238 2004-08-22  Martin Baulig  <martin@ximian.com>
12239
12240         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12241         a switch and may break, reset the barrier.  Fixes #59867.
12242
12243 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
12244
12245         CLS-Compliance speed up (~5% for corlib)
12246
12247         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
12248         New method. Tests container for CLS-Compliant names
12249
12250         * class.cs (TypeContainer.VerifyClsName): New method.
12251         Checks whether container name is CLS Compliant.
12252         (Constructor): Implements IMethodData.
12253
12254         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
12255         low-case table for CLS Compliance test.
12256         (MemberCache.VerifyClsParameterConflict): New method.
12257         Checks method parameters for CS3006 error.
12258
12259         * enum.cs (EnumMember): Is derived from MemberCore.
12260         (Enum.VerifyClsName): Optimized for better performance.
12261
12262 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
12263
12264         * report.cs: Renamed Error_T to Error and changed all
12265         references.
12266
12267 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
12268
12269         * class.cs (TypeContainer.IndexerArrayList): New inner class
12270         container for indexers.
12271         (TypeContainer.DefaultIndexerName): New constant for default
12272         indexer name. Replaced all "Item" with this constant.
12273         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
12274
12275         * typemanager.cs (TypeManager.default_member_ctor): Cache here
12276         DefaultMemberAttribute constructor.
12277
12278 2004-08-05  Martin Baulig  <martin@ximian.com>
12279
12280         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
12281         Fix bug #59429.
12282
12283 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
12284
12285         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
12286         multi platforms problem.
12287
12288         * compiler.csproj: Included shared files.
12289
12290 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
12291
12292         Fix bug 60333, 55971 in the more general way
12293         * attribute.cs (Attribute.GetAttributeArgumentExpression):
12294         Added arg_type argument for constant conversion.
12295         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
12296
12297 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
12298
12299         Fix bug #59760
12300         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
12301         OperatorArrayList, MethodCoreArrayList for typecontainer
12302         containers. Changed class member types to these new types.
12303         (MethodArrayList.DefineMembers): Added test for CS0659.
12304
12305 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
12306
12307         * cfold.cs: Synchronize the folding with the code in expression.cs
12308         Binary.DoNumericPromotions for uint operands.
12309
12310         * attribute.cs: Revert patch from Raja, it introduced a regression
12311         while building Blam-1.2.1 (hard to isolate a test case).
12312
12313 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
12314
12315         Fix for #55382
12316         * class.cs:
12317         (TypeContainer.Define): Renamed to DefineContainerMembers because of
12318         name collision.
12319         (MethodCore.parent_method): New member. The method we're overriding
12320         if this is an override method.
12321         (MethodCore.CheckBase): Moved from Method class and made common.
12322         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
12323         private.
12324         (MethodCore.CheckForDuplications): New abstract method. For custom
12325         member duplication search in a container
12326         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
12327         method and its return type.
12328         (Event.conflict_symbol): New member. Symbol with same name in the
12329         parent class.
12330
12331         * decl.cs:
12332         (MemberCache.FindMemberWithSameName): New method. The method
12333         is looking for conflict with inherited symbols.
12334
12335 2004-08-04  Martin Baulig  <martin@ximian.com>
12336
12337         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
12338
12339         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
12340
12341 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
12342
12343         * report.cs (Message): New enum for better error, warning reference in
12344         the code.
12345         (MessageData): New inner abstract class. It generally handles printing of
12346         error and warning messages.
12347         Removed unused Error, Warning, Message methods.
12348
12349 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
12350
12351         Fix for cs0592-8.cs test
12352         * attribute.cs
12353         (Attributable.ValidAttributeTargets): Made public.
12354         (Attribute.ExplicitTarget): New member for explicit target value.
12355         (Attribute.CheckTargets): Now we translate explicit attribute
12356         target to Target here.
12357
12358 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
12359
12360         * ecore.cs (MethodGroupExpr): new IsBase property.
12361
12362         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
12363
12364         * delegate.cs (DelegateCreation): store a MethodGroupExpr
12365         rather than an instance expr.
12366
12367         (DelegateCreation.Emit): Use the method group rather than
12368         the instance expression. Also, if you have base.Foo as the
12369         method for a delegate, make sure to emit ldftn, not ldftnvirt.
12370
12371         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
12372
12373         (NewDelegate.DoResolve): Only check for the existance of Invoke
12374         if the method is going to be needed. Use MethodGroupExpr.
12375
12376         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
12377
12378         * expression.cs: For pointer arith., make sure to use
12379         the size of the type, not the size of the pointer to
12380         the type.
12381
12382 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
12383
12384         Fix for #60722
12385         * class.cs (Class): Added error CS0502 test.
12386
12387 2004-08-03  John Luke  <jluke@cfl.rr.com>
12388             Raja R Harinath  <rharinath@novell.com>
12389
12390         Fix for #60997.
12391         * attribute.cs (Attribute.complained_before): New flag.
12392         (Attribute.ResolveType, Attribute.Resolve),
12393         (Attribute.DefinePInvokeMethod): Set it.
12394         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
12395         
12396 2004-08-03  Martin Baulig  <martin@ximian.com>
12397
12398         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
12399         use a user-defined operator; we still need to do numeric
12400         promotions in case one argument is a builtin type and the other
12401         one has an implicit conversion to that type.  Fixes #62322.
12402
12403 2004-08-02  Martin Baulig  <martin@ximian.com>
12404
12405         * statement.cs (LocalInfo.Flags): Added `IsThis'.
12406         (LocalInfo.IsThis): New public property.
12407         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
12408
12409 2004-08-01  Martin Baulig  <martin@ximian.com>
12410
12411         * class.cs (TypeContainer.GetClassBases): Don't set the default
12412         here since we may get called from GetPartialBases().
12413         (TypeContainer.DefineType): If GetClassBases() didn't return a
12414         parent, use the default one.
12415
12416 2004-07-30  Duncan Mak  <duncan@ximian.com>
12417
12418         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
12419
12420 2004-07-30  Martin Baulig  <martin@ximian.com>
12421
12422         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
12423
12424         * class.cs (SourceMethod): New public class, derive from the
12425         symbol writer's ISourceMethod.
12426         (Method): Use the new symbol writer API.
12427
12428         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
12429         as argument and use the new symbol writer.
12430
12431         * location.cs
12432         (SourceFile): Implement the symbol writer's ISourceFile.
12433         (Location.SymbolDocument): Removed.
12434         (Location.SourceFile): New public property.
12435
12436         * symbolwriter.cs: Use the new symbol writer API.
12437
12438 2004-07-30  Raja R Harinath  <rharinath@novell.com>
12439
12440         * Makefile (install-local): Remove.  Functionality moved to
12441         executable.make.
12442
12443 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
12444
12445         * Makefile: Install mcs.exe.config file together with mcs.exe.
12446         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
12447         correct runtime version.
12448         
12449 2004-07-25  Martin Baulig  <martin@ximian.com>
12450
12451         * class.cs
12452         (TypeContainer.RegisterOrder): Removed, this was unused.
12453         (TypeContainer, interface_order): Removed.
12454         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
12455         TypeContainer as argument since we can also be called with a
12456         `PartialContainer' for a partial class/struct/interface.
12457         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
12458         of checking whether we're an `Interface' - we could be a
12459         `PartialContainer'.
12460         (PartialContainer.Register): Override; call
12461         AddClass()/AddStruct()/AddInterface() on our parent.
12462
12463         * cs-parser.jay (interface_member_declaration): Add things to the
12464         `current_container', not the `current_class'.
12465
12466         * rootcontext.cs (RegisterOrder): The overloaded version which
12467         takes an `Interface' was unused, removed.
12468
12469         * typemanager.cs (TypeManager.LookupInterface): Return a
12470         `TypeContainer', not an `Interface'.
12471         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
12472         contain a `PartialContainer' for an interface, so check it's
12473         `Kind' to figure out what it is.
12474
12475 2004-07-25  Martin Baulig  <martin@ximian.com>
12476
12477         * class.cs (Class.DefaultTypeAttributes): New public constant.
12478         (Struct.DefaultTypeAttributes): Likewise.
12479         (Interface.DefaultTypeAttributes): Likewise.
12480         (PartialContainer.TypeAttr): Override this and add the
12481         DefaultTypeAttributes.
12482
12483 2004-07-25  Martin Baulig  <martin@ximian.com>
12484
12485         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
12486         we can just use the `Parent' field instead.
12487
12488 2004-07-25  Martin Baulig  <martin@ximian.com>
12489
12490         * class.cs (TypeContainer.Emit): Renamed to EmitType().
12491
12492 2004-07-25  Martin Baulig  <martin@ximian.com>
12493
12494         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
12495         our parts before defining any methods.
12496         (TypeContainer.VerifyImplements): Make this virtual.
12497         (ClassPart.VerifyImplements): Override and call VerifyImplements()
12498         on our PartialContainer.
12499
12500 2004-07-25  Martin Baulig  <martin@ximian.com>
12501
12502         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
12503
12504         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
12505         argument, we can just use the `Parent' field instead.
12506
12507         * class.cs
12508         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
12509         (MemberBase.DoDefine): Likewise.
12510
12511 2004-07-24  Martin Baulig  <martin@ximian.com>
12512
12513         * decl.cs (MemberCore.Parent): New public field.
12514         (DeclSpace.Parent): Moved to MemberCore.
12515
12516         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
12517         (MemberBase.ctor): Added TypeContainer argument, pass it to our
12518         parent's .ctor.
12519         (FieldBase, Field, Operator): Likewise.
12520         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
12521         (EventField, Event): Likewise.
12522
12523 2004-07-23  Martin Baulig  <martin@ximian.com>
12524
12525         * class.cs (PartialContainer): New public class.
12526         (ClassPart): New public class.
12527         (TypeContainer): Added support for partial classes.
12528         (TypeContainer.GetClassBases): Splitted some of the functionality
12529         out into GetNormalBases() and GetPartialBases().
12530
12531         * cs-tokenizer.cs (Token.PARTIAL): New token.
12532         (Tokenizer.consume_identifier): Added some hacks to recognize
12533         `partial', but only if it's immediately followed by `class',
12534         `struct' or `interface'.
12535
12536         * cs-parser.jay: Added support for partial clases.
12537
12538 2004-07-23  Martin Baulig  <martin@ximian.com>
12539
12540         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
12541         a `DeclSpace' and also made it readonly.
12542         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
12543         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
12544         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
12545
12546         * cs-parser.jay: Pass the `current_class', not the
12547         `current_container' (at the moment, this is still the same thing)
12548         to a new Method, Property, Event, Indexer or Constructor.
12549
12550 2004-07-23  Martin Baulig  <martin@ximian.com>
12551
12552         * cs-parser.jay (CSharpParser): Added a new `current_class' field
12553         and removed the `current_interface' one.
12554         (struct_declaration, class_declaration, interface_declaration):
12555         Set `current_class' to the newly created class/struct/interface;
12556         set their `Bases' and call Register() before parsing their body.
12557
12558 2004-07-23  Martin Baulig  <martin@ximian.com>
12559
12560         * class.cs (Kind): New public enum.
12561         (TypeContainer): Made this class abstract.
12562         (TypeContainer.Kind): New public readonly field.
12563         (TypeContainer.CheckDef): New public method; moved here from
12564         cs-parser.jay.
12565         (TypeContainer.Register): New public abstract method.
12566         (TypeContainer.GetPendingImplementations): New public abstract
12567         method.
12568         (TypeContainer.GetClassBases): Removed the `is_class' and
12569         `is_iface' parameters.
12570         (TypeContainer.DefineNestedTypes): Formerly known as
12571         DoDefineType().
12572         (ClassOrStruct): Made this class abstract.
12573
12574         * tree.cs (RootTypes): New public type. 
12575
12576 2004-07-20  Martin Baulig  <martin@ximian.com>
12577
12578         * tree.cs (Tree.RecordNamespace): Removed.
12579         (Tree.Namespaces): Removed.
12580
12581         * rootcontext.cs (RootContext.IsNamespace): Removed.
12582
12583         * cs-parser.jay (namespace_declaration): Just create a new
12584         NamespaceEntry here.
12585
12586 2004-07-20  Martin Baulig  <martin@ximian.com>
12587
12588         * statement.cs (ExceptionStatement): New abstract class.  This is
12589         now used as a base class for everyone who's using `finally'.
12590         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
12591         our local variables before using them.
12592
12593         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
12594         virtual method.  This is used by Yield.Resolve() to "steal" an
12595         outer block's `finally' clauses.
12596         (FlowBranchingException): The .ctor now takes an ExceptionStatement
12597         argument.
12598
12599         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
12600         version which takes an ExceptionStatement.  This version must be
12601         used to create exception branchings.
12602
12603         * iterator.cs
12604         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
12605         (Iterator.EmitMoveNext): Added exception support; protect the
12606         block with a `fault' clause, properly handle 'finally' clauses.
12607         (Iterator.EmitDispose): Run all the `finally' clauses here.
12608
12609 2004-07-20  Martin Baulig  <martin@ximian.com>
12610
12611         * iterator.cs: This is the first of a set of changes in the
12612         iterator code.  Match the spec more closely: if we're an
12613         IEnumerable, then GetEnumerator() must be called.  The first time
12614         GetEnumerator() is called, it returns the current instance; all
12615         subsequent invocations (if any) must create a copy.
12616
12617 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
12618
12619         * expression.cs: Resolve the constant expression before returning
12620         it. 
12621
12622 2004-07-19  Martin Baulig  <martin@ximian.com>
12623
12624         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
12625         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
12626         the return type of the new EmitContext.
12627
12628 2004-07-18  Martin Baulig  <martin@ximian.com>
12629
12630         * class.cs (Property.Define): Fix iterators.
12631
12632         * iterators.cs (Iterator.Define): Moved the
12633         `container.AddInterator (this)' call here from the .ctor; only do
12634         it if we resolved successfully.
12635
12636 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
12637
12638         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
12639         `true' for preprocessing directives that we parse.  The return
12640         value indicates whether we should return to regular tokenizing or
12641         not, not whether it was parsed successfully.
12642
12643         In the past if we were in: #if false ... #line #endif, we would
12644         resume parsing after `#line'.  See bug 61604.
12645
12646         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
12647         building: IsEnumType should return true only for enums, not for
12648         enums or System.Enum itself.  This fixes #61593.
12649
12650         Likely what happened is that corlib was wrong: mcs depended on
12651         this bug in some places.  The bug got fixed, we had to add the
12652         hack, which caused bug 61593.
12653
12654         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
12655         that was a workaround for the older conditions.
12656
12657 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
12658
12659         * assign.cs: IAssignMethod has a new interface, as documented
12660         inline. All assignment code now uses this new api.
12661
12662         * ecore.cs, expression.cs: All classes which implement
12663         IAssignMethod now use the new interface.
12664
12665         * expression.cs (Invocation): add a hack to EmitCall so that
12666         IndexerAccess can be the target of a compound assignment without
12667         evaluating its arguments twice.
12668
12669         * statement.cs: Handle changes in Invocation api.
12670
12671 2004-07-16  Martin Baulig  <martin@ximian.com>
12672
12673         * iterators.cs: Rewrote this.  We're now using one single Proxy
12674         class for both the IEnumerable and the IEnumerator interface and
12675         `Iterator' derives from Class so we can use the high-level API.
12676
12677         * class.cs (TypeContainer.AddIterator): New method.
12678         (TypeContainer.DoDefineType): New protected virtual method, which
12679         is called from DefineType().
12680         (TypeContainer.DoDefineMembers): Call DefineType() and
12681         DefineMembers() on all our iterators.
12682         (TypeContainer.Emit): Call Emit() on all our iterators.
12683         (TypeContainer.CloseType): Call CloseType() on all our iterators.
12684
12685         * codegen.cs (EmitContext.CurrentIterator): New public field.
12686
12687 2004-07-15  Martin Baulig  <martin@ximian.com>
12688
12689         * typemanager.cs
12690         (TypeManager.not_supported_exception_type): New type.   
12691
12692 2004-07-14  Martin Baulig  <martin@ximian.com>
12693
12694         * iterators.cs: Use real error numbers.
12695
12696 2004-07-14  Martin Baulig  <martin@ximian.com>
12697
12698         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
12699         requires this to be a System.Collection.IEnumerable and not a
12700         class implementing that interface.
12701         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
12702
12703 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
12704
12705         * class.cs: Fixed previous fix, it broke some error tests.
12706
12707 2004-07-12  Martin Baulig  <martin@ximian.com>
12708
12709         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
12710         Fixes #61293.
12711
12712 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
12713
12714         * assign.cs (LocalTemporary): Add new argument: is_address,If
12715         `is_address' is true, then the value that we store is the address
12716         to the real value, and not the value itself.
12717         
12718         * ecore.cs (PropertyExpr): use the new local temporary
12719         stuff to allow us to handle X.Y += z (where X is a struct)
12720
12721 2004-07-08  Martin Baulig  <martin@ximian.com>
12722
12723         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
12724         not always return, just like we're doing in Using.Resolve().
12725
12726 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
12727
12728         * cs-parser.jay (fixed_statement): flag this as Pinned.
12729
12730 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
12731
12732         * typemanager.cs (TypeManager): Removed MakePinned method, this
12733         mechanism is replaced with the .NET 2.x compatible mechanism of
12734         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
12735
12736         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
12737         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
12738         `IsFixed' property which has a different meaning.
12739
12740 2004-07-02  Raja R Harinath  <rharinath@novell.com>
12741
12742         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
12743         visible from inside a nested class, not just the names of the
12744         immediately enclosing class.
12745         Fix for bug #60730.
12746
12747 2004-06-24  Raja R Harinath  <rharinath@novell.com>
12748
12749         * expression.cs (BetterConversion): Remove buggy special-case
12750         handling of "implicit constant expression conversions".  At this
12751         point, we already know that the conversion is possible -- we're
12752         only checking to see which is better.
12753
12754 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12755
12756         * cs-parser.jay: Added error CS0210 test.
12757
12758 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12759
12760         * cs-parser.jay: Added error CS0134 test.
12761
12762 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12763
12764         Fix bug #52507
12765         * cs-parser.jay: Added error CS0145 test.
12766
12767 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12768
12769         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
12770
12771 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
12772         
12773         * expression.cs (StackAlloc.Resolve): The argument may not
12774         be a constant; deal with this case.
12775         
12776 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
12777
12778         * attribute.cs (IndexerName_GetIndexerName): Renamed to
12779         GetIndexerAttributeValue.
12780         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
12781
12782         * class.cs (Indexer.Define): Added error tests for CS0415,
12783         CS0609.
12784
12785 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
12786
12787         * attribute.cs (Attribute.Resolve): Keep field code in sync with
12788         property code.
12789
12790 2004-06-23  Martin Baulig  <martin@ximian.com>
12791
12792         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
12793         neither return nor throw, reset the barrier as well.  Fixes #60457.
12794
12795 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
12796
12797         * class.cs : EventAttributes is now set to None by default.
12798           This fixes bug #60459.
12799
12800 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
12801
12802         Fix bug #60219
12803         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
12804         Don't throw exception but return null (it's sufficient now).
12805
12806 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
12807
12808         * typemanager.cs (GetArgumentTypes): Faster implementation.
12809
12810 2004-06-18  Martin Baulig  <martin@ximian.com>
12811
12812         * attribute.cs (Attribute.Resolve): Check whether we're an
12813         EmptyCast which a Constant child.  Fixes #60333.
12814
12815 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
12816
12817         * statement.cs (EmitCollectionForeach): Account for the fact that
12818         not all valuetypes are in areas which we can take the address of.
12819         For these variables, we store to a temporary variable. Also, make
12820         sure that we dont emit a `callvirt' on a valuetype method.
12821
12822 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
12823
12824         * expression.cs (StackAlloc.DoReSolve): Added test for
12825         negative parameter (CS0247).
12826
12827 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
12828
12829         Fix bug #59792
12830         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
12831
12832 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
12833
12834         Fix bug #59781
12835         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
12836         ulong.
12837
12838 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
12839
12840         Fix bug #58254 & cs1555.cs, cs1556.cs
12841         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
12842
12843 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
12844
12845         * cs-parser.jay: Added error CS1669 test for indexers.
12846
12847 2004-06-11  Martin Baulig  <martin@ximian.com>
12848
12849         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
12850         call this twice: for params and varargs methods.
12851
12852 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12853
12854         * class.cs:
12855         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
12856
12857 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12858
12859         * attribute.cs (Attribute.GetValidTargets): Made public.
12860
12861         * class.cs: 
12862         (AbstractPropertyEventMethod): New class for better code sharing.
12863         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
12864         CS1667 report.
12865         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
12866
12867 2004-06-11  Raja R Harinath  <rharinath@novell.com>
12868
12869         Fix bug #59477.
12870         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
12871         that the call to Resolve is part of a MemberAccess.
12872         (Expression.Resolve): Use it for SimpleName resolution.
12873         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
12874         Add 'intermediate' boolean argument.
12875         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
12876         error message when the SimpleName can be resolved ambiguously
12877         between an expression and a type.
12878         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
12879         public.
12880         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
12881         call on the left-side.
12882
12883 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12884
12885         * class.cs:
12886         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
12887
12888 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12889
12890         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
12891
12892 2004-06-11  Martin Baulig  <martin@ximian.com>
12893
12894         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
12895         varargs methods if applicable.
12896
12897 2004-06-11  Martin Baulig  <martin@ximian.com>
12898
12899         * expression.cs (Invocation.EmitCall): Don't use
12900         `method.CallingConvention == CallingConventions.VarArgs' since the
12901         method could also have `CallingConventions.HasThis'.
12902
12903 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12904
12905         * class.cs (Event.GetSignatureForError): Implemented.
12906         Fixed crash in error test cs3010.cs
12907
12908 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
12909
12910         * cs-tokenizer.cs: Change the way we track __arglist to be
12911         consistent with the other keywords.
12912
12913 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
12914
12915         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
12916         tomorrow.
12917
12918 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
12919
12920         * codegen.cs: Check that all referenced assemblies have a strongname
12921         before strongnaming the compiled assembly. If not report error CS1577.
12922         Fix bug #56563. Patch by Jackson Harper.
12923         * typemanager.cs: Added a method to return all referenced assemblies.
12924         Fix bug #56563. Patch by Jackson Harper.
12925
12926 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
12927
12928         * class.cs:
12929         (Method.ApplyAttributeBuilder): Moved and added conditional
12930         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
12931
12932         * delegate.cs:
12933         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
12934
12935 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
12936
12937         Fixed #59640
12938         * class.cs: (EventField.attribute_targets): Changed default target.
12939
12940 2004-06-08  Martin Baulig  <martin@ximian.com>
12941
12942         * expression.cs (Invocation.EmitCall): Enable varargs methods.
12943
12944 2004-06-08  Martin Baulig  <martin@ximian.com>
12945
12946         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
12947
12948 2004-06-07  Martin Baulig  <martin@ximian.com>
12949
12950         Added support for varargs methods.
12951
12952         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
12953         keyword.
12954
12955         * cs-parser.jay: Added support for `__arglist'.
12956
12957         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
12958
12959         * expression.cs (Argument.AType): Added `ArgList'.
12960         (Invocation): Added support for varargs methods.
12961         (ArglistAccess): New public class.
12962         (Arglist): New public class.
12963
12964         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
12965
12966         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
12967         a method's top-level block if the method has varargs.
12968
12969         * support.cs (ReflectionParameters, InternalParameters): Added
12970         support for varargs methods.    
12971
12972 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
12973
12974         * class.cs: Provide location in indexer error report.
12975
12976         * driver.cs: Use standard names.
12977
12978         * namespace.cs: Catch the use of using after a namespace has been
12979         declared also on using aliases.
12980
12981 2004-06-03  Raja R Harinath  <rharinath@novell.com>
12982
12983         Bug #50820.
12984         * typemanager.cs (closure_private_ok, closure_invocation_type)
12985         (closure_qualifier_type, closure_invocation_assembly)
12986         (FilterWithClosure): Move to ...
12987         (Closure): New internal nested class.
12988         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
12989         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
12990         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
12991         (MemberLookup, MemberLookupFailed): Use it.
12992         * expression.cs (New.DoResolve): Treat the lookup for the
12993         constructor as being qualified by the 'new'ed type.
12994         (Indexers.GetIndexersForTypeOrInterface): Update.
12995
12996 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
12997
12998         * attribute.cs
12999         (GetConditionalAttributeValue): New method. Returns
13000         condition of ConditionalAttribute.
13001         (SearchMulti): New method.  Returns all attributes of type 't'.
13002         Use it when attribute is AllowMultiple = true.
13003         (IsConditionalMethodExcluded): New method.
13004
13005         * class.cs
13006         (Method.IsExcluded): Implemented. Returns true if method has conditional
13007         attribute and the conditions is not defined (method is excluded).
13008         (IMethodData): Extended interface for ConditionalAttribute support.
13009         (PropertyMethod.IsExcluded): Implemented.
13010
13011         * decl.cs
13012         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
13013
13014         * expression.cs
13015         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
13016         on the method.
13017
13018 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13019
13020         * expression.cs (ArrayCreationExpression): Make this just an
13021         `expression'. It can't be a statement, so the code here was
13022         dead.
13023
13024 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
13025
13026         Fixed #59072
13027         * typemanager.cs (GetFullNameSignature): New method for
13028         MethodBase types.
13029
13030 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
13031
13032         Fixed #56452
13033         * class.cs (MemberBase.GetSignatureForError): New virtual method.
13034         Use this method when MethodBuilder is null.
13035         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
13036         Added test for error CS0626 (MONO reports error for this situation).
13037         (IMethodData.GetSignatureForError): Extended interface.
13038
13039 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
13040
13041         * attribute.cs
13042         (AttributeTester.GetObsoleteAttribute): Returns instance of
13043         ObsoleteAttribute when type is obsolete.
13044
13045         * class.cs
13046         (TypeContainer.VerifyObsoleteAttribute): Override.
13047         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
13048         (MethodCode.VerifyObsoleteAttribute): Override.
13049         (MemberBase.VerifyObsoleteAttribute): Override.
13050
13051         * decl.cs
13052         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
13053         and report proper error.
13054
13055         *delegate.cs
13056         Delegate.VerifyObsoleteAttribute): Override.
13057
13058         * ecore.cs
13059         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
13060         and report proper error.
13061         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
13062
13063         * enum.cs
13064         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
13065         and enum member.
13066
13067         * expression.cs
13068         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
13069         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
13070         Added test for ObsoleteAttribute.
13071
13072         * statement.cs
13073         (Catch): Derived from Statement.
13074
13075 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
13076  
13077         Fixed bug #59071 & cs0160.cs
13078  
13079         * statement.cs (Try.Resolve): Check here whether order of catch
13080         clauses matches their dependencies.
13081
13082 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
13083
13084         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
13085         caused a regression: #59343.  Referencing nested classes from an
13086         assembly stopped working.
13087
13088 2004-05-31  Martin Baulig  <martin@ximian.com>
13089
13090         MCS is now frozen for beta 2.
13091
13092 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13093
13094         * convert.cs: add a trivial cache for overload operator resolution.
13095
13096 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13097
13098         * decl.cs: If possible, use lookuptypedirect here. We can only do
13099         this if there is no `.' after the namespace. Avoids using
13100         LookupType, which does lots of slow processing.
13101         (FindNestedType) New method, does what it says :-).
13102         * namespace.cs: use LookupTypeDirect.
13103         * rootcontext.cs: use membercache, if possible.
13104         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
13105
13106 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13107
13108         * expression.cs:
13109         According to the spec, 
13110
13111         In a member access of the form E.I, if E is a single identifier,
13112         and if the meaning of E as a simple-name (§7.5.2) is a constant,
13113         field, property, localvariable, or parameter with the same type as
13114         the meaning of E as a type-name (§3.8), then both possible
13115         meanings of E are permitted.
13116
13117         We did not check that E as a simple-name had the same type as E as
13118         a type name.
13119
13120         This trivial check gives us 5-7% on bootstrap time.
13121
13122 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13123
13124         * expression.cs (Invocation.OverloadResolve): Avoid the
13125         use of hashtables and boxing here by allocating on demand.
13126
13127 2004-05-30  Martin Baulig  <martin@ximian.com>
13128
13129         * rootcontext.cs (RootContext.LookupType): Don't cache things if
13130         we're doing a silent lookup.  Don't try to lookup nested types in
13131         TypeManager.object_type (thanks to Ben Maurer).
13132
13133 2004-05-30  Martin Baulig  <martin@ximian.com>
13134
13135         Committing a patch from Ben Maurer.
13136
13137         * rootcontext.cs (RootContext.LookupType): Cache negative results.
13138
13139 2004-05-29  Martin Baulig  <martin@ximian.com>
13140
13141         * class.cs (IMethodData.ShouldIgnore): New method.
13142
13143         * typemanager.cs (TypeManager.MethodFlags): Don't take a
13144         `Location' argument, we don't need it anywhere.  Use
13145         `IMethodData.ShouldIgnore ()' instead of
13146         `MethodData.GetMethodFlags ()'.
13147         (TypeManager.AddMethod): Removed.
13148         (TypeManager.AddMethod2): Renamed to AddMethod.
13149
13150 2004-05-29  Martin Baulig  <martin@ximian.com>
13151
13152         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
13153
13154         * convert.cs (Convert.ImplicitReferenceConversion): If we're
13155         converting from a class type S to an interface type and we already
13156         have an object on the stack, don't box it again.  Fixes #52578.
13157
13158 2004-05-29  Martin Baulig  <martin@ximian.com>
13159
13160         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
13161         Added support for `params' parameters.  Fixes #59267.
13162
13163 2004-05-29  Martin Baulig  <martin@ximian.com>
13164
13165         * literal.cs (NullPointer): Provide a private .ctor which sets
13166         `type' to TypeManager.object_type.  Fixes #59048.
13167
13168 2004-05-29  Martin Baulig  <martin@ximian.com>
13169
13170         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
13171         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
13172
13173         * ecore.cs (EventExpr.instance_expr): Make the field private.
13174
13175 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
13176
13177         Fixed bug #50080 & cs0214-2.cs
13178         * expression.cs (Cast.DoResolve): Check unsafe context here.
13179         
13180         * statement.cs (Resolve.DoResolve): Likewise.
13181
13182 2004-05-26  Martin Baulig  <martin@ximian.com>
13183
13184         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
13185
13186         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
13187         (RootContext.LookupType): Pass down the `silent' flag.
13188
13189 2004-05-25  Martin Baulig  <martin@ximian.com>
13190
13191         * expression.cs
13192         (MethodGroupExpr.IdenticalTypeName): New public property.
13193         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
13194         expression actually refers to a type.
13195
13196 2004-05-25  Martin Baulig  <martin@ximian.com>
13197
13198         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
13199         for #56176 and made it actually work.
13200
13201 2004-05-25  Martin Baulig  <martin@ximian.com>
13202
13203         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
13204         (FieldExpr, PropertyExpr): Override and implement
13205         CacheTemporaries.  Fixes #52279.
13206
13207 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
13208
13209         * location.cs: In the new compiler listing a file twice is a
13210         warning, not an error.
13211
13212 2004-05-24  Martin Baulig  <martin@ximian.com>
13213
13214         * enum.cs (Enum.DefineType): For the `BaseType' to be a
13215         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
13216
13217 2004-05-24  Martin Baulig  <martin@ximian.com>
13218
13219         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
13220         walking the `using' list.  Fixes #53921.
13221
13222 2004-05-24  Martin Baulig  <martin@ximian.com>
13223
13224         * const.cs (Const.LookupConstantValue): Added support for
13225         EmptyCast's; fixes #55251.
13226
13227 2004-05-24  Martin Baulig  <martin@ximian.com>
13228
13229         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
13230         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
13231         which does the CS0135 check.  The reason is that we first need to
13232         check whether the variable actually exists.
13233
13234 2004-05-24  Martin Baulig  <martin@ximian.com>
13235
13236         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
13237         than RootContext.LookupType() to find the explicit interface
13238         type.  Fixes #58584.
13239
13240 2004-05-24  Raja R Harinath  <rharinath@novell.com>
13241
13242         * Makefile: Simplify.  Use executable.make.
13243         * mcs.exe.sources: New file.  List of sources of mcs.exe.
13244
13245 2004-05-24  Anders Carlsson  <andersca@gnome.org>
13246
13247         * decl.cs:
13248         * enum.cs:
13249         Use the invariant culture when doing String.Compare for CLS case
13250         sensitivity.
13251         
13252 2004-05-23  Martin Baulig  <martin@ximian.com>
13253
13254         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
13255         don't have any dots.  Fixes #52622, added cs0246-8.cs.
13256
13257         * namespace.cs (NamespaceEntry.Lookup): Likewise.
13258         
13259 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
13260
13261         * class.cs (MemberBase.Define): Reuse MemberType member for 
13262         resolved type. Other methods can use it too.
13263
13264 2004-05-23  Martin Baulig  <martin@ximian.com>
13265
13266         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
13267         the variable also exists in the current block (otherwise, we need
13268         to report a CS0103).  Fixes #58670.
13269
13270 2004-05-23  Martin Baulig  <martin@ximian.com>
13271
13272         * flowanalysis.cs (Reachability.Reachable): Compute this
13273         on-the-fly rather than storing it as a field.
13274
13275 2004-05-23  Martin Baulig  <martin@ximian.com>
13276
13277         * flowanalysis.cs (Reachability.And): Manually compute the
13278         resulting `barrier' from the reachability.      
13279        
13280 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
13281
13282         Fix bug #57835
13283         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
13284         instance of ObsoleteAttribute when symbol is obsolete.
13285
13286         * class.cs
13287         (IMethodData): Extended interface for ObsoleteAttribute support.
13288
13289 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
13290
13291         * attribute.cs: Fix bug #55970
13292
13293 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
13294
13295         Fix bug #52705
13296         * attribute.cs
13297         (GetObsoleteAttribute): New method. Creates the instance of
13298         ObsoleteAttribute.
13299         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
13300         ObsoleteAttribute when member is obsolete.
13301         (AttributeTester.Report_ObsoleteMessage): Common method for
13302         Obsolete error/warning reporting.
13303
13304         * class.cs
13305         (TypeContainer.base_classs_type): New member for storing parent type.
13306
13307         * decl.cs
13308         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
13309         for this MemberCore.
13310
13311 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
13312
13313         * attribute.cs, const.cs: Fix bug #58590
13314
13315 2004-05-21  Martin Baulig  <martin@ximian.com>
13316
13317         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
13318         out parameters if the end of the method is unreachable.  Fixes
13319         #58098. 
13320
13321 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
13322
13323         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
13324         Hari was right, why extra method.
13325
13326 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
13327
13328         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
13329
13330 2004-05-20  Martin Baulig  <martin@ximian.com>
13331
13332         Merged this back from gmcs to keep the differences to a minumum.
13333
13334         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
13335         instead of a Declspace.
13336         (Attribute.ResolveType): Likewise.
13337         (Attributes.Search): Likewise.
13338         (Attributes.Contains): Likewise.
13339         (Attributes.GetClsCompliantAttribute): Likewise.
13340
13341         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
13342         argument.
13343         (MethodData.ApplyAttributes): Take an EmitContext instead of a
13344         DeclSpace.
13345
13346 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
13347
13348         Fix bug #58688 (MCS does not report error when the same attribute
13349         is assigned twice)
13350
13351         * attribute.cs (Attribute.Emit): Distinction between null and default.
13352
13353 2004-05-19  Raja R Harinath  <rharinath@novell.com>
13354
13355         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
13356         of a top-level attribute without an attribute target.
13357         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
13358         Make non-static.
13359         (Attribute.Conditional_GetConditionName), 
13360         (Attribute.Obsolete_GetObsoleteMessage): Update.
13361         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
13362         part of ScanForIndexerName.
13363         (Attribute.CanIgnoreInvalidAttribute): New function.
13364         (Attribute.ScanForIndexerName): Move to ...
13365         (Attributes.ScanForIndexerName): ... here.
13366         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
13367         (Attributes.Search): New internal variant that can choose not to
13368         complain if types aren't resolved.  The original signature now
13369         complains.
13370         (Attributes.GetClsCompliantAttribute): Use internal variant, with
13371         complaints suppressed.
13372         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
13373         only if it not useful.
13374         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
13375         top-level for attributes that are shared between the assembly
13376         and a top-level class.
13377         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
13378         * class.cs: Update to reflect changes.
13379         (DefineIndexers): Fuse loops.
13380         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
13381         a couple more variants of attribute names.
13382
13383 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
13384
13385         Fix bug #52585 (Implemented explicit attribute declaration)
13386
13387         * attribute.cs:
13388         (Attributable.ValidAttributeTargets): New abstract method. It gets
13389         list of valid attribute targets for explicit target declaration.
13390         (Attribute.Target): It holds target itself.
13391         (AttributeSection): Removed.
13392         (Attribute.CheckTargets): New method. It checks whether attribute
13393         target is valid for the current element.
13394
13395         * class.cs:
13396         (EventProperty): New class. For events that are declared like
13397         property (with add and remove accessors).
13398         (EventField): New class. For events that are declared like field.
13399         class.cs
13400
13401         * cs-parser.jay: Implemented explicit attribute target declaration.
13402
13403         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
13404         Override ValidAttributeTargets.
13405
13406         * parameter.cs:
13407         (ReturnParameter): Class for applying custom attributes on 
13408         the return type.
13409         (ParameterAtribute): New class. Class for applying custom
13410         attributes on the parameter type.
13411
13412 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
13413
13414         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
13415         definitions. 
13416
13417         (Method): Allow UNSAFE here.
13418
13419         * modifiers.cs: Support unsafe reporting.
13420
13421 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
13422
13423         * decl.cs: Fix bug #58478.
13424
13425 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13426
13427         * statement.cs: When checking for unreachable code on an EmptyStatement,
13428         set the location. Fixes bug #58488.
13429
13430 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
13431
13432         * driver.cs: Add -pkg handling.
13433
13434         From Gonzalo: UseShelLExecute=false
13435
13436 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
13437
13438         * attribute.cs:
13439         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
13440         for attribute.
13441         (Attribute.IsClsCompliaceRequired): Moved to base for better
13442         accesibility.
13443         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
13444         when attribute is AttributeUsageAttribute.
13445         (Attribute.GetValidTargets): Simplified.
13446         (Attribute.GetAttributeUsage): New method returns AttributeUsage
13447         attribute for this type.
13448         (Attribute.ApplyAttributes): Method renamed to Emit and make
13449         non-static.
13450         (GlobalAttributeSection): New class for special handling of global
13451         attributes (assembly, module).
13452         (AttributeSection.Emit): New method.
13453
13454         * class.cs: Implemented Attributable abstract methods.
13455         (MethodCore.LabelParameters): Moved to Parameter class.
13456         (Accessor): Is back simple class.
13457         (PropertyMethod): Implemented Attributable abstract class.
13458         (DelegateMethod): Implemented Attributable abstract class.
13459         (Event): New constructor for disctintion between normal Event
13460         and Event with accessors.
13461
13462         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
13463
13464         * codegen.cs, const.cs, decl.cs, delegate.cs:
13465         (CommonAssemblyModulClass): Implemented Attributable abstract class
13466         and simplified.
13467
13468         * enum.cs: Implement IAttributeSupport interface.
13469         (EnumMember): New class for emum members. Implemented Attributable
13470         abstract class
13471
13472         * parameter.cs:
13473         (ParameterBase): Is abstract.
13474         (ReturnParameter): New class for easier [return:] attribute handling.
13475
13476         * typemanager.cs: Removed builder_to_attr.
13477
13478 2004-05-11  Raja R Harinath  <rharinath@novell.com>
13479
13480         Fix bug #57151.
13481         * attribute.cs (Attribute.GetPositionalValue): New function.
13482         * class.cs (TypeContainer.VerifyMembers): New function.
13483         (TypeContainer.Emit): Use it.
13484         (ClassOrStruct): New base class for Class and Struct.
13485         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
13486         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
13487         class.
13488         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
13489         then each non-static field should have a FieldOffset attribute.
13490         Otherwise, none of the fields should have a FieldOffset attribute.
13491         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
13492         and FieldOffset attributes.
13493         * typemanager.cs (TypeManager.struct_layout_attribute_type)
13494         (TypeManager.field_offset_attribute_type): New core types.
13495         (TypeManager.InitCoreTypes): Initialize them.
13496
13497 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
13498
13499         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
13500         Return correct type.
13501         From bug #58270.
13502
13503 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
13504
13505         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
13506         be implicitly converted to ulong.
13507         
13508         * expression.cs: The logic for allowing operator &, | and ^ worked
13509         was wrong, it worked before because we did not report an error in
13510         an else branch.  Fixes 57895.
13511
13512         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
13513         allow volatile fields to be reference types.
13514
13515 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
13516
13517         * driver.cs: Add support for /debug-
13518
13519 2004-05-07  Raja R Harinath  <rharinath@novell.com>
13520
13521         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
13522         Add a 'complain' parameter to silence errors.
13523         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
13524         silently overlooked type-resolutions.
13525         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
13526         to reflect changes.
13527         (Attributes.Search): New function.
13528         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
13529         (Attributes.GetAttributeFullName): Remove hack.
13530         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
13531         Update to reflect changes.
13532         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13533         Use Attributes.Search instead of nested loops.
13534
13535 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
13536
13537         * decl.cs:
13538         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
13539         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
13540         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
13541
13542         * report.cs: (Report.Warning): Renamed to Warning_T because of
13543         parameter collision.
13544
13545 2004-05-05  Raja R Harinath  <rharinath@novell.com>
13546
13547         * expression.cs (MemberAccess.ResolveMemberAccess):
13548         Exit with non-zero status after Report.Error.
13549         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
13550         Likewise.
13551         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
13552
13553 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
13554
13555         * support.cs: Don't hang when the file is empty.
13556
13557 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
13558
13559         * support.cs: In SeekableStreamReader, compute the preamble size of the
13560           underlying stream. Position changes should take into account that initial
13561           count of bytes.
13562
13563 2004-05-03  Todd Berman  <tberman@sevenl.net>
13564
13565         * driver.cs: remove unused GetSysVersion function.
13566
13567 2004-05-03  Todd Berman  <tberman@sevenl.net>
13568
13569         * driver.cs: Remove the hack from saturday, as well as the hack
13570         from jackson (LoadAssemblyFromGac), also adds the CWD to the
13571         link_paths to get that bit proper.
13572
13573 2004-05-01  Todd Berman  <tberman@sevenl.net>
13574
13575         * driver.cs: Try a LoadFrom before a Load, this checks the current
13576         path. This is currently a bug in mono that is be fixed, however, this
13577         provides a workaround for now. This will be removed when the bug
13578         is fixed.
13579
13580 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
13581
13582         * CryptoConvert.cs: Updated to latest version. Fix issue with 
13583         incomplete key pairs (#57941).
13584
13585 2004-05-01  Todd Berman  <tberman@sevenl.net>
13586
13587         * driver.cs: Remove '.' from path_chars, now System.* loads properly
13588         from the GAC
13589
13590 2004-04-30  Jackson Harper  <jackson@ximian.com>
13591
13592         * codegen.cs: Open keys readonly.
13593         
13594 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13595
13596         * typemanager.cs: don't report cyclic struct layout when a struct
13597         contains 2 or more fields of the same type. Failed for Pango.AttrShape
13598         which has 2 Pango.Rectangle fields.
13599
13600 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13601
13602         * expression.cs: Handle IntPtr comparisons with IL code
13603         rather than a method call.
13604
13605 2004-04-29  Martin Baulig  <martin@ximian.com>
13606
13607         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
13608         the list of PropertyInfo's in class hierarchy and find the
13609         accessor.  Fixes #56013.
13610
13611 2004-04-29  Martin Baulig  <martin@ximian.com>
13612
13613         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
13614
13615 2004-04-29  Martin Baulig  <martin@ximian.com>
13616
13617         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13618
13619         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
13620
13621 2004-04-29  Martin Baulig  <martin@ximian.com>
13622
13623         * class.cs (ConstructorInitializer.Resolve): Check whether the
13624         parent .ctor is accessible.  Fixes #52146.
13625
13626 2004-04-29  Martin Baulig  <martin@ximian.com>
13627
13628         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13629
13630         * statement.cs (Using.EmitLocalVariableDecls): Use
13631         TypeManager.idisposable_type, not typeof (IDisposable).
13632         (Foreach.EmitCollectionForeach): Added support for valuetypes.
13633
13634 2004-04-29  Martin Baulig  <martin@ximian.com>
13635
13636         * class.cs (Event.Define): Don't emit the field and don't set
13637         RTSpecialName and SpecialName for events on interfaces.  Fixes
13638         #57703. 
13639
13640 2004-04-29  Raja R Harinath  <rharinath@novell.com>
13641
13642         Refactor Attribute.ApplyAttributes.
13643         * attribute.cs (Attributable): New base class for objects that can
13644         have Attributes applied on them.
13645         (Attribute): Make AttributeUsage fields public.
13646         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
13647         (Attribute.IsInternalCall): New property.
13648         (Attribute.UsageAttr): Convert to a public read-only property.
13649         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
13650         (Attribute.ResolveType, Attribute.Resolve)
13651         (Attribute.ScanForIndexerName): Update to reflect changes.
13652         (Attribute.CheckAttributeTarget): Re-format.
13653         (Attribute.ApplyAttributes): Refactor, to various
13654         Attributable.ApplyAttributeBuilder methods.
13655         * decl.cs (MemberCore): Make Attributable.
13656         * class.cs (Accessor): Make Attributable.
13657         (MethodData.ApplyAttributes): Use proper attribute types, not
13658         attribute names.
13659         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
13660         (TypeContainer.ApplyAttributeBuilder)
13661         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
13662         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
13663         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
13664         (Operator.ApplyAttributeBuilder): New factored-out methods.
13665         * const.cs (Const.ApplyAttributeBuilder): Likewise.
13666         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
13667         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
13668         * parameter.cs (ParameterBase): New Attributable base class
13669         that can also represent Return types.
13670         (Parameter): Update to the changes.
13671
13672 2004-04-29  Jackson Harper  <jackson@ximian.com>
13673
13674         * driver.cs: Prefer the corlib system version when looking for
13675         assemblies in the GAC. This is still a hack, but its a better hack
13676         now.
13677         
13678 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
13679
13680         * decl.cs, enum.cs: Improved error 3005 reporting.
13681   
13682         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
13683         (related_symbols): New private member for list of symbols
13684         related to reported error/warning.
13685         
13686         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
13687
13688 2004-04-29  Martin Baulig  <martin@ximian.com>
13689
13690         * ecore.cs (Expression.Constantify): If we're an enum and
13691         TypeManager.TypeToCoreType() doesn't give us another type, use
13692         t.UnderlyingSystemType.  Fixes #56178.  
13693
13694 2004-04-29  Martin Baulig  <martin@ximian.com>
13695
13696         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
13697         interfaces and for each interface, only add members directly
13698         declared in that interface.  Fixes #53255.
13699
13700 2004-04-28  Martin Baulig  <martin@ximian.com>
13701
13702         * expression.cs (ConditionalLogicalOperator): Use a temporary
13703         variable for `left' to avoid that we evaluate it more than once;
13704         bug #52588.
13705
13706 2004-04-28  Martin Baulig  <martin@ximian.com>
13707
13708         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
13709         `void[]' (CS1547).
13710
13711 2004-04-28  Martin Baulig  <martin@ximian.com>
13712
13713         * statement.cs (LocalInfo.Resolve): Check whether the type is not
13714         void (CS1547).
13715
13716         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
13717         whether the type is not void (CS1547).
13718
13719 2004-04-28  Martin Baulig  <martin@ximian.com>
13720
13721         * expression.cs (Unary.DoResolveLValue): Override this and report
13722         CS0131 for anything but Operator.Indirection.
13723
13724 2004-04-28  Martin Baulig  <martin@ximian.com>
13725
13726         Committing a patch from Ben Maurer; see bug #50820.
13727
13728         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13729         check for classes.
13730
13731         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13732         classes.        
13733
13734 2004-04-28  Martin Baulig  <martin@ximian.com>
13735
13736         Committing a patch from Ben Maurer; see bug #50820.
13737
13738         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13739         check for classes.
13740
13741         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13742         classes.        
13743
13744 2004-04-28  Martin Baulig  <martin@ximian.com>
13745
13746         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
13747         (Block.AddLabel): Call DoLookupLabel() to only search in the
13748         current block.
13749
13750 2004-04-28  Martin Baulig  <martin@ximian.com>
13751
13752         * cfold.cs (ConstantFold.BinaryFold): Added special support for
13753         comparing StringConstants and NullLiterals in Equality and Inequality.
13754
13755 2004-04-28  Jackson Harper  <jackson@ximian.com>
13756
13757         * driver.cs: Attempt to load referenced assemblies from the
13758         GAC. This is the quick and dirty version of this method that
13759         doesnt take into account versions and just takes the first
13760         canidate found. Will be good enough for now as we will not have more
13761         then one version installed into the GAC until I update this method.
13762
13763 2004-04-28  Martin Baulig  <martin@ximian.com>
13764
13765         * typemanager.cs (TypeManager.CheckStructCycles): New public
13766         static method to check for cycles in the struct layout.
13767
13768         * rootcontext.cs (RootContext.PopulateTypes): Call
13769         TypeManager.CheckStructCycles() for each TypeContainer.
13770         [Note: We only need to visit each type once.]
13771
13772 2004-04-28  Martin Baulig  <martin@ximian.com>
13773
13774         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
13775
13776         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
13777         success and added `out object value'.  Use a `bool resolved' field
13778         to check whether we've already been called rather than
13779         `ConstantValue != null' since this breaks for NullLiterals.
13780
13781 2004-04-28  Raja R Harinath  <rharinath@novell.com>
13782
13783         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
13784         setting of this flag, since the 'set' method may be non-public.
13785
13786 2004-04-28  Raja R Harinath  <rharinath@novell.com>
13787
13788         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
13789         check on current_vector.Block.
13790
13791 2004-04-27  Martin Baulig  <martin@ximian.com>
13792
13793         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
13794         a field initializer.  Fixes #56459.
13795
13796 2004-04-27  Martin Baulig  <martin@ximian.com>
13797
13798         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
13799         we're not attempting to use an indexer.  Fixes #52154.
13800
13801 2004-04-27  Martin Baulig  <martin@ximian.com>
13802
13803         * statement.cs (Return): Don't create a return label if we don't
13804         need it; reverts my change from January 20th.  Thanks to Ben
13805         Maurer for this.
13806
13807 2004-04-27  Martin Baulig  <martin@ximian.com>
13808
13809         According to the spec, `goto' can only leave a nested scope, but
13810         never enter it.
13811
13812         * statement.cs (Block.LookupLabel): Only lookup in the current
13813         block, don't recurse into parent or child blocks.
13814         (Block.AddLabel): Check in parent and child blocks, report
13815         CS0140/CS0158 if we find a duplicate.
13816         (Block): Removed this indexer for label lookups.
13817         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
13818         this already does the error reporting for us.
13819
13820         * flowanalysis.cs
13821         (FlowBranching.UsageVector.Block): New public variable; may be null.
13822         (FlowBranching.CreateSibling): Added `Block' argument.
13823         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
13824         label for the target of a `goto' and check whether we're not
13825         leaving a `finally'.
13826
13827 2004-04-27  Martin Baulig  <martin@ximian.com>
13828
13829         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13830         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
13831         just for returns).
13832
13833 2004-04-27  Martin Baulig  <martin@ximian.com>
13834
13835         * statement.cs (Block.AddLabel): Also check for implicit blocks
13836         and added a CS0158 check.
13837
13838 2004-04-27  Martin Baulig  <martin@ximian.com>
13839
13840         * flowanalysis.cs (FlowBranchingLoop): New class.
13841         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
13842         UsageVector's instead of an ArrayList.
13843         (FlowBranching.Label): Likewise.
13844         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
13845         (FlowBranching.AddBreakVector): New method.
13846
13847 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
13848
13849         * attribute.cs: Small regression fix: only convert the type if we
13850         the type is different, fixes System.Drawing build.
13851
13852 2004-04-27  Martin Baulig  <martin@ximian.com>
13853
13854         * attribute.cs (Attribute.Resolve): If we have a constant value
13855         for a named field or property, implicity convert it to the correct
13856         type.
13857
13858 2004-04-27  Raja R Harinath  <rharinath@novell.com>
13859
13860         * statement.cs (Block.Block): Implicit blocks share
13861         'child_variable_names' fields with parent blocks.
13862         (Block.AddChildVariableNames): Remove.
13863         (Block.AddVariable): Mark variable as "used by a child block" in
13864         every surrounding block.
13865         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
13866         been used in a child block, complain about violation of "Invariant
13867         meaning in blocks" rule.
13868         * cs-parser.jay (declare_local_variables): Don't use
13869         AddChildVariableNames.
13870         (foreach_statement): Don't create an implicit block: 'foreach'
13871         introduces a scope.
13872
13873 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
13874
13875         * convert.cs (ImplicitNumericConversion): 0 is also positive when
13876         converting from 0L to ulong.  Fixes 57522.
13877
13878 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
13879
13880         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
13881         derived class hides via 'new' keyword field from base class (test-242.cs).
13882         TODO: Handle this in the more general way.
13883         
13884         * class.cs (CheckBase): Ditto.
13885
13886 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
13887
13888         * decl.cs (caching_flags): New member for storing cached values
13889         as bit flags.
13890         (MemberCore.Flags): New enum where bit flags for caching_flags
13891         are defined.
13892         (MemberCore.cls_compliance): Moved to caching_flags.
13893         (DeclSpace.Created): Moved to caching_flags.
13894
13895         * class.cs: Use caching_flags instead of DeclSpace.Created
13896         
13897 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
13898
13899         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
13900         if we are only a derived class, not a nested class.
13901
13902         * typemanager.cs: Same as above, but do this at the MemberLookup
13903         level (used by field and methods, properties are handled in
13904         PropertyExpr).   Allow for the qualified access if we are a nested
13905         method. 
13906
13907 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
13908
13909         * class.cs: Refactoring.
13910         (IMethodData): New inteface; Holds links to parent members
13911         to avoid member duplication (reduced memory allocation).
13912         (Method): Implemented IMethodData interface.
13913         (PropertyBase): New inner classes for get/set methods.
13914         (PropertyBase.PropertyMethod): Implemented IMethodData interface
13915         (Event): New inner classes for add/remove methods.
13916         (Event.DelegateMethod): Implemented IMethodData interface.
13917
13918         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
13919         EmitContext (related to class.cs refactoring).
13920
13921 2004-04-21  Raja R Harinath  <rharinath@novell.com>
13922
13923         * delegate.cs (Delegate.VerifyApplicability): If the number of
13924         arguments are the same as the number of parameters, first try to
13925         verify applicability ignoring  any 'params' modifier on the last
13926         parameter.
13927         Fixes #56442.
13928
13929 2004-04-16  Raja R Harinath  <rharinath@novell.com>
13930
13931         * class.cs (TypeContainer.AddIndexer): Use
13932         'ExplicitInterfaceName' to determine if interface name was
13933         explicitly specified.  'InterfaceType' is not initialized at this time.
13934         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
13935         Indexers array is already in the required order.  Initialize
13936         'IndexerName' only if there are normal indexers.
13937         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
13938         (TypeContainer.Emit): Emit DefaultMember attribute only if
13939         IndexerName is initialized.
13940         Fixes #56300.
13941
13942 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
13943
13944         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
13945         Fixes #57007
13946
13947 2004-04-15  Raja R Harinath  <rharinath@novell.com>
13948
13949         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
13950         attributes.
13951         Fix for #56456.
13952
13953         * attribute.cs (Attribute.Resolve): Check for duplicate named
13954         attributes.
13955         Fix for #56463.
13956
13957 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
13958
13959         * iterators.cs (MarkYield): track whether we are in an exception,
13960         and generate code accordingly.  Use a temporary value to store the
13961         result for our state.
13962
13963         I had ignored a bit the interaction of try/catch with iterators
13964         since their behavior was not entirely obvious, but now it is
13965         possible to verify that our behavior is the same as MS .NET 2.0
13966
13967         Fixes 54814
13968
13969 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
13970
13971         * iterators.cs: Avoid creating temporaries if there is no work to
13972         do. 
13973
13974         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
13975         Enumerations, use TypeManager.EnumToUnderlying and call
13976         recursively. 
13977
13978         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
13979         bug #57013
13980
13981         (This.Emit): Use EmitContext.EmitThis to emit our
13982         instance variable.
13983
13984         (This.EmitAssign): Ditto.
13985
13986         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
13987         codepaths, we will move all the functionality into
13988         Mono.CSharp.This 
13989
13990         (FieldExpr.EmitAssign): Ditto.
13991
13992         This fixes several hidden bugs that I uncovered while doing a code
13993         review of this today.
13994
13995         * codegen.cs (EmitThis): reworked so the semantics are more clear
13996         and also support value types "this" instances.
13997
13998         * iterators.cs: Changed so that for iterators in value types, we
13999         do not pass the value type as a parameter.  
14000
14001         Initialization of the enumerator helpers is now done in the caller
14002         instead of passing the parameters to the constructors and having
14003         the constructor set the fields.
14004
14005         The fields have now `assembly' visibility instead of private.
14006
14007 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
14008
14009         * expression.cs (Argument.Resolve): Check if fields passed as ref
14010         or out are contained in a MarshalByRefObject.
14011
14012         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
14013         another compiler type.
14014
14015 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
14016
14017         * class.cs (Indexer.Define): use the new name checking method.
14018         Also, return false on an error.
14019         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
14020         (is_identifier_[start/part]_character): make static.
14021
14022 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
14023
14024         * expression.cs (Binary.ResolveOperator): Do no append strings
14025         twice: since we can be invoked more than once (array evaluation)
14026         on the same concatenation, take care of this here.  Based on a fix
14027         from Ben (bug #56454)
14028
14029 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
14030
14031         * codegen.cs: Fix another case where CS1548 must be reported (when 
14032         delay-sign isn't specified and no private is available #56564). Fix
14033         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
14034         error when MCS is used on the MS runtime and we need to delay-sign 
14035         (which seems unsupported by AssemblyBuilder - see #56621).
14036
14037 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
14038
14039         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
14040         (TypeManager.ComputeNamespaces): Faster implementation for
14041         Microsoft runtime.
14042
14043         * compiler.csproj: Updated AssemblyName to mcs.
14044
14045 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
14046
14047         * rootcontext.cs: Add new types to the boot resolution.
14048
14049         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
14050         MulticastDelegate is not allowed.
14051
14052         * typemanager.cs: Add new types to lookup: System.TypedReference
14053         and ArgIterator.
14054
14055         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
14056         check for TypedReference or ArgIterator, they are not allowed. 
14057
14058         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
14059         makes us properly catch 1510 in some conditions (see bug 56016 for
14060         details). 
14061
14062 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
14063
14064         * CryptoConvert.cs: update from corlib version
14065         with endian fixes.
14066
14067 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
14068
14069         * class.cs (Indexer.Define): Check indexername declaration
14070
14071 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
14072
14073         * attribute.cs (IsClsCompliant): Fixed problem with handling
14074         all three states (compliant, not-compliant, undetected).
14075
14076 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
14077
14078         * attribute.cs (Attribute): Location is now public.
14079         (Resolve): Store resolved arguments (pos_values) in attribute class.
14080         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
14081         (GetClsCompliantAttributeValue): New method that gets
14082         CLSCompliantAttribute value.
14083         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
14084         if exists else null.
14085         (AttributeTester): New class for CLS-Compliant verification routines.
14086
14087         * class.cs (Emit): Add CLS-Compliant verification.
14088         (Method.GetSignatureForError): Implemented.
14089         (Constructor.GetSignatureForError): Implemented
14090         (Constructor.HasCompliantArgs): Returns if constructor has
14091         CLS-Compliant arguments.
14092         (Constructor.Emit): Override.
14093         (Construcor.IsIdentifierClsCompliant): New method; For constructors
14094         is needed to test only parameters.
14095         (FieldBase.GetSignatureForError): Implemented.
14096         (TypeContainer): New member for storing base interfaces.
14097         (TypeContainer.FindMembers): Search in base interfaces too.
14098
14099         * codegen.cs (GetClsComplianceAttribute): New method that gets
14100         assembly or module CLSCompliantAttribute value.
14101         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
14102         for assembly.
14103         (ModuleClass.Emit): Add error 3012 test.
14104
14105         * const.cs (Emit): Override and call base for CLS-Compliant tests.
14106
14107         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
14108         state for all decl types.
14109         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
14110         if CLS-Compliant tests are required.
14111         (IsClsCompliaceRequired): New method. Analyze whether code
14112         must be CLS-Compliant.
14113         (IsExposedFromAssembly): New method. Returns true when MemberCore
14114         is exposed from assembly.
14115         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
14116         value or gets cached value.
14117         (HasClsCompliantAttribute): New method. Returns true if MemberCore
14118         is explicitly marked with CLSCompliantAttribute.
14119         (IsIdentifierClsCompliant): New abstract method. This method is
14120         used to testing error 3005.
14121         (IsIdentifierAndParamClsCompliant): New method. Common helper method
14122         for identifier and parameters CLS-Compliant testing.
14123         (VerifyClsCompliance): New method. The main virtual method for
14124         CLS-Compliant verifications.
14125         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
14126         null. I don't know why is null (too many public members !).
14127         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
14128         and get value of first CLSCompliantAttribute that found.
14129
14130         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
14131         (VerifyClsCompliance): Override and add extra tests.
14132
14133         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
14134         clscheck- disable CLS-Compliant verification event if assembly is has
14135         CLSCompliantAttribute(true).
14136
14137         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
14138         ApllyAttribute is now called in emit section as in the other cases.
14139         Possible future Emit integration.
14140         (IsIdentifierClsCompliant): New override.
14141         (VerifyClsCompliance): New override.
14142         (GetEnumeratorName): Returns full enum name.
14143
14144         * parameter.cs (GetSignatureForError): Implemented.
14145
14146         * report.cs (WarningData): New struct for Warning message information.
14147         (LocationOfPreviousError): New method.
14148         (Warning): New method. Reports warning based on the warning table.
14149         (Error_T): New method. Reports error based on the error table.
14150
14151         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
14152         verifications are done here.
14153
14154         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
14155
14156         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
14157         CLSCompliantAttribute.
14158         (all_imported_types): New member holds all imported types from other
14159         assemblies.
14160         (LoadAllImportedTypes): New method fills static table with exported types
14161         from all referenced assemblies.
14162         (Modules): New property returns all assembly modules.
14163
14164 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
14165
14166         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
14167         throwing a parser error.
14168
14169         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
14170         which removes the hardcoded get_/set_ prefixes for properties, as
14171         IL allows for the properties to be named something else.  
14172
14173         Bug #56013
14174
14175         * expression.cs: Do not override operand before we know if it is
14176         non-null.  Fix 56207
14177
14178 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14179
14180         * typemanager.cs: support for pinned variables.
14181
14182 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14183
14184         * decl.cs, typemanager.cs: Avoid using an arraylist
14185         as a buffer if there is only one result set.
14186
14187 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14188
14189         * expression.cs: Make sure you cant call a static method
14190         with an instance expression, bug #56174.
14191
14192 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
14193
14194         * class.cs (IsDuplicateImplementation): Improve error reporting to
14195         flag 663 (method only differs in parameter modifier).
14196
14197         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
14198         in preprocessor directives.
14199
14200         * location.cs (LookupFile): Allow for the empty path.
14201
14202         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
14203         better approach for some of that patch, but its failing with the
14204         CharSet enumeration.  For now try/catch will do.
14205
14206         * typemanager.cs: Do not crash if a struct does not have fields.
14207         Fixes 56150.
14208
14209 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
14210
14211         * expression.cs: cs0213, cant fix a fixed expression.
14212         fixes 50231.
14213
14214 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
14215
14216         * cs-parser.jay: detect invalid embeded statements gracefully.
14217         bug #51113.
14218
14219 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
14220
14221         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
14222         As a regex:
14223         s/
14224         the invocation type may not be a subclass of the tye of the item/
14225         The type of the item must be a subclass of the invocation item.
14226         /g
14227
14228         Fixes bug #50820.
14229
14230 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
14231
14232         * attribute.cs: Added methods to get a string and a bool from an
14233         attribute. Required to information from AssemblyKeyFileAttribute,
14234         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
14235         * codegen.cs: Modified AssemblyName creation to include support for
14236         strongnames. Catch additional exceptions to report them as CS1548.
14237         * compiler.csproj: Updated include CryptoConvert.cs.
14238         * compiler.csproj.user: Removed file - user specific configuration.
14239         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
14240         Mono.Security assembly. The original class is maintained and tested in
14241         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
14242         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
14243         like CSC 8.0 (C# v2) supports.
14244         * Makefile: Added CryptoConvert.cs to mcs sources.
14245         * rootcontext.cs: Added new options for strongnames.
14246
14247 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
14248
14249         * driver.cs: For --expect-error, report error code `2'
14250         if the program compiled with no errors, error code `1' if
14251         it compiled with an error other than the one expected.
14252
14253 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
14254
14255         * compiler.csproj: Updated for Visual Studio .NET 2003.
14256         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
14257         * compiler.sln: Updated for Visual Studio .NET 2003.
14258
14259 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
14260
14261         * expression.cs: Fix bug #47234. We basically need to apply the
14262         rule that we prefer the conversion of null to a reference type
14263         when faced with a conversion to 'object' (csc behaviour).
14264
14265 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14266
14267         * statement.cs: Shorter form for foreach, eliminates
14268         a local variable. r=Martin.
14269
14270 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14271
14272         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
14273         checks if we can use brtrue/brfalse to test for 0.
14274         * expression.cs: use the above in the test for using brtrue/brfalse.
14275         cleanup code a bit.
14276
14277 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14278
14279         * expression.cs: Rewrite string concat stuff. Benefits:
14280
14281         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
14282         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
14283         rather than a concat chain.
14284
14285         * typemanager.cs: Add lookups for more concat overloads.
14286
14287 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14288
14289         * expression.cs: Emit shorter il code for array init.
14290
14291         newarr
14292         dup
14293         // set 1
14294
14295         // set 2
14296
14297         newarr
14298         stloc.x
14299
14300         ldloc.x
14301         // set 1
14302
14303         ldloc.x
14304         // set 2
14305
14306 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
14307
14308         * statement.cs: Before, two switch blocks would be merged if the
14309         total size of the blocks (end_item - begin_item + 1) was less than
14310         two times the combined sizes of the blocks.
14311
14312         Now, it will only merge if after the merge at least half of the
14313         slots are filled.
14314
14315         fixes 55885.
14316
14317 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
14318
14319         * class.cs : csc build fix for GetMethods(). See bug #52503.
14320
14321 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
14322
14323         * expression.cs: Make sure fp comparisons work with NaN.
14324         This fixes bug #54303. Mig approved this patch a long
14325         time ago, but we were not able to test b/c the runtime
14326         had a related bug.
14327
14328 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
14329
14330         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
14331
14332 2004-03-19  Martin Baulig  <martin@ximian.com>
14333
14334         * class.cs (MemberCore.IsDuplicateImplementation): Report the
14335         error here and not in our caller.
14336
14337 2004-03-19  Martin Baulig  <martin@ximian.com>
14338
14339         * interface.cs: Completely killed this file.
14340         (Interface): We're now a TypeContainer and live in class.cs.
14341
14342         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
14343         argument; we're now also called for interfaces.
14344         (TypeContainer.DefineMembers): Allow this method being called
14345         multiple times.
14346         (TypeContainer.GetMethods): New public method; formerly known as
14347         Interface.GetMethod().  This is used by PendingImplementation.
14348         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
14349         it's now private and non-static.
14350         (Interface): Moved this here; it's now implemented similar to
14351         Class and Struct.
14352         (Method, Property, Event, Indexer): Added `bool is_interface'
14353         argument to their .ctor's.
14354         (MemberBase.IsInterface): New public field.
14355
14356         * cs-parser.jay: Create normal Method, Property, Event, Indexer
14357         instances instead of InterfaceMethod, InterfaceProperty, etc.
14358         (opt_interface_base): Removed; we now use `opt_class_base' instead.
14359         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
14360
14361 2004-03-19  Martin Baulig  <martin@ximian.com>
14362
14363         * class.cs (MethodCore.IsDuplicateImplementation): New private
14364         method which does the CS0111 checking.
14365         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
14366         Use IsDuplicateImplementation().
14367
14368 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
14369
14370         * decl.cs (FindMemberToOverride): New method to find the correct
14371         method or property to override in the base class.
14372         * class.cs
14373             - Make Method/Property use the above method to find the
14374               version in the base class.
14375             - Remove the InheritableMemberSignatureCompare as it is now
14376               dead code.
14377
14378         This patch makes large code bases much faster to compile, as it is
14379         O(n) rather than O(n^2) to do this validation.
14380
14381         Also, it fixes bug 52458 which is that nested classes are not
14382         taken into account when finding the base class member.
14383
14384         Reviewed/Approved by Martin.
14385
14386 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
14387
14388         * interface.cs: In all interface classes removed redundant
14389         member initialization.
14390
14391 2004-03-16  Martin Baulig  <martin@ximian.com>
14392
14393         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
14394
14395 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
14396
14397         * decl.cs (DefineTypeAndParents): New helper method to define a
14398         type's containers before the type itself is defined;  This is a
14399         bug exposed by the recent changes to Windows.Forms when an
14400         implemented interface was defined inside a class that had not been
14401         built yet.   
14402
14403         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
14404
14405         (Check): Loop correctly to report errors modifiers
14406         (UNSAFE was not in the loop, since it was the same as TOP).
14407
14408         * interface.cs: Every interface member now takes a ModFlags,
14409         instead of a "is_new" bool, which we set on the base MemberCore. 
14410
14411         Every place where we called "UnsafeOk" in the interface, now we
14412         call the proper member (InterfaceMethod.UnsafeOK) instead to get
14413         the unsafe settings from the member declaration instead of the
14414         container interface. 
14415
14416         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
14417
14418         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
14419         `set_indexer_name' to the pending bits (one per type).
14420
14421         We fixed a bug today that was picking the wrong method to
14422         override, since for properties the existing InterfaceMethod code
14423         basically ignored the method name.  Now we make sure that the
14424         method name is one of the valid indexer names.
14425
14426 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
14427  
14428         * support.cs (SeekableStreamReader): Keep track of stream byte
14429         positions and don't mix them with character offsets to the buffer.
14430
14431         Patch from Gustavo Giráldez
14432
14433 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
14434
14435         * interface.cs (InterfaceSetGetBase): Removed double member
14436         initialization, base class does it as well.
14437
14438 2004-03-13  Martin Baulig  <martin@ximian.com>
14439
14440         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
14441         when compiling corlib.
14442
14443 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
14444
14445         * convert.cs (ExplicitConversion): We were reporting an error on
14446         certain conversions (object_type source to a value type, when the
14447         expression was `null') before we had a chance to pass it through
14448         the user defined conversions.
14449
14450         * driver.cs: Replace / and \ in resource specifications to dots.
14451         Fixes 50752
14452
14453         * class.cs: Add check for duplicate operators.  Fixes 52477
14454
14455 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
14456
14457         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
14458         that are in the middle of the statements, not only at the end.
14459         Fixes #54987
14460
14461         * class.cs (TypeContainer.AddField): No longer set the
14462         `HaveStaticConstructor' flag, now we call it
14463         `UserDefineStaticConstructor' to diferentiate the slightly
14464         semantic difference.
14465
14466         The situation is that we were not adding BeforeFieldInit (from
14467         Modifiers.TypeAttr) to classes that could have it.
14468         BeforeFieldInit should be set to classes that have no static
14469         constructor. 
14470
14471         See:
14472
14473         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
14474
14475         And most importantly Zoltan's comment:
14476
14477         http://bugzilla.ximian.com/show_bug.cgi?id=44229
14478
14479         "I think beforefieldinit means 'it's ok to initialize the type sometime 
14480          before its static fields are used', i.e. initialization does not need
14481          to be triggered by the first access to the type. Setting this flag
14482          helps the JIT to compile better code, since it can run the static
14483          constructor at JIT time, and does not need to generate code to call it
14484          (possibly lots of times) at runtime. Unfortunately, mcs does not set
14485          this flag for lots of classes like String. 
14486          
14487          csc sets this flag if the type does not have an explicit static 
14488          constructor. The reasoning seems to be that if there are only static
14489          initalizers for a type, and no static constructor, then the programmer
14490          does not care when this initialization happens, so beforefieldinit
14491          can be used.
14492          
14493          This bug prevents the AOT compiler from being usable, since it 
14494          generates so many calls to mono_runtime_class_init that the AOT code
14495          is much slower than the JITted code. The JITted code is faster, 
14496          because it does not generate these calls if the vtable is type is
14497          already initialized, which is true in the majority of cases. But the
14498          AOT compiler can't do this."
14499
14500 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
14501
14502         * class.cs (MethodData.Emit): Refactor the code so symbolic
14503         information is generated for destructors;  For some reasons we
14504         were taking a code path that did not generate symbolic information
14505         before. 
14506
14507 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
14508
14509         * class.cs: Create a Constructor.CheckBase method that
14510         takes care of all validation type code. The method
14511         contains some code that was moved from Define.
14512
14513         It also includes new code that checks for duplicate ctors.
14514         This fixes bug #55148.
14515
14516 2004-03-09  Joshua Tauberer <tauberer@for.net>
14517
14518         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
14519         a { ... }-style array creation invokes EmitStaticInitializers
14520         which is not good for reference-type arrays.  String, decimal
14521         and now null constants (NullCast) are not counted toward
14522         static initializers.
14523
14524 2004-03-05  Martin Baulig  <martin@ximian.com>
14525
14526         * location.cs (SourceFile.HasLineDirective): New public field;
14527         specifies whether the file contains or is referenced by a "#line"
14528         directive.
14529         (Location.DefineSymbolDocuments): Ignore source files which
14530         either contain or are referenced by a "#line" directive.        
14531
14532 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
14533
14534         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
14535         direct access to our parent, so check the method inline there.
14536
14537 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
14538
14539         * expression.cs (Invocation.EmitCall): Miguel's last commit
14540         caused a regression. If you had:
14541
14542             T t = null;
14543             t.Foo ();
14544
14545         In Foo the implict this would be null.
14546
14547 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
14548
14549         * expression.cs (Invocation.EmitCall): If the method is not
14550         virtual, do not emit a CallVirt to it, use Call.
14551
14552         * typemanager.cs (GetFullNameSignature): Improve the method to
14553         cope with ".ctor" and replace it with the type name.
14554
14555         * class.cs (ConstructorInitializer.Resolve): Now the method takes
14556         as an argument the ConstructorBuilder where it is being defined,
14557         to catch the recursive constructor invocations.
14558
14559 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
14560
14561         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
14562         routines to check if a type is an enumerable/enumerator allow
14563         classes that implement the IEnumerable or IEnumerator interfaces.
14564
14565         * class.cs (Property, Operator): Implement IIteratorContainer, and
14566         implement SetYields.
14567
14568         (Property.Define): Do the block swapping for get_methods in the
14569         context of iterators.   We need to check if Properties also
14570         include indexers or not.
14571
14572         (Operator): Assign the Block before invoking the
14573         OperatorMethod.Define, so we can trigger the Iterator code
14574         replacement. 
14575
14576         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
14577         Property and Operator classes are not created when we parse the
14578         declarator but until we have the block completed, so we use a
14579         singleton SimpleIteratorContainer.Simple to flag whether the
14580         SetYields has been invoked.
14581
14582         We propagate this setting then to the Property or the Operator to
14583         allow the `yield' to function.
14584
14585 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
14586
14587         * codegen.cs: Implemented attribute support for modules.
14588         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
14589         Assembly/Module functionality.
14590
14591         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
14592         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
14593         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
14594
14595 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
14596
14597         * interface.cs (FindMembers): The operation is performed on all base
14598         interfaces and not only on the first. It is required for future CLS Compliance patch.
14599
14600 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
14601
14602         * statement.cs, codegen.cs:
14603         This patch deals with patterns such as:
14604
14605         public class List : IEnumerable {
14606
14607                 public MyEnumerator GetEnumerator () {
14608                         return new MyEnumerator(this);
14609                 }
14610
14611                 IEnumerator IEnumerable.GetEnumerator () {
14612                         ...
14613                 }
14614                 
14615                 public struct MyEnumerator : IEnumerator {
14616                         ...
14617                 }
14618         }
14619
14620         Before, there were a few things we did wrong:
14621         1) we would emit callvirt on a struct, which is illegal
14622         2) we emited ldarg when we needed to emit ldarga
14623         3) we would mistakenly call the interface methods on an enumerator
14624         type that derived from IEnumerator and was in another assembly. For example:
14625
14626         public class MyEnumerator : IEnumerator
14627
14628         Would have the interface methods called, even if there were public impls of the
14629         method. In a struct, this lead to invalid IL code.
14630
14631 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
14632
14633         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
14634           renamed to Emit.
14635
14636         * delegate.cs (Define): Fixed crash when delegate type is undefined.
14637
14638 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
14639
14640         * cs-parser.jay: Fix small regression: we were not testing V2
14641         compiler features correctly.
14642
14643         * interface.cs: If the emit context is null, then create one
14644
14645 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
14646
14647         * decl.cs (GetSignatureForError): New virtual method to get full name
14648           for error messages.
14649
14650         * attribute.cs (IAttributeSupport): New interface for attribute setting.
14651           Now it is possible to rewrite ApplyAttributes method to be less if/else.
14652
14653         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
14654           Duplicated members and code in these classes has been removed.
14655           Better encapsulation in these classes.
14656
14657 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
14658
14659         * assign.cs (Assign.DoResolve): When dealing with compound
14660         assignments, there is a new rule in ECMA C# 2.4 (might have been
14661         there before, but it is documented here) that states that in:
14662
14663         a op= b;
14664
14665         If b is of type int, and the `op' is a shift-operator, then the
14666         above is evaluated as:
14667
14668         a = (int) a op b 
14669
14670         * expression.cs (Binary.ResolveOperator): Instead of testing for
14671         int/uint/long/ulong, try to implicitly convert to any of those
14672         types and use that in pointer arithmetic.
14673
14674         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
14675         method to print information for from the type, not from the
14676         null-method we were given.
14677
14678 2004-02-01  Duncan Mak  <duncan@ximian.com>
14679
14680         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
14681         parsing for cmd, fixes bug #53694.
14682
14683 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
14684
14685         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
14686         in the member name duplication tests. Property and operator name duplication
14687         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
14688
14689 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
14690
14691         * interface.cs (PopulateMethod): Fixed crash when interface method
14692         returns not existing type (error test cs0246-3.cs).
14693
14694 2004-02-02  Ravi Pratap M <ravi@ximian.com>
14695
14696         * cs-parser.jay (interface_accessors): Re-write actions to also
14697         store attributes attached to get and set methods. Fix spelling
14698         while at it.
14699
14700         (inteface_property_declaration): Modify accordingly.
14701
14702         (InterfaceAccessorInfo): New helper class to store information to pass
14703         around between rules that use interface_accessors.
14704
14705         * interface.cs (Emit): Apply attributes on the get and set
14706         accessors of properties and indexers too.
14707
14708         * attribute.cs (ApplyAttributes): Modify accordingly to use the
14709         right MethodBuilder when applying attributes to the get and set accessors.
14710
14711 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
14712
14713         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
14714
14715 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
14716
14717         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
14718
14719 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
14720
14721         * cs-parser.jay: Remove YIELD token, instead use the new grammar
14722         changes that treat `yield' specially when present before `break'
14723         or `return' tokens.
14724
14725         * cs-tokenizer.cs: yield is no longer a keyword.
14726
14727 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
14728
14729         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
14730         setting for default constructors.
14731         For default constructors are almost every time set wrong Modifier. The
14732         generated IL code has been alright. But inside mcs this values was
14733         wrong and this was reason why several of my CLS Compliance tests
14734         failed.
14735
14736 2004-01-22  Martin Baulig  <martin@ximian.com>
14737
14738         * cs-parser.jay (namespace_or_type_name): Return an Expression,
14739         not a QualifiedIdentifier.  This is what `type_name_expression'
14740         was previously doing.
14741         (type_name_expression): Removed; the code is now in
14742         `namespace_or_type_name'.
14743         (qualified_identifier): Removed, use `namespace_or_type_name'
14744         instead.
14745         (QualifiedIdentifier): Removed this class.      
14746
14747 2004-01-22  Martin Baulig  <martin@ximian.com>
14748
14749         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
14750         not a string as alias name.
14751
14752 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
14753
14754         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
14755         #52730 bug, and instead compute correctly the need to use a
14756         temporary variable when requesting an address based on the
14757         static/instace modified of the field and the constructor.
14758  
14759 2004-01-21  Martin Baulig  <martin@ximian.com>
14760
14761         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
14762         class and namespace before looking up aliases.  Fixes #52517.
14763
14764 2004-01-21  Martin Baulig  <martin@ximian.com>
14765
14766         * flowanalysis.cs (UsageVector.Merge): Allow variables being
14767         assinged in a 'try'; fixes exception4.cs.
14768
14769 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14770         * class.cs : Implemented parameter-less constructor for TypeContainer
14771
14772         * decl.cs: Attributes are now stored here. New property OptAttributes
14773
14774         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
14775
14776         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
14777
14778 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14779
14780         * typemanager.cs (CSharpSignature): Now reports also inner class name.
14781           (CSharpSignature): New method for indexer and property signature.
14782
14783 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14784
14785         * pending.cs (IsVirtualFilter): Faster implementation.
14786
14787 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14788
14789         * typemanager.cs: Avoid inclusion of same assembly more than once.
14790
14791 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14792
14793         * cs-parser.jay: Fixed problem where the last assembly attribute
14794           has been applied also to following declaration (class, struct, etc.)
14795           
14796 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14797
14798         * class.cs: Added error CS0538, CS0539 reporting.
14799         Fixed crash on Microsoft runtime when field type is void.
14800
14801         * cs-parser.jay: Added error CS0537 reporting.
14802
14803         * pending.cs: Added error CS0535 reporting.
14804         Improved error report for errors CS0536, CS0534.
14805
14806 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
14807
14808         Merge a few bits from the Anonymous Method MCS tree.
14809
14810         * statement.cs (ToplevelBlock): New class for toplevel methods,
14811         will hold anonymous methods, lifted variables.
14812
14813         * cs-parser.jay: Create toplevel blocks for delegates and for
14814         regular blocks of code. 
14815
14816 2004-01-20  Martin Baulig  <martin@ximian.com>
14817
14818         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
14819         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
14820         and `NeedExplicitReturn'; added `IsLastStatement'.
14821         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
14822         have a `ReturnLabel' or we're not unreachable.
14823
14824         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
14825         child's reachability; don't just override ours with it.  Fixes
14826         #58058 (lluis's example).
14827         (FlowBranching): Added public InTryOrCatch(), InCatch(),
14828         InFinally(), InLoop(), InSwitch() and
14829         BreakCrossesTryCatchBoundary() methods.
14830
14831         * statement.cs (Return): Do all error checking in Resolve().
14832         Unless we are the last statement in a top-level block, always
14833         create a return label and jump to it.
14834         (Break, Continue): Do all error checking in Resolve(); also make
14835         sure we aren't leaving a `finally'.
14836         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
14837         statement in a top-level block.
14838         (Block.Flags): Added `IsDestructor'.
14839         (Block.IsDestructor): New public property.
14840
14841 2004-01-20  Martin Baulig  <martin@ximian.com>
14842
14843         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
14844
14845 2004-01-20  Martin Baulig  <martin@ximian.com>
14846
14847         * statement.cs (Statement.ResolveUnreachable): New public method.
14848         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
14849         (Block.Resolve): Resolve unreachable statements.
14850
14851 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
14852
14853         * expression.cs: We need to fix the case where we do
14854         not have a temp variable here.
14855
14856         * assign.cs: Only expression compound assignments need
14857         temporary variables.
14858
14859 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
14860
14861         * flowanalysis.cs: Reduce memory allocation in a few ways:
14862           - A block with no variables should not allocate a bit
14863             vector for itself.
14864           - A method with no out parameters does not need any tracking
14865             for assignment of the parameters, so we need not allocate
14866             any data for it.
14867           - The arrays:
14868                 public readonly Type[] VariableTypes;
14869                 public readonly string[] VariableNames;
14870             Are redundant. The data is already stored in the variable
14871             map, so we need not allocate another array for it.
14872           - We need to add alot of checks for if (params | locals) == null
14873             due to the first two changes.
14874
14875 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
14876
14877         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
14878         implement IMemoryLocation, we store a copy on a local variable and
14879         take the address of it.  Patch from Benjamin Jemlich
14880
14881         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
14882         to use a special "type_name_expression" rule which reduces the
14883         number of "QualifiedIdentifier" classes created, and instead
14884         directly creates MemberAccess expressions.
14885
14886 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
14887
14888         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
14889         that fixes #52853.  Null literal assignment to ValueType
14890
14891         * class.cs (MethodData.Emit): Instead of checking the name of the
14892         method to determine if its a destructor, create a new derived
14893         class from Method called Destructor, and test for that.  
14894
14895         * cs-parser.jay: Create a Destructor object instead of a Method.  
14896
14897         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
14898
14899         Fixes: 52933
14900
14901 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
14902
14903         * expression.cs (Binary.ResolveOperator): Perform an implicit
14904         conversion from MethodGroups to their delegate types on the
14905         Addition operation.
14906
14907         * delegate.cs: Introduce a new class DelegateCreation that is the
14908         base class for `NewDelegate' and `ImplicitDelegateCreation',
14909         factor some code in here.
14910
14911         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
14912         conversion from MethodGroups to compatible delegate types. 
14913
14914         * ecore.cs (Expression.Resolve): Do not flag error 654
14915         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
14916         we allow conversions from MethodGroups to delegate types now.
14917
14918         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
14919         assignments in v2 either.
14920
14921 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
14922
14923         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
14924         static read-only fields in ctors.
14925
14926         Applied patch from Benjamin Jemlich 
14927
14928         * expression.cs (UnaryMutator): Avoid leaking local variables. 
14929
14930 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
14931
14932         * cs-tokenizer.cs (IsCastToken): Allow the various native types
14933         here to return true, as they can be used like this:
14934
14935                 (XXX) int.MEMBER ()
14936
14937         Fixed 49836 and all the other dups
14938
14939 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
14940
14941         * driver.cs: Implement /win32res and /win32icon.
14942
14943 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
14944
14945         * cs-parser.jay: Add a rule to improve error handling for the
14946         common mistake of placing modifiers after the type.
14947
14948 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
14949
14950         * cs-parser.jay (interface_event_declaration): Catch
14951         initialization of events on interfaces, and report cs0068
14952
14953         * cs-parser.jay (interface_event_declaration): Catch
14954         initialization of events. 
14955
14956         * ecore.cs: Better report missing constructors.
14957
14958         * expression.cs (Binary.ResolveOperator): My previous bug fix had
14959         the error reporting done in the wrong place.  Fix.
14960
14961         * expression.cs (Binary.ResolveOperator): Catch the 
14962         operator + (E x, E y) error earlier, and later allow for implicit
14963         conversions in operator +/- (E e, U x) from U to the underlying
14964         type of E.
14965
14966         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
14967         52596, if the container class is abstract, the default constructor
14968         is protected otherwise its public (before, we were always public).
14969
14970         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
14971         fixed statement.
14972
14973         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
14974         Jemlich that fixes bug #52597, MCS was generating invalid code for
14975         idisposable structs.   Thanks to Ben for following up with this
14976         bug as well.
14977
14978 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
14979
14980         * driver.cs: Allow assemblies without code to be generated, fixes
14981         52230.
14982
14983 2004-01-07  Nick Drochak <ndrochak@gol.com>
14984
14985         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
14986
14987 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
14988
14989         * cs-parser.jay: Add rules to improve error reporting if fields or
14990         methods are declared at the namespace level (error 116)
14991
14992         * Add rules to catch event add/remove
14993
14994 2004-01-04  David Sheldon <dave-mono@earth.li>
14995
14996   * expression.cs: Added matching ")" to error message for 
14997   CS0077
14998
14999 2004-01-03 Todd Berman <tberman@gentoo.org>
15000
15001         * ecore.cs, attribute.cs:
15002         Applying fix from #52429.
15003
15004 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
15005
15006         * ecore.cs, expression.cs, statement.cs:
15007         Total rewrite of how we handle branching. We
15008         now handle complex boolean expressions with fewer
15009         jumps. As well if (x == 0) no longer emits a ceq.
15010
15011         if (x is Foo) is much faster now, because we generate
15012         better code.
15013
15014         Overall, we get a pretty big improvement on our benchmark
15015         tests. The code we generate is smaller and more readable.
15016
15017         I did a full two-stage bootstrap. The patch was reviewed
15018         by Martin and Miguel.
15019
15020 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
15021
15022         * cs-parser.jay: Make primary_expression not take a QI.
15023         we dont need this because the member_access rule covers
15024         us here. So we replace the rule with just IDENTIFIER.
15025
15026         This has two good effects. First, we remove a s/r conflict.
15027         Second, we allocate many fewer QualifiedIdentifier objects.
15028
15029 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
15030
15031         * attribute.cs: Handle MarshalAs attributes as pseudo, and
15032         set the correct information via SRE. This prevents
15033         hanging on the MS runtime. Fixes #29374.
15034
15035 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
15036
15037         * convert.cs: correctly handle conversions to value types
15038         from Enum and ValueType as unboxing conversions.
15039
15040         Fixes bug #52569. Patch by Benjamin Jemlich.
15041
15042 2004-01-02  Ravi Pratap  <ravi@ximian.com>
15043
15044         * expression.cs (BetterConversion): Prefer int -> uint
15045         over int -> ulong (csc's behaviour). This fixed bug #52046.
15046
15047 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
15048
15049         * decl.cs (MemberCache.FindMembers): now returns a
15050         MemberInfo [].
15051
15052         * typemanager.cs: In general, go with with ^^.
15053         (CopyNewMethods): take an IList.
15054         (RealMemberLookup): Only allocate an arraylist
15055         if we copy from two sets of methods.
15056
15057         This change basically does two things:
15058         1) Fewer array lists allocated due to CopyNewMethods.
15059         2) the explicit cast in MemberList costed ALOT.
15060
15061 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
15062
15063         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
15064         a hashtable to avoid needless string allocations when an identifier is
15065         used more than once (the common case).
15066
15067 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
15068
15069         * pending.cs: MS's TypeBuilder.GetInterfaces ()
15070         is broken, it will not return anything. So, we
15071         have to use the information we have in mcs to
15072         do the task.
15073
15074         * typemanager.cs: Add a cache for GetInterfaces,
15075         since this will now be used more often (due to ^^)
15076
15077         (GetExplicitInterfaces) New method that gets the
15078         declared, not effective, interfaces on a type
15079         builder (eg, if you have interface IFoo, interface
15080         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
15081         { IBar }.
15082
15083         This patch makes MCS able to bootstrap itself on
15084         Windows again.
15085
15086 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
15087
15088         * expression.cs: Remove the Nop's that Miguel put
15089         in by mistake.
15090
15091 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
15092
15093         * report.cs, codegen.cs: Give the real stack trace to
15094         the error when an exception is thrown.
15095
15096 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
15097
15098         * decl.cs: only allocate hashtables for ifaces if 
15099         it is an iface!
15100
15101 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
15102
15103         * expression.cs: fix the error from cs0121-2.cs
15104         (a parent interface has two child interfaces that
15105         have a function with the same name and 0 params
15106         and the function is called through the parent).
15107
15108 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
15109
15110         * class.cs, rootcontext.cs, typmanager.cs: do not
15111         leak pointers.
15112
15113 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
15114
15115         * codegen.cs: remove stack for the ec flow branching.
15116         It is already a linked list, so no need.
15117
15118 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
15119
15120         * Makefile: Allow custom profiler here.
15121
15122 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
15123
15124         * typemanager.cs (LookupType):
15125           - Use a static char [], because split takes
15126             a param array for args, so it was allocating
15127             every time.
15128           - Do not store true in a hashtable, it boxes.
15129
15130 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
15131
15132         * flowanalysis.cs: bytify common enums.
15133
15134 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
15135
15136         * modifiers.cs: Add a new set of flags for the
15137         flags allowed on explicit interface impls.
15138         * cs-parser.jay: catch the use of modifiers in
15139         interfaces correctly.
15140         * class.cs: catch private void IFoo.Blah ().
15141
15142         All related to bug #50572.
15143
15144 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
15145
15146         * decl.cs: Rewrite the consistant accessability checking.
15147         Accessability is not linear, it must be implemented in
15148         a tableish way. Fixes #49704.
15149
15150 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
15151
15152         * expression.cs: Handle negation in a checked context.
15153         We must use subtraction from zero. Fixes #38674.
15154
15155 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15156
15157         * class.cs: Ignore static void main in DLLs.
15158         * rootcontext.cs: Handle the target type here,
15159         since we are have to access it from class.cs
15160         * driver.cs: account for the above.
15161
15162 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15163
15164         * report.cs: Give line numbers and files if available.
15165
15166 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
15167
15168         * driver.cs: Implement /addmodule.
15169
15170         * typemanager.cs:  Change 'modules' field so it now contains Modules not
15171         ModuleBuilders.
15172
15173 2003-12-20  Martin Baulig  <martin@ximian.com>
15174
15175         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
15176         (FieldBase.IsAssigned): Removed this field.
15177         (FieldBase.SetAssigned): New public method.
15178         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
15179
15180 2003-12-20  Martin Baulig  <martin@ximian.com>
15181
15182         * expression.cs (LocalVariableReference.DoResolve): Don't set
15183         `vi.Used' if we're called from DoResolveLValue().
15184
15185         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
15186         returns the usage vector it just merged into the current one -
15187         pass this one to UsageWarning().
15188         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
15189         of the `EmitContext', don't call this recursively on our children.
15190
15191 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
15192
15193         * driver.cs: Implement /target:module.
15194
15195 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
15196
15197         * support.cs (CharArrayHashtable): New helper class.
15198
15199         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
15200         char arrays, not strings, so we can avoid creating a string in
15201         consume_identifier if the identifier is a keyword.
15202
15203 2003-12-16  Martin Baulig  <martin@ximian.com>
15204
15205         * statement.cs (LocalInfo.Assigned): Removed this property.
15206         (LocalInfo.Flags): Removed `Assigned'.
15207         (LocalInfo.IsAssigned): New public method; takes the EmitContext
15208         and uses flow analysis.
15209         (Block.UsageWarning): Made this method private.
15210         (Block.Resolve): Call UsageWarning() if appropriate.
15211
15212         * expression.cs (LocalVariableReference.DoResolve): Always set
15213         LocalInfo.Used here.
15214
15215 2003-12-13  Martin Baulig  <martin@ximian.com>
15216
15217         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
15218         any value here; we're now using flow analysis to figure out
15219         whether a statement/block returns a value.
15220
15221 2003-12-13  Martin Baulig  <martin@ximian.com>
15222
15223         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
15224         working again.
15225         (FlowBranching.MergeFinally): Don't call
15226         `branching.CheckOutParameters()' here, this is called in
15227         MergeTopBlock().
15228         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
15229         when adding the `finally' vector.       
15230
15231 2003-12-13  Martin Baulig  <martin@ximian.com>
15232
15233         * flowanalysis.cs
15234         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
15235         actually work and also fix #48962.
15236
15237 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
15238
15239         * decl.cs: Do not check System.Object for nested types,
15240         since we know it does not have any. Big bang for buck:
15241
15242         BEFORE:
15243            Run 1:   8.35 seconds
15244            Run 2:   8.32 seconds
15245            corlib:  17.99 seconds
15246         AFTER:
15247            Run 1:   8.17 seconds
15248            Run 2:   8.17 seconds
15249            corlib:  17.39 seconds
15250
15251 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
15252
15253         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
15254         time we are returning 0 members, so we save alot here.
15255
15256 2003-12-11  Martin Baulig  <martin@ximian.com>
15257
15258         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
15259         `MergeChild()', also just take the `FlowBranching' as argument;
15260         call Merge() on it and return the result.
15261         (FlowBranching.Merge): We don't need to do anything if we just
15262         have one sibling.
15263
15264 2003-12-11  Martin Baulig  <martin@ximian.com>
15265
15266         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
15267         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
15268         Maurer for this idea.
15269
15270 2003-12-11  Martin Baulig  <martin@ximian.com>
15271
15272         * flowanalysis.cs (MergeResult): This class is now gone; we now
15273         use the `UsageVector' for this.  The reason for this is that if a
15274         branching just has one sibling, we don't need to "merge" them at
15275         all - that's the next step to do.
15276         (FlowBranching.Merge): We now return a `UsageVector' instead of a
15277         `MergeResult'.
15278
15279 2003-12-11  Martin Baulig  <martin@ximian.com>
15280
15281         Reworked flow analyis and made it more precise and bug-free.  The
15282         most important change is that we're now using a special `Reachability'
15283         class instead of having "magic" meanings of `FlowReturns'.  I'll
15284         do some more cleanups and optimizations and also add some more
15285         documentation this week.
15286
15287         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
15288         largely reworked this class.
15289         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
15290         the new `Reachability' class instead of having "magic" values here.
15291         (FlowBranching): We're now using an instance of `Reachability'
15292         instead of having separate `Returns', `Breaks' etc. fields.
15293
15294         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
15295         based on flow analysis; ignore the return value of block.Emit ().
15296
15297 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
15298
15299         * driver.cs typemanager.cs: Find the mono extensions to corlib even
15300         if they are private.
15301
15302 2003-12-09  Martin Baulig  <martin@ximian.com>
15303
15304         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
15305         call them directly on the UsageVector.
15306
15307 2003-12-09  Martin Baulig  <martin@ximian.com>
15308
15309         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
15310         Changed return type from `FlowReturns' to `Reachability'.
15311
15312 2003-12-09  Martin Baulig  <martin@ximian.com>
15313
15314         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
15315         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
15316         `Reachable' fields with a single `Reachability' one.
15317
15318 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15319
15320         * class.cs (FindMembers): Remove foreach's.
15321
15322         Bootstrap times:
15323
15324         BEFORE
15325                 Run 1:   8.74 seconds
15326                 Run 2:   8.71 seconds
15327
15328         AFTER
15329                 Run 1:   8.64 seconds
15330                 Run 2:   8.58 seconds
15331
15332
15333 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15334
15335         * cs-parser.jay:
15336         * gen-treedump.cs:
15337         * statement.cs:
15338         This patch does a few things:
15339                 1. EmptyStatement is now a singleton, so it is never reallocated.
15340                 2. All blah is EmptyStatement constructs have been changed to
15341                    blah == EmptyStatement.Value, which is much faster and valid
15342                    now that EmptyStatement is a singleton.
15343                 3. When resolving a block, rather than allocating a new array for
15344                    the non-empty statements, empty statements are replaced with
15345                    EmptyStatement.Value
15346                 4. Some recursive functions have been made non-recursive.
15347         Mainly the performance impact is from (3), however (1) and (2) are needed for
15348         this to work. (4) does not make a big difference in normal situations, however
15349         it makes the profile look saner.
15350
15351         Bootstrap times:
15352
15353         BEFORE
15354         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15355         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15356         Total memory allocated: 56397 KB
15357
15358         AFTER
15359         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
15360         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
15361         Total memory allocated: 55666 KB
15362
15363 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15364
15365         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
15366         than the hashtable in a hashtable version
15367
15368         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
15369         we always end up concating a string. This results in a huge perf
15370         loss, because many strings have to be tracked by the GC. In this
15371         patch, we first use a hashtable that works with two keys, so that
15372         the strings do not need to be concat'ed.
15373
15374         Bootstrap times:
15375         BEFORE
15376                 Run 1:   8.74 seconds
15377                 Run 2:   8.71 seconds
15378
15379         AFTER
15380                 Run 1:   8.65 seconds
15381                 Run 2:   8.56 seconds
15382
15383 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15384
15385         * Makefile: Add a new target `do-time' that does a quick and simple
15386         profile, leaving easy to parse output.
15387
15388 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
15389
15390         * codegen.cs (Init): Create the dynamic assembly with 
15391         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
15392
15393 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
15394
15395         * support.cs: Make the PtrHashtable use only one
15396         instance of its comparer.
15397
15398 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
15399
15400         * typemanager.cs: Fix lookup of GetNamespaces.
15401
15402 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
15403
15404         * expression.cs: Removed redundant line.
15405
15406         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
15407         ArrayLists, use for loops with bounds.  
15408
15409         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
15410         arraylist.
15411
15412         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
15413         arraylists, use for loop with bounds.
15414
15415         The above three changes give us a 0.071 second performance
15416         improvement out of 3.294 seconds down to 3.223.  On my machine
15417         the above changes reduced the memory usage by 1,387 KB during
15418         compiler bootstrap.
15419
15420         * cs-parser.jay (QualifiedIdentifier): New class used to represent
15421         QualifiedIdentifiers.  Before we created a new string through
15422         concatenation, and mostly later on, the result would be
15423         manipulated by DecomposeQI through string manipulation.
15424
15425         This reduced the compiler memory usage for bootstrapping from
15426         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
15427         compile times in 0.05 seconds.
15428
15429 2003-11-28  Dick Porter  <dick@ximian.com>
15430
15431         * support.cs: Do string compares with the Invariant culture.
15432
15433         * rootcontext.cs: 
15434         * gen-treedump.cs: 
15435         * expression.cs: 
15436         * driver.cs: 
15437         * decl.cs: 
15438         * codegen.cs: 
15439         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
15440         the comparison is done with the Invariant culture.
15441
15442 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
15443
15444         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
15445         GetEnumerator method.
15446
15447         (ProbeCollectionType): Iterate starting at the most specific type
15448         upwards looking for a GetEnumerator
15449
15450         * expression.cs: Shift count can be up to 31 for int/uint and 63
15451         for long/ulong.
15452
15453 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
15454
15455         * statement.cs (Block.LookupLabel): Also look for the label on the
15456         children blocks.  Use a hash table to keep track of visited
15457         nodes. 
15458
15459         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
15460         we actually did transform the other operand, otherwise fall back
15461         to the common codepath that casts to long.
15462
15463         * cs-tokenizer.cs: Use the same code pattern as the int case.
15464         Maybe I should do the parsing myself, and avoid depending on the
15465         Parse routines to get this done.
15466
15467 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
15468
15469         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
15470         which fixes bug 51347.  This time test it.
15471
15472         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
15473         attributes for example can not tell the difference between these.
15474         The difference was only a syntax feature of the language. 
15475
15476         * attribute.cs: Apply attributes to delegates.
15477
15478         * delegate.cs: Call the apply attributes method.
15479
15480 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
15481
15482         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
15483         comparing 0 vs Byte.MinValue, not the value
15484
15485         (ImplicitConversionRequired): When reporting a conversion error,
15486         use error 31 to print out the constant error instead of the
15487         simpler 29.
15488
15489         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
15490         which fixes bug 51347.
15491
15492 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
15493
15494         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
15495         which fixes the -warnaserror command line option.
15496
15497 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
15498
15499         * cfold.cs (DoNumericPromotions): During constant folding of
15500         additions on UIntConstant, special case intconstants with
15501         IntConstants like we do on the expression binary operator. 
15502
15503 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
15504
15505         * convert.cs (ImplicitReferenceConversion): We were missing a case
15506         (System.Enum are not value types or class types, so we need to
15507         classify them separatedly).
15508
15509         * driver.cs: We do not support error 2007.
15510
15511 2003-11-12 Jackson Harper <jackson@ximian.com>
15512
15513         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
15514         system directory. Also use the full file name so users can
15515         libraries names mscorlib-o-tron.dll in a non system dir.
15516
15517 2003-11-10  Martin Baulig  <martin@ximian.com>
15518
15519         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
15520         (TypeManager.InitCoreTypes): Initialize them here, but instead of
15521         calling `ResolveType()' on them, directly assign their `Type'.
15522
15523 2003-11-08  Martin Baulig  <martin@ximian.com>
15524
15525         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
15526         return value and the `out parent' parameter.
15527         (TypeContainer.DefineType): Moved the CS0644 check into
15528         GetClassBases().  Don't pass the interface types to the
15529         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
15530         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
15531
15532         * ecore.cs (TypeExpr.IsAttribute): New property.
15533         (TypeExpr.GetInterfaces): New method.
15534
15535         * interface.cs (Interface.GetInterfaceTypeByName): Return a
15536         TypeExpr instead of a Type.
15537         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
15538         (Interface.DefineType): Don't pass the interface types to the
15539         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
15540         them later and then call `TypeBulider.AddInterfaceImplementation()'.
15541
15542         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
15543         instead of a `Type[]'.
15544         (TypeManager.RegisterBuilder): Likewise.
15545         (TypeManager.AddUserInterface): Likewise.
15546         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
15547         `Type[]' and also return a `TypeExpr[]'.
15548         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
15549
15550 2003-11-08  Martin Baulig  <martin@ximian.com>
15551
15552         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
15553         Expression.     
15554
15555 2003-11-08  Martin Baulig  <martin@ximian.com>
15556
15557         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
15558         TypeManager.ResolveExpressionTypes().
15559
15560         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
15561         instead of an Expression.
15562         (TypeExpr): This is now an abstract base class for `TypeExpression'.
15563         (TypeExpression): New public class; formerly known as `TypeExpr'.
15564
15565         * expression.cs (ComposedCast): Derive from TypeExpr.
15566
15567         * typemanager.cs (TypeManager.system_*_expr): These are now
15568         TypExpr's instead of Expression's.
15569         (TypeManager.ResolveExpressionTypes): New public static function;
15570         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
15571         of them.        
15572
15573 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
15574
15575         * expression.cs (New.DoResolve): Do not dereference value that
15576         might be a null return.
15577
15578         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
15579         sure that the constant value has the right type.  Fixes an
15580         unreported bug, similar to 50425.
15581
15582         * const.cs (Const.LookupConstantValue): Call
15583         ImplicitStandardConversionExists before doing a conversion to
15584         avoid havng the TypeManager.ChangeType do conversions.
15585
15586         Reduced the number of casts used
15587
15588         (Const.ChangeType): New routine to enable reuse of the constant
15589         type changing code from statement.
15590
15591         * typemanager.cs (ChangeType): Move common initialization to
15592         static global variables.
15593
15594         Fixes #50425.
15595
15596         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
15597         every value type to go through, even if it was void.  Fix that. 
15598
15599         * cs-tokenizer.cs: Use is_identifier_start_character on the start
15600         character of the define, and the is_identifier_part_character for
15601         the rest of the string.
15602
15603 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
15604
15605         * expression.cs (UnaryMutator.EmitCode): When I updated
15606         LocalVariableReference.DoResolve, I overdid it, and dropped an
15607         optimization done on local variable references.
15608
15609 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
15610
15611         * ecore.cs: Convert the return from Ldlen into an int.
15612
15613 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
15614
15615         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
15616         the accessibility, this is a special case for toplevel non-public
15617         classes (internal for instance).
15618
15619 2003-10-20  Nick Drochak <ndrochak@gol.com>
15620
15621         * ecore.cs: Fix typo and build.  Needed another right paren.
15622
15623 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
15624
15625         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
15626         `internal' case regular and protected, but not allowing protected
15627         to be evaluated later.  Bug 49840
15628
15629 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
15630
15631         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
15632         to kb.Nlast, and not the kb.nFirst to isolate the switch
15633         statement.
15634
15635         Extract the underlying type, so enumerations of long/ulong are
15636         treated like long/ulong.
15637
15638 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
15639
15640         * expression.cs (New): Overload the meaning of RequestedType to
15641         track the possible creation of the NewDelegate type, since
15642         DoResolve is invoked more than once for new constructors on field
15643         initialization.
15644
15645         See bugs: #48800 and #37014
15646
15647         * cs-parser.jay (declare_local_constants): Take an arraylist
15648         instead of a single constant.
15649
15650         (local_constant_declaration): It should take a
15651         constant_declarators, not a constant_declarator.  Fixes 49487
15652
15653         * convert.cs: Fix error report.
15654
15655 2003-10-13 Jackson Harper <jackson@ximian.com>
15656
15657         * typemanager.cs (TypeToCoreType): Add float and double this fixes
15658         bug #49611
15659
15660 2003-10-09  Martin Baulig  <martin@ximian.com>
15661
15662         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
15663         to the .ctor.
15664         (MethodCore.DoDefineParameters): Removed the TypeContainer
15665         argument; use the DeclSpace which was passed to the .ctor instead.
15666         (MethodCore.CheckParameter): Take a DeclSpace instead of a
15667         TypeContainer; we only need a DeclSpace here.
15668
15669 2003-10-09  Martin Baulig  <martin@ximian.com>
15670
15671         * class.cs (MethodData): Added additional `DeclSpace ds' argument
15672         to the .ctor.
15673         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
15674         EmitContext's .ctor.    
15675
15676 2003-10-09  Martin Baulig  <martin@ximian.com>
15677
15678         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
15679         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
15680         AsAccessible(), moved them as well.
15681
15682         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
15683
15684 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
15685
15686         * cs-parser.jay : Renamed yyName to yyNames related to jay.
15687
15688 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
15689
15690         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
15691         generation for >=, as spotted by Paolo, bug 48679.  
15692         Patch from David Waite.
15693
15694         * cs-tokenizer.cs: Add handling for #pragma.
15695
15696         * cs-parser.jay: Allow for both yield and yield return in the
15697         syntax.  The anti-cobolization of C# fight will go on!
15698
15699         * class.cs (TypeBuilder.DefineType): Catch error condition here
15700         (Parent.DefineType erroring out and returning null).
15701
15702         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15703         coping with enumerations variables, we were mistakenly processing
15704         them as a regular value type instead of built-in types.  Fixes the
15705         bug #48063
15706
15707         * typemanager.cs (IsBuiltinOrEnum): New method.
15708
15709 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
15710
15711         * cs-parser.jay: Upgrade: yield now needs the return clause.
15712
15713 2003-09-19  Martin Baulig  <martin@ximian.com>
15714
15715         * decl.cs (MemberCache.SetupCacheForInterface): Take a
15716         `MemberCache parent' argument.  Normally, an interface doesn't
15717         have a parent type except System.Object, but we use this in gmcs
15718         for generic type parameters.
15719
15720 2003-09-18  Martin Baulig  <martin@ximian.com>
15721
15722         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
15723         on `type.IsInterface'; don't check whether the type has a parent
15724         to determine whether it's an interface.
15725
15726 2003-09-15  Martin Baulig  <martin@ximian.com>
15727
15728         * class.cs (TypeContainer.DefineType): Added an error flag to
15729         avoid reporting duplicate CS0146's ("class definition is
15730         circular.").
15731
15732         * driver.cs (Driver.MainDriver): Abort if
15733         RootContext.ResolveTree() reported any errors.
15734
15735 2003-09-07  Martin Baulig  <martin@ximian.com>
15736
15737         * report.cs (Error, Warning): Added overloaded versions which take
15738         a `params object[] args' and call String.Format().
15739
15740 2003-09-07  Martin Baulig  <martin@ximian.com>
15741
15742         * decl.cs (DeclSpace..ctor): Don't call
15743         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
15744         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
15745         (DeclSpace.RecordDecl): New method.
15746
15747         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
15748
15749 2003-09-02  Ravi Pratap  <ravi@ximian.com>
15750
15751         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
15752         value attributes to be applied to ParameterBuilders.
15753
15754         * class.cs (MethodCore.LabelParameters): Make static and more
15755         generic so that it can be used from other places - like interface
15756         methods, for instance.
15757
15758         * interface.cs (Interface.Emit): Call LabelParameters before
15759         emitting attributes on the InterfaceMethod.
15760
15761 2003-08-26  Martin Baulig  <martin@ximian.com>
15762
15763         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
15764         resolving aliases; fixes #47927.
15765
15766 2003-08-26  Martin Baulig  <martin@ximian.com>
15767
15768         * statement.cs (Using.DoResolve): This is internally emitting a
15769         try/finally clause, so we need to set ec.NeedExplicitReturn if we
15770         do not always return.  Fixes #47681.
15771
15772 2003-08-26  Martin Baulig  <martin@ximian.com>
15773
15774         * decl.cs (MemberCore): Moved WarningNotHiding(),
15775         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
15776         into MemberBase.
15777         (AdditionResult): Make this nested in DeclSpace.
15778         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
15779         argument; call NamespaceEntry.Define() unless we're nested in a
15780         class or struct.
15781
15782         * namespace.cs (Namespace.DefineName): New public function.  This
15783         is called from DeclSpace's .ctor to add 
15784         (Namespace.Lookup): Include DeclSpaces in the lookup.
15785
15786         * class.cs (Operator): Derive from MemberBase, not MemberCore.
15787
15788         * const.cs (Const): Derive from MemberBase, not MemberCore.     
15789
15790 2003-08-25  Martin Baulig  <martin@ximian.com>
15791
15792         * convert.cs (Convert.ExplicitReferenceConversion): When
15793         converting from an interface type to a class, unbox if the target
15794         type is a struct type.  Fixes #47822.
15795
15796 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15797
15798         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
15799         #47854.
15800
15801 2003-08-22  Martin Baulig  <martin@ximian.com>
15802
15803         * class.cs (TypeManager.DefineType): When defining a nested type,
15804         call DefineType() on our parent; fixes #47801.
15805
15806 2003-08-22  Martin Baulig  <martin@ximian.com>
15807
15808         * class.cs (MethodData.Define): While checking if a method is an
15809         interface implementation, improve the test a bit more to fix #47654.
15810
15811 2003-08-22  Martin Baulig  <martin@ximian.com>
15812
15813         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
15814         correctly; fixes #47722.
15815
15816 2003-08-22  Martin Baulig  <martin@ximian.com>
15817
15818         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
15819         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
15820
15821         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
15822
15823 2003-08-22  Martin Baulig  <martin@ximian.com>
15824
15825         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
15826         can only be assigned in static constructors.  Fixes #47161.
15827
15828 2003-08-22  Martin Baulig  <martin@ximian.com>
15829
15830         Rewrote and improved the flow analysis code.
15831
15832         * flowbranching.cs (FlowBranching): Make this class abstract.
15833         (FlowBranching.CreateBranching): New static function to create a
15834         new flow branching.
15835         (FlowBranchingBlock, FlowBranchingException): New classes.
15836         (FlowBranching.UsageVector.Type): New public readonly field.
15837         (FlowBranching.UsageVector.Breaks): Removed the setter.
15838         (FlowBranching.UsageVector.Returns): Removed the setter.
15839         (FlowBranching.UsageVector): Added Break(), Return(),
15840         NeverReachable() and Throw() methods to modify the reachability.
15841         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
15842         done by FlowBranching.Merge().
15843         (FlowBranching.UsageVector.MergeChild): New method; merges the
15844         merge result into the current vector.
15845         (FlowBranching.Merge): New abstract method to merge a branching.
15846
15847 2003-08-12  Martin Baulig  <martin@ximian.com>
15848
15849         * expression.cs (Indirection.CacheTemporaries): Create the
15850         LocalTemporary with the pointer type, not its element type.
15851
15852 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
15853
15854         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
15855         token was a keyword or not.
15856
15857         Add `error' options where an IDENTIFIER was expected;  Provide
15858         CheckToken and CheckIdentifierToken convenience error reporting
15859         functions. 
15860
15861         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
15862
15863         * decl.cs: Rename `NamespaceEntry Namespace' public field into
15864         NameSpaceEntry NameSpaceEntry.
15865
15866         (LookupInterfaceOrClass): Avoid creating a full qualified name
15867         from namespace and name: avoid doing lookups when we know the
15868         namespace is non-existant.   Use new Tree.LookupByNamespace which
15869         looks up DeclSpaces based on their namespace, name pair.
15870
15871         * driver.cs: Provide a new `parser verbose' to display the
15872         exception thrown during parsing.  This is turned off by default
15873         now, so the output of a failure from mcs is more graceful.
15874
15875         * namespace.cs: Track all the namespaces defined in a hashtable
15876         for quick lookup.
15877
15878         (IsNamespace): New method
15879
15880 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
15881
15882         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
15883         we know that we need to concatenate (full typename can never be
15884         null). 
15885
15886         * class.cs: ditto.
15887
15888         * statement.cs: Use a bitfield;  Do not initialize to null things
15889         which are done by the constructor by default.
15890
15891         * cs-parser.jay: bug fix, parameter was 4, not 3.
15892
15893         * expression.cs: Just use the property;
15894
15895         * statement.cs: No need for GetVariableInfo method.
15896
15897 2003-08-08  Martin Baulig  <martin@ximian.com>
15898
15899         * flowanalysis.cs (FlowReturns): This is now nested in the
15900         `FlowBranching' class.
15901         (MyBitVector): Moved this here from statement.cs.
15902         (FlowBranching.SiblingType): New enum type.
15903         (FlowBranching.CreateSibling): Added `SiblingType' argument.
15904
15905 2003-08-07  Martin Baulig  <martin@ximian.com>
15906
15907         * flowanalysis.cs (FlowBranchingType): This is now nested in the
15908         `FlowBranching' class and called `BranchingType'.
15909
15910 2003-08-07  Martin Baulig  <martin@ximian.com>
15911
15912         * flowanalysis.cs: Moved all the control flow analysis code into
15913         its own file.
15914
15915 2003-08-07  Martin Baulig  <martin@ximian.com>
15916
15917         * assign.cs (Assign.DoResolve): `target' must either be an
15918         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
15919         #37319.
15920
15921 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
15922
15923         * expression.cs (BinaryMethod): This kind of expression is created by the
15924         Binary class if it determines that the operator has to be handled
15925         by a method.
15926
15927         (BinaryDelegate): This kind of expression is created if we are
15928         dealing with a + or - operator on delegates.
15929
15930         (Binary): remove method, argumetns, and DelegateOperator: when
15931         dealing with methods, 
15932
15933         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
15934
15935         * statement.cs (Block): use bitfields for the three extra booleans
15936         we had in use.   Remove unused topblock parameter.
15937
15938         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
15939
15940         * assign.cs: Drop extra unneeded tests.
15941
15942 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
15943
15944         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
15945
15946         * statement.cs (Foreach): Use VariableStorage instead of
15947         LocalBuilders.   
15948
15949         * codegen.cs (VariableStorage): New class used by clients that
15950         require a variable stored: locals or fields for variables that
15951         need to live across yield.
15952
15953         Maybe provide a convenience api for EmitThis+EmitLoad?
15954
15955         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
15956         these bad boys.
15957
15958 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
15959
15960         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
15961         RemapParameterLValue): New methods that are used to turn a
15962         precomputed FieldInfo into an expression like this:
15963
15964                 instance.FieldInfo
15965
15966         The idea is to use this instead of making LocalVariableReference
15967         have more than one meaning.
15968
15969         * cs-parser.jay: Add error production to BASE.
15970
15971         * ecore.cs: Deal with TypeManager.GetField returning null, which
15972         is now a valid return value.
15973
15974         (FieldExprNoAddress): New expression for Fields whose address can
15975         not be taken.
15976
15977         * expression.cs (LocalVariableReference): During the resolve
15978         phases, create new expressions if we are in a remapping context.
15979         Remove code that dealt with remapping here.
15980
15981         (ParameterReference): same.
15982
15983         (ProxyInstance): New expression, like the `This' expression, but
15984         it is born fully resolved.  We know what we are doing, so remove
15985         the errors that are targeted to user-provided uses of `this'.
15986
15987         * statement.cs (Foreach): our variable is now stored as an
15988         Expression;  During resolution, follow the protocol, dont just
15989         assume it will return this.
15990
15991 2003-08-06  Martin Baulig  <martin@ximian.com>
15992
15993         * support.cs (SeekableStreamReader.cs): New public class.
15994
15995         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
15996         SeekableStreamReader instead of the normal StreamReader.
15997
15998 2003-08-04  Martin Baulig  <martin@ximian.com>
15999
16000         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
16001         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
16002         deambiguate casts and delegate invocations.
16003         (parenthesized_expression): Use the new tokens to ensure this is
16004         not a cast of method invocation.
16005
16006         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
16007         when reading a `)' and Deambiguate_CloseParens () was previously
16008         called.
16009
16010         * expression.cs (ParenthesizedExpression): New class.  This is
16011         just used for the CS0075 test.
16012         (Binary.DoResolve): Check for CS0075.   
16013
16014 2003-07-29  Ravi Pratap  <ravi@ximian.com>
16015
16016         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
16017         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
16018         reference comparison.
16019
16020         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
16021         examine the ReturnType for equality - this is necessary in the
16022         cases of implicit and explicit operators whose signature also
16023         includes the return type.
16024
16025 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
16026
16027         * namespace.cs: Cache the result of the namespace computation,
16028         instead of computing it every time.
16029
16030 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
16031
16032         * decl.cs: Use a global arraylist that we reuse over invocations
16033         to avoid excesive memory consumption.  Reduces memory usage on an
16034         mcs compile by one meg (45 average).
16035
16036         * typemanager.cs (LookupTypeReflection): In .NET pointers are
16037         private, work around that.
16038
16039 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
16040
16041         * literal.cs (IntLiteral): Define Zero and One static literals. 
16042
16043         * cs-parser.jay (integer_literal): use static literals to reduce
16044         memory usage for the most used literals (0, 1 and -1).  211kb
16045         reduced in memory usage.
16046
16047         Replace all calls to `new ArrayList' with `new
16048         ArrayList(4)' which is a good average number for most allocations,
16049         and also requires only 16 bytes of memory for its buffer by
16050         default. 
16051
16052         This reduced MCS memory usage in seven megabytes for the RSS after
16053         bootstrapping.
16054
16055 2003-07-28  Ravi Pratap  <ravi@ximian.com>
16056
16057         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
16058         handle params methods the correct way by forming only one
16059         applicable set with params and normal methods in them. Earlier we
16060         were looking at params methods only if we found no normal methods
16061         which was not the correct thing to do.
16062
16063         (Invocation.BetterFunction): Take separate arguments indicating
16064         when candidate and the best method are params methods in their
16065         expanded form.
16066
16067         This fixes bugs #43367 and #46199.
16068
16069         * attribute.cs: Documentation updates.
16070
16071         (CheckAttribute): Rename to CheckAttributeTarget.
16072         (GetValidPlaces): Rename to GetValidTargets.
16073
16074         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
16075         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
16076
16077         Fixes bug #44468.
16078
16079 2003-07-28  Martin Baulig  <martin@ximian.com>
16080
16081         * class.cs (TypeContainer.DefineMembers): Use the base type's full
16082         name when looking up the base class of a nested class.  Fixes #46977.
16083
16084 2003-07-26  Martin Baulig  <martin@ximian.com>
16085
16086         * expression.cs (Indexers.Indexer): New nested struct; contains
16087         getter, setter and the indexer's type.
16088         (Indexers.Properties): This is now an ArrayList of
16089         Indexers.Indexer's.
16090         (IndexerAccess.DoResolveLValue): Correctly set the type if the
16091         indexer doesn't have any getters.
16092
16093         * assign.cs (Assign.DoResolve): Also do the implicit conversions
16094         for embedded property and indexer assignments.
16095
16096 2003-07-26  Martin Baulig  <martin@ximian.com>
16097
16098         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
16099         preprocessor directive is not the first non-whitespace character
16100         on a line.
16101
16102 2003-07-26  Martin Baulig  <martin@ximian.com>
16103
16104         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
16105         namespace parsing, follow the spec more closely.
16106
16107         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
16108         NamespaceEntry.Lookup().
16109
16110 2003-07-25  Martin Baulig  <martin@ximian.com>
16111
16112         * MethodCore.cs (OverridesSomething): New public field; it's set
16113         from TypeContainer.DefineMembers if this method overrides
16114         something (which doesn't need to be a method).  Fix #39462.
16115
16116 2003-07-25  Ravi Pratap  <ravi@ximian.com>
16117
16118         * typemanager.cs (GetMembers): Ensure that the list of members is
16119         reversed. This keeps things in sync.
16120
16121         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
16122         find an AttributeUsage attribute.
16123
16124         * expression.cs (Invocation.OverloadResolve): Perform the check
16125         which disallows Invoke to be directly called on a Delegate.
16126
16127         (Error_InvokeOnDelegate): Report error cs1533.
16128
16129 2003-07-25  Martin Baulig  <martin@ximian.com>
16130
16131         * expression.cs (Indexers.GetIndexersForType): Only look in the
16132         interface hierarchy if the requested type is already an
16133         interface.  Fixes #46788 while keeping #46502 fixed.
16134
16135 2003-07-25  Martin Baulig  <martin@ximian.com>
16136
16137         * class.cs (TypeContainer.DefineMembers): Check whether all
16138         readonly fields have been assigned and report warning CS0649 if
16139         not.
16140
16141         * statement.cs (LocalInfo.IsFixed): Always return true if this is
16142         a valuetype.
16143
16144 2003-07-24  Ravi Pratap  <ravi@ximian.com>
16145
16146         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
16147         returned from GetMethods to make things consistent with the
16148         assumptions MCS makes about ordering of methods.
16149
16150         This should comprehensively fix bug #45127 and it does :-)
16151
16152         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
16153         ordering is actually reverse.
16154
16155         * Clean up some debug messages I left lying around.
16156
16157         * interface.cs (Populate*): Get rid of code which emits attributes
16158         since the stage in which we emit attributes is the 'Emit' stage,
16159         not the define stage.
16160
16161         (Emit): Move attribute emission for interface members here.
16162
16163 2003-07-22  Ravi Pratap  <ravi@ximian.com>
16164
16165         * expression.cs (Invocation.OverloadResolve): Follow the spec more
16166         closely: we eliminate methods in base types when we have an
16167         applicable method in a top-level type.
16168
16169         Please see section 14.5.5.1 for an exact description of what goes
16170         on. 
16171
16172         This fixes bug #45127 and a host of other related to corlib compilation.
16173
16174         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
16175         array is the method corresponding to the top-level type (this is
16176         because of the changes made to icall.c) so we change this
16177         accordingly.
16178
16179         (MethodGroupExpr.Name): This too.
16180
16181         * typemanager.cs (GetElementType): New method which does the right
16182         thing when compiling corlib. 
16183
16184         * everywhere: Make use of the above in the relevant places.
16185
16186 2003-07-22  Martin Baulig  <martin@ximian.com>
16187
16188         * cs-parser.jay (invocation_expression): Moved
16189         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
16190         `cast_expression', but create a InvocationOrCast which later
16191         resolves to either an Invocation or a Cast.
16192
16193         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
16194         method; call this before EmitStatement() to make sure that this
16195         expression can be used as a statement.
16196
16197         * expression.cs (InvocationOrCast): New class; resolves to either
16198         an Invocation or a Cast.
16199
16200         * statement.cs (StatementExpression): Call ResolveStatement() on
16201         the ExpressionStatement before emitting it.
16202
16203 2003-07-21  Martin Baulig  <martin@ximian.com>
16204
16205         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
16206         `ref' and `out' attributes match; fixes #46220.
16207         (MemberAccess.ResolveMemberAccess): You can't reference a type
16208         through an expression; fixes #33180.
16209         (Indexers.GetIndexersForType): Don't return the indexers from
16210         interfaces the class implements; fixes #46502.
16211
16212 2003-07-21  Martin Baulig  <martin@ximian.com>
16213
16214         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
16215         CS0661 checks; fixes bug #30442.
16216
16217 2003-07-21  Martin Baulig  <martin@ximian.com>
16218
16219         * decl.cs (AdditionResult): Added `Error'.
16220
16221         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
16222
16223         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
16224         makes cs0031.cs actually work.
16225
16226 2003-07-20  Martin Baulig  <martin@ximian.com>
16227
16228         * namespace.cs: Fixed that bug which caused a crash when compiling
16229         the debugger's GUI.
16230
16231 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
16232
16233         * typemanager.cs (LookupTypeReflection): Never expose types which
16234         are NotPublic, NestedPrivate, NestedAssembly, or
16235         NestedFamANDAssem.  We used to return these, and later do a check
16236         that would report a meaningful error, but the problem is that we
16237         would not get the real match, if there was a name override.
16238
16239 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
16240
16241         * namespace.cs (Namespace, Name): Do not compute the namespace
16242         name dynamically, compute it in the constructor.  This reduced
16243         memory usage by 1697 KB.
16244
16245         * driver.cs: Use --pause to pause at the end.
16246
16247 2003-07-17  Peter Williams  <peter@newton.cx>
16248
16249         * Makefile: Change the name of the test target so that it doesn't
16250         conflict with the recursive test target.
16251
16252 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
16253
16254         * expression.cs (LocalVariableReference.Emit, EmitAssign,
16255         AddressOf): Do not use EmitThis, that was wrong, use the actual
16256         this pointer.
16257
16258 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
16259
16260         * class.cs (MethodData.Define): While checking if a method is an
16261         interface implementation, improve the test: If we are not public
16262         (use new test here: use the computed MethodAttributes directly,
16263         instead of the parsed modifier flags) check if the `implementing'
16264         method comes from an interface or not.
16265
16266         * pending.cs (VerifyPendingMethods): Slightly better error
16267         message.
16268
16269         * makefile: add test target that does the mcs bootstrap.
16270
16271 2003-07-16  Ravi Pratap  <ravi@ximian.com>
16272
16273         * interface.cs (Define): Do nothing here since there are no
16274         members to populate etc. Move the attribute emission out of here
16275         since this was just totally the wrong place to put it. Attribute
16276         application happens during the 'Emit' phase, not in the 'Define'
16277         phase.
16278
16279         (Emit): Add this method and move the attribute emission here
16280
16281         * rootcontext.cs (EmitCode): Call the Emit method on interface
16282         types too.
16283
16284 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
16285
16286         * expression.cs (OverloadResolve): Report error only if Location
16287         is not 'Null' which means that there was a probe going on.
16288
16289 2003-07-14  Martin Baulig  <martin@ximian.com>
16290
16291         * expression.cs (ConditionalLogicalOperator): New public class to
16292         implement user defined conditional logical operators.
16293         This is section 14.11.2 in the spec and bug #40505.
16294
16295 2003-07-14  Martin Baulig  <martin@ximian.com>
16296
16297         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
16298
16299 2003-07-14  Martin Baulig  <martin@ximian.com>
16300
16301         * codegen.cs (EmitContext.InFixedInitializer): New public field.
16302
16303         * ecore.cs (IVariable.VerifyFixed): New interface method.
16304
16305         * expression.cs (Unary.ResolveOperator): When resolving the `&'
16306         operator, check whether the variable is actually fixed.  Fixes bug
16307         #36055.  Set a variable definitely assigned when taking its
16308         address as required by the spec.
16309
16310         * statement.cs (LocalInfo.IsFixed): New field.
16311         (LocalInfo.MakePinned): Set `IsFixed' to true.
16312
16313 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
16314
16315         * attribute.cs (Attribute.Resolve): While doing a Member lookup
16316         for .ctors, ensure that we only ask for members declared in the
16317         attribute type (BindingFlags.DeclaredOnly).
16318
16319         Fixes bug #43632.
16320
16321         * expression.cs (Error_WrongNumArguments): Report error 1501
16322         correctly the way CSC does.
16323
16324 2003-07-13  Martin Baulig  <martin@ximian.com>
16325
16326         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
16327         lookup on the fully qualified name, to make things like "X.X" work
16328         where "X.X" is a fully qualified type name, but we also have a
16329         namespace "X" in the using list.  Fixes #41975.
16330
16331 2003-07-13  Martin Baulig  <martin@ximian.com>
16332
16333         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
16334         function. If we're a CompoundAssign, we need to create an embedded
16335         CompoundAssign, not an embedded Assign.
16336         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
16337         Fixes #45854.
16338
16339 2003-07-13  Martin Baulig  <martin@ximian.com>
16340
16341         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
16342         work to fix bug #46088.
16343
16344 2003-07-13  Ravi Pratap <ravi@ximian.com>
16345
16346         * class.cs (Operator.Emit): Do not emit attributes here - it is
16347         taken care of by the Method class that we delegate too. This takes
16348         care of bug #45876.
16349
16350 2003-07-10  Martin Baulig  <martin@ximian.com>
16351
16352         * expression.cs (TypeOfVoid): New class.
16353         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
16354
16355 2003-07-10  Martin Baulig  <martin@ximian.com>
16356
16357         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
16358         bug #35957.
16359
16360 2003-07-10  Martin Baulig  <martin@ximian.com>
16361
16362         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
16363         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
16364
16365         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
16366
16367         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
16368
16369 2003-07-10  Martin Baulig  <martin@ximian.com>
16370
16371         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
16372         of decimal.  Fixes #42850.
16373
16374         NOTE: I also fixed the created byte blob, but this doesn't work on
16375         the MS runtime and csc never produces any byte blobs for decimal
16376         arrays.
16377
16378 2003-07-10  Martin Baulig  <martin@ximian.com>
16379
16380         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
16381         structs; fixes #32068.
16382         (Block.AddChildVariableNames): Fixed #44302.
16383
16384 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16385
16386         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
16387
16388 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
16389
16390         * attribute.cs: And this test is onger needed.
16391
16392 2003-07-08  Martin Baulig  <martin@ximian.com>
16393
16394         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
16395         inaccessible types.  Fixes #36313.
16396
16397         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
16398
16399         * namespace.cs (NamespaceEntry): Create implicit entries for all
16400         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
16401         implicit entries for N1.N2 and N1.
16402
16403 2003-07-08  Martin Baulig  <martin@ximian.com>
16404
16405         Rewrote the handling of namespaces to fix a lot of the issues
16406         wrt. `using' aliases etc.
16407
16408         * namespace.cs (Namespace): Splitted this class into a
16409         per-assembly `Namespace' and a per-file `NamespaceEntry'.
16410
16411         * typemanager.cs (TypeManager.IsNamespace): Removed.
16412         (TypeManager.ComputeNamespaces): Only compute namespaces from
16413         loaded assemblies here, not the namespaces from the assembly we're
16414         currently compiling.
16415
16416 2003-07-08  Martin Baulig  <martin@ximian.com>
16417
16418         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
16419
16420 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
16421
16422         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
16423         already fixed it.  
16424
16425         I thought about the memory savings here, but LookupTypeReflection
16426         is used under already very constrained scenarios.  Compiling
16427         corlib or mcs only exposes one hit, so it would not really reduce
16428         any memory consumption.
16429
16430 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16431
16432         * typemanager.cs: fixes bug #45889 by only adding public types from
16433         other assemblies to the list of known types.
16434
16435 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
16436
16437         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
16438         on the type we resolved.
16439
16440 2003-07-05  Martin Baulig  <martin@ximian.com>
16441
16442         * pending.cs (PendingImplementation.ParentImplements): Don't
16443         create the proxy if the parent is abstract.
16444
16445         * class.cs (TypeContainer.DefineIndexers): Process explicit
16446         interface implementations first.  Fixes #37714.
16447
16448 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
16449
16450         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
16451         defined recursively;  but since we modify the input parameters
16452         (left is set to `this' temporarily), we reset this value if the
16453         left_is_explicit is false, which gives the original semantics to
16454         the code.  
16455
16456         * literal.cs (NullPointer): new class used to represent a null
16457         literal in a pointer context.
16458
16459         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
16460         type is a pointer, use a NullPointer object instead of a
16461         NullLiteral.   Closes 43687
16462
16463         (ExplicitConversion): Convert pointer values using
16464         the conv opcode to the proper type.
16465
16466         * ecore.cs (New): change ValueTypeVariable property into a method,
16467         that returns whether the valuetype is suitable for being used.
16468
16469         * expression.cs (Binary.DoNumericPromotions): Only return if we
16470         the int constant was a valid uint, and we can return both left and
16471         right as uints.  If not, we continue processing, to trigger the
16472         type conversion.  This fixes 39018.
16473
16474         * statement.cs (Block.EmitMeta): During constant resolution, set
16475         the CurrentBlock property on the emitcontext, so that we resolve
16476         constants propertly.
16477
16478 2003-07-02  Martin Baulig  <martin@ximian.com>
16479
16480         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
16481         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
16482
16483         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
16484         than emitting it here.
16485
16486         * statement.cs: Fixed some more flow analysis bugs.
16487
16488 2003-07-02  Martin Baulig  <martin@ximian.com>
16489
16490         * class.cs (MethodData.Define): When implementing interface
16491         methods, set Final unless we're Virtual.
16492
16493         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
16494         check work for interface methods.
16495
16496 2003-07-01  Martin Baulig  <martin@ximian.com>
16497
16498         * ecore.cs (EmitContext.This): Replaced this property with a
16499         GetThis() method which takes a Location argument.  This ensures
16500         that we get the correct error location for a CS0188.
16501
16502 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
16503
16504         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
16505         ImplicitStandardConversion.
16506
16507         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
16508
16509 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
16510
16511         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
16512         optimization.
16513
16514 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
16515
16516         * class.cs (Constructor.Define): Turn off initlocals for unsafe
16517         constructors.
16518
16519         (MethodData.Define): Turn off initlocals for unsafe methods.
16520
16521 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
16522
16523         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
16524         complete;  Fixes #37521.
16525
16526         * delegate.cs: Use Modifiers.TypeAttr to compute the
16527         TypeAttributes, instead of rolling our own.  This makes the flags
16528         correct for the delegates.
16529
16530 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
16531
16532         * class.cs (Constructor.Define): Set the private flag for static
16533         constructors as well.
16534
16535         * cs-parser.jay (statement_expression): Set the return value to
16536         null, to avoid a crash when we catch an error.
16537
16538 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
16539
16540         * cs-parser.jay: Applied patch from Jackson that adds support for
16541         extern and unsafe modifiers to destructor declarations.
16542
16543         * expression.cs: Report error 21 if the user is trying to index a
16544         System.Array.
16545
16546         * driver.cs: Add an error message, suggested by the bug report.
16547
16548         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
16549         if we do not have a ": this ()" constructor initializer.  Fixes 45149
16550
16551 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
16552
16553         * namespace.cs: Add some information to reduce FAQs.
16554
16555 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
16556
16557         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
16558         underlying enumeration types.  Fixes #43915.
16559
16560         * expression.cs: Treat ushort/short as legal values to be used in
16561         bitwise operations.
16562
16563 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
16564
16565         * delegate.cs: transfer custom attributes for paramenters from
16566         the delegate declaration to Invoke and BeginInvoke.
16567
16568 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
16569
16570         * attribute.cs: handle custom marshalers and emit marshal info
16571         for fields, too.
16572
16573 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
16574
16575         * makefile.gnu: Added anonymous.cs to the compiler sources.
16576
16577 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
16578
16579         * iterators.cs: Change the name of the proxy class to include two
16580         underscores.
16581
16582         * cs-parser.jay: Update grammar to include anonymous methods.
16583
16584         * anonymous.cs: new file.
16585
16586 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
16587
16588         * class.cs (Field.Define): Add missing test for pointers and
16589         safety. 
16590
16591 2003-05-27  Ravi Pratap  <ravi@ximian.com>
16592
16593         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
16594         we use the stobj opcode.
16595
16596         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
16597         since it wasn't the correct fix. 
16598
16599         It still is puzzling that we are required to use stobj for IntPtr
16600         which seems to be a ValueType.
16601
16602 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
16603
16604         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
16605         during regular simple name resolution.   Now, the trick is that
16606         instead of returning for processing the simplename, we do a
16607         TypeManager.LookupType (ie, a rooted lookup as opposed to a
16608         contextual lookup type).   If a match is found, return that, if
16609         not, return for further composition.
16610
16611         This fixes long-standing 30485.
16612
16613         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
16614         using the address to initialize an object, do an Stobj instead of
16615         using the regular Stelem.
16616
16617         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
16618         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
16619         Because if we are a BaseIndexerAccess that value will be true.
16620         Fixes 43643.
16621
16622         * statement.cs (GotoCase.Resolve): Return after reporting an
16623         error, do not attempt to continue. 
16624
16625         * expression.cs (PointerArithmetic.Emit): If our operand is a
16626         long, convert our constants to match the operand before
16627         multiplying.  Convert to I type before adding.   Fixes 43670.
16628
16629 2003-05-14  Ravi Pratap  <ravi@ximian.com>
16630
16631         * enum.cs (ImplicitConversionExists) : Rename to
16632         ImplicitEnumConversionExists to remove ambiguity. 
16633
16634         * ecore.cs (NullCast): New type of cast expression class which
16635         basically is very similar to EmptyCast with the difference being
16636         it still is a constant since it is used only to cast a null to
16637         something else
16638         (eg. (string) null)
16639
16640         * convert.cs (ImplicitReferenceConversion): When casting a null
16641         literal, we return a NullCast.
16642
16643         * literal.cs (NullLiteralTyped): Remove - I don't see why this
16644         should be around anymore.
16645
16646         The renaming (reported was slightly wrong). Corrections:
16647
16648         ConvertImplicitStandard -> ImplicitConversionStandard
16649         ConvertExplicitStandard -> ExplicitConversionStandard
16650
16651         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
16652         before passing them in !
16653
16654         * convert.cs (ImplicitConversionStandard): When comparing for
16655         equal expr and target types, ensure that expr is not a
16656         NullLiteral.
16657
16658         In general, we must not be checking (expr_type ==
16659         target_type) in the top level conversion methods
16660         (ImplicitConversion, ExplicitConversion etc). This checking is
16661         done in the methods that they delegate to.
16662
16663 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
16664
16665         * convert.cs: Move Error_CannotConvertType,
16666         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
16667         ImplicitNumericConversion, ImplicitConversionExists,
16668         ImplicitUserConversionExists, StandardConversionExists,
16669         FindMostEncompassedType, FindMostSpecificSource,
16670         FindMostSpecificTarget, ImplicitUserConversion,
16671         ExplicitUserConversion, GetConversionOperators,
16672         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
16673         TryImplicitIntConversion, Error_CannotConvertImplicit,
16674         ConvertImplicitRequired, ConvertNumericExplicit,
16675         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
16676         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
16677         its own file.
16678
16679         Perform the following renames:
16680
16681         StandardConversionExists -> ImplicitStandardConversionExists
16682         ConvertImplicit -> ImplicitConversion
16683         ConvertImplicitStandard -> ImplicitStandardConversion
16684         TryImplicitIntConversion -> ImplicitIntConversion
16685         ConvertImplicitRequired -> ImplicitConversionRequired
16686         ConvertNumericExplicit -> ExplicitNumericConversion
16687         ConvertReferenceExplicit -> ExplicitReferenceConversion
16688         ConvertExplicit -> ExplicitConversion
16689         ConvertExplicitStandard -> ExplicitStandardConversion
16690
16691 2003-05-19  Martin Baulig  <martin@ximian.com>
16692
16693         * statement.cs (TypeInfo.StructInfo): Made this type protected.
16694         (TypeInfo): Added support for structs having structs as fields.
16695
16696         * ecore.cs (FieldExpr): Implement IVariable.
16697         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
16698         VariableInfo for the field.
16699
16700 2003-05-18  Martin Baulig  <martin@ximian.com>
16701
16702         * expression.cs (This.DoResolve): Report a CS0027 if we're
16703         emitting a field initializer.
16704
16705 2003-05-18  Martin Baulig  <martin@ximian.com>
16706
16707         * expression.cs (This.ResolveBase): New public function.
16708         (This.DoResolve): Check for CS0188.
16709
16710         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
16711         This.Resolve().
16712
16713         * ecore.cs (MethodGroupExpr.DoResolve): Set the
16714         `instance_expression' to null if we don't have any non-static
16715         methods.
16716
16717 2003-05-18  Martin Baulig  <martin@ximian.com>
16718
16719         Reworked the way how local variables and parameters are handled by
16720         the flow analysis code.
16721
16722         * statement.cs (TypeInfo, VariableMap): New public classes.
16723         (VariableInfo): New public class.  This is now responsible for
16724         checking whether a variable has been assigned.  It is used for
16725         parameters and local variables.
16726         (Block.EmitMeta): Take the InternalParameters as argument; compute
16727         the layout of the flow vectors here.
16728         (Block.LocalMap, Block.ParameterMap): New public properties.
16729         (FlowBranching): The .ctor doesn't get the InternalParameters
16730         anymore since Block.EmitMeta() now computes the layout of the flow
16731         vector.
16732         (MyStructInfo): This class is now known as `StructInfo' and nested
16733         in `TypeInfo'; we don't access this directly anymore.
16734
16735         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
16736         property and removed IsAssigned(), IsFieldAssigned(),
16737         SetAssigned() and SetFieldAssigned(); we now call them on the
16738         VariableInfo so we don't need to duplicate this code everywhere.
16739
16740         * expression.cs (ParameterReference): Added `Block block' argument
16741         to the .ctor.
16742         (LocalVariableReference, ParameterReference, This): The new
16743         VariableInfo class is now responsible for all the definite
16744         assignment stuff.
16745
16746         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
16747         IsParameterAssigned, SetParameterAssigned): Removed.
16748
16749 2003-05-18  Martin Baulig  <martin@ximian.com>
16750
16751         * typemanager.cs (InitCoreTypes): Try calling
16752         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
16753         the 3-args-version.  Corlib now also needs our `void_type'.
16754         (GetMethod): Added overloaded version which takes an optional
16755         `bool report_errors' to allow lookups of optional methods.
16756
16757 2003-05-12  Martin Baulig  <martin@ximian.com>
16758
16759         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
16760         only used for locals and not for parameters.
16761
16762 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
16763
16764         * support.cs (InternalParameters.ParameterType): Return the
16765         ExternalType of the parameter.
16766
16767         * parameter.cs (Parameter.ExternalType): drop the two arguments,
16768         they were unused.
16769
16770 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
16771
16772         * class.cs (MethodData.Define): Do not set the `newslot' on
16773         interface members, if they are also flagged as "override".
16774
16775         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
16776         better code for ++i and i++.  This only works for static fields
16777         and local variables.
16778
16779         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
16780         want to pull the DeclSpace out of the builder_to_declspace instead
16781         of the TypeBuilder (like in TypeContainer.FindMembers).
16782
16783         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
16784         instead of LookupTypeContainer.  Fixes the crash on .NET for
16785         looking up interface members.
16786
16787         * const.cs: Create our own emit context during the Definition
16788         stage, so that constants are evaluated in the proper context, when
16789         a recursive definition happens.
16790
16791 2003-05-11  Martin Baulig  <martin@ximian.com>
16792
16793         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
16794         new block for a switch section.
16795         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
16796         the adding/lookup in the switch block.  Fixes #39828.
16797
16798 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
16799
16800         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
16801         functionality: I needed to convert the data after I had performed
16802         the add/sub operation into the operands type size.
16803
16804         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
16805         pass the type for the box operation, otherwise the resulting
16806         object would have been of type object.
16807
16808         (BoxedCast): Add constructor to specify the type to box as.
16809
16810 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
16811
16812         * iterators.cs: I was reusing the `count' variable inadvertently,
16813         take steps to not allow this to happen.
16814
16815 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
16816
16817         * attribute.cs (Attribute.Resolve): Params attributes are encoded
16818         by creating an array at the point where the params starts and
16819         putting all those arguments there, then adjusting the size of the
16820         array.
16821
16822 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
16823
16824         * expression.cs (New.AddressOf): Implement interface
16825         IMemoryLocation.  This is used when the `new' operator is used in
16826         the context of an invocation to a method on a value type.
16827
16828         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
16829         example. 
16830
16831         * namespace.cs: Also check the using aliases here.
16832
16833         * driver.cs: Move the test for using validity after the types have
16834         been entered, so we do a single pass that also includes the using
16835         aliases. 
16836
16837         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
16838         in the regular case.   CreateSiblingForFinally is doing extra
16839         error checking.
16840
16841         * attribute.cs (GetAttributeArgumentExpression): Store the result
16842         on an out value, and use the return value to indicate failure
16843         instead of using null (which is a valid return for Constant.GetValue).
16844
16845         * statement.cs: Perform the analysis flow for the increment
16846         portion after the statement, because this will be the real flow of
16847         execution.  Fixes #42385
16848
16849         * codegen.cs (EmitContext.EmitArgument,
16850         EmitContext.EmitStoreArgument): New helper functions when the
16851         RemapToProxy flag is set.
16852
16853         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
16854         function.
16855
16856         Add support for remapping parameters. 
16857
16858         * iterators.cs: Propagate parameter values;  Store parameter
16859         values in the proxy classes.
16860
16861 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
16862
16863         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
16864         need a proxy reference;  I do not know what I was thinking
16865
16866         * cs-parser.jay (constructor_initializer): catch another error,
16867         and display nice message.
16868
16869         (field_declaration): catch void field declaration
16870         to flag a better error. 
16871
16872         * class.cs (MemberBase.CheckBase): Report an error instead of a
16873         warning if a new protected member is declared in a struct. 
16874         (Field.Define): catch the error of readonly/volatile.
16875
16876         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
16877
16878         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
16879         volatile variable is taken
16880
16881 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
16882
16883         * statement.cs (Fixed.Resolve): Report an error if we are not in
16884         an unsafe context.
16885
16886 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
16887
16888         * typemanager.cs: reuse the code that handles type clashes for
16889         delegates and enumerations.
16890
16891         * class.cs (Report28): Always report.
16892
16893         * expression.cs (EncodeAsAttribute): Allow nulls here.
16894
16895 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
16896
16897         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
16898         the functionality for testing whether an expression is valid for
16899         an attribute here.  Also handle the case of arrays of elements
16900         being stored. 
16901
16902         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
16903         encoding a linear array into an array of objects that are suitable
16904         to be passed to an CustomAttributeBuilder.
16905
16906         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
16907
16908         * ecore.cs: (FieldExpr): Handle field remapping here.
16909
16910         * iteratators.cs: Pass the instance variable (if the method is an
16911         instance method) to the constructors, so we can access the field
16912         variables on the class.
16913
16914         TODO: Test this with structs.  I think the THIS variable on
16915         structs might have to be a pointer, and not a refenrece
16916
16917 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
16918
16919         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
16920         local variables to fields in a proxy class.
16921
16922         * iterators.cs (PopulateProxy): Rename our internal fields to
16923         <XXX>.  
16924         Create a <THIS> field if we are an instance method, so we can
16925         reference our parent container variables.
16926         (MapVariable): Called back from the EmitContext code to enter a
16927         new variable to field mapping into the proxy class (we just create
16928         a FieldBuilder).
16929
16930         * expression.cs
16931         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
16932         for using the remapped locals to fields.
16933
16934         I placed the code here, because that gives the same semantics to
16935         local variables, and only changes the Emit code.
16936
16937         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
16938         statements inside iterators.
16939         (VariableInfo): Add a FieldBuilder for the cases when we are
16940         remapping local variables to fields in a proxy class
16941
16942         * ecore.cs (SimpleNameResolve): Avoid testing two times for
16943         current_block != null.
16944
16945         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
16946         not cope with strings, as it has been moved to the
16947         TableSwitchEmit.  Fixed bug in switch generation.
16948
16949         * expression.cs (New.DoResolve): Provide more context for the user
16950         when reporting an error.
16951
16952         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
16953         pointers. 
16954
16955         * expression.cs (MemberAccess.DoResolve): When we get a type back,
16956         check the permissions for it.  Note than in a type-resolution
16957         context the check was already present in DeclSpace.ResolveType,
16958         but was missing from the MemberAccess.
16959
16960         (ArrayCreation.CheckIndices): warn if the user has
16961         more nested levels of expressions, but there are no more
16962         dimensions specified.  Avoids crash on bug 41906.
16963
16964 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
16965
16966         * statement.cs (Block): replace Implicit bool, for a generic
16967         flags.   
16968         New flag: `Unchecked'.  This is used during the EmitMeta phase
16969         (which is out-of-line with the regular Resolve/Emit process for a
16970         statement, as this is done ahead of time, but still gets a chance
16971         to call constant resolve).
16972
16973         (Block.Flags): new enum for adding a new flag.
16974
16975         (Block.EmitMeta): track the state of unchecked.
16976
16977         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
16978         to enable constant resolution to work there as well.
16979
16980 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
16981
16982         * typemanager.cs (ienumerable_type): Also look up
16983         System.Collections.IEnumerable. 
16984
16985 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
16986
16987         TODO: Test more than one conditional per method.
16988
16989         * class.cs (Indexer.Define): Report the location where the user is
16990         referencing the unsupported feature.
16991
16992         (MethodData): Overload the use of `conditionals' to
16993         minimize the creation of needless ArrayLists.   This saves roughly
16994         212kb on my machine.
16995
16996         (Method): Implement the new IIteratorContainer interface.
16997         (Method.SetYields): Implement the method by setting the ModFlags
16998         to contain METHOD_YIELDS.
16999
17000         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
17001         which just got set to null.
17002
17003         * iterators.cs: New file.
17004
17005         (Yield, YieldBreak): New statements.
17006
17007         * statement.cs (Return.Resolve): Flag an error if we are used in
17008         an iterator method.
17009
17010         * codegen.cs (InIterator): New flag set if the code is being
17011         compiled in an iterator method.
17012
17013         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
17014         internal modifier, and we just use it to avoid adding extra
17015         fields, as this is seldom used.  
17016
17017         * cs-parser.jay: Add yield_statement (yield and yield break).
17018
17019         * driver.cs: New flag -v2 to turn on version 2 features. 
17020
17021         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
17022         hashtable when v2 is enabled.
17023
17024 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
17025
17026         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
17027         there is already a namespace defined with this name.
17028
17029         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
17030         people upgraded their corlibs.
17031
17032         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
17033         always use fully qualified types, no need to use the compiler
17034         front end.
17035
17036         (TypeManager.IsNamespace): Use binarysearch.
17037
17038         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
17039         AddDelegate): I did not quite use the new IsValid API properly: I
17040         have to pass the short-name and the fullname.  I was passing only
17041         the basename instead of the fullname sometimes. 
17042
17043         (TypeContainer.DefineType): call NamespaceClash.
17044
17045         * interface.cs (Interface.DefineType): use NamespaceClash before
17046         defining the type.
17047
17048         * delegate.cs (Delegate.DefineType): use NamespaceClash before
17049         defining the type.
17050
17051         * enum.cs: (Enum.DefineType): use NamespaceClash before
17052         defining the type.
17053
17054         * typemanager.cs (: 3-line patch that gives us some tasty 11%
17055         speed increase.  First, use the negative_hits cache when we get a
17056         negative.  Second, add the type with its full original name
17057         instead of the new . and + encoded name (reflection uses + to
17058         separate type from a nested type).  Use LookupTypeReflection
17059         directly which bypasses the type->name hashtable (that we already
17060         know does not contain the type.
17061
17062         * decl.cs (DeclSpace.ResolveTypeExpr): track the
17063         location/container type. 
17064
17065         * driver.cs: When passing utf8, use directly the UTF8Encoding.
17066
17067 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
17068
17069         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
17070
17071         * delegate.cs (NewDelegate.Resolve): Test whether an instance
17072         method is being referenced in the method group from a static
17073         context, and report error 120 if so.
17074
17075         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
17076         Error118. 
17077
17078         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
17079         is created, we create the A namespace).
17080
17081         * cs-parser.jay: A namespace also introduces a DeclarationFound.
17082         Fixes #41591
17083
17084 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
17085
17086         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
17087         invocation to ModuleBuilder.GetType with the same values will
17088         return a new type instance, so we need to cache its return
17089         values. 
17090
17091         * expression.cs (Binary.ResolveOperator): Only allow the compare
17092         operators on enums if they are of the same type.
17093
17094         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
17095         types of ValueType on their own case.  Before we were giving them
17096         the same treatment as objects.
17097
17098         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
17099         fullname.  Short name is used to compare against container name.
17100         Fullname is used to check against defined namespace names.
17101
17102         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
17103         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
17104
17105         (Method.CheckBase): Call parent.
17106         (MemberBase.CheckBase): Check for protected members on sealed
17107         classes.
17108         (PropertyBase.CheckBase): Call parent.
17109         (Field.Define): Call parent.
17110
17111         * report.cs: Negative error codes are now mapped to 8000 - code,
17112         so that the display is render more nicely.
17113
17114         * typemanager.cs: Do not use try/catch, instead report a regular
17115         error. 
17116
17117         (GetPointerType, GetReferenceType): These methods provide
17118         mechanisms to obtain the T* and T& from a T.  We had the code
17119         previously scattered around the code base, and it also used
17120         TypeManager.LookupType that would go through plenty of caches.
17121         This one goes directly to the type source.
17122
17123         In some places we did the Type.GetType followed by
17124         ModuleBuilder.GetType, but not in others, so this unifies the
17125         processing as well.
17126
17127         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
17128         statements now that we have namespace information.
17129
17130         * typemanager.cs (IsNamespace): New method, returns whether the
17131         string presented is a namespace or not.
17132
17133         (ComputeNamespaces): New public entry point, computes the list of
17134         available namespaces, using the GetNamespaces API call in Mono, or
17135         the slower version in MS.NET.   
17136
17137         Now before we start the semantic analysis phase, we have a
17138         complete list of namespaces including everything that the user has
17139         provided.
17140
17141         Deleted old code to cache namespaces in .nsc files.
17142
17143 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
17144
17145         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
17146         class/struct location definition Location for the implicit
17147         constructor location.
17148
17149         (Operator.Define): Use the location of the operator for the
17150         implicit Method definition.
17151
17152         (Constructor.Emit): use the constructor location for the implicit
17153         base initializer constructor.
17154
17155         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
17156         and the Expression class now contains two new methods:
17157
17158         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
17159         isolate type lookup from the rest of the resolution process.
17160
17161         Since we use Expressions to hold type definitions due to the way
17162         we parse the input we have historically overloaded Resolve to
17163         perform the Type lookups if a special flag is passed.  Now this is
17164         eliminated and two methods take their place. 
17165
17166         The differences in the two methods between xStep and xTerminal is
17167         that xStep is involved in our current lookup system that uses
17168         SimpleNames to compose a name, while xTerminal is used just to
17169         catch the case where the simplename lookup failed.
17170
17171 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
17172
17173         * expression.cs (ResolveMemberAccess): Remove redundant code.
17174         TypeExpr expressions are always born fully resolved.
17175
17176         * interface.cs (PopulateMethod): Do not lookup the types twice.
17177         We were doing it once during SemanticAnalysis and once during
17178         PopulateMethod.
17179
17180         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
17181         in local variable type definitions, were being returned as a
17182         SimpleName (we decomposed everything into a string), that is
17183         because primary_expression was being used instead of a type in the
17184         grammar (reduce/reduce conflicts).
17185
17186         The part that was wrong is that we converted the expression into a
17187         string (an oversimplification in one hand, compounded with primary
17188         expressions doing string concatenation).
17189
17190         So things like:
17191
17192         A.B.C [] x;
17193
17194         Would return "A.B.C[]" as a SimpleName.  This stopped things like
17195         using clauses from working on this particular context.  And a type
17196         was being matched directly against "A.B.C[]".
17197
17198         We now use the correct approach, and allow for ComposedCast to be
17199         part of the unary expression.  So the "A.B.C []" become a composed
17200         cast of "A.B.C" (as a nested group of MemberAccess with a
17201         SimpleName at the end) plus the rank composition "[]". 
17202
17203         Also fixes 35567
17204
17205 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
17206
17207         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
17208         for the access level checking.
17209
17210         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
17211         `TypeContainer container', because I kept getting confused when I
17212         was debugging this code.
17213
17214         * expression.cs (Indexers): Instead of tracking getters/setters,
17215         we now track them in parallel.  We create one arraylist less, but
17216         most importantly it is possible now for the LValue code to find a
17217         matching get for a set.
17218
17219         (IndexerAccess.DoResolveLValue): Update the code.
17220         GetIndexersForType has been modified already to extract all the
17221         indexers from a type.  The code assumed it did not.
17222
17223         Also make the code set the correct return type for the indexer.
17224         This was fixed a long time ago for properties, but was missing for
17225         indexers.  It used to be void_type.
17226
17227         (Binary.Emit): Test first for doubles instead of
17228         floats, as they are more common.
17229
17230         (Binary.EmitBranchable): Use the .un version of the branch opcodes
17231         when dealing with floats and the <=, >= operators.  This fixes bug
17232         #39314 
17233
17234         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
17235         to load the array value by emitting a load on the foreach variable
17236         type.  This was incorrect.  
17237
17238         We now emit the code to load an element using the the array
17239         variable type, and then we emit the conversion operator.
17240
17241         Fixed #40176
17242
17243 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
17244
17245         * attribute.cs: Avoid allocation of ArrayLists in the common case.
17246
17247 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
17248
17249         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
17250         test for protection before we test for signatures. 
17251
17252         (MethodSignature.ToString): implement.
17253
17254         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
17255         to the case where we reduced into a LongConstant.
17256
17257         * decl.cs (CheckAccessLevel): If the type is an array, we can not
17258         depend on whether the information is acurrate, because the
17259         Microsoft runtime will always claim that the array type is public,
17260         regardless of the real state.
17261
17262         If the type is a pointer, another problem happens: the type is
17263         reported as non-public in Microsoft.  
17264
17265         In both cases we have to call CheckAccessLevel recursively with
17266         the underlying type as the argument to be tested.
17267
17268 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
17269
17270         * assign.cs (Assign.Emit): If we are dealing with a compound
17271         assignment expression, we should use the code path that stores the
17272         intermediate result in a temporary value.  This fixes #40903.
17273
17274         *expression.cs (Indirection.ToString): Provide ToString method for
17275         debugging. 
17276
17277 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
17278
17279         * class.cs: Null out fields holding references to Block objects so
17280         they can be garbage collected.
17281
17282         * expression.cs (OverloadResolve): Remove unused local.
17283
17284 2003-04-07  Martin Baulig  <martin@ximian.com>
17285
17286         * codegen.cs (EmitContext.CurrentFile): New public field.
17287         (EmitContext.Mark): Use the CurrentFile to check whether the
17288         location is in the correct file.
17289         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
17290
17291 2003-04-07  Martin Baulig  <martin@ximian.com>
17292
17293         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
17294
17295         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
17296         location.  [FIXME: The location argument which gets passed to this
17297         method is sometimes wrong!]
17298
17299 2003-04-07  Nick Drochak <ndrochak@gol.com>
17300
17301         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
17302
17303 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
17304
17305         * expression.cs (Indirection.EmitAssign): We were using the
17306         temporary, but returning immediately instead of continuing the
17307         EmitAssing flow.
17308
17309 2003-04-06  Martin Baulig  <martin@ximian.com>
17310
17311         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
17312         if it's a nested child, but also deriving from the outer class.
17313         See test 190.cs.
17314
17315         * typemanager.cs (IsNestedChildOf): Make this work if it's a
17316         nested child, but also deriving from the outer class.  See
17317         test-190.cs.
17318         (FilterWithClosure): We may access private members of the outer
17319         class if we're a nested child and deriving from the outer class.
17320         (RealMemberLookup): Only set `closure_private_ok' if the
17321         `original_bf' contained BindingFlags.NonPublic.
17322
17323 2003-04-05  Martin Baulig  <martin@ximian.com>
17324
17325         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
17326
17327 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
17328
17329         * class.cs (Event.Define): Do not allow abstract events to have
17330         initializers. 
17331
17332 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
17333
17334         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
17335         block in event declarations.
17336
17337         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
17338         value type, get its address.
17339
17340         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
17341         leaving a class on the stack instead of a boolean value (int
17342         0/1).  Change the code so we compare against null, and then the
17343         result against zero.
17344
17345         * class.cs (TypeContainer.GetClassBases): We were checking for the
17346         parent class being sealed too late.
17347
17348         * expression.cs (Binary.Emit): For <= and >= when dealing with
17349         floating point values, use cgt.un and clt.un instead of cgt and
17350         clt alone.
17351
17352 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
17353
17354         * statement.cs: Apply the same optimization as MS: skip the 
17355         GetEnumerator returning an IEnumerator, and use the one returning a 
17356         CharEnumerator instead. This allows us to avoid the try-finally block 
17357         and the boxing.
17358
17359 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
17360
17361         * cs-parser.jay: Attributes cannot be applied to
17362                          namespaces. Fixes #40473
17363
17364 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17365
17366         * class.cs:
17367         (Add*): check if the name is valid using the full name for constants,
17368         fields, properties and events.
17369
17370 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
17371
17372         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
17373         char constants to be part of the enumeration.
17374
17375         * expression.cs (Conditional.DoResolve): Add support for operator
17376         true. Implements the missing functionality from 14.12
17377
17378         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
17379         operator true/false as required by the spec.
17380
17381         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
17382         implicit conversion to boolean.
17383
17384         * statement.cs (Statement.ResolveBoolean): A boolean expression is
17385         also one where the type implements `operator true'. 
17386
17387         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
17388         get an expression that will invoke operator true based on an
17389         expression.  
17390
17391         (GetConversionOperators): Removed the hack that called op_True
17392         here.  
17393
17394         (Expression.ResolveBoolean): Move this from Statement.
17395
17396 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
17397
17398         * ecore.cs (FieldExpr): do not allow initialization of initonly
17399         fields on derived classes
17400
17401 2003-03-13  Martin Baulig  <martin@ximian.com>
17402
17403         * statement.cs (Block.Emit): Call ig.BeginScope() and
17404         ig.EndScope() when compiling with debugging info; call
17405         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
17406
17407 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
17408
17409         * expression.cs (Indexers): Do not construct immediately, allow
17410         for new members to be appended as we go.  Fixes 38143
17411
17412 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17413
17414         * expression.cs: save/restore context when resolving an unchecked
17415         expression.
17416
17417 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
17418
17419         * cfold.cs: Catch division by zero in modulus operator during
17420         constant folding.
17421
17422 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
17423
17424         * interface.cs (Interface.DefineMembers): Avoid defining members
17425         twice. 
17426
17427 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
17428
17429         * driver.cs: handle the +/- options for -noconfig
17430
17431         * statement.cs (Unckeched.Resolve): Also track the state of
17432         unchecked in the Resolve phase.
17433
17434 2003-02-27  Martin Baulig  <martin@ximian.com>
17435
17436         * ecore.cs (Expression.MemberLookup): Don't create a
17437         MethodGroupExpr for something which is not a method.  Fixes #38291.
17438
17439 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
17440
17441         * class.cs (MemberBase.CheckParameters): Also check that the type
17442         is unmanaged if it is a pointer.
17443
17444         * expression.cs (SizeOf.Resolve): Add location information.
17445
17446         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
17447         a managed type is declared.
17448
17449         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
17450         parameter modifiers as well.  Fixes bug 38606
17451
17452         * class.cs: Very sad.  Am backing out the speed up changes
17453         introduced by the ArrayList -> Array in the TypeContainer, as they
17454         were not actually that much faster, and introduced a bug (no error
17455         reports on duplicated methods).
17456
17457         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
17458         source first, this will guarantee that we have a valid expression
17459         before calling in lower levels functions that will require a
17460         resolved object.  Then use this original_source in the
17461         target.ResolveLValue instead of the original source that was
17462         passed to us.
17463
17464         Another change.  Use target.Resolve instead of LValueResolve.
17465         Although we are resolving for LValues, we will let the Assign code
17466         take care of that (it will be called again from Resolve).  This
17467         basically allows code like this:
17468
17469         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
17470         class Y { void A (X x) { x [0] += o; }
17471
17472         The problem was that the indexer was trying to resolve for
17473         set_Item (idx, object o) and never finding one.  The real set_Item
17474         was set_Item (idx, X).  By delaying the process we get the right
17475         semantics. 
17476
17477         Fixes bug 36505
17478
17479 2003-02-23  Martin Baulig  <martin@ximian.com>
17480
17481         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
17482         while calling DoEmit ().
17483
17484         * codegen.cs (EmitContext.Mark): Don't mark locations in other
17485         source files; if you use the #line directive inside a method, the
17486         compiler stops emitting line numbers for the debugger until it
17487         reaches the end of the method or another #line directive which
17488         restores the original file.
17489
17490 2003-02-23  Martin Baulig  <martin@ximian.com>
17491
17492         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
17493
17494 2003-02-23  Martin Baulig  <martin@ximian.com>
17495
17496         * statement.cs (Block.AddChildVariableNames): We need to call this
17497         recursively, not just for our immediate children.
17498
17499 2003-02-23  Martin Baulig  <martin@ximian.com>
17500
17501         * class.cs (Event.Define): Always make the field private, like csc does.
17502
17503         * typemanager.cs (TypeManager.RealMemberLookup): Make events
17504         actually work, fixes bug #37521.
17505
17506 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
17507
17508         * delegate.cs: When creating the various temporary "Parameters"
17509         classes, make sure that we call the ComputeAndDefineParameterTypes
17510         on those new parameters (just like we do with the formal ones), to
17511         allow them to be resolved in the context of the DeclSpace.
17512
17513         This fixes the bug that Dick observed in Bugzilla #38530.
17514
17515 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
17516
17517         * expression.cs (ResolveMemberAccess): When resolving a constant,
17518         do not attempt to pull a constant if the value was not able to
17519         generate a valid constant.
17520
17521         * const.cs (LookupConstantValue): Do not report more errors than required.
17522
17523 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17524
17525         * expression.cs: fixes bug #38328.
17526
17527 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
17528
17529         * class.cs: Changed all the various members that can be part of a
17530         class from being an ArrayList to be an Array of the right type.
17531         During the DefineType type_list, interface_list, delegate_list and
17532         enum_list are turned into types, interfaces, delegates and enums
17533         arrays.  
17534
17535         And during the member population, indexer_list, event_list,
17536         constant_list, field_list, instance_constructor_list, method_list,
17537         operator_list and property_list are turned into their real arrays.
17538
17539         Although we could probably perform this operation earlier, for
17540         good error reporting we need to keep the lists and remove the
17541         lists for longer than required.
17542
17543         This optimization was triggered by Paolo profiling the compiler
17544         speed on the output of `gen-sample-program.pl' perl script. 
17545
17546         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
17547         not crash in methods like MemberLookupFailed that use this field.  
17548
17549         This problem arises when the compiler fails to resolve a type
17550         during interface type definition for example.
17551
17552 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
17553
17554         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
17555         inherit from System.Object, so we have to stop at null, not only
17556         when reaching System.Object.
17557
17558 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
17559
17560         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
17561         DeclaredOnly because the parent indexer might have had a different
17562         name, but did not loop until the top of the hierarchy was reached.
17563
17564         The problem this one fixes is 35492: when a class implemented an
17565         indexer from an interface, we were getting the interface method
17566         (which was abstract) and we were flagging an error (can not invoke
17567         abstract method).
17568
17569         This also keeps bug 33089 functioning, and test-148 functioning.
17570
17571         * typemanager.cs (IsSpecialMethod): The correct way of figuring
17572         out if a method is special is to see if it is declared in a
17573         property or event, or whether it is one of the predefined operator
17574         names.   This should fix correctly #36804.
17575
17576 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
17577
17578         The goal here is to remove the dependency on EmptyCast.Peel ().
17579         Killing it completely.
17580
17581         The problem is that currently in a number of places where
17582         constants are expected, we have to "probe" for an EmptyCast, and
17583         Peel, which is not the correct thing to do, as this will be
17584         repetitive and will likely lead to errors. 
17585
17586         The idea is to remove any EmptyCasts that are used in casts that
17587         can be reduced to constants, so we only have to cope with
17588         constants. 
17589
17590         This bug hunt was triggered by Bug 37363 and the desire to remove
17591         the duplicate pattern where we were "peeling" emptycasts to check
17592         whether they were constants.  Now constants will always be
17593         constants.
17594
17595         * ecore.cs: Use an enumconstant here instead of wrapping with
17596         EmptyCast.  
17597
17598         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
17599         throwing me off.  By handling this we can get rid of a few hacks.
17600
17601         * statement.cs (Switch): Removed Peel() code.
17602
17603 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
17604
17605         * class.cs: Location information for error 508
17606
17607         * expression.cs (New.DoResolve): Add a guard against double
17608         resolution of an expression.  
17609
17610         The New DoResolve might be called twice when initializing field
17611         expressions (see EmitFieldInitializers, the call to
17612         GetInitializerExpression will perform a resolve on the expression,
17613         and later the assign will trigger another resolution
17614
17615         This leads to bugs (#37014)
17616
17617         * delegate.cs: The signature for EndInvoke should contain any ref
17618         or out parameters as well.  We were not doing this in the past. 
17619
17620         * class.cs (Field.Define): Do not overwrite the type definition
17621         inside the `volatile' group.  Turns out that volatile enumerations
17622         were changing the type here to perform a validity test, which
17623         broke conversions. 
17624
17625 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
17626
17627         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
17628         and structs, we do not want to load the instance variable
17629
17630         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
17631         enum_type has to be handled like an object reference (implicit
17632         conversions exists from this to object), but the regular IsClass
17633         and IsValueType tests will never return true for this one.
17634
17635         Also we use TypeManager.IsValueType instead of type.IsValueType,
17636         just for consistency with the rest of the code (this is only
17637         needed if we ever use the construct exposed by test-180.cs inside
17638         corlib, which we dont today).
17639
17640 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
17641
17642         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
17643         just InternalCall.
17644
17645 2003-02-09  Martin Baulig  <martin@ximian.com>
17646
17647         * namespace.cs (Namespace..ctor): Added SourceFile argument.
17648         (Namespace.DefineNamespaces): New static public method; this is
17649         called when we're compiling with debugging to add all namespaces
17650         to the symbol file.
17651
17652         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
17653         pass it to the Namespace's .ctor.
17654
17655         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
17656         and MethodBase arguments; pass the namespace ID to the symwriter;
17657         pass the MethodBase instead of the token to the symwriter.
17658         (SymbolWriter.DefineNamespace): New method to add a namespace to
17659         the symbol file.
17660
17661 2003-02-09  Martin Baulig  <martin@ximian.com>
17662
17663         * symbolwriter.cs: New file.  This is a wrapper around
17664         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
17665         methods here in near future.
17666
17667 2003-02-09  Martin Baulig  <martin@ximian.com>
17668
17669         * codegen.cs (EmitContext.Mark): Just pass the arguments to
17670         ILGenerator.MarkSequencePoint() which are actually used by the
17671         symbol writer.
17672
17673 2003-02-09  Martin Baulig  <martin@ximian.com>
17674
17675         * location.cs (SourceFile): New public sealed class.  This
17676         contains the name and an index which is used in the location's token.
17677         (Location): Reserve an appropriate number of bits in the token for
17678         the source file instead of walking over that list, this gives us a
17679         really huge performance improvement when compiling with debugging.
17680
17681         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
17682         `SourceFile' argument instead of a string.
17683         (Driver.ProcessFile): Add all the files via Location.AddFile(),
17684         but don't parse/tokenize here, we need to generate the list of all
17685         source files before we do that.
17686         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
17687         the files.
17688
17689         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
17690         instead of a string.
17691
17692         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
17693         of a string.
17694
17695 2003-02-09  Martin Baulig  <martin@ximian.com>
17696
17697         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
17698         filename on `#line default'.
17699
17700 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
17701
17702         * statement.cs: don't clear the pinned var when the fixed statement
17703         returns from the method (fixes bug#37752).
17704
17705 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
17706
17707         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
17708         to IsValueType.
17709
17710 2003-02-07  Martin Baulig  <martin@ximian.com>
17711
17712         * driver.cs: Removed the `--debug-args' command line argument.
17713
17714         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
17715         automatically by the AsssemblyBuilder.
17716         (CodeGen.InitializeSymbolWriter): We don't need to call any
17717         initialization function on the symbol writer anymore.  This method
17718         doesn't take any arguments.
17719
17720 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
17721
17722         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
17723         from referenced assemblies as well.
17724
17725 2003-02-02  Martin Baulig  <martin@ximian.com>
17726
17727         * class.cs (MethodData.Emit): Generate debugging info for external methods.
17728
17729 2003-02-02  Martin Baulig  <martin@ximian.com>
17730
17731         * class.cs (Constructor.Emit): Open the symbol writer before
17732         emitting the constructor initializer.
17733         (ConstructorInitializer.Emit): Call ec.Mark() to allow
17734         single-stepping through constructor initializers.
17735
17736 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
17737
17738         * class.cs: Handle error 549: do not allow virtual methods in
17739         sealed classes. 
17740
17741 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
17742
17743         * decl.cs: Check access levels when resolving types
17744
17745 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
17746
17747         * statement.cs: Add parameters and locals set in catch blocks that might 
17748         return to set vector
17749
17750 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
17751
17752         * class.cs (Operator): Set the SpecialName flags for operators.
17753
17754         * expression.cs (Invocation.DoResolve): Only block calls to
17755         accessors and operators on SpecialName methods.
17756
17757         (Cast.TryReduce): Handle conversions from char constants.
17758
17759
17760 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
17761
17762         * statement.cs: small memory and time optimization in FlowBranching.
17763
17764 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
17765
17766         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
17767         problem that the last fix but in the other sid (Set).
17768
17769         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
17770         access when there is no indexer in the hierarchy.
17771
17772 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
17773
17774         * class.cs: Combine some if statements.
17775
17776 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17777
17778         * driver.cs: fixed bug #37187.
17779
17780 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
17781
17782         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
17783         any indexer, it's needed to build a list with all the indexers in the
17784         hierarchy (AllGetters), else we have problems. Fixes #35653.
17785
17786 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
17787
17788         * class.cs (MethodData.Define): It is wrong for an interface
17789         implementation to be static in both cases: explicit and implicit.
17790         We were only handling this in one case.
17791
17792         Improve the if situation there to not have negations.
17793
17794         * class.cs (Field.Define): Turns out that we do not need to check
17795         the unsafe bit on field definition, only on usage.  Remove the test.
17796
17797 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17798
17799         * driver.cs: use assembly.Location instead of Codebase (the latest
17800         patch made mcs fail when using MS assemblies).
17801
17802 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
17803
17804         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
17805         get the path to *corlib.dll.
17806
17807 2003-01-21  Nick Drochak <ndrochak@gol.com>
17808
17809         * cs-tokenizer.cs:
17810         * pending.cs:
17811         * typemanager.cs: Remove compiler warnings
17812
17813 2003-01-20  Duncan Mak  <duncan@ximian.com>
17814
17815         * AssemblyInfo.cs: Bump the version number to 0.19.
17816
17817 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17818
17819         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
17820
17821 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
17822
17823         * class.cs (Constructor::Emit): Emit debugging info for constructors.
17824
17825 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
17826
17827         * cs-parser.jay: Small fix: we were not comparing the constructor
17828         name correctly.   Thanks to Zoltan for the initial pointer.
17829
17830 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
17831
17832         * cs-tokenizer.cs: Set file name when specified with #line
17833
17834 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
17835
17836         * cs-parser.jay: Only perform the constructor checks here if we
17837         are named like the class;  This will help provider a better
17838         error.  The constructor path is taken when a type definition is
17839         not found, but most likely the user forgot to add the type, so
17840         report that rather than the constructor error.
17841
17842 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
17843
17844         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
17845         allocations.
17846
17847 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17848
17849         * cs-parser.jay: Add cleanup call.
17850
17851 2003-01-13  Duncan Mak  <duncan@ximian.com>
17852
17853         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
17854         consistent with other methods.
17855
17856 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17857
17858         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
17859
17860 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
17861
17862         * attribute.cs: only set GuidAttr to true when we have a
17863         GuidAttribute.
17864
17865 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17866
17867         * ecore.cs:
17868         * expression.cs:
17869         * typemanager.cs: fixes to allow mcs compile corlib with the new
17870         Type.IsSubclassOf fix.
17871
17872 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
17873
17874         * expression.cs (LocalVariableReference.DoResolve): Classify a
17875         constant as a value, not as a variable.   Also, set the type for
17876         the variable.
17877
17878         * cs-parser.jay (fixed_statement): take a type instead of a
17879         pointer_type, so we can produce a better error message later.
17880
17881         * statement.cs (Fixed.Resolve): Flag types that are not pointers
17882         as an error.  
17883
17884         (For.DoEmit): Make inifinite loops have a
17885         non-conditional branch back.
17886
17887         (Fixed.DoEmit): First populate the pinned variables, then emit the
17888         statement, then clear the variables.  Before I was emitting the
17889         code once for each fixed piece.
17890
17891
17892 2003-01-08  Martin Baulig  <martin@ximian.com>
17893
17894         * statement.cs (FlowBranching.MergeChild): A break in a
17895         SWITCH_SECTION does not leave a loop.  Fixes #36155.
17896
17897 2003-01-08  Martin Baulig  <martin@ximian.com>
17898
17899         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
17900         lives in the same number space than `param_map'.  Fixes #36154.
17901
17902 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
17903
17904         * cs-parser.jay (constructor_declaration): Set the
17905         Constructor.ModFlags before probing for it.  This makes the
17906         compiler report 514, 515 and 132 (the code was there, but got
17907         broken). 
17908
17909         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
17910         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
17911         (GotoCase.Resolve): Set `Returns' to ALWAYS.
17912
17913 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
17914
17915         * enum.cs: create the enum static fields using the enum type.
17916
17917 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
17918
17919         * class.cs: don't try to create the ParamBuilder for the return
17920         type if it's not needed (and handle it breaking for the ms runtime
17921         anyway).
17922
17923 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
17924
17925         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
17926
17927 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
17928
17929         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
17930         the command.   This showed up while compiling the JANET source
17931         code, which used \r as its only newline separator.
17932
17933 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
17934
17935         * class.cs (Method.Define): If we are an operator (because it
17936         reuses our code), then set the SpecialName and HideBySig.  #36128
17937
17938 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
17939
17940         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
17941         exception, report error 120 `object reference required'.
17942
17943         * driver.cs: Add --pause option, used during to measure the size
17944         of the process as it goes with --timestamp.
17945
17946         * expression.cs (Invocation.DoResolve): Do not allow methods with
17947         SpecialName to be invoked.
17948
17949 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
17950
17951         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
17952         number before adding it.
17953
17954 2002-12-21  Ravi Pratap  <ravi@ximian.com>
17955
17956         * ecore.cs (StandardImplicitConversion): When in an unsafe
17957         context, we allow conversion between void * to any other pointer
17958         type. This fixes bug #35973.
17959
17960 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
17961
17962         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
17963         is not thrown when extensionless outputs are used 
17964
17965 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17966
17967         * rootcontext.cs: fixed compilation of corlib.
17968
17969 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
17970
17971         * attribute.cs (Attributes.Contains): Add new method.
17972
17973         * class.cs (MethodCore.LabelParameters): if the parameter is an
17974         `out' parameter, check that no attribute `[In]' has been passed.
17975
17976         * enum.cs: Handle the `value__' name in an enumeration.
17977
17978 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
17979
17980         * decl.cs: Added special case to allow overrides on "protected
17981         internal" methods
17982
17983 2002-12-18  Ravi Pratap  <ravi@ximian.com>
17984
17985         * attribute.cs (Attributes.AddAttributeSection): Rename to this
17986         since it makes much more sense.
17987
17988         (Attributes.ctor): Don't require a Location parameter.
17989
17990         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
17991
17992         * attribute.cs (ApplyAttributes): Remove extra Location parameters
17993         since we already have that information per attribute.
17994
17995         * everywhere : make appropriate changes.
17996
17997         * class.cs (LabelParameters): Write the code which actually
17998         applies attributes to the return type. We can't do this on the MS
17999         .NET runtime so we flag a warning in the case an exception is
18000         thrown.
18001
18002 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
18003
18004         * const.cs: Handle implicit null conversions here too.
18005
18006 2002-12-17  Ravi Pratap  <ravi@ximian.com>
18007
18008         * class.cs (MethodCore.LabelParameters): Remove the extra
18009         Type [] parameter since it is completely unnecessary. Instead
18010         pass in the method's attributes so that we can extract
18011         the "return" attribute.
18012
18013 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
18014
18015         * cs-parser.jay (parse): Use Report.Error to flag errors instead
18016         of ignoring it and letting the compile continue.
18017
18018         * typemanager.cs (ChangeType): use an extra argument to return an
18019         error condition instead of throwing an exception.
18020
18021 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
18022
18023         * expression.cs (Unary.TryReduce): mimic the code for the regular
18024         code path.  Perform an implicit cast in the cases where we can
18025         implicitly convert to one of the integral types, and then reduce
18026         based on that constant.   This fixes bug #35483.
18027
18028 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18029
18030         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
18031
18032 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18033
18034         * namespace.cs: fixed bug #35489.
18035
18036 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
18037
18038         * class.cs: Remove some dead code.
18039
18040         * cs-parser.jay: Estimate the number of methods needed
18041         (RootContext.MethodCount);
18042
18043         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
18044         numbers instead of StringBuilders.
18045
18046         * support.cs (PtrHashtable): Add constructor with initial size;
18047         We can now reduce reallocations of the method table.
18048
18049 2002-12-10  Ravi Pratap  <ravi@ximian.com>
18050
18051         * attribute.cs (ApplyAttributes): Keep track of the emitted
18052         attributes on a per-target basis. This fixes bug #35413.
18053
18054 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
18055
18056         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
18057         default to the Windows 1252 encoding.
18058
18059         (UnixParseOption): Support version, thanks to Alp for the missing
18060         pointer. 
18061
18062         * AssemblyInfo.cs: Add nice assembly information.
18063
18064         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
18065         (bug 35169).
18066
18067         * cs-parser.jay: Allow a trailing comma before the close bracked
18068         in the attribute_section production.
18069
18070         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
18071         address of the instance was being taken, I will take this out,
18072         because we take the address of the object immediately here.
18073
18074 2002-12-09  Ravi Pratap  <ravi@ximian.com>
18075
18076         * typemanager.cs (AreMultipleAllowed): Take care of the most
18077         obvious case where attribute type is not in the current assembly -
18078         stupid me ;-)
18079
18080 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
18081
18082         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
18083         definitions, instead of doing that afterwards.  
18084
18085         Also we use a nice little hack, depending on the constructor, we
18086         know if we are a "composed" name or a simple name.  Hence, we
18087         avoid the IndexOf test, and we avoid 
18088
18089         * codegen.cs: Add code to assist in a bug reporter to track down
18090         the source of a compiler crash. 
18091
18092 2002-12-07  Ravi Pratap  <ravi@ximian.com>
18093
18094         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
18095         types have been emitted for a given element and flag an error
18096         if something which does not have AllowMultiple set is used more
18097         than once.
18098
18099         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
18100         attribute types and their corresponding AllowMultiple properties
18101
18102         (AreMultipleAllowed): Check the property for a given type.
18103
18104         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
18105         property in the case we have a TypeContainer.
18106
18107         (Attributes.AddAttribute): Detect duplicates and just skip on
18108         adding them. This trivial fix catches a pretty gross error in our
18109         attribute emission - global attributes were being emitted twice!
18110
18111         Bugzilla bug #33187 is now fixed.
18112
18113 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
18114
18115         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
18116         instead of pp_and).
18117
18118         * expression.cs (Binary.ResolveOperator): I can only use the
18119         Concat (string, string, string) and Concat (string, string,
18120         string, string) if the child is actually a concatenation of
18121         strings. 
18122
18123 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
18124
18125         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
18126         context where we need a 2-character lookahead.
18127
18128         * pending.cs (PendingImplementation): Rework so we can keep track
18129         of interface types all the time, and flag those which were
18130         implemented by parents as optional.
18131
18132 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
18133
18134         * expression.cs (Binary.ResolveOperator): Use
18135         String.Concat(string,string,string) or
18136         String.Concat(string,string,string,string) when possible. 
18137
18138         * typemanager: More helper methods.
18139
18140
18141 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
18142
18143         * pending.cs: remove the bogus return from GetMissingInterfaces()
18144         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
18145
18146 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18147
18148         * namespace.cs: avoid duplicated 'using xxx' being added to
18149         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
18150         when we get more than one 'using' statement for the same namespace.
18151         Report a CS0105 warning for it.
18152
18153 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
18154
18155         * cs-tokenizer.cs (consume_identifier): use read directly, instead
18156         of calling getChar/putback, uses internal knowledge of it.    
18157
18158         (xtoken): Reorder tokenizer so most common patterns are checked
18159         first.  This reduces the compilation time in another 5% (from 8.11s
18160         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
18161
18162         The parsing time is 22% of the compilation in mcs, and from that
18163         64% is spent on the tokenization process.  
18164
18165         I tried using a binary search for keywords, but this is slower
18166         than the hashtable.  Another option would be to do a couple of
18167         things:
18168
18169                 * Not use a StringBuilder, instead use an array of chars,
18170                   with a set value.  Notice that this way we could catch
18171                   the 645 error without having to do it *afterwards*.
18172
18173                 * We could write a hand-parser to avoid the hashtable
18174                   compares altogether.
18175
18176         The identifier consumption process takes 37% of the tokenization
18177         time.  Another 15% is spent on is_number.  56% of the time spent
18178         on is_number is spent on Int64.Parse:
18179
18180                 * We could probably choose based on the string length to
18181                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
18182                   computations. 
18183
18184         Another 3% is spend on wrapping `xtoken' in the `token' function.
18185
18186         Handle 0xa0 as whitespace (#34752)
18187
18188 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
18189
18190         * typemanager.cs (IsCLRType): New routine to tell whether a type
18191         is one of the builtin types.  
18192
18193         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
18194         typecode in more places instead of doing pointer comparissions.
18195         We could leverage some knowledge about the way the typecodes are
18196         laid out.
18197
18198         New code to cache namespaces in assemblies, it is currently not
18199         invoked, to be used soon.
18200
18201         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
18202
18203         * expression.cs (Binary.ResolveOperator): specially handle
18204         strings, and do not perform user-defined operator overloading for
18205         built-in types.
18206
18207 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
18208
18209         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
18210         internalcall as it is a pretty simple operation;  Avoid whenever
18211         possible to call Char.IsLetter.
18212
18213         (consume_identifier): Cut by half the number of
18214         hashtable calls by merging the is_keyword and GetKeyword behavior.
18215
18216         Do not short-circuit, because if we do, we
18217         report errors (ie, #if false && true would produce an invalid
18218         directive error);
18219
18220
18221 2002-11-24  Martin Baulig  <martin@ximian.com>
18222
18223         * expression.cs (Cast.TryReduce): If we're in checked syntax,
18224         check constant ranges and report a CS0221.  Fixes #33186.
18225
18226 2002-11-24  Martin Baulig  <martin@ximian.com>
18227
18228         * cs-parser.jay: Make this work for uninitialized variable
18229         declarations in the `for' initializer.  Fixes #32416.
18230
18231 2002-11-24  Martin Baulig  <martin@ximian.com>
18232
18233         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
18234         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
18235
18236 2002-11-24  Martin Baulig  <martin@ximian.com>
18237
18238         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
18239         argument; if true, we also check for user-defined conversions.
18240         This is only needed if both arguments are of a user-defined type.
18241         Fixes #30443, added test-175.cs.
18242         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
18243
18244         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
18245
18246 2002-11-24  Martin Baulig  <martin@ximian.com>
18247
18248         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
18249         function to get the store opcode.
18250         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
18251         only emit the Ldelema if the store opcode is Stobj.  You must run
18252         both test-34 and test-167 to test this.  Fixes #34529.
18253
18254 2002-11-23  Martin Baulig  <martin@ximian.com>
18255
18256         * ecore.cs (Expression.MemberLookup): Added additional
18257         `qualifier_type' argument which is used when we're being called
18258         from MemberAccess.DoResolve() and null if we're called from a
18259         SimpleName lookup.
18260         (Expression.MemberLookupFailed): New method to report errors; this
18261         does the CS1540 check and reports the correct error message.
18262
18263         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
18264         argument for the CS1540 check and redone the way how we're dealing
18265         with private members.  See the comment in the source code for details.
18266         (FilterWithClosure): Reverted this back to revision 1.197; renamed
18267         `closure_start_type' to `closure_qualifier_type' and check whether
18268         it's not null.  It was not this filter being broken, it was just
18269         being called with the wrong arguments.
18270
18271         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
18272         and pass it the correct `qualifier_type'; this also does the error
18273         handling for us.
18274
18275 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
18276
18277         * expression.cs (Invocation.EmitParams): If the we are dealing
18278         with a non-built-in value type, load its address as well.
18279
18280         (ArrayCreation): Use a a pretty constant instead
18281         of the hardcoded value 2.   Use 6 instead of 2 for the number of
18282         static initializers.  
18283
18284         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
18285         because they are not really value types, just glorified integers. 
18286
18287         * driver.cs: Do not append .exe, the CSC compiler does not do it.
18288
18289         * ecore.cs: Remove redundant code for enumerations, make them use
18290         the same code path as everything else, fixes the casting issue
18291         with enumerations in Windows.Forms.
18292
18293         * attribute.cs: Do only cast to string if it is a string, the
18294         validation happens later.
18295
18296         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
18297         people upgrade their corlibs.
18298
18299         * ecore.cs: Oops, enumerations were not following the entire code path
18300
18301 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
18302
18303         * typemanager.cs (FilterWithClosure): Commented out the test for
18304         1540 in typemanager.cs, as it has problems when accessing
18305         protected methods from a parent class (see test-174.cs). 
18306
18307         * attribute.cs (Attribute.ValidateGuid): new method.
18308         (Attribute.Resolve): Use above.
18309
18310 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
18311
18312         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
18313
18314         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
18315         handling for enumerations, as we only needed the TypeContainer
18316         functionality to begin with (this is required for the fix below to
18317         work for enums that reference constants in a container class for
18318         example). 
18319
18320         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
18321
18322         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
18323         a valid TypeBuilder to perform lookups on.o
18324
18325         * class.cs (InheritableMemberSignatureCompare): Use true in the
18326         call to GetGetMethod and GetSetMethod, because we are comparing
18327         the signature, and we need to get the methods *even* if they are
18328         private. 
18329
18330         (PropertyBase.CheckBase): ditto.
18331
18332         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
18333         GotoCase.Resolve): Use Peel on EmpytCasts.
18334
18335         * ecore.cs (EmptyCast): drop child, add Peel method.
18336
18337 2002-11-17  Martin Baulig  <martin@ximian.com>
18338
18339         * ecore.cs (EmptyCast.Child): New public property.
18340
18341         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
18342         label resolved to an EmptyCast.  Fixes #34162.
18343         (GotoCase.Resolve): Likewise.
18344         (Block.EmitMeta): Likewise.
18345
18346 2002-11-17  Martin Baulig  <martin@ximian.com>
18347
18348         * expression.cs (Invocation.BetterConversion): Prefer int over
18349         uint; short over ushort; long over ulong for integer literals.
18350         Use ImplicitConversionExists instead of StandardConversionExists
18351         since we also need to check for user-defined implicit conversions.
18352         Fixes #34165.  Added test-173.cs.
18353
18354 2002-11-16  Martin Baulig  <martin@ximian.com>
18355
18356         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
18357         with the `true' and `false' literals.  Fixes #33151.
18358
18359 2002-11-16  Martin Baulig  <martin@ximian.com>
18360
18361         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
18362         October 22nd; don't do the cs1540 check for static members.
18363
18364         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
18365         now using our own filter here and doing the cs1540 check again.
18366
18367 2002-11-16  Martin Baulig  <martin@ximian.com>
18368
18369         * support.cs (InternalParameters): Don't crash if we don't have
18370         any fixed parameters.  Fixes #33532.
18371
18372 2002-11-16  Martin Baulig  <martin@ximian.com>
18373
18374         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
18375         when looking up static methods to make this work on Windows.
18376         Fixes #33773.
18377
18378 2002-11-16  Martin Baulig  <martin@ximian.com>
18379
18380         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
18381         a setter rather than using PropertyInfo.CanWrite.
18382
18383 2002-11-15  Nick Drochak  <ndrochak@gol.com>
18384
18385         * class.cs: Allow acces to block member by subclasses. Fixes build
18386         breaker.
18387
18388 2002-11-14  Martin Baulig  <martin@ximian.com>
18389
18390         * class.cs (Constructor.Emit): Added the extern/block check.
18391         Fixes bug #33678.
18392
18393 2002-11-14  Martin Baulig  <martin@ximian.com>
18394
18395         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
18396         iteration while looking for indexers, this is needed because the
18397         indexer may have a different name in our base classes.  Fixed the
18398         error reporting (no indexers at all, not get accessor, no
18399         overloaded match).  Fixes bug #33089.
18400         (IndexerAccess.DoResolveLValue): Likewise.
18401
18402 2002-11-14  Martin Baulig  <martin@ximian.com>
18403
18404         * class.cs (PropertyBase.CheckBase): Make this work for multiple
18405         indexers.  Fixes the first part of bug #33089.
18406         (MethodSignature.InheritableMemberSignatureCompare): Added support
18407         for properties.
18408
18409 2002-11-13  Ravi Pratap  <ravi@ximian.com>
18410
18411         * attribute.cs (Attribute.Resolve): Catch the
18412         NullReferenceException and report it since it isn't supposed to
18413         happen. 
18414
18415 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
18416
18417         * expression.cs (Binary.EmitBranchable): Also handle the cases for
18418         LogicalOr and LogicalAnd that can benefit from recursively
18419         handling EmitBranchable.  The code now should be nice for Paolo.
18420
18421 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
18422
18423         * typemanager.cs (LookupType): Added a negative-hit hashtable for
18424         the Type lookups, as we perform quite a number of lookups on
18425         non-Types.  This can be removed once we can deterministically tell
18426         whether we have a type or a namespace in advance.
18427
18428         But this might require special hacks from our corlib.
18429
18430         * TODO: updated.
18431
18432         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
18433         and double which avoids a conversion from an integer to a double.
18434
18435         * expression.cs: tiny optimization, avoid calling IsConstant,
18436         because it effectively performs the lookup twice.
18437
18438 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
18439
18440         But a bogus return here to keep the semantics of the old code
18441         until the Mono runtime is fixed.
18442
18443         * pending.cs (GetMissingInterfaces): New method used to remove all
18444         the interfaces that are already implemented by our parent
18445         classes from the list of pending methods. 
18446
18447         * interface.cs: Add checks for calls after ResolveTypeExpr.
18448
18449 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
18450
18451         * class.cs (Class.Emit): Report warning 67: event not used if the
18452         warning level is beyond 3.
18453
18454         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
18455         being a NullLiteral.
18456
18457         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
18458         specifiers. 
18459
18460         * class.cs (TypeContainer.GetClassBases): Cover a missing code
18461         path that might fail if a type can not be resolved.
18462
18463         * expression.cs (Binary.Emit): Emit unsigned versions of the
18464         operators. 
18465
18466         * driver.cs: use error 5.
18467
18468 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
18469
18470         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
18471
18472 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
18473
18474         * cs-parser.jay (switch_section): A beautiful patch from Martin
18475         Baulig that fixed 33094.
18476
18477 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
18478
18479         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
18480         Check whether the base is abstract and report an error if so.
18481
18482         * expression.cs (IndexerAccess.DoResolveLValue,
18483         IndexerAccess.DoResolve): ditto. 
18484
18485         (Invocation.DoResolve): ditto.
18486
18487         (Invocation.FullMethodDesc): Improve the report string.
18488
18489         * statement.cs (Block): Eliminate IsVariableDefined as it is
18490         basically just a wrapper for GetVariableInfo.
18491
18492         * ecore.cs (SimpleName): Use new 
18493
18494         * support.cs (ReflectionParamter.ParameterType): We unwrap the
18495         type, as we return the actual parameter ref/unref state on a
18496         different call.
18497
18498 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
18499
18500         * support.cs: Return proper flags REF/OUT fixing the previous
18501         commit.  
18502
18503         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
18504         not used to mean `ref' but `ref or out' in ParameterReference
18505
18506         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
18507         full type signature instead of calling TypeManger.CSharpName
18508         ourselves. 
18509
18510         * support.cs (InternalParameters.ParameterDesc): Do not compare
18511         directly to the modflags, because REF/OUT will actually be bitsets
18512         if set. 
18513
18514         * delegate.cs (VerifyMethod): Check also the modifiers.
18515
18516         * cs-tokenizer.cs: Fix bug where floating point values with an
18517         exponent where a sign was missing was ignored.
18518
18519         * driver.cs: Allow multiple assemblies to be specified in a single
18520         /r: argument
18521
18522 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
18523
18524         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
18525         because identifiers after a parenthesis would end up in this kind
18526         of production, and we needed to desamiguate it for having casts
18527         like:
18528
18529                 (UserDefinedType *) xxx
18530
18531 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
18532
18533         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
18534         we should set on the Bindingflags.NonPublic, but not turn on
18535         private_ok.  private_ok controls whether a Private member is
18536         returned (this is chekced on the filter routine), while the
18537         BindingFlags.NonPublic just controls whether private/protected
18538         will be allowed.   This fixes the problem part of the problem of
18539         private properties being allowed to be used in derived classes.
18540
18541         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
18542         so we can call the children DoResolveLValue method (this will
18543         properly signal errors on lvalue assignments to base properties)
18544
18545         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
18546         getter are null, and we have a property info, we know that this
18547         happened because the lookup failed, so we report an error 122 for
18548         protection level violation.
18549
18550         We also silently return if setter and getter are null in the
18551         resolve functions, this condition only happens if we have flagged
18552         the error before.  This is the other half of the problem. 
18553
18554         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
18555         not have accessibility information, that is why we were returning
18556         true in the filter function in typemanager.cs.
18557
18558         To properly report 122 (property is inaccessible because of its
18559         protection level) correctly, we report this error in ResolveAccess
18560         by failing if both the setter and the getter are lacking (ie, the
18561         lookup failed). 
18562
18563         DoResolve and DoLResolve have been modified to check for both
18564         setter/getter being null and returning silently, the reason being
18565         that I did not want to put the knowledge about this error in upper
18566         layers, like:
18567
18568         int old = Report.Errors;
18569         x = new PropertyExpr (...);
18570         if (old != Report.Errors)
18571                 return null;
18572         else
18573                 return x;
18574
18575         So the property expr is returned, but it is invalid, so the error
18576         will be flagged during the resolve process. 
18577
18578         * class.cs: Remove InheritablePropertySignatureCompare from the
18579         class, as we no longer depend on the property signature to compute
18580         whether it is possible to implement a method or not.
18581
18582         The reason is that calling PropertyInfo.GetGetMethod will return
18583         null (in .NET, in Mono it works, and we should change this), in
18584         cases where the Get Method does not exist in that particular
18585         class.
18586
18587         So this code:
18588
18589         class X { public virtual int A { get { return 1; } } }
18590         class Y : X { }
18591         class Z : Y { public override int A { get { return 2; } } }
18592
18593         Would fail in Z because the parent (Y) would not have the property
18594         defined.  So we avoid this completely now (because the alternative
18595         fix was ugly and slow), and we now depend exclusively on the
18596         method names.
18597
18598         (PropertyBase.CheckBase): Use a method-base mechanism to find our
18599         reference method, instead of using the property.
18600
18601         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
18602         routines are gone now.
18603
18604         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
18605         names, they were incorrectly named.
18606
18607         * cs-tokenizer.cs: Return are more gentle token on failure. 
18608
18609         * pending.cs (PendingImplementation.InterfaceMethod): This routine
18610         had an out-of-sync index variable, which caused it to remove from
18611         the list of pending methods the wrong method sometimes.
18612
18613 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
18614
18615         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
18616         CanWrite, because those refer to this particular instance of the
18617         property, and do not take into account the fact that we can
18618         override single members of a property.
18619
18620         Constructor requires an EmitContext.  The resolution process does
18621         not happen here, but we need to compute the accessors before,
18622         because the resolution does not always happen for properties.
18623
18624         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
18625         subclass, before we did not update this flag, but we did update
18626         bindingflags. 
18627
18628         (GetAccessors): Drop this routine, as it did not work in the
18629         presence of partially overwritten set/get methods. 
18630
18631         Notice that this broke the cs1540 detection, but that will require
18632         more thinking. 
18633
18634 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18635
18636         * class.cs:
18637         * codegen.cs:
18638         * driver.cs: issue a warning instead of an error if we don't support
18639         debugging for the platform. Also ignore a couple of errors that may
18640         arise when trying to write the symbols. Undo my previous patch.
18641
18642 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18643
18644         * driver.cs: ignore /debug switch except for Unix platforms.
18645
18646 2002-10-23  Nick Drochak  <ndrochak@gol.com>
18647
18648         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
18649
18650 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
18651
18652         * driver.cs: Do not make mcs-debug conditional, so we do not break
18653         builds that use it.
18654
18655         * statement.cs (UsageVector.MergeChildren): I would like Martin to
18656         review this patch.  But basically after all the children variables
18657         have been merged, the value of "Breaks" was not being set to
18658         new_breaks for Switch blocks.  I think that it should be set after
18659         it has executed.  Currently I set this to the value of new_breaks,
18660         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
18661         conservative, but I do not understand this code very well.
18662
18663         I did not break anything in the build, so that is good ;-)
18664
18665         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
18666
18667 2002-10-20  Mark Crichton  <crichton@gimp.org>
18668
18669         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
18670
18671 2002-10-20  Nick Drochak  <ndrochak@gol.com>
18672
18673         * cfold.cs: Fixed compile blocker.
18674
18675 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
18676
18677         * driver.cs: I was chekcing the key, not the file.
18678
18679 2002-10-19  Ravi Pratap  <ravi@ximian.com>
18680
18681         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
18682         message that we were generating - we just need to silently return
18683         a null.
18684
18685 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
18686
18687         * class.cs (Event.Define): Change my previous commit, as this
18688         breaks the debugger.  This is a temporary hack, as it seems like
18689         the compiler is generating events incorrectly to begin with.
18690
18691         * expression.cs (Binary.ResolveOperator): Added support for 
18692         "U operator - (E x, E y)"
18693
18694         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
18695         y)".
18696
18697         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
18698         init-only variables, but this path did not take into account that
18699         there might be also instance readonly variables.  Correct this
18700         problem. 
18701
18702         This fixes bug 32253
18703
18704         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
18705         delegates as well.
18706
18707         * driver.cs: Change the extension for modules to `netmodule'
18708
18709         * cs-parser.jay: Improved slightly the location tracking for
18710         the debugger symbols.
18711
18712         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
18713         modifiers that were specified instead of the hardcoded value
18714         (FamAndAssem).  This was basically ignoring the static modifier,
18715         and others.  Fixes 32429.
18716
18717         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
18718         fixed a bug in the process (32476)
18719
18720         * expression.cs (ArrayAccess.EmitAssign): Patch from
18721         hwang_rob@yahoo.ca that fixes bug 31834.3
18722
18723 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
18724
18725         * driver.cs: Make the module extension .netmodule.
18726
18727 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
18728
18729         * driver.cs: Report an error if the resource file is not found
18730         instead of crashing.
18731
18732         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
18733         false, like Emit does.
18734
18735 2002-10-16  Nick Drochak  <ndrochak@gol.com>
18736
18737         * typemanager.cs: Remove unused private member.  Also reported mcs
18738         bug to report this as a warning like csc.
18739
18740 2002-10-15  Martin Baulig  <martin@gnome.org>
18741
18742         * statement.cs (Statement.Emit): Made this a virtual method; emits
18743         the line number info and calls DoEmit().
18744         (Statement.DoEmit): New protected abstract method, formerly knows
18745         as Statement.Emit().
18746
18747         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
18748
18749 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
18750
18751         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
18752         have fixed a remaining problem: not every AddXXXX was adding a
18753         fully qualified name.  
18754
18755         Now everyone registers a fully qualified name in the DeclSpace as
18756         being defined instead of the partial name.  
18757
18758         Downsides: we are slower than we need to be due to the excess
18759         copies and the names being registered this way.  
18760
18761         The reason for this is that we currently depend (on the corlib
18762         bootstrap for instance) that types are fully qualified, because
18763         we dump all the types in the namespace, and we should really have
18764         types inserted into the proper namespace, so we can only store the
18765         basenames in the defined_names array.
18766
18767 2002-10-10  Martin Baulig  <martin@gnome.org>
18768
18769         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
18770         from bug #31834, see the bug report for a testcase which is
18771         miscompiled.
18772
18773 2002-10-10  Martin Baulig  <martin@gnome.org>
18774
18775         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
18776         flow analysis code for this.
18777
18778         * statement.cs (Do, While, For): Tell the flow analysis code about
18779         infinite loops.
18780         (FlowBranching.UsageVector): Added support for infinite loops.
18781         (Block.Resolve): Moved the dead code elimination here and use flow
18782         analysis to do it.
18783
18784 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
18785
18786         * class.cs (Field.Define): Catch cycles on struct type
18787         definitions. 
18788
18789         * typemanager.cs (IsUnmanagedtype): Do not recursively check
18790         fields if the fields are static.  We only need to check instance
18791         fields. 
18792
18793         * expression.cs (As.DoResolve): Test for reference type.
18794
18795         * statement.cs (Using.ResolveExpression): Use
18796         ConvertImplicitRequired, not ConvertImplicit which reports an
18797         error on failture
18798         (Using.ResolveLocalVariableDecls): ditto.
18799
18800         * expression.cs (Binary.ResolveOperator): Report errors in a few
18801         places where we had to.
18802
18803         * typemanager.cs (IsUnmanagedtype): Finish implementation.
18804
18805 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
18806
18807         * expression.cs: Use StoreFromPtr instead of extracting the type
18808         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
18809
18810         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
18811         an enumeration value to a System.Enum, but System.Enum is not a
18812         value type, but an class type, so we need to box.
18813
18814         (Expression.ConvertExplicit): One codepath could return
18815         errors but not flag them.  Fix this.  Fixes #31853
18816
18817         * parameter.cs (Resolve): Do not allow void as a parameter type.
18818
18819 2002-10-06  Martin Baulig  <martin@gnome.org>
18820
18821         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
18822         if it's a class type and not a struct.  Fixes #31815.
18823
18824 2002-10-06  Martin Baulig  <martin@gnome.org>
18825
18826         * statement.cs: Reworked the flow analysis code a bit to make it
18827         usable for dead code elimination.
18828
18829 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18830
18831         * cs-parser.jay: allow empty source files. Fixes bug #31781.
18832
18833 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
18834
18835         * expression.cs (ComposedCast.DoResolveType): A quick workaround
18836         to fix the test 165, will investigate deeper.
18837
18838 2002-10-04  Martin Baulig  <martin@gnome.org>
18839
18840         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
18841         finally blocks actually work.
18842         (Try.Resolve): We don't need to create a sibling for `finally' if
18843         there is no finally block.
18844
18845 2002-10-04  Martin Baulig  <martin@gnome.org>
18846
18847         * class.cs (Constructor.Define): The default accessibility for a
18848         non-default constructor is private, not public.
18849
18850 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
18851
18852         * class.cs (Constructor): Make AllowedModifiers public, add
18853         EXTERN.
18854
18855         * cs-parser.jay: Perform the modifiers test here, as the
18856         constructor for the Constructor class usually receives a zero
18857         because of the way we create it (first we create, later we
18858         customize, and we were never checking the modifiers).
18859
18860         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
18861         is a version of LookupTypeReflection that includes the type-name
18862         cache.  This can be used as a fast path for functions that know
18863         the fully qualified name and are only calling into *.GetType() to
18864         obtain a composed type.
18865
18866         This is also used by TypeManager.LookupType during its type
18867         composition.
18868
18869         (LookupType): We now also track the real type name, as sometimes
18870         we can get a quey for the real type name from things like
18871         ComposedCast.  This fixes bug 31422.
18872
18873         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
18874         complete type fullname, it does not have to go through the type
18875         resolution system to obtain the composed version of the type (for
18876         obtaining arrays or pointers).
18877
18878         (Conditional.Emit): Use the EmitBoolExpression to
18879         generate nicer code, as requested by Paolo.
18880
18881         (ArrayCreation.CheckIndices): Use the patch from
18882         hwang_rob@yahoo.ca to validate the array initializers. 
18883
18884 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
18885
18886         * class.cs (ConstructorInitializer.Emit): simplify code by using
18887         Invocation.EmitCall, and at the same time, fix the bugs in calling
18888         parent constructors that took variable arguments. 
18889
18890         * ecore.cs (Expression.ConvertNumericExplicit,
18891         Expression.ImplicitNumericConversion): Remove the code that
18892         manually wrapped decimal (InternalTypeConstructor call is now gone
18893         as well).
18894
18895         * expression.cs (Cast.TryReduce): Also handle decimal types when
18896         trying to perform a constant fold on the type.
18897
18898         * typemanager.cs (IsUnmanagedtype): Partially implemented.
18899
18900         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
18901         that only turned off an error report, and did nothing else. 
18902
18903 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
18904
18905         * driver.cs: Handle and ignore /fullpaths
18906
18907 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
18908
18909         * expression.cs (Binary.ResolveOperator): Catch the case where
18910         DoNumericPromotions returns true, 
18911
18912         (Binary.DoNumericPromotions): Simplify the code, and the tests.
18913
18914 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
18915
18916         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
18917         report error 70.
18918
18919 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
18920
18921         * ecore.cs (ConvertNumericExplicit): It is not enough that the
18922         conversion exists, but it is also required that the conversion be
18923         performed.  This manifested in "(Type64Enum) 2".  
18924
18925         * class.cs (TypeManager.AddMethod): The fix is not to change
18926         AddEnum, because that one was using a fully qualified name (every
18927         DeclSpace derivative does), but to change the AddMethod routine
18928         that was using an un-namespaced name.  This now correctly reports
18929         the duplicated name.
18930
18931         Revert patch until I can properly fix it.  The issue
18932         is that we have a shared Type space across all namespaces
18933         currently, which is wrong.
18934
18935         Options include making the Namespace a DeclSpace, and merge
18936         current_namespace/current_container in the parser.
18937
18938 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
18939
18940         * cs-parser.jay: Improve error reporting when we get a different
18941         kind of expression in local_variable_type and
18942         local_variable_pointer_type. 
18943
18944         Propagate this to avoid missleading errors being reported.
18945
18946         * ecore.cs (ImplicitReferenceConversion): treat
18947         TypeManager.value_type as a target just like object_type.   As
18948         code like this:
18949
18950         ValueType v = 1;
18951
18952         Is valid, and needs to result in the int 1 being boxed before it
18953         is assigned to the value type v.
18954
18955         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
18956         to validate the enumeration name.
18957
18958         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
18959         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
18960         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
18961
18962         * ecore.cs (TryImplicitIntConversion): When doing an
18963         implicit-enumeration-conversion, check if the type is 64-bits and
18964         perform a conversion before passing to EnumConstant.
18965
18966 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
18967
18968         * decl.cs (Error_AmbiguousTypeReference); New routine used to
18969         report ambiguous type references.  Unlike the MS version, we
18970         report what the ambiguity is.   Innovation at work ;-)
18971
18972         (DeclSpace.FindType): Require a location argument to
18973         display when we display an ambiguous error.
18974
18975         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
18976
18977         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
18978
18979         * expression.cs (EmitDynamicInitializers): Apply patch from
18980         hwang_rob@yahoo.ca that fixes the order in which we emit our
18981         initializers. 
18982
18983 2002-09-21  Martin Baulig  <martin@gnome.org>
18984
18985         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
18986         delegate takes no arguments.
18987
18988 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
18989
18990         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
18991         from integers.
18992
18993         * expression.cs: Extract the underlying type.
18994
18995         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
18996
18997         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
18998
18999 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
19000
19001         * class.cs (TypeContainer.DefineType): We can not use the nice
19002         PackingSize with the size set to 1 DefineType method, because it
19003         will not allow us to define the interfaces that the struct
19004         implements.
19005
19006         This completes the fixing of bug 27287
19007
19008         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
19009         means also structs.  This fixes part of the problem. 
19010         (Expresion.ImplicitReferenceConversionExists): ditto.
19011
19012         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
19013         error if there were no errors reported during the type lookup
19014         process, to avoid duplicates or redundant errors.  Without this
19015         you would get an ambiguous errors plus a type not found.  We have
19016         beaten the user enough with the first error.  
19017
19018         (DeclSparce.FindType): Emit a warning if we have an ambiguous
19019         reference. 
19020
19021         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
19022         during the resolution process, stop the lookup, this avoids
19023         repeated error reports (same error twice).
19024
19025         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
19026
19027         * typemanager.cs (LookupType): Redo the type lookup code to match
19028         the needs of System.Reflection.  
19029
19030         The issue is that System.Reflection requires references to nested
19031         types to begin with a "+" sign instead of a dot.  So toplevel
19032         types look like: "NameSpace.TopLevelClass", and nested ones look
19033         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
19034         levels. 
19035
19036 2002-09-19  Martin Baulig  <martin@gnome.org>
19037
19038         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
19039         says that a method always returns or always throws an exception,
19040         don't report the CS0161.
19041
19042         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
19043         set `Returns = new_returns'.
19044
19045 2002-09-19  Martin Baulig  <martin@gnome.org>
19046
19047         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
19048         to an enum constant, check for a CS0176.
19049
19050 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
19051
19052         * class.cs (TypeContainer.CheckPairedOperators): Now we check
19053         for operators that must be in pairs and report errors.
19054
19055         * ecore.cs (SimpleName.DoResolveType): During the initial type
19056         resolution process, when we define types recursively, we must
19057         check first for types in our current scope before we perform
19058         lookups in the enclosing scopes.
19059
19060         * expression.cs (MakeByteBlob): Handle Decimal blobs.
19061
19062         (Invocation.VerifyArgumentsCompat): Call
19063         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
19064         I thought we were supposed to always call this, but there are a
19065         few places in the code where we dont do it.
19066
19067 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
19068
19069         * driver.cs: Add support in -linkres and -resource to specify the
19070         name of the identifier.
19071
19072 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
19073
19074         * ecore.cs (StandardConversionExists): Sync with the conversion
19075         code: allow anything-* to void* conversions.
19076
19077         (FindMostSpecificSource): Use an Expression argument
19078         instead of a Type, because we might be handed over a Literal which
19079         gets a few more implicit conversions that plain types do not.  So
19080         this information was being lost.
19081
19082         Also, we drop the temporary type-holder expression when not
19083         required.
19084
19085 2002-09-17  Martin Baulig  <martin@gnome.org>
19086
19087         * class.cs (PropertyBase.CheckBase): Don't check the base class if
19088         this is an explicit interface implementation.
19089
19090 2002-09-17  Martin Baulig  <martin@gnome.org>
19091
19092         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
19093         different `IndexerName' attributes.
19094
19095         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
19096         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
19097         virtual CommonResolve().
19098
19099 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
19100
19101         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
19102         and convert that to the UnderlyingType.
19103
19104         * statement.cs (Foreach.Resolve): Indexers are just like variables
19105         or PropertyAccesses.
19106
19107         * cs-tokenizer.cs (consume_string): Track line numbers and columns
19108         inside quoted strings, we were not doing this before.
19109
19110 2002-09-16  Martin Baulig  <martin@gnome.org>
19111
19112         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
19113         resolve it.  This is needed for the definite assignment check of the
19114         instance expression, fixes bug #29846.
19115         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
19116
19117 2002-09-16  Nick Drochak  <ndrochak@gol.com>
19118
19119         * parameter.cs: Fix compile error.  Cannot reference static member
19120         from an instance object.  Is this an mcs bug?
19121
19122 2002-09-14  Martin Baulig  <martin@gnome.org>
19123
19124         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
19125         multiple times.  Fixes bug #30295, added test-166.cs.
19126
19127 2002-09-14  Martin Baulig  <martin@gnome.org>
19128
19129         * statement.cs (Block.Emit): Don't emit unreachable code.
19130         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
19131         `break' statements.
19132         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
19133
19134 2002-09-14  Martin Baulig  <martin@gnome.org>
19135
19136         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
19137         is set.
19138
19139 2002-09-14  Martin Baulig  <martin@gnome.org>
19140
19141         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
19142         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
19143         be false on the ms runtime.
19144
19145 2002-09-13  Martin Baulig  <martin@gnome.org>
19146
19147         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
19148         the CS0038 error message.
19149
19150 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
19151
19152         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
19153         constant inside, return it.
19154
19155 2002-09-12  Martin Baulig  <martin@gnome.org>
19156
19157         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
19158         implicit conversion can be done between enum types.
19159
19160         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
19161         check whether an implicit conversion to the current enum's UnderlyingType
19162         exists and report an error if not.
19163
19164         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
19165         without debugging support.
19166
19167         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
19168         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
19169
19170 2002-09-12  Martin Baulig  <martin@gnome.org>
19171
19172         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
19173
19174         * ecore.cs (IMemberExpr.DeclaringType): New property.
19175         (SimpleName.SimpleNameResolve): Check whether we're accessing a
19176         nonstatic member of an outer type (CS0038).
19177
19178 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
19179
19180         * driver.cs: Activate the using-error detector at warning level
19181         4 (at least for MS-compatible APIs).
19182
19183         * namespace.cs (VerifyUsing): Small buglett fix.
19184
19185         * pending.cs (PendingImplementation): pass the container pointer. 
19186
19187         * interface.cs (GetMethods): Allow for recursive definition.  Long
19188         term, I would like to move every type to support recursive
19189         definitions, not the current ordering mechanism that we have right
19190         now.
19191
19192         The situation is this: Attributes are handled before interfaces,
19193         so we can apply attributes to interfaces.  But some attributes
19194         implement interfaces, we will now handle the simple cases
19195         (recursive definitions will just get an error).  
19196
19197         * parameter.cs: Only invalidate types at the end if we fail to
19198         lookup all types.  
19199
19200 2002-09-09  Martin Baulig  <martin@gnome.org>
19201
19202         * ecore.cs (PropertyExpr.Emit): Also check for
19203         TypeManager.system_int_array_get_length so this'll also work when
19204         compiling corlib.  Fixes #30003.
19205
19206 2002-09-09  Martin Baulig  <martin@gnome.org>
19207
19208         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
19209         and throw an exception if we can't get the type's size.  Fixed #30040,
19210         added test-165.cs.
19211
19212 2002-09-09  Martin Baulig  <martin@gnome.org>
19213
19214         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
19215
19216         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
19217         context.  Fixes bug #30027.
19218
19219         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
19220         virtual functions.  Fixes bug #30043, added test-164.cs.
19221
19222 2002-09-08  Ravi Pratap  <ravi@ximian.com>
19223
19224         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
19225
19226 2002-09-08  Nick Drochak  <ndrochak@gol.com>
19227
19228         * driver.cs: Use an object to get the windows codepage since it's not a
19229         static property.
19230
19231 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
19232
19233         * statement.cs (For.Emit): for infinite loops (test == null)
19234         return whether there is a break inside, not always "true".
19235
19236         * namespace.cs (UsingEntry): New struct to hold the name of the
19237         using definition, the location where it is defined, and whether it
19238         has been used in a successful type lookup.
19239
19240         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
19241         strings.
19242
19243         * decl.cs: ditto.
19244
19245 2002-09-06  Ravi Pratap  <ravi@ximian.com>
19246
19247         * attribute.cs : Fix incorrect code which relied on catching
19248         a NullReferenceException to detect a null being passed in
19249         where an object was expected.
19250
19251 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
19252
19253         * statement.cs (Try): flag the catch variable as assigned
19254
19255         * expression.cs (Cast): Simplified by using ResolveType instead of
19256         manually resolving.
19257
19258         * statement.cs (Catch): Fix bug by using ResolveType.
19259
19260 2002-09-06  Ravi Pratap  <ravi@ximian.com>
19261
19262         * expression.cs (BetterConversion): Special case for when we have
19263         a NullLiteral as the argument and we have to choose between string
19264         and object types - we choose string the way csc does.
19265
19266         * attribute.cs (Attribute.Resolve): Catch the
19267         NullReferenceException and report error #182 since the Mono
19268         runtime no more has the bug and having this exception raised means
19269         we tried to select a constructor which takes an object and is
19270         passed a null.
19271
19272 2002-09-05  Ravi Pratap  <ravi@ximian.com>
19273
19274         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
19275         message (1502, 1503) when we can't locate a method after overload
19276         resolution. This is much more informative and closes the bug
19277         Miguel reported.
19278
19279         * interface.cs (PopulateMethod): Return if there are no argument
19280         types. Fixes a NullReferenceException bug.
19281
19282         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
19283         expressions too. Previously we were checking only in one place for
19284         positional arguments leaving out named arguments.
19285
19286         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
19287         type to the enum type is not allowed. Remove code corresponding to
19288         that.
19289
19290         (ConvertNumericExplicit): Allow explicit conversions from
19291         the underlying type to enum type. This precisely follows the spec
19292         and closes a bug filed by Gonzalo.
19293
19294 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19295
19296         * compiler.csproj:
19297         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
19298
19299 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
19300
19301         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
19302         it was important that we stored the right value after the
19303         reduction in `converted'.
19304
19305 2002-09-04  Martin Baulig  <martin@gnome.org>
19306
19307         * location.cs (Location.SymbolDocument): Use full pathnames for the
19308         source files.
19309
19310 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
19311
19312         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
19313         of the expression resolve mechanism, because that will catch the
19314         SimpleName error failures.
19315
19316         (Conditional): If we can not resolve the
19317         expression, return, do not crash.
19318
19319 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19320
19321         * cs-tokenizer.cs:
19322         (location): display token name instead of its number.
19323
19324 2002-08-28  Martin Baulig  <martin@gnome.org>
19325
19326         * expression.cs (Binary.ResolveOperator): Don't silently return
19327         but return an error if an operator cannot be applied between two
19328         enum types.
19329
19330 2002-08-28  Martin Baulig  <martin@gnome.org>
19331
19332         * class.cs (Constructor.Define): Set the permission attributes
19333         correctly instead of making all constructors public.
19334
19335 2002-08-28  Martin Baulig  <martin@gnome.org>
19336
19337         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
19338         for private members before reporting a CS0103; if we find anything,
19339         it's a CS0122.
19340
19341 2002-08-28  Martin Baulig  <martin@gnome.org>
19342
19343         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
19344         to check whether `closure_start_type == closure_invocation_type',
19345         we also need to check whether `m.DeclaringType == closure_invocation_type'
19346         before bypassing the permission checks.  We might be accessing
19347         protected/private members from the base class.
19348         (TypeManager.RealMemberLookup): Only set private_ok if private
19349         members were requested via BindingFlags.NonPublic.
19350
19351         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
19352
19353         * expression.cs (MemberAccess.ResolveMemberAccess): Set
19354         MethodGroupExpr.IsExplicitImpl if appropriate.
19355         (Invocation.DoResolve): Don't report the CS0120 for explicit
19356         interface implementations.
19357
19358 2002-08-27  Martin Baulig  <martin@gnome.org>
19359
19360         * expression.cs (Invocation.DoResolve): If this is a static
19361         method and we don't have an InstanceExpression, we must report
19362         a CS0120.
19363
19364 2002-08-25  Martin Baulig  <martin@gnome.org>
19365
19366         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
19367         `==' between a valuetype and an object.
19368
19369 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
19370
19371         * ecore.cs (TypeExpr): Provide a ToString method.
19372
19373 2002-08-24  Martin Baulig  <martin@gnome.org>
19374
19375         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
19376         now called proggie.dbg and it's a binary file.
19377
19378 2002-08-23  Martin Baulig  <martin@gnome.org>
19379
19380         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
19381
19382 2002-08-23  Martin Baulig  <martin@gnome.org>
19383
19384         * struct.cs (MyStructInfo.ctor): Make this work with empty
19385         structs; it's not allowed to use foreach() on null.
19386
19387 2002-08-23  Martin Baulig  <martin@gnome.org>
19388
19389         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
19390         writer the full pathname of the generated assembly.
19391
19392 2002-08-23  Martin Baulig  <martin@gnome.org>
19393
19394         * statements.cs (FlowBranching.UsageVector.MergeChildren):
19395         A `finally' block never returns or breaks; improved handling of
19396         unreachable code.
19397
19398 2002-08-23  Martin Baulig  <martin@gnome.org>
19399
19400         * statement.cs (Throw.Resolve): Allow `throw null'.
19401
19402 2002-08-23  Martin Baulig  <martin@gnome.org>
19403
19404         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
19405         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
19406         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
19407         MemberLookup would return a wrong event if this is an explicit
19408         interface implementation and the class has an event with the same
19409         name.
19410
19411 2002-08-23  Martin Baulig  <martin@gnome.org>
19412
19413         * statement.cs (Block.AddChildVariableNames): New public method.
19414         (Block.AddChildVariableName): Likewise.
19415         (Block.IsVariableNameUsedInChildBlock): Likewise.
19416         (Block.AddVariable): Check whether a variable name has already
19417         been used in a child block.
19418
19419         * cs-parser.jay (declare_local_variables): Mark all variable names
19420         from the current block as being used in a child block in the
19421         implicit block.
19422
19423 2002-08-23  Martin Baulig  <martin@gnome.org>
19424
19425         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
19426         find the symbol writer.
19427
19428         * driver.cs: csc also allows the arguments to /define being
19429         separated by commas, not only by semicolons.
19430
19431 2002-08-23  Martin Baulig  <martin@gnome.org>
19432
19433         * interface.cs (Interface.GetMembers): Added static check for events.
19434
19435 2002-08-15  Martin Baulig  <martin@gnome.org>
19436
19437         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
19438         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
19439
19440         * ecore.cs (Expression.MemberLookup): Added documentation and explained
19441         why the MethodData.EmitDestructor() change was necessary.
19442
19443 2002-08-20  Martin Baulig  <martin@gnome.org>
19444
19445         * class.cs (TypeContainer.FindMembers): Added static check for events.
19446
19447         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
19448
19449         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
19450         use Type.GetEvents(), not Type.FindMembers().
19451
19452 2002-08-20  Martin Baulig  <martin@gnome.org>
19453
19454         * decl.cs (MemberCache): Added a special method cache which will
19455         be used for method-only searched.  This ensures that a method
19456         search will return a MethodInfo with the correct ReflectedType for
19457         inherited methods.      
19458
19459 2002-08-20  Martin Baulig  <martin@gnome.org>
19460
19461         * decl.cs (DeclSpace.FindMembers): Made this public.
19462
19463 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19464
19465         * delegate.cs: fixed build on windows.
19466         [FIXME:  Filed as bug #29150: MCS must report these errors.]
19467
19468 2002-08-19  Ravi Pratap  <ravi@ximian.com>
19469
19470         * ecore.cs (StandardConversionExists): Return a false
19471         if we are trying to convert the void type to anything else
19472         since that is not allowed.
19473
19474         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
19475         we flag error 70 in the event an event is trying to be accessed
19476         directly from outside the declaring type.
19477
19478 2002-08-20  Martin Baulig  <martin@gnome.org>
19479
19480         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
19481         MemberCache from typemanager.cs to decl.cs.
19482
19483 2002-08-19  Martin Baulig  <martin@gnome.org>
19484
19485         * class.cs (TypeContainer): Implement IMemberContainer.
19486         (TypeContainer.DefineMembers): Create the MemberCache.
19487         (TypeContainer.FindMembers): Do better BindingFlags checking; only
19488         return public members if BindingFlags.Public was given, check
19489         whether members are static.
19490
19491 2002-08-16  Martin Baulig  <martin@gnome.org>
19492
19493         * decl.cs (DeclSpace.Define): Splitted this in Define and
19494         DefineMembers.  DefineMembers is called first and initializes the
19495         MemberCache.
19496
19497         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
19498         DefineMembers() on all our DeclSpaces.
19499
19500         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
19501         but call DefineMembers() on all nested interfaces.  We call their
19502         Define() in our new Define() function.
19503
19504         * interface.cs (Interface): Implement IMemberContainer.
19505         (Interface.Define): Moved all code except the attribute stuf to
19506         DefineMembers().
19507         (Interface.DefineMembers): Initialize the member cache.
19508
19509         * typemanager.cs (IMemberFinder): Removed this interface, we don't
19510         need this anymore since we can use MemberCache.FindMembers directly.
19511
19512 2002-08-19  Martin Baulig  <martin@gnome.org>
19513
19514         * typemanager.cs (MemberCache): When creating the cache for an
19515         interface type, add all inherited members.
19516         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
19517         to `out bool used_cache' and documented it.
19518         (TypeManager.MemberLookup): If we already used the cache in the first
19519         iteration, we don't need to do the interfaces check.
19520
19521 2002-08-19  Martin Baulig  <martin@gnome.org>
19522
19523         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
19524         here from IMemberFinder and don't implement this interface anymore.
19525         (DeclSpace.MemberCache): Moved here from IMemberFinder.
19526
19527         * typemanager.cs (IMemberFinder): This interface is now only used by
19528         classes which actually support the member cache.
19529         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
19530         since we only put DeclSpaces into this Hashtable.
19531         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
19532         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
19533
19534 2002-08-16  Martin Baulig  <martin@gnome.org>
19535
19536         * typemanager.cs (ICachingMemberFinder): Removed.
19537         (IMemberFinder.MemberCache): New property.
19538         (TypeManager.FindMembers): Merged this with RealFindMembers().
19539         This function will never be called from TypeManager.MemberLookup()
19540         so we can't use the cache here, just the IMemberFinder.
19541         (TypeManager.MemberLookup_FindMembers): Check whether the
19542         IMemberFinder has a MemberCache and call the cache's FindMembers
19543         function.
19544         (MemberCache): Rewrote larger parts of this yet another time and
19545         cleaned it up a bit.
19546
19547 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
19548
19549         * driver.cs (LoadArgs): Support quoting.
19550
19551         (Usage): Show the CSC-like command line arguments.
19552
19553         Improved a few error messages.
19554
19555 2002-08-15  Martin Baulig  <martin@gnome.org>
19556
19557         * typemanager.cs (IMemberContainer.Type): New property.
19558         (IMemberContainer.IsInterface): New property.
19559
19560         The following changes are conditional to BROKEN_RUNTIME, which is
19561         defined at the top of the file.
19562
19563         * typemanager.cs (MemberCache.MemberCache): Don't add the base
19564         class'es members, but add all members from TypeHandle.ObjectType
19565         if we're an interface.
19566         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
19567         is the current type.
19568         (MemberCache.CacheEntry.Container): Removed this field.
19569         (TypeHandle.GetMembers): Include inherited members.
19570
19571 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19572
19573         * typemanager.cs: fixed compilation and added a comment on a field that
19574         is never used.
19575
19576 2002-08-15  Martin Baulig  <martin@gnome.org>
19577
19578         * class.cs (ConstructorInitializer.Resolve): In the
19579         Expression.MemberLookup call, use the queried_type as
19580         invocation_type.
19581
19582         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
19583         declared' attribute, it's always true.
19584         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
19585         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
19586         temporary wrapper for FindMembers which tells MemberLookup whether
19587         members from the base classes are included in the return value.
19588         This will go away soon.
19589         (TypeManager.MemberLookup): Use this temporary hack here; once the
19590         new MemberCache is completed, we don't need to do the DeclaredOnly
19591         looping here anymore since the MemberCache will take care of this.
19592         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
19593         (MemberCache): When creating the MemberCache for a class, get
19594         members from the current class and all its base classes.
19595         (MemberCache.CacheEntry.Container): New field.  This is a
19596         temporary hack until the Mono runtime is fixed to distinguish
19597         between ReflectedType and DeclaringType.  It allows us to use MCS
19598         with both the MS runtime and the unfixed Mono runtime without
19599         problems and without accecting performance.
19600         (MemberCache.SearchMembers): The DeclaredOnly looping from
19601         TypeManager.MemberLookup is now done here.      
19602
19603 2002-08-14  Martin Baulig  <martin@gnome.org>
19604
19605         * statement.cs (MyStructInfo.MyStructInfo): Don't call
19606         Type.GetFields on dynamic types but get the fields from the
19607         corresponding TypeContainer.
19608         (MyStructInfo.GetStructInfo): Added check for enum types.
19609
19610         * typemanager.cs (MemberList.IsSynchronized): Implemented.
19611         (MemberList.SyncRoot): Implemented.
19612         (TypeManager.FilterWithClosure): No need to check permissions if
19613         closure_start_type == closure_invocation_type, don't crash if
19614         closure_invocation_type is null.
19615
19616 2002-08-13  Martin Baulig  <martin@gnome.org>
19617
19618         Rewrote TypeContainer.FindMembers to use a member cache.  This
19619         gives us a speed increase of about 35% for the self-hosting MCS
19620         build and of about 15-20% for the class libs (both on GNU/Linux).
19621
19622         * report.cs (Timer): New class to get enhanced profiling.  This
19623         whole class is "TIMER" conditional since it remarkably slows down
19624         compilation speed.
19625
19626         * class.cs (MemberList): New class.  This is an IList wrapper
19627         which we're now using instead of passing MemberInfo[]'s around to
19628         avoid copying this array unnecessarily.
19629         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
19630         (ICachingMemberFinder, IMemberContainer): New interface.
19631         (TypeManager.FilterWithClosure): If `criteria' is null, the name
19632         has already been checked, otherwise use it for the name comparision.
19633         (TypeManager.FindMembers): Renamed to RealMemberFinder and
19634         provided wrapper which tries to use ICachingMemberFinder.FindMembers
19635         if possible.  Returns a MemberList, not a MemberInfo [].
19636         (TypeHandle): New class, implements IMemberContainer.  We create
19637         one instance of this class per type, it contains a MemberCache
19638         which is used to do the member lookups.
19639         (MemberCache): New class.  Each instance of this class contains
19640         all members of a type and a name-based hash table.
19641         (MemberCache.FindMembers): This is our new member lookup
19642         function.  First, it looks up all members of the requested name in
19643         the hash table.  Then, it walks this list and sorts out all
19644         applicable members and returns them.
19645
19646 2002-08-13  Martin Baulig  <martin@gnome.org>
19647
19648         In addition to a nice code cleanup, this gives us a performance
19649         increase of about 1.4% on GNU/Linux - not much, but it's already
19650         half a second for the self-hosting MCS compilation.
19651
19652         * typemanager.cs (IMemberFinder): New interface.  It is used by
19653         TypeManager.FindMembers to call FindMembers on a TypeContainer,
19654         Enum, Delegate or Interface.
19655         (TypeManager.finder_to_member_finder): New PtrHashtable.
19656         (TypeManager.finder_to_container): Removed.
19657         (TypeManager.finder_to_delegate): Removed.
19658         (TypeManager.finder_to_interface): Removed.
19659         (TypeManager.finder_to_enum): Removed.
19660
19661         * interface.cs (Interface): Implement IMemberFinder.
19662
19663         * delegate.cs (Delegate): Implement IMemberFinder.
19664
19665         * enum.cs (Enum): Implement IMemberFinder.
19666
19667         * class.cs (TypeContainer): Implement IMemberFinder.
19668
19669 2002-08-12  Martin Baulig  <martin@gnome.org>
19670
19671         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
19672
19673 2002-08-12  Martin Baulig  <martin@gnome.org>
19674
19675         * ecore.cs (ITypeExpression): New interface for expressions which
19676         resolve to a type.
19677         (TypeExpression): Renamed to TypeLookupExpression.
19678         (Expression.DoResolve): If we're doing a types-only lookup, the
19679         expression must implement the ITypeExpression interface and we
19680         call DoResolveType() on it.
19681         (SimpleName): Implement the new ITypeExpression interface.
19682         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
19683         hack, the situation that we're only looking up types can't happen
19684         anymore when this method is called.  Moved the type lookup code to
19685         DoResolveType() and call it.
19686         (SimpleName.DoResolveType): This ITypeExpression interface method
19687         is now doing the types-only lookup.
19688         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
19689         (ResolveFlags): Added MaskExprClass.
19690
19691         * expression.cs (MemberAccess): Implement the ITypeExpression
19692         interface.
19693         (MemberAccess.DoResolve): Added support for a types-only lookup
19694         when we're called via ITypeExpression.DoResolveType().
19695         (ComposedCast): Implement the ITypeExpression interface.
19696
19697         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
19698         Expression.Resolve() with ResolveFlags.Type instead.
19699
19700 2002-08-12  Martin Baulig  <martin@gnome.org>
19701
19702         * interface.cs (Interface.Define): Apply attributes.
19703
19704         * attribute.cs (Attribute.ApplyAttributes): Added support for
19705         interface attributes.
19706
19707 2002-08-11  Martin Baulig  <martin@gnome.org>
19708
19709         * statement.cs (Block.Emit): Only check the "this" variable if we
19710         do not always throw an exception.
19711
19712         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
19713         whether the property has a set accessor.
19714
19715 2002-08-11  Martin Baulig  <martin@gnome.org>
19716
19717         Added control flow analysis support for structs.
19718
19719         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
19720         with control flow analysis turned off.
19721         (IVariable): New interface.
19722         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
19723         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
19724         (FieldExpr.DoResolve): Resolve the instance expression with flow
19725         analysis turned off and do the definite assignment check after the
19726         resolving when we know what the expression will resolve to.
19727
19728         * expression.cs (LocalVariableReference, ParameterReference):
19729         Implement the new IVariable interface, only call the flow analysis
19730         code if ec.DoFlowAnalysis is true.
19731         (This): Added constructor which takes a Block argument.  Implement
19732         the new IVariable interface.
19733         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
19734         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
19735         This does the definite assignment checks for struct members.
19736
19737         * class.cs (Constructor.Emit): If this is a non-static `struct'
19738         constructor which doesn't have any initializer, call
19739         Block.AddThisVariable() to tell the flow analysis code that all
19740         struct elements must be initialized before control returns from
19741         the constructor.
19742
19743         * statement.cs (MyStructInfo): New public class.
19744         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
19745         argument to this indexer.  If non-zero, check an individual struct
19746         member, not the whole struct.
19747         (FlowBranching.CheckOutParameters): Check struct members.
19748         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
19749         overloaded versions of these methods which take an additional
19750         `int field_idx' argument to check struct members.
19751         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
19752         overloaded versions of these methods which take an additional
19753         `string field_name' argument to check struct member.s
19754         (VariableInfo): Implement the IVariable interface.
19755         (VariableInfo.StructInfo): New public property.  Returns the
19756         MyStructInfo instance of the variable if it's a struct or null.
19757         (Block.AddThisVariable): New public method.  This is called from
19758         Constructor.Emit() for non-static `struct' constructor which do
19759         not have any initializer.  It creates a special variable for the
19760         "this" instance variable which will be checked by the flow
19761         analysis code to ensure that all of the struct's fields are
19762         initialized before control returns from the constructor.
19763         (UsageVector): Added support for struct members.  If a
19764         variable/parameter is a struct with N members, we reserve a slot
19765         in the usage vector for each member.  A struct is considered fully
19766         initialized if either the struct itself (slot 0) or all its
19767         members are initialized.
19768
19769 2002-08-08  Martin Baulig  <martin@gnome.org>
19770
19771         * driver.cs (Driver.MainDriver): Only report an error CS5001
19772         if there were no compilation errors.
19773
19774         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
19775         `UnsafeContext' property to determine whether the parent is in
19776         unsafe context rather than checking the parent's ModFlags:
19777         classes nested in an unsafe class are unsafe as well.
19778
19779 2002-08-08  Martin Baulig  <martin@gnome.org>
19780
19781         * statement.cs (UsageVector.MergeChildren): Distinguish between
19782         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
19783         we return.  Added test17() and test18() to test-154.cs.
19784
19785 2002-08-08  Martin Baulig  <martin@gnome.org>
19786
19787         * typemanager.cs (TypeManager.FilterWithClosure): If we have
19788         Family access, make sure the invoking type isn't a subclass of the
19789         queried type (that'd be a CS1540).
19790
19791         * ecore.cs (Expression.MemberLookup): Added overloaded version of
19792         this method which takes an additional `Type invocation_type'.
19793
19794         * expression.cs (BaseAccess.DoResolve): Use the base type as
19795         invocation and query type.
19796         (MemberAccess.DoResolve): If the lookup failed and we're about to
19797         report a CS0122, try a lookup with the ec.ContainerType - if this
19798         succeeds, we must report a CS1540.
19799
19800 2002-08-08  Martin Baulig  <martin@gnome.org>
19801
19802         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
19803         (MethodGroupExpr): Implement the IMemberExpr interface.
19804
19805         * expression (MemberAccess.ResolveMemberAccess): No need to have
19806         any special code for MethodGroupExprs anymore, they're now
19807         IMemberExprs.   
19808
19809 2002-08-08  Martin Baulig  <martin@gnome.org>
19810
19811         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
19812         Family, FamANDAssem and FamORAssem permissions.
19813         (TypeManager.IsSubclassOrNestedChildOf): New public method.
19814
19815 2002-08-08  Martin Baulig  <martin@gnome.org>
19816
19817         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
19818         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
19819         or loop block.
19820
19821 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
19822
19823         * driver.cs: implemented /resource option to embed managed resources.
19824
19825 2002-08-07  Martin Baulig  <martin@gnome.org>
19826
19827         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
19828         (FieldBase.HasFieldInitializer): New public property.
19829         (FieldBase.GetInitializerExpression): New public method.  Resolves and
19830         returns the field initializer and makes sure it is only resolved once.
19831         (TypeContainer.EmitFieldInitializers): Call
19832         FieldBase.GetInitializerExpression to get the initializer, this ensures
19833         that it isn't resolved multiple times.
19834
19835         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
19836         the resolving process (SimpleName/MemberLookup) that we're currently
19837         emitting a field initializer (which must not access any instance members,
19838         this is an error CS0236).
19839
19840         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
19841         argument, if the `IsFieldInitializer' flag is set, we must report and
19842         error CS0236 and not an error CS0120.   
19843
19844 2002-08-07  Martin Baulig  <martin@gnome.org>
19845
19846         * ecore.cs (IMemberExpr): New public interface.
19847         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
19848         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
19849         if the expression is an IMemberExpr.
19850
19851         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
19852         to be null, implicitly default to `this' if we're non-static in
19853         this case.  Simplified the code a lot by using the new IMemberExpr
19854         interface.  Also fixed bug #28176 here.
19855
19856 2002-08-06  Martin Baulig  <martin@gnome.org>
19857
19858         * cs-parser.jay (SimpleLookup): Removed.  We need to create
19859         ParameterReferences during semantic analysis so that we can do a
19860         type-only search when resolving Cast, TypeOf and SizeOf.
19861         (block): Pass the `current_local_parameters' to the Block's
19862         constructor.
19863
19864         * class.cs (ConstructorInitializer): Added `Parameters parameters'
19865         argument to the constructor.
19866         (ConstructorInitializer.Resolve): Create a temporary implicit
19867         block with the parameters.
19868
19869         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
19870         references here if we aren't doing a type-only search.
19871
19872         * statement.cs (Block): Added constructor which takes a
19873         `Parameters parameters' argument.
19874         (Block.Parameters): New public property.
19875
19876         * support.cs (InternalParameters.Parameters): Renamed `parameters'
19877         to `Parameters' and made it public readonly.
19878
19879 2002-08-06  Martin Baulig  <martin@gnome.org>
19880
19881         * ecore.cs (Expression.Warning): Made this public as well.
19882
19883         * report.cs (Report.Debug): Print the contents of collections.
19884
19885 2002-08-06  Martin Baulig  <martin@gnome.org>
19886
19887         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
19888         used to tell Resolve() which kinds of expressions it may return.
19889         (Expression.Resolve): Added overloaded version of this method which
19890         takes a `ResolveFlags flags' argument.  This can be used to tell
19891         Resolve() which kinds of expressions it may return.  Reports a
19892         CS0118 on error.
19893         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
19894         ResolveFlags.SimpleName.
19895         (Expression.Error118): Added overloaded version of this method which
19896         takes a `ResolveFlags flags' argument.  It uses the flags to determine
19897         which kinds of expressions are allowed.
19898
19899         * expression.cs (Argument.ResolveMethodGroup): New public method.
19900         Resolves an argument, but allows a MethodGroup to be returned.
19901         This is used when invoking a delegate.
19902
19903         * TODO: Updated a bit.
19904
19905 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19906
19907         Fixed compilation with csc.
19908
19909         * ecore.cs: Expression.Error made public. Is this correct? Should
19910         Warning be made public too?
19911
19912         * expression.cs: use ea.Location instead of ea.loc.
19913         [FIXME:  Filed as bug #28607: MCS must report these errors.]
19914
19915 2002-08-06  Martin Baulig  <martin@gnome.org>
19916
19917         * ecore.cs (Expression.loc): Moved the location here instead of
19918         duplicating it in all derived classes.
19919         (Expression.Location): New public property.
19920         (Expression.Error, Expression.Warning): Made them non-static and
19921         removed the location argument.
19922         (Expression.Warning): Added overloaded version which takes an
19923         `int level' argument.
19924         (Expression.Error118): Make this non-static and removed the
19925         expression and location arguments.
19926         (TypeExpr): Added location argument to the constructor.
19927
19928         * expression.cs (StaticCallExpr): Added location argument to
19929         the constructor.
19930         (Indirection, PointerArithmetic): Likewise.
19931         (CheckedExpr, UnCheckedExpr): Likewise.
19932         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
19933         (StringPtr): Likewise.
19934
19935
19936 2002-08-05  Martin Baulig  <martin@gnome.org>
19937
19938         * expression.cs (BaseAccess.DoResolve): Actually report errors.
19939
19940         * assign.cs (Assign.DoResolve): Check whether the source
19941         expression is a value or variable.
19942
19943         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
19944         while resolving the corresponding blocks.
19945
19946         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
19947         an error, don't silently return null.
19948
19949         * statement.cs (Block.AddVariable): Do the error reporting here
19950         and distinguish between CS0128 and CS0136.
19951         (Block.DoResolve): Report all unused labels (warning CS0164).
19952         (LabeledStatement): Pass the location to the constructor.
19953         (LabeledStatement.HasBeenReferenced): New property.
19954         (LabeledStatement.Resolve): Set it to true here.
19955
19956         * statement.cs (Return.Emit): Return success even after reporting
19957         a type mismatch error (CS0126 or CS0127), this is what csc does and
19958         it avoids confusing the users with any consecutive errors.
19959
19960 2002-08-05  Martin Baulig  <martin@gnome.org>
19961
19962         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
19963
19964         * const.cs (Const.LookupConstantValue): Catch circular definitions.
19965
19966         * expression.cs (MemberAccess.DoResolve): Silently return if an
19967         error has already been reported.
19968
19969         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
19970         error has already been reported.
19971
19972 2002-08-05  Martin Baulig  <martin@gnome.org>
19973
19974         * statement.cs (UsageVector): Only initialize the `parameters'
19975         vector if we actually have any "out" parameters.
19976
19977 2002-08-05  Martin Baulig  <martin@gnome.org>
19978
19979         * expression.cs (Binary.ResolveOperator): When combining delegates,
19980         they must have the same type.
19981
19982 2002-08-05  Martin Baulig  <martin@gnome.org>
19983
19984         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
19985         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
19986         work with the ms runtime and we also don't need it: if we're a
19987         PropertyBuilder and not in the `indexer_arguments' hash, then we
19988         are a property and not an indexer.
19989
19990         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
19991         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
19992         since the latter one doesn't work with the ms runtime.
19993
19994 2002-08-03  Martin Baulig  <martin@gnome.org>
19995
19996         Fixed bugs #27998 and #22735.
19997
19998         * class.cs (Method.IsOperator): New public field.
19999         (Method.CheckBase): Report CS0111 if there's already a method
20000         with the same parameters in the current class.  Report CS0508 when
20001         attempting to change the return type of an inherited method.
20002         (MethodData.Emit): Report CS0179 if a method doesn't have a body
20003         and it's not marked abstract or extern.
20004         (PropertyBase): New abstract base class for Property and Indexer.
20005         (PropertyBase.CheckBase): Moved here from Property and made it work
20006         for indexers.
20007         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
20008         the same so we can reuse it there.
20009         (Property, Indexer): Derive from PropertyBase.
20010         (MethodSignature.inheritable_property_signature_filter): New delegate
20011         to find properties and indexers.
20012
20013         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
20014         argument and improved error reporting.
20015
20016         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
20017         EmptyReadOnlyParameters and made it a property.
20018
20019         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
20020         version of this method which takes a `PropertyInfo indexer'.
20021         (TypeManager.RegisterIndexer): New method.
20022
20023         * class.cs: Added myself as author of this file :-)
20024
20025 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20026
20027         * class.cs: fixed compilation on windoze.
20028
20029 2002-08-03  Martin Baulig  <martin@gnome.org>
20030
20031         * interface.cs (Interface.GetInterfaceBases): Check whether all
20032         base interfaces are at least as accessible than the current one.
20033
20034         * class.cs (TypeContainer.GetClassBases): Check whether base types
20035         are at least as accessible than the current type.
20036         (TypeContainer.AsAccessible): Implemented and made non-static.
20037         (MemberBase.CheckParameters): Report errors if the accessibility
20038         checks fail.
20039
20040         * delegate.cs (Delegate.Delegate): The default visibility is
20041         internal for top-level types and private for nested types.
20042         (Delegate.Define): Report errors if the accessibility checks fail.
20043
20044         * enum.cs (Enum.Enum): The default visibility is internal for
20045         top-level types and private for nested types.
20046         (Enum.DefineType): Compute the correct visibility.
20047
20048         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
20049         function which takes a `bool is_toplevel' instead of a TypeContainer.
20050
20051         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
20052         builtin type.
20053
20054 2002-08-02  Martin Baulig  <martin@gnome.org>
20055
20056         * expression.cs (LocalVariableReferenc): Added constructor which
20057         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
20058         (LocalVariableReference.IsReadOnly): New property.
20059         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
20060         variable is readonly, use our own readonly flag to do this; you can
20061         use the new constructor to get a writable reference to a read-only
20062         variable.
20063
20064         * cs-parser.jay (foreach_statement, using_statement): Get a writable
20065         reference to the local variable.
20066
20067 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
20068
20069         * rootcontext.cs (ResolveCore): Also include System.Exception
20070
20071         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
20072         we reach an EmptyStatement.
20073
20074         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
20075         is also fine.
20076
20077         * expression.cs (Binary.ResolveOperator): Check error result in
20078         two places.
20079
20080         use brtrue/brfalse directly and avoid compares to null.
20081
20082 2002-08-02  Martin Baulig  <martin@gnome.org>
20083
20084         * class.cs (TypeContainer.Define): Define all nested interfaces here.
20085         Fixes bug #28407, added test-155.cs.
20086
20087 2002-08-01  Martin Baulig  <martin@gnome.org>
20088
20089         * class.cs (Event.EmitDefaultMethod): Make this work with static
20090         events.  Fixes #28311, added verify-3.cs.
20091
20092 2002-08-01  Martin Baulig  <martin@gnome.org>
20093
20094         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
20095         `is_disposable' fields.
20096         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
20097         `hm.is_disposable' if we're using the collection pattern.
20098         (Foreach.EmitCollectionForeach): Use the correct type for the
20099         enumerator's local variable, only emit the try/finally block if
20100         necessary (fixes #27713).
20101
20102 2002-08-01  Martin Baulig  <martin@gnome.org>
20103
20104         * ecore.cs (Expression.report118): Renamed to Error118 and made
20105         it public static.
20106
20107         * statement.cs (Throw.Resolve): Check whether the expression is of
20108         the correct type (CS0118) and whether the type derives from
20109         System.Exception (CS0155).
20110         (Catch.Resolve): New method.  Do the type lookup here and check
20111         whether it derives from System.Exception (CS0155).
20112         (Catch.CatchType, Catch.IsGeneral): New public properties.
20113
20114         * typemanager.cs (TypeManager.exception_type): Added.
20115
20116 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
20117
20118         * driver.cs: Updated About function.
20119
20120 2002-07-31  Martin Baulig  <martin@gnome.org>
20121
20122         Implemented Control Flow Analysis.
20123
20124         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
20125         (EmitContext.CurrentBranching): Added.
20126         (EmitContext.StartFlowBranching): Added.
20127         (EmitContext.EndFlowBranching): Added.
20128         (EmitContext.KillFlowBranching): Added.
20129         (EmitContext.IsVariableAssigned): Added.
20130         (EmitContext.SetVariableAssigned): Added.
20131         (EmitContext.IsParameterAssigned): Added.
20132         (EmitContext.SetParameterAssigned): Added.
20133         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
20134         Added control flow analysis stuff here.
20135
20136         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
20137         resolve the expression as lvalue.
20138         (LocalVariableReference.DoResolve): Check whether the variable has
20139         already been assigned.
20140         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
20141         the parameter as assigned here.
20142         (ParameterReference.DoResolve): Check whether the parameter has already
20143         been assigned.
20144         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
20145         expression as lvalue.
20146
20147         * statement.cs (FlowBranching): New class for the flow analysis code.
20148         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
20149         (LabeledStatement.IsDefined): New public property.
20150         (LabeledStatement.AddUsageVector): New public method to tell flow
20151         analyis that the label may be reached via a forward jump.
20152         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
20153         flow analysis.
20154         (VariableInfo.Number): New public field.  This is used by flow analysis
20155         to number all locals of a block.
20156         (Block.CountVariables): New public property.  This is the number of
20157         local variables in this block (including the locals from all parent
20158         blocks).
20159         (Block.EmitMeta): Number all the variables.
20160
20161         * statement.cs: Added flow analysis support to all classes.
20162
20163 2002-07-31  Martin Baulig  <martin@gnome.org>
20164
20165         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
20166         To get debugging messages, compile mcs with /define:MCS_DEBUG and
20167         then use this argument.
20168
20169         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
20170
20171         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
20172         use this to specify /define options.
20173
20174 2002-07-29  Martin Baulig  <martin@gnome.org>
20175
20176         * statement.cs (Fixed): Moved all code that does variable lookups
20177         and resolvings from Emit to Resolve.
20178
20179         * statement.cs (For): Moved all code that does variable lookups
20180         and resolvings from Emit to Resolve.
20181
20182         * statement.cs (Using): Moved all code that does variable lookups
20183         and resolvings from Emit to Resolve.
20184
20185 2002-07-29  Martin Baulig  <martin@gnome.org>
20186
20187         * attribute.cs (Attribute.Resolve): Explicitly catch a
20188         System.NullReferenceException when creating the
20189         CustromAttributeBuilder and report a different warning message.
20190
20191 2002-07-29  Martin Baulig  <martin@gnome.org>
20192
20193         * support.cs (ParameterData.ParameterName): Added method to
20194         get the name of a parameter.
20195
20196         * typemanager.cs (TypeManager.IsValueType): New public method.
20197
20198 2002-07-29  Martin Baulig  <martin@gnome.org>
20199
20200         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
20201         is a flag which specifies that it's either ref or out.
20202         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
20203         the out parameter to `out Parameter.Modifier mod', also set the
20204         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
20205
20206         * support.cs (InternalParameters.ParameterModifier): Distinguish
20207         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
20208         Parameter.Modifier.ISBYREF flag if it's either ref or out.
20209
20210         * expression.cs (Argument.GetParameterModifier): Distinguish
20211         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
20212         Parameter.Modifier.ISBYREF flag if it's either ref or out.
20213
20214 2002-07-29  Martin Baulig  <martin@gnome.org>
20215
20216         * expression.cs (ParameterReference.ParameterReference): Added
20217         `Location loc' argument to the constructor.
20218
20219         * cs-parser.jay: Pass location to ParameterReference.
20220
20221 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
20222
20223         * statement.cs (Try): Initialize the location.
20224
20225         * cs-parser.jay: pass location to Try.
20226
20227         * expression.cs (Unary.Reduce): Change the prototype to return
20228         whether a constant fold could be performed or not.  The result is
20229         returned in an out parameters.  In the case of Indirection and
20230         AddressOf, we want to perform the full tests.
20231
20232 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
20233
20234         * statement.cs (Statement.Emit): Flag dead code.
20235
20236 2002-07-27  Andrew Birkett  <andy@nobugs.org>
20237
20238         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
20239
20240 2002-07-27  Martin Baulig  <martin@gnome.org>
20241
20242         * class.cs (MethodData.Define): Put back call to
20243         TypeManager.AddMethod(), accidentally commented this out.
20244
20245         * report.cs (Debug): New public method to print debugging information,
20246         this is `[Conditional ("DEBUG")]'.
20247
20248 2002-07-26  Martin Baulig  <martin@gnome.org>
20249
20250         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
20251         (switch_statement): Push the current_block to the switch_stack and
20252         pop it again when we're done with the switch.
20253         (switch_section): The new block is a child of the current_block.
20254         Fixes bug #24007, added test-152.cs.
20255
20256 2002-07-27  Martin Baulig  <martin@gnome.org>
20257
20258         * expression.cs (Invocation.EmitArguments): When calling a varargs
20259         function with only its fixed arguments, we need to pass an empty
20260         array.
20261
20262 2002-07-27  Martin Baulig  <martin@gnome.org>
20263
20264         Mono 0.13 has been released.
20265
20266 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
20267
20268         * driver.cs: Rename --resource to --linkres, because that is what
20269         we do currently, we dont support --resource yet.
20270
20271         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
20272
20273 2002-07-25  Martin Baulig  <martin@gnome.org>
20274
20275         * class.cs (MethodData): New public class.  This is a `method builder'
20276         class for a method or one accessor of a Property/Indexer/Event.
20277         (MethodData.GetMethodFlags): Moved here from MemberBase.
20278         (MethodData.ApplyAttributes): Likewise.
20279         (MethodData.ApplyObsoleteAttribute): Likewise.
20280         (MethodData.ApplyConditionalAttribute): Likewise.
20281         (MethodData.ApplyDllImportAttribute): Likewise.
20282         (MethodData.CheckAbstractAndExternal): Likewise.
20283         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
20284         (MethodData.Emit): Formerly known as Method.Emit().
20285         (MemberBase): Moved everything which was specific to a single
20286         accessor/method to MethodData.
20287         (Method): Create a new MethodData and call Define() and Emit() on it.
20288         (Property, Indexer, Event): Create a new MethodData objects for each
20289         accessor and call Define() and Emit() on them.
20290
20291 2002-07-25  Martin Baulig  <martin@gnome.org>
20292
20293         Made MethodCore derive from MemberBase to reuse the code from there.
20294         MemberBase now also checks for attributes.
20295
20296         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
20297         (MemberBase.GetMethodFlags): Moved here from class Method and marked
20298         as virtual.
20299         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
20300         `CallingConventions cc' and `Attributes opt_attrs' arguments.
20301         (MemberBase.ApplyAttributes): New virtual method; applies the
20302         attributes to a method or accessor.
20303         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
20304         (MemberBase.ApplyConditionalAttribute): Likewise.
20305         (MemberBase.ApplyDllImportAttribute): Likewise.
20306         (MemberBase.CheckAbstractAndExternal): Likewise.
20307         (MethodCore.ParameterTypes): This is now a property instead of a
20308         method, it's initialized from DoDefineParameters().
20309         (MethodCore.ParameterInfo): Removed the set accessor.
20310         (MethodCore.DoDefineParameters): New protected virtual method to
20311         initialize ParameterTypes and ParameterInfo.
20312         (Method.GetReturnType): We can now simply return the MemberType.
20313         (Method.GetMethodFlags): Override the MemberBase version and add
20314         the conditional flags.
20315         (Method.CheckBase): Moved some code from Define() here, call
20316         DoDefineParameters() here.
20317         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
20318         here to avoid some larger code duplication.
20319         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
20320         ensure that abstract and external accessors don't declare a body.
20321
20322         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
20323         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
20324         lookup in the attribute's parent classes, so we need to abort as soon
20325         as we found the first match.
20326         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
20327         the attribute has no arguments.
20328
20329         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
20330         of a Method.
20331
20332 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20333
20334         * cs-parser.jay: reverted previous patch.
20335
20336 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20337
20338         * cs-parser.jay: fixed bug #22119.
20339
20340 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20341
20342         * attribute.cs: fixed compilation. The error was:
20343         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
20344         be assigned to before control leaves the current method."
20345         [FIXME:  Filed as bug #28186: MCS must report this error.]
20346
20347 2002-07-25  Martin Baulig  <martin@gnome.org>
20348
20349         * attribute.cs (Attribute.Conditional_GetConditionName): New static
20350         method to pull the condition name ouf of a Conditional attribute.
20351         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
20352         the obsolete message and error flag out of an Obsolete attribute.
20353
20354         * class.cs (Method.GetMethodFlags): New public method to get the
20355         TypeManager.MethodFlags for this method.
20356         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
20357         private methods.
20358         (Method.Define): Get and apply the Obsolete and Conditional attributes;
20359         if we're overriding a virtual function, set the new private variable
20360         `parent_method'; call the new TypeManager.AddMethod().
20361
20362         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
20363         the MethodBuilder and the Method in a PtrHashtable.
20364         (TypeManager.builder_to_method): Added for this purpose.
20365         (TypeManager.MethodFlags): Added IsObsoleteError.
20366         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
20367         Obsolete and Conditional arguments in MethodBuilders.  If we discover
20368         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
20369         the message from the attribute.
20370
20371 2002-07-24  Martin Baulig  <martin@gnome.org>
20372
20373         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
20374         preprocessor directives, ensure that the argument to #define/#undef is
20375         exactly one identifier and that it's actually an identifier.
20376
20377         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
20378         did not work ....
20379
20380 2002-07-24  Martin Baulig  <martin@gnome.org>
20381
20382         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
20383         initialize it to TypeManager.object_type in the constructor.
20384         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
20385         of the `hm.get_current' method if we're using the collection pattern.
20386         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
20387         for the explicit conversion to make it work when we're using the collection
20388         pattern and the `Current' property has a different return type than `object'.
20389         Fixes #27713.
20390
20391 2002-07-24  Martin Baulig  <martin@gnome.org>
20392
20393         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
20394         does not match, but don't report any errors.  This method is called in
20395         order for all methods in a MethodGroupExpr until a matching method is
20396         found, so we don't want to bail out if the first method doesn't match.
20397         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
20398         matches, report the 123.  Fixes #28070.
20399
20400 2002-07-24  Martin Baulig  <martin@gnome.org>
20401
20402         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
20403         TypeManager.TypeToCoreType() to the top of the method so the
20404         following equality checks will work.  Fixes #28107.
20405
20406 2002-07-24  Martin Baulig  <martin@gnome.org>
20407
20408         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
20409         operand is of type uint, and the other operand is of type sbyte,
20410         short or int, the operands are converted to type long." -
20411         Actually do what this comment already told us.  Fixes bug #28106,
20412         added test-150.cs.
20413
20414 2002-07-24  Martin Baulig  <martin@gnome.org>
20415
20416         * class.cs (MethodBase): New abstract class.  This is now a base
20417         class for Property, Indexer and Event to avoid some code duplication
20418         in their Define() and DefineMethods() methods.
20419         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
20420         generic methods for Define() and DefineMethods().
20421         (FieldBase): Derive from MemberBase, not MemberCore.
20422         (Property): Derive from MemberBase, not MemberCore.
20423         (Property.DefineMethod): Moved all the code from this method to the
20424         new MethodBase.DefineAccessor(), just call it with appropriate
20425         argumetnts.
20426         (Property.Define): Call the new Property.DoDefine(), this does some
20427         sanity checks and we don't need to duplicate the code everywhere.
20428         (Event): Derive from MemberBase, not MemberCore.
20429         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
20430         accessors, this will also make them work with interface events.
20431         (Indexer): Derive from MemberBase, not MemberCore.
20432         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
20433         (Indexer.Define): Use the new MethodBase functions.
20434
20435         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
20436         argument to the constructor.
20437         (Interface.FindMembers): Added support for interface events.
20438         (Interface.PopluateEvent): Implemented.
20439
20440         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
20441
20442 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
20443
20444         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
20445         but this is required to check for a method name being the same as
20446         the containing class.  
20447
20448         Handle this now.
20449
20450 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20451
20452         * interface.cs: initialize variable.
20453
20454 2002-07-23  Martin Baulig  <martin@gnome.org>
20455
20456         Implemented the IndexerName attribute in interfaces.
20457
20458         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
20459         name if this is an explicit interface implementation.
20460         (Indexer.InterfaceIndexerName): New public variable.  If we're
20461         implementing an interface indexer, this is the IndexerName in that
20462         interface.  Otherwise, it's the IndexerName.
20463         (Indexer.DefineMethod): If we're implementing interface indexer,
20464         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
20465         and Pending.ImplementIndexer methods.
20466         (Indexer.Define): Also define the PropertyBuilder if we're
20467         implementing an interface indexer and this is neither an explicit
20468         interface implementation nor do the IndexerName match the one in
20469         the interface.
20470
20471         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
20472         If a method is defined here, then we always need to create a proxy
20473         for it.  This is used when implementing interface indexers.
20474         (Pending.IsInterfaceIndexer): New public method.
20475         (Pending.ImplementIndexer): New public method.
20476         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
20477         This is used when implementing interface indexers to define a proxy
20478         if necessary.
20479         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
20480         define a proxy if necessary.
20481
20482         * interface.cs (Interface.IndexerName): New public variable.
20483         (Interface.PopulateIndexer): Set the IndexerName.
20484         (Interface.DefineIndexers): New private method.  Populate all the
20485         indexers and make sure their IndexerNames match.
20486
20487         * typemanager.cs (IndexerPropertyName): Added support for interface
20488         indexers.
20489
20490 2002-07-22  Martin Baulig  <martin@gnome.org>
20491
20492         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
20493         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
20494         ret if HasReturnLabel.
20495         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
20496         variables.
20497
20498         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
20499         and set the ec.LoopBeginTryCatchLevel.
20500         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
20501         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
20502         the current ec.TryCatchLevel, the branch goes out of an exception
20503         block.  In this case, we need to use Leave and not Br.
20504
20505 2002-07-22  Martin Baulig  <martin@gnome.org>
20506
20507         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
20508         block unless the block does not always return or it is contained in
20509         another try { ... } catch { ... } block.  Fixes bug #26506.
20510         Added verify-1.cs to the test suite.
20511
20512 2002-07-22  Martin Baulig  <martin@gnome.org>
20513
20514         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
20515         then we do not always return.  Fixes bug #24985.
20516
20517 2002-07-22  Martin Baulig  <martin@gnome.org>
20518
20519         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
20520         lookup on a per-class level; ie. walk up the class hierarchy until we
20521         found at least one applicable method, then choose the best among them.
20522         Fixes bug #24463 and test-29.cs.
20523
20524 2002-07-22  Martin Baulig  <martin@gnome.org>
20525
20526         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
20527         return types of the methods.  The return type is not part of the
20528         signature and we must not check it to make the `new' modifier work.
20529         Fixes bug #27999, also added test-147.cs.
20530         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
20531
20532         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
20533         on the method's return type.
20534
20535 2002-07-21  Martin Baulig  <martin@gnome.org>
20536
20537         * assign.cs: Make this work if the rightmost source is a constant and
20538         we need to do an implicit type conversion.  Also adding a few more tests
20539         to test-38.cs which should have caught this.
20540
20541         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
20542         target in the makefile for this.  The makefile.gnu is primarily intended
20543         for end-users who don't want to debug the compiler.
20544
20545 2002-07-21  Martin Baulig  <martin@gnome.org>
20546
20547         * assign.cs: Improved the Assign class so it can now handle embedded
20548         assignments (X = Y = Z = something).  As a side-effect this'll now also
20549         consume less local variables.  test-38.cs now passes with MCS, added
20550         a few new test cases to that test.
20551
20552 2002-07-20  Martin Baulig  <martin@gnome.org>
20553
20554         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
20555         instructions.  Fixes bug #27977, also added test-146.cs.
20556
20557 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20558
20559         * cs-tokenizer.cs: fixed getHex ().
20560
20561 2002-07-19  Martin Baulig  <martin@gnome.org>
20562
20563         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
20564         not Type.GetType() to lookup the array type.  This is needed when
20565         we're constructing an array of a user-defined type.
20566         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
20567         single-dimensional arrays, but also for single-dimensial arrays of
20568         type decimal.
20569
20570 2002-07-19  Martin Baulig  <martin@gnome.org>
20571
20572         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
20573         this function is called, it's not allowed to share LocalBuilders
20574         among ILGenerators.
20575
20576 2002-07-19  Martin Baulig  <martin@gnome.org>
20577
20578         * expression.cs (Argument.Resolve): Report an error 118 when trying
20579         to pass a type as argument.
20580
20581 2002-07-18  Martin Baulig  <martin@gnome.org>
20582
20583         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
20584         Conv_R_Un for the signed `long' type.
20585
20586 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
20587
20588         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
20589         `expr' for the temporary result, as that will fail if we do
20590         multiple resolves on the same expression.
20591
20592 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
20593
20594         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
20595         ec.TypeContainer for looking up aliases. 
20596
20597         * class.cs (TypeContainer): Remove LookupAlias from here.
20598
20599         * decl.cs (DeclSpace); Move here.
20600
20601 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
20602
20603         * class.cs (FindMembers): Only call filter if the constructor
20604         bulider is not null.
20605
20606         Also handle delegates in `NestedTypes' now.  Now we will perform
20607         type lookups using the standard resolution process.  This also
20608         fixes a bug.
20609
20610         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
20611         This uses Expressions (the limited kind that can be parsed by the
20612         tree) instead of strings.
20613
20614         * expression.cs (ComposedCast.ToString): Implement, used to flag
20615         errors since now we have to render expressions.
20616
20617         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
20618         FormArrayType. 
20619
20620         * ecore.cs (SimpleName.ToString): ditto.
20621
20622         * cs-parser.jay: Instead of using strings to assemble types, use
20623         Expressions to assemble the type (using SimpleName, ComposedCast,
20624         MemberAccess).  This should fix the type lookups in declarations,
20625         because we were using a different code path for this.
20626
20627         * statement.cs (Block.Resolve): Continue processing statements
20628         even when there is an error.
20629
20630 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
20631
20632         * class.cs (Event.Define): Also remove the `remove' method from
20633         the list of pending items.
20634
20635         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
20636         generate more compact code. 
20637
20638 2002-07-17  Martin Baulig  <martin@gnome.org>
20639
20640         * const.cs (Const.LookupConstantValue): Add support for constant
20641         `unchecked' and `checked' expressions.
20642         Also adding test case test-140.cs for this.
20643
20644 2002-07-17  Martin Baulig  <martin@gnome.org>
20645
20646         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
20647         check whether mi.ReturnType implements the IEnumerator interface; the
20648         `==' and the IsAssignableFrom() will fail in this situation.
20649
20650 2002-07-16  Ravi Pratap  <ravi@ximian.com>
20651
20652         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
20653         here too.
20654
20655 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20656
20657         * expression.cs: fixed bug #27811.
20658
20659 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
20660
20661         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
20662         Molaro: when we are a ref, the value already contains a pointer
20663         value, do not take the address of it.
20664
20665 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
20666         * removed mb-parser.jay and mb-tokenizer.cs
20667
20668 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20669
20670         * expression.cs: check against the building corlib void type.
20671
20672 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
20673
20674         * ecore.cs: fix for valuetype static readonly fields: when 
20675         initializing them, we need their address, not the address of a copy.
20676
20677 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
20678
20679         * typemanager.cs: register also enum_type in corlib.
20680
20681 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20682
20683         * class.cs: allow calling this (but not base) initializers in structs.
20684
20685 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
20686
20687         * ecore.cs: make sure we compare against the building base types
20688         in GetTypeSize ().
20689
20690 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
20691
20692         * typemanager.cs: fix TypeToCoreType() to handle void and object
20693         (corlib gets no more typerefs after this change).
20694
20695 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
20696
20697         * expression.cs (ArrayCreation.EmitArrayArguments): use
20698         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
20699
20700         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
20701         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
20702         array indexes, the runtime actually forbids them.
20703
20704         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
20705         for array arguments here.
20706
20707         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
20708         instead of the default for ValueTypes.
20709
20710         (New.DoEmit): Use IsValueType instead of
20711         IsSubclassOf (value_type)
20712         (New.DoResolve): ditto.
20713         (Invocation.EmitCall): ditto.
20714
20715         * assign.cs (Assign): ditto.
20716
20717         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
20718         Statements *are* currently doing part of their resolution during
20719         Emit.  
20720
20721         Expressions do always resolve during resolve, but statements are
20722         only required to propagate resolution to their children.
20723
20724 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
20725
20726         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
20727
20728         (LoadAssembly): Do not add the dll if it is already specified
20729
20730         (MainDriver): Add the System directory to the link path at the end,
20731         after all the other -L arguments. 
20732
20733         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
20734         wrong opcode for loading bytes and bools (ldelem.i1 instead of
20735         ldelem.u1) and using the opposite for sbytes.
20736
20737         This fixes Digger, and we can finally run it.
20738
20739         * driver.cs (UnixParseOption): Move the option parsing here.  
20740         (CSCParseOption): Implement CSC-like parsing of options.
20741
20742         We now support both modes of operation, the old Unix way, and the
20743         new CSC-like way.  This should help those who wanted to make cross
20744         platform makefiles.
20745
20746         The only thing broken is that /r:, /reference: and /lib: are not
20747         implemented, because I want to make those have the same semantics
20748         as the CSC compiler has, and kill once and for all the confussion
20749         around this.   Will be doing this tomorrow.
20750
20751         * statement.cs (Unsafe.Resolve): The state is checked during
20752         resolve, not emit, so we have to set the flags for IsUnsfe here.
20753
20754 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
20755
20756         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
20757         not catch the Error_ObjectRefRequired in SimpleName (as it is
20758         possible to have a class/instance variable name that later gets
20759         deambiguated), we have to check this here.      
20760
20761 2002-07-10  Ravi Pratap  <ravi@ximian.com>
20762
20763         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
20764         make static and put into Expression.
20765
20766         (Event.Define): Register the private field of the event with the 
20767         TypeManager so that GetFieldFromEvent can get at it.
20768
20769         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
20770         keep track of the private field associated with an event which
20771         has no accessors.
20772
20773         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
20774         private field.
20775
20776         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
20777
20778 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
20779
20780         * expression.cs (Binary.EmitBranchable): this routine emits the
20781         Binary expression in a branchable context.  This basically means:
20782         we need to branch somewhere, not just get the value on the stack.
20783
20784         This works together with Statement.EmitBoolExpression.
20785
20786         * statement.cs (Statement.EmitBoolExpression): Use
20787         EmitBranchable. 
20788
20789 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
20790
20791         * statement.cs (For): Reduce the number of jumps in loops.
20792
20793         (For): Implement loop inversion for the For statement.
20794
20795         (Break): We can be breaking out of a Try/Catch controlled section
20796         (foreach might have an implicit try/catch clause), so we need to
20797         use Leave instead of Br.
20798
20799         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
20800         now).  If the instace expression supports IMemoryLocation, we use
20801         the AddressOf method from the IMemoryLocation to extract the
20802         address instead of emitting the instance.
20803
20804         This showed up with `This', as we were emitting the instance
20805         always (Emit) instead of the Address of This.  Particularly
20806         interesting when This is a value type, as we dont want the Emit
20807         effect (which was to load the object).
20808
20809 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
20810
20811         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
20812
20813         * statement.cs (Checked): Set the CheckedState during the resolve
20814         process too, as the ConvCast operations track the checked state on
20815         the resolve process, and not emit.
20816
20817         * cs-parser.jay (namespace_member_declaration): Flag that we have
20818         found a declaration when we do.  This is used to flag error 1529
20819
20820         * driver.cs: Report ok when we display the help only.
20821
20822 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
20823
20824         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
20825
20826 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
20827
20828         * cs-tokenizer.cs (define): We also have to track locally the
20829         defines.  AllDefines is just used for the Conditional Attribute,
20830         but we also need the local defines for the current source code. 
20831
20832 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
20833
20834         * statement.cs (While, For, Do): These loops can exit through a
20835         Break statement, use this information to tell whether the
20836         statement is the last piece of code.
20837
20838         (Break): Flag that we break.
20839
20840         * codegen.cs (EmitContexts): New `Breaks' state variable.
20841
20842 2002-07-03  Martin Baulig  <martin@gnome.org>
20843
20844         * class.cs (TypeContainer.MethodModifiersValid): Allow override
20845         modifiers in method declarations in structs.  Otherwise, you won't
20846         be able to override things like Object.Equals().
20847
20848 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
20849
20850         * class.cs (Method, Property, Indexer): Do not allow the public
20851         modifier to be used in explicit interface implementations.
20852
20853         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
20854         override modifiers in method declarations in structs
20855
20856 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
20857
20858         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
20859         integer or real overflow, report an error
20860
20861 2002-07-02  Martin Baulig  <martin@gnome.org>
20862
20863         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
20864         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
20865         to tell the runtime about our newly created System.Object and
20866         System.ValueType types.
20867
20868 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
20869
20870         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
20871         struct instead of Ldarg/Starg.
20872
20873 2002-07-02  Martin Baulig  <martin@gnome.org>
20874
20875         * expression.cs (Indirection.Indirection): Call
20876         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
20877
20878 2002-07-02  Martin Baulig  <martin@gnome.org>
20879
20880         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
20881         ValueType, call TypeManager.TypeToCoreType() on it.
20882         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
20883         the OpCodes.Newarr argument.
20884
20885 2002-07-02  Martin Baulig  <martin@gnome.org>
20886
20887         * expression.cs (Invocation.EmitCall): When compiling corlib,
20888         replace all calls to the system's System.Array type to calls to
20889         the newly created one.
20890
20891         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
20892         System.Array methods.
20893         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
20894         from the system's System.Array type which must be replaced.
20895
20896 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
20897
20898         * typemanager.cs: load unverifiable_code_ctor so we can build
20899         corlib using the correct type. Avoid using GetTypeCode() with
20900         TypeBuilders.
20901         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
20902         TypeManager.object_type to allow building corlib.
20903
20904 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
20905
20906         * ecore.cs: handle System.Enum separately in LoadFromPtr().
20907
20908 2002-07-01  Martin Baulig  <martin@gnome.org>
20909
20910         * class.cs: Make the last change actually work, we need to check
20911         whether `ifaces != null' to avoid a crash.
20912
20913 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20914
20915         * class.cs: when we build structs without fields that implement
20916         interfaces, we need to add the interfaces separately, since there is
20917         no API to both set the size and add the interfaces at type creation
20918         time.
20919
20920 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20921
20922         * expression.cs: the dimension arguments to the array constructors
20923         need to be converted if they are a long.
20924
20925 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
20926
20927         * class.cs: don't emit ldarg.0 if there is no parent constructor
20928         (fixes showstopper for corlib).
20929
20930 2002-06-29  Martin Baulig  <martin@gnome.org>
20931
20932         MCS now compiles corlib on GNU/Linux :-)
20933
20934         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
20935         ie. check for MethodImplOptions.InternalCall.
20936
20937         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
20938         and TypeManager.attribute_type are null, so we must explicitly check
20939         whether parent is not null to find out whether it's an attribute type.
20940         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
20941         and SetBuilder, not only if the property is neither abstract nor external.
20942         This is necessary to set the MethodImplOptions on the accessor methods.
20943         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
20944         SetBuilder, see Property.Emit().
20945
20946         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
20947         populate "System.Object", "System.ValueType" and "System.Attribute" since
20948         they've already been populated from BootCorlib_PopulateCoreTypes().
20949
20950 2002-06-29  Martin Baulig  <martin@gnome.org>
20951
20952         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
20953         is the NullLiteral, we also need to make sure that target_type is not
20954         an enum type.   
20955
20956 2002-06-29  Martin Baulig  <martin@gnome.org>
20957
20958         * rootcontext.cs (RootContext.ResolveCore): We must initialize
20959         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
20960         before calling BootstrapCorlib_ResolveDelegate ().
20961
20962 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20963
20964         * statement.cs: fixed build-breaker. All tests passed ok.
20965
20966 2002-06-27  Martin Baulig  <martin@gnome.org>
20967
20968         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
20969         for System.Decimal when compiling corlib.
20970
20971 2002-06-27  Martin Baulig  <martin@gnome.org>
20972
20973         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
20974         switch blocks which contain nothing but a default clause.
20975
20976 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
20977
20978        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
20979
20980 2002-06-27  Martin Baulig  <martin@gnome.org>
20981
20982         * ecore.cs (PropertyExpr.PropertyExpr): Call
20983         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
20984
20985         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
20986         is already a TypeBuilder.
20987
20988 2002-06-27  Martin Baulig  <martin@gnome.org>
20989
20990         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
20991         `target_type == TypeManager.array_type', not IsAssignableFrom() in
20992         the "from an array-type to System.Array" case.  This makes it work
20993         when compiling corlib.
20994
20995 2002-06-27  Martin Baulig  <martin@gnome.org>
20996
20997         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
20998         non-static PropertyExpr, set its InstanceExpression.  This makes
20999         the `ICollection.Count' property work in System/Array.cs.
21000
21001 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
21002
21003         * driver.cs: Made error handling more consistent.  Errors now
21004         tracked by Report class, so many methods which used to return int
21005         now return void.  Main() now prints success/failure and 
21006         errors/warnings message.
21007
21008         Renamed '--probe' compiler argument to '--expect-error'.  Removed
21009         the magic number return values (123 and 124).  Now, if the
21010         expected error occurs, the compiler exits with success (exit value
21011         0).  If the compilation completes without seeing that particular
21012         error, the compiler exits with failure (exit value 1).  The
21013         makefile in mcs/errors has been changed to handle the new behaviour.
21014
21015         * report.cs: Made 'expected error' number a property and renamed
21016         it from 'Probe' to 'ExpectedError'.
21017
21018         * genericparser.cs: Removed error handling support, since it is
21019         now all done by Report class.
21020
21021         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
21022         class, so parse() no longer returns an int.
21023
21024         * namespace.cs: Use Report.Error instead of GenericParser.error
21025
21026 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
21027
21028         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
21029         TypeContainer.AddOperator): At the front of the list put the
21030         explicit implementations, so they get resolved/defined first. 
21031
21032 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
21033
21034         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
21035         interface type is implemented by this TypeContainer.  Used during
21036         explicit interface implementation.
21037
21038         (Property.Define, Indexer.Define, Method.Define): Validate that
21039         the given interface in the explicit implementation is one of the
21040         base classes for the containing type.
21041
21042         Also if we are explicitly implementing an interface, but there is
21043         no match in the pending implementation table, report an error.
21044
21045         (Property.Define): Only define the property if we are
21046         not explicitly implementing a property from an interface.  Use the
21047         correct name also for those properties (the same CSC uses,
21048         although that is really not needed).
21049
21050         (Property.Emit): Do not emit attributes for explicitly implemented
21051         properties, as there is no TypeBuilder.
21052
21053         (Indexer.Emit): ditto.
21054
21055         Hiding then means that we do not really *implement* a pending
21056         implementation, which makes code fail.
21057
21058 2002-06-22  Martin Baulig  <martin@gnome.org>
21059
21060         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
21061         the return value of Object.GetType().  [FIXME: we need to do this whenever
21062         we get a type back from the reflection library].
21063
21064 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
21065
21066         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
21067
21068 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
21069
21070         * attribute.cs: Return null if we can not look up the type.
21071
21072         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
21073         the interface types found.
21074
21075         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
21076         interface types found.
21077
21078         * typemanager.cs (GetInterfaces): Make this routine returns alll
21079         the interfaces and work around the lame differences between
21080         System.Type and System.Reflection.Emit.TypeBuilder in the results
21081         result for GetInterfaces.
21082
21083         (ExpandInterfaces): Given an array of interface types, expand and
21084         eliminate repeated ocurrences of an interface.  This expands in
21085         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
21086         be IA, IB, IC.
21087
21088 2002-06-21  Martin Baulig  <martin@gnome.org>
21089
21090         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
21091         on System.Enum.
21092
21093 2002-06-21  Martin Baulig  <martin@gnome.org>
21094
21095         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
21096         and called with one of the core types, return the corresponding typebuilder for
21097         that type.
21098
21099         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
21100         element type.
21101
21102 2002-06-21  Martin Baulig  <martin@gnome.org>
21103
21104         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
21105         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
21106         (Expression.ConvertReferenceExplicit): Likewise.
21107
21108         * expression.cs (ElementAccess.DoResolve): Likewise.
21109         (ElementAccess.DoResolveLValue): Likewise.
21110
21111 2002-06-10  Martin Baulig  <martin@gnome.org>
21112
21113         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
21114         add the "value" parameter to the parameter list.
21115
21116         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
21117         to our caller.
21118
21119 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
21120
21121         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
21122         the argument to an int, uint, long or ulong, per the spec.  Also
21123         catch negative constants in array creation.
21124
21125 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
21126
21127         * class.cs: do not allow the same interface to appear twice in
21128         the definition list.
21129
21130 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
21131
21132         * ecore.cs: don't use ldlen with System.Array.
21133
21134 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
21135
21136         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
21137
21138 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
21139
21140         * modifiers.cs: produce correct field attributes for protected
21141         internal. Easy fix so miguel can work on ther harder stuff:-)
21142
21143 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
21144
21145         * pending.cs: New file.  Move the code from class.cs here.
21146         Support clearning the pending flag for all methods (when not doing
21147         explicit interface implementation).
21148
21149 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
21150
21151         * rootcontext.cs: added a couple more types needed to bootstrap.
21152
21153 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
21154
21155         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
21156         constructor in the type, instead of any constructor in the type
21157         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
21158         a bug in the Mono runtime when applying the params attribute). 
21159
21160 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
21161         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
21162
21163 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
21164
21165         * expression.cs (Unary.ResolveOperator): Use TypeManager
21166         to resolve the type.
21167
21168 2002-06-13  Ravi Pratap  <ravi@ximian.com>
21169
21170         * cs-parser.jay (enum_member_declaration): Pass in the attributes
21171         attached.
21172
21173         * enum.cs (AddEnumMember): Add support to store the attributes associated 
21174         with each member too.
21175
21176         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
21177         field builders too - this takes care of the enum member case.
21178
21179 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
21180
21181         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
21182         address-of operator on both value types and pointers.
21183
21184 2002-06-10  Martin Baulig  <martin@gnome.org>
21185
21186         * interface.cs (Interface.PopulateIndexer): Add the indexer's
21187         PropertyBuilder to the `property_builders' list.
21188
21189         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
21190         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
21191         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
21192         find any indexers which are inherited from an interface.
21193
21194 2002-06-09  Martin Baulig  <martin@gnome.org>
21195
21196         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
21197         the same type as the constant if necessary.  There's also a test-130.cs
21198         for this.
21199
21200         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
21201
21202         * typemanager.cs (TypeManager.ChangeType): Previously known as
21203         Enum.ChangeEnumType().
21204
21205 2002-06-09  Martin Baulig  <martin@gnome.org>
21206
21207         * expression.cs (Cast.TryReduce): Added support for consts.
21208
21209 2002-06-08  Ravi Pratap  <ravi@ximian.com>
21210
21211         * class.cs (Accessor): Hold attributes information so we can pass
21212         it along.
21213
21214         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
21215         Modify to pass in attributes attached to the methods.
21216
21217         (add_accessor_declaration, remove_accessor_declaration): Ditto.
21218
21219         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
21220         to handle the Accessor kind :-)
21221
21222         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
21223
21224 2002-06-08  Martin Baulig  <martin@gnome.org>
21225
21226         * expression.cs (Unary.TryReduceNegative): Added support for
21227         ULongConstants.
21228
21229 2002-06-08  Martin Baulig  <martin@gnome.org>
21230
21231         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
21232         name can't be found in the `defined_names' - the caller will do a
21233         MemberLookup in this case and thus find methods in System.Enum
21234         such as Enum.IsDefined().
21235
21236 2002-06-08  Martin Baulig  <martin@gnome.org>
21237
21238         * enum.cs (Enum.ChangeEnumType): This is a custom version of
21239         Convert.ChangeType() which works with TypeBuilder created types.
21240         (Enum.LookupEnumValue, Enum.Define): Use it here.
21241
21242         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
21243         `TypeBuilder.BaseType != null' check.
21244         (TypeContainer.FindMembers): Only lookup parent members if we
21245         actually have a parent.
21246         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
21247         (ConstructorInitializer.Resolve): Likewise.
21248
21249         * interface.cs (Interface.FindMembers): Added
21250         `TypeBuilder.BaseType != null' check.
21251
21252         * rootcontext.cs (RootContext.ResolveCore): Added
21253         "System.Runtime.CompilerServices.IndexerNameAttribute" to
21254         classes_second_stage.
21255
21256         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
21257         debug_type and trace_type when compiling with --nostdlib.       
21258
21259 2002-06-07  Martin Baulig  <martin@gnome.org>
21260
21261         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
21262         (AddField): Set it to true when adding a non-static field.
21263         (DefineType): Use `have_nonstatic_fields' to find out whether we
21264         have non-static fields, not `Fields != null'.
21265
21266 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
21267
21268         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
21269         dereferencing a null on the static-field code path)
21270
21271 2002-05-30  Martin Baulig  <martin@gnome.org>
21272
21273         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
21274         to take command line arguments.  Use reflection to call the new
21275         custom `Initialize' function on the symbol writer and pass it the
21276         command line arguments.
21277
21278         * driver.cs (--debug-args): New command line argument to pass command
21279         line arguments to the symbol writer.
21280
21281 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
21282
21283         * assign.cs (DoResolve): Forgot to do the implicit conversion to
21284         the target type for indexers and properties.  Thanks to Joe for
21285         catching this.
21286
21287 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
21288
21289         * typemanager.cs (MethodFlags): returns the method flags
21290         (Obsolete/ShouldIgnore) that control warning emission and whether
21291         the invocation should be made, or ignored. 
21292
21293         * expression.cs (Invocation.Emit): Remove previous hack, we should
21294         not do this on matching a base type, we should do this based on an attribute
21295
21296         Only emit calls to System.Diagnostics.Debug and
21297         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
21298         on the command line.
21299
21300         * rootcontext.cs: Global settings for tracing and debugging.
21301
21302         * cs-tokenizer.cs (define): New utility function to track
21303         defines.   Set the global settings for TRACE and DEBUG if found.
21304
21305 2002-05-25  Ravi Pratap  <ravi@ximian.com>
21306
21307         * interface.cs (Populate*): Pass in the TypeContainer as well as
21308         the DeclSpace as parameters so that we can create EmitContexts and
21309         then use that to apply attributes etc.
21310
21311         (PopulateMethod, PopulateEvent, PopulateProperty)
21312         (PopulateIndexer): Apply attributes everywhere.
21313
21314         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
21315         etc.
21316
21317         (ApplyAttributes): Update accordingly.
21318
21319         We now apply interface attributes for all members too.
21320
21321 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
21322
21323         * class.cs (Indexer.Define); Correctly check if we are explicit
21324         implementation (instead of checking the Name for a ".", we
21325         directly look up if the InterfaceType was specified).
21326
21327         Delay the creation of the PropertyBuilder.
21328
21329         Only create the PropertyBuilder if we are not an explicit
21330         interface implementation.   This means that explicit interface
21331         implementation members do not participate in regular function
21332         lookups, and hence fixes another major ambiguity problem in
21333         overload resolution (that was the visible effect).
21334
21335         (DefineMethod): Return whether we are doing an interface
21336         implementation. 
21337
21338         * typemanager.cs: Temporary hack until we get attributes in
21339         interfaces (Ravi is working on that) and we get IndexerName
21340         support in interfaces.
21341
21342         * interface.cs: Register the indexers as properties.
21343
21344         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
21345         warning, I have verified that this is a bug in the .NET runtime
21346         (JavaScript suffers of the same problem).
21347
21348         * typemanager.cs (MemberLookup): When looking up members for
21349         interfaces, the parent of an interface is the implicit
21350         System.Object (so we succeed in searches of Object methods in an
21351         interface method invocation.  Example:  IEnumerable x;  x.ToString
21352         ()) 
21353
21354 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
21355
21356         * class.cs (Event): Events should also register if they do
21357         implement the methods that an interface requires.
21358
21359         * typemanager.cs (MemberLookup); use the new GetInterfaces
21360         method. 
21361
21362         (GetInterfaces): The code used to lookup interfaces for a type is
21363         used in more than one place, factor it here. 
21364
21365         * driver.cs: Track the errors at the bottom of the file, we kept
21366         on going.
21367
21368         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
21369         instance if the method we are calling is static!
21370
21371 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
21372
21373         * attribute.cs (ApplyAttributes): Make this function filter out
21374         the IndexerName attribute (as that attribute in reality is never
21375         applied) and return the string constant for the IndexerName
21376         attribute. 
21377
21378         * class.cs (TypeContainer.Emit): Validate that all the indexers
21379         have the same IndexerName attribute, and if so, set the
21380         DefaultName attribute on the class. 
21381
21382         * typemanager.cs: The return value might contain other stuff (not
21383         only methods).  For instance, consider a method with an "Item"
21384         property and an Item method.
21385
21386         * class.cs: If there is a problem with the parameter types,
21387         return. 
21388
21389 2002-05-24  Ravi Pratap  <ravi@ximian.com>
21390
21391         * ecore.cs (ImplicitConversionExists): Wrapper function which also
21392         looks at user defined conversion after making a call to 
21393         StandardConversionExists - we need this for overload resolution.
21394
21395         * expression.cs : Update accordingly the various method calls.
21396
21397         This fixes 2 bugs filed against implicit user defined conversions 
21398
21399 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
21400
21401         * statement.cs: Track the result of the assignment.
21402
21403 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
21404
21405         * expression.cs (MemberAccess): Improved error reporting for
21406         inaccessible members.
21407
21408 2002-05-22  Martin Baulig  <martin@gnome.org>
21409
21410         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
21411         itself with debugging support.
21412
21413 2002-05-22  Martin Baulig  <martin@gnome.org>
21414
21415         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
21416         Removed, this isn't needed anymore.
21417
21418 2002-05-20  Martin Baulig  <martin@gnome.org>
21419
21420         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
21421         be underlying type for an enum.
21422
21423 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
21424
21425         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
21426         that splits out the loading of just the core types.
21427
21428         * rootcontext.cs (ResolveCore): Split the struct resolution in
21429         two, so we can load the enumeration underlying types before any
21430         enums are used.
21431
21432         * expression.cs (Is): Bandaid until we fix properly Switch (see
21433         bug #24985 for details).
21434
21435         * typemanager.cs (ImplementsInterface): The hashtable will contain
21436         a null if there are no interfaces implemented.
21437
21438 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
21439
21440         * cs-parser.jay (indexer_declarator): It is fine to have array
21441         parameters
21442
21443 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
21444
21445         * typemanager.cs: (RegisterBuilder): New function used to register
21446         TypeBuilders that implement interfaces.  Since
21447         TypeBuilder.GetInterfaces (as usual) does not work with lame
21448         Reflection.Emit. 
21449         (AddUserType): register interfaces.
21450
21451         (ImplementsInterface): Use the builder_to_ifaces hash if we are
21452         dealing with TypeBuilder.  Also, arrays are showing up as
21453         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
21454         methods can not be invoked on them!
21455
21456         * ecore.cs (ExplicitReferenceConversionExists): Made public.
21457         (ImplicitReferenceConversionExists): Split out from
21458         StandardConversionExists. 
21459
21460         * expression.cs (As): We were only implementing one of the three
21461         cases for the as operator.  We now implement them all.
21462         (Is): Implement the various other cases for Is as well.
21463
21464         * typemanager.cs (CACHE): New define used to control if we want or
21465         not the FindMembers cache.  Seems to have a negative impact on
21466         performance currently
21467
21468         (MemberLookup): Nested types have full acess to
21469         enclosing type members
21470
21471         Remove code that coped with instance/static returns for events, we
21472         now catch this in RealFindMembers.
21473
21474         (RealFindMembers): only perform static lookup if the instance
21475         lookup did not return a type or an event.  
21476
21477 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
21478
21479         * assign.cs (CompoundAssign): We pass more semantic information
21480         now to Compound Assignments than we did before: now we have all
21481         the information at hand, and now we resolve the target *before* we
21482         do the expression expansion, which allows the "CacheValue" method
21483         to have the effect we intended (before, a [x] += 1 would generate
21484         two differen ArrayAccess expressions from the ElementAccess,
21485         during the resolution process).
21486
21487         (CompoundAssign.DoResolve): Resolve target and original_source here.
21488
21489 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
21490
21491         * expression.cs (ArrayAccess): dropped debugging information. 
21492
21493         * typemanager.cs: Small bug fix: I was always returning i_members,
21494         instead of one of i_members or s_members (depending on which had
21495         the content).
21496
21497         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
21498         method is invoked before any code generation takes place, and it
21499         is a mechanism to inform that the expression will be invoked more
21500         than once, and that the method should use temporary values to
21501         avoid having side effects
21502
21503         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
21504
21505         * ecore.cs (Expression.CacheTemporaries): Provide empty default
21506         implementation.
21507
21508         * expression.cs (Indirection, ArrayAccess): Add support for
21509         CacheTemporaries in these two bad boys. 
21510
21511         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
21512         ldobj or ldind_ref.  
21513         (StoreFromPtr): Handle stobj as well.
21514
21515         * expression.cs (UnaryMutator): Share more code.
21516
21517         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
21518         down: I was not tracking the Filter function as well, which
21519         was affecting the results of the cache.
21520
21521 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
21522
21523         * attribute.cs: Remove the hack to handle the CharSet property on
21524         StructLayouts. 
21525
21526 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
21527
21528         * attribute.cs (DoResolve): More uglyness, we now only try to
21529         resolve the attribute partially, to extract the CharSet
21530         information (only if we are a StructLayout attribute).  Otherwise 
21531
21532         (GetExtraTypeInfo): Add some code to conditionally kill in the
21533         future this.   I am more and more convinced that the .NET
21534         framework has special code to handle the attribute setting on
21535         certain elements.
21536
21537         * expression.cs (IsParamsMethodApplicable): Revert my previous
21538         foreach change here, it was wrong.
21539
21540 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
21541
21542         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
21543         (pp_expr): do not abort on unknown input, just return.
21544         (eval): abort if there are pending chars.
21545
21546         * attribute.cs (Attribute.Resolve): Positional parameters are
21547         optional.  Deal with that case.
21548
21549         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
21550         the Ansi/Unicode/Auto information for the type.
21551
21552         (TypeContainer.DefineType): instantiate the EmitContext here, as
21553         we will be using it during the type definition (to resolve
21554         attributes) and during the emit phase.
21555
21556         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
21557         to pull type information out of the attributes
21558
21559         (Attribute.Resolve): track the constructor builder, and allow for
21560         multiple invocations (structs and classes will use this).
21561
21562         * ecore.cs (MemberLookupFinal): new version with all the
21563         parameters customizable.
21564
21565         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
21566         constructors.  Return if the result value is null (as the error
21567         would have been flagged already by MemberLookupFinal)
21568
21569         Do not allow instances of abstract classes or interfaces to be
21570         created.
21571
21572         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
21573         We have to compare the assembly property here when dealing with
21574         FamANDAssem and Assembly access modifiers, because we might be
21575         creating an assembly from *modules* (that means that we are not
21576         getting TypeBuilders for types defined in other modules that are
21577         part of this assembly).
21578
21579         (Method.Emit): If the method is marked abstract and has a body,
21580         emit an error. 
21581
21582         (TypeContainer.DefineMembers): If both the defined member and the
21583         parent name match are methods, then do not emit any warnings: let
21584         the Method.Define routine take care of flagging warnings.  But if
21585         there is a mismatch (method overrides something else, or method is
21586         overriwritten by something, then emit warning).
21587
21588         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
21589         set to null, this means `do not check for the return type on the
21590         signature'. 
21591
21592         (Method.Define): set the return type for the method signature to
21593         null, so that we get methods with the same name and parameters and
21594         different return types.  This is used to flag warning 114 (you are
21595         hiding a method, and you probably want to use the new/override
21596         keywords instead).
21597
21598         * typemanager.cs (MemberLookup): Implemented proper access
21599         control, closing a long standing set of bug reports.  The problem
21600         was that the Framework only has two bits: Public and NonPublic,
21601         and NonPublic includes private and protected methods, but we need
21602         to enforce the FamANDAssem, FamOrAssem and Family. 
21603
21604 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
21605
21606         * statement.cs (GotoCase): Return true: Ammounts to giving up
21607         knowledge on whether we return or not, and letting the other case
21608         be responsible for it.
21609
21610 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
21611
21612         * driver.cs: Do not load directories for each file processed, only
21613         do it if there is a pattern.
21614
21615         * ecore.cs: Report readonly assigns here as well, as we might have
21616         been resolved only by MemberAccess.
21617
21618         (SimpleName.SimpleNameResolve): Also be useful for LValue
21619         resolution.   We need this to propagate assign to local readonly variables
21620
21621         * typemanager.cs: Use a ptrhashtable for the criteria, because we
21622         do not want to reuse potential criteria memory.
21623
21624         * class.cs (MyEventBuilder): Set reflected_type;
21625
21626         * ecore.cs (Constantify): Added support for constifying bools.
21627
21628         (RootContext.LookupType): Added a cache for values looked up in
21629         the declaration space.
21630
21631         * typemanager.cs (FindMembers): Now is a front-end to
21632         RealFindMembers, and provides a two-level hashtable-based cache to
21633         the request.  
21634
21635         15% performance improvement: from 22.5 to 19.2 seconds.
21636
21637         * expression.cs (IsParamsMethodApplicable): use foreach.
21638         (Invocation.DoResolve): ditto.
21639         (New.DoResolve): ditto.
21640         (ArrayCreation.DoResolve): ditto.
21641
21642         * ecore.cs (FindMostEncompassingType): use foreach.
21643
21644         * delegate.cs (NewDelegate.DoResolve): Use foreach
21645
21646         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
21647         (RemoveMethods): use foreach.
21648
21649         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
21650         nested foreach statements instead of for, and also break out of
21651         the inner loop once a match is found.
21652
21653         (Invocation.OverloadResolve): Use foreach, simplify the code. 
21654
21655 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
21656
21657         * cfold.cs (BinaryFold): During an enumeration evaluation context,
21658         we actually unwrap the expression to allow for extra information
21659         to be extracted. 
21660
21661         * expression.cs: Use Shr_Un on unsigned operations. 
21662
21663 2002-05-08  Ravi Pratap  <ravi@ximian.com>
21664
21665         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
21666         applicable operators was not being considered correctly. This closes
21667         the bug Miguel reported.
21668
21669 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
21670
21671         * attribute.cs: check that the type derives from System.Attribute
21672         and report the correct error in that case (moved the duplicate code to
21673         its own method, too).
21674
21675 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
21676
21677         * attribute.cs: lookup attribute type name as the spec says: first the
21678         bare attribute name and then name + "Attribute" (nant compiles with
21679         mcs after this fix).
21680
21681 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
21682
21683         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
21684         Because of the way we parse things, we should try to see if a
21685         UIntConstant can fit in an integer.
21686
21687 2002-05-07  Ravi Pratap  <ravi@ximian.com>
21688
21689         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
21690         when we are in an explicit context.
21691
21692         (ConvertReferenceExplicit): When converting from Iface type S to Class
21693         T make sure the rules are implemented as an OR.
21694
21695         * parameter.cs (ParameterType): Make it a property for now although the
21696         purpose really isn't anything immediate.
21697
21698         * expression.cs (Is*Applicable): Do better checking on the parameter type
21699         of a ref/out parameter. The ones from the system assemblies are already 
21700         marked with the correct type so we don't need to do any correction.
21701
21702         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
21703         the object type is standard too so include that.
21704
21705 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
21706
21707         * ecore.cs (StandardConversionExists): Augment with missing code:
21708         deal with IntConstant, LongConstants and Enumerations.
21709
21710         * assign.cs: Report the error, instead of failing silently
21711
21712         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
21713         typecontainer that they are declared, because the
21714         typecontainer/namespace will have the list of using clauses that
21715         need to be applied.
21716
21717         Assembly Attributes were escaping the normal registration
21718         mechanism. 
21719
21720         (EmitCode): Apply attributes within an EmitContext that represents
21721         the container they were declared on.
21722
21723         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
21724
21725 2002-05-06  Ravi Pratap  <ravi@ximian.com>
21726
21727         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
21728         Revamp completely - make much cleaner as we now operate only
21729         on a set of Types.
21730
21731         (FindMostSpecificSource, FindMostSpecificTarget): New methods
21732         to implement the logic detailed in the spec more correctly.
21733
21734         (UserDefinedConversion): Update accordingly.
21735
21736 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
21737
21738         * statement.cs: Return flow analysis information up.
21739
21740         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
21741         and the default.
21742
21743         (token): Do not consume an extra character before calling
21744         decimal_digits.
21745
21746 2002-05-06  Piers Haken <piersh@friskit.com>
21747
21748         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
21749
21750 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
21751
21752         * class.cs (Constructor.Emit): Set the IsStatic flag in the
21753         EmitContext during the instance constructor initializer
21754         resolution, to stop access to instance variables.
21755
21756         This is mandated by the spec, last paragraph of the `constructor
21757         initializers' section. 
21758
21759 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
21760
21761         * cs-parser.jay, class.cs (Accessor): new class used to represent
21762         an accessor (get or set).  In the past we used `null' to represent
21763         a missing accessor.  But this is ambiguous because there was no
21764         way to tell in abstract indexers/properties if one of them was
21765         specified.
21766
21767         Now there is a way of addressing that.
21768
21769         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
21770         instead of FindMembers.
21771
21772         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
21773         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
21774
21775         * attribute.cs: Treat indexers and properties as the same in terms
21776         of applying attributes
21777
21778         * ecore.cs (FindMostEncompassedType): Use statically initialized
21779         EmptyExpressions()s like we do elsewhere to avoid creating useless
21780         objects (and we take this out of the tight loop).
21781
21782         (GetConversionOperators): Move the code to extract the actual
21783         operators to a separate routine to clean things up.
21784
21785 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
21786
21787         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
21788         events are always registered FieldBuilders.
21789
21790         * class.cs (FieldBase): New class shared by Fields 
21791
21792         * delegate.cs: If we are a toplevel delegate, use our full name.
21793         If we are a nested delegate, then only use our tail name.
21794
21795 2002-05-02  Ravi Pratap  <ravi@ximian.com>
21796
21797         * expression.cs (IsApplicable): Ensure that we add the "&" to
21798         ref/out types before comparing it with the type of the argument.
21799
21800         (IsParamsMethodApplicable): Ditto.
21801
21802         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
21803         silly me ;-)
21804
21805         * delegate.cs : Handle the case when we have more than one applicable
21806         method. Flag an error only when we finish checking all.
21807
21808 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
21809
21810         * expression.cs: Add support for boolean static initializers.
21811
21812 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
21813
21814         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
21815
21816         * parameter.cs (ComputeParameterTypes,
21817         ComputeAndDefineParameterTypes): Better error handling: now we
21818         clear the `types' cache if we fail during any of the type lookups.
21819         We also return the status code correctly to our caller
21820
21821         * delegate.cs: If we fail to define a delegate, abort the extra
21822         steps. 
21823
21824         * expression.cs (Binary.ResolveOperator): for
21825         operator==(object,object) and operator !=(object, object) we also
21826         have to verify that there is an implicit conversion from one to
21827         the other.
21828
21829         (ArrayAccess.DoResolve): Array Access can operate on
21830         non-variables. 
21831
21832 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
21833
21834         * assign.cs (CompoundAssign): A new class used as a "flag" that
21835         the assignment actually is happening as part of a compound
21836         assignment operator.
21837
21838         During compound assignment, a few new rules exist to enable things
21839         like:
21840
21841         byte b |= 1 + 2
21842
21843         From the spec:
21844
21845         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
21846         to the type of x) if y is implicitly convertible to the type of x,
21847         and the operator is a builtin operator and the return type of the
21848         operator is explicitly convertible to the type of x. 
21849
21850         * rootcontext.cs: Reset warning level to 2.  4 catches various
21851         "interesting" features in mcs, we must clean this up at some
21852         point, but currently am trying to kill other bugs ;-)
21853
21854         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
21855         in container classes as well.  
21856
21857         * expression.cs (Binary.ResolveOperator): Handle string case
21858         before anything else (as operator overloading does emit an error
21859         before doing anything else).
21860
21861         This code could go away when we move to a table driven model, but
21862         i could not come up with a good plan last night.
21863
21864 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
21865
21866         * typemanager.cs (CSharpName): reimplementation using regex.
21867         * class.cs: added null check for fields in Emit
21868         * rootcontext.cs: set warninglevel to 4
21869
21870 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
21871
21872         * typemanager.cs (CSharpName): reimplemented with Lupus
21873         suggestion.
21874
21875 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
21876
21877         * statement.cs (If): correclty implement Resolve, because we were
21878         not catching sem errors in there.  The same process is needed
21879         everywhere else. 
21880         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
21881
21882
21883         (Statement.Warning_DeadCodeFound): Factorize code.
21884         (While): Report dead code here too.
21885
21886         (Statement): Added Resolve virtual method to allow
21887         for resolution split from the emit code.
21888
21889 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
21890
21891         * statement.cs (EmitBoolExpression): No longer try to resolve the
21892         expression here.    
21893         (MakeBoolean): New utility function that resolve, implicitly
21894         converts to boolean and tags the expression. 
21895
21896
21897         (If, Do): Implement dead code elimination.
21898         (While): Implement loop inversion
21899
21900         (Do, While, For, If): Resolve the expression prior to calling our
21901         code generation.
21902
21903 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
21904
21905         * class.cs:
21906           - added method Report28 (warning: program has more than one entry point)
21907           - added method IsEntryPoint, implements paragraph 10.1 of the spec
21908           - modified method Method.Define, the part at the end of the method
21909
21910         * rootcontext.cs: added static public Location EntryPointLocation;
21911           
21912         * ../errors/cs0028.cs : Add test case for the above warning.              
21913
21914         * typemanager.cs:
21915           - modified method CSharpName to allow arrays of primitive type to
21916             be printed nicely (e.g. instead of System.Int32[][] it now prints
21917             int[][])
21918           - added method CSharpSignature: returns the signature of a method
21919             in string format to be used in reporting errors, warnings, etc.
21920
21921         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
21922         with String.Empty.
21923
21924 2002-04-26  Ravi Pratap  <ravi@ximian.com>
21925
21926         * delegate.cs (Define): Fix extremely silly bug where I was
21927         setting the type of the 'object' parameter of the BeginInvoke
21928         method to System.IAsyncResult instead of System.Object ;-)
21929
21930 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
21931
21932         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
21933         here. 
21934
21935         (Constructor.Emit): return if we fail to initialize the
21936         constructor.  Another door closed!  
21937
21938         * expression.cs (New.DoResolve): Improve error message (from -6 to
21939         1501).  Use DeclaredOnly lookup to find the exact constructor.
21940
21941         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
21942         loop.  This is useful.
21943
21944         * cs-parser.jay: Adjust the default parameters so that destructors
21945         have the proper signature.
21946
21947 2002-04-26  Martin Baulig  <martin@gnome.org>
21948
21949         * driver.cs (LoadAssembly): If `assembly' contains any characters
21950         which are only valid in path names and not in assembly names
21951         (currently slash, backslash and point), use Assembly.LoadFrom ()
21952         instead of Assembly.Load () on the `assembly' (before iteration
21953         over the link_paths).
21954
21955 2002-04-26  Martin Baulig  <martin@gnome.org>
21956
21957         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
21958
21959 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
21960
21961         * class.cs (Property): use the new typemanager.MemberLookup
21962
21963         (TypeContainer.MemberLookup): Implement using the
21964         TypeManager.MemberLookup now. 
21965
21966         * typemanager.cs: Make MemberLookup a function of the TypeManager,
21967         and return MemberInfos, so that these can be used without an
21968         EmitContext (what we had before).
21969
21970 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
21971
21972         * expression.cs: Fix the case where the argument to params if the
21973         type of the params.  I omitted handling this before.   Fixed
21974
21975 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
21976
21977         * driver.cs: Call BootCorlib_PopulateCoreType
21978
21979         * class.cs (Property.CheckBase): Check for properties only, not
21980         for all members. 
21981
21982         * interface.cs: Temporary hack: try/catch around the
21983         CustomAttributeBuilder, because I am getting an exception that I
21984         do not understand.
21985
21986         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
21987         types whose definitions are required to be there (attributes are
21988         defined before standard types).
21989
21990         Compute definitions as we boot the various types, as they are used
21991         immediately (value_type class will need object_type, but if we do
21992         not initialize object_type, we will pass a null, which will let
21993         the runtime pick the System.Object from the existing corlib, which
21994         is not what we want).
21995
21996 2002-04-22  Patrik Torstensson <totte@labs2.com>
21997
21998         * cs-tokenizer.cs: fixed a number of trim() issues.
21999
22000 2002-04-22  Ravi Pratap  <ravi@ximian.com>
22001
22002         * expression.cs (Argument.Type): Ensure that we return the correct
22003         type when we have out or ref parameters [in which case we 
22004         append a "&"].
22005
22006 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
22007
22008         * class.cs (Property, Indexer): Allow extern modifier in there. 
22009
22010         * typemanager.cs (InitBaseTypes): Initializes object_type and
22011         value_type, since those will be used early on during the bootstrap
22012         process to compile corlib.
22013
22014         (InitCoreTypes): Move code from here to InitBaseTypes.
22015
22016 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
22017
22018         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
22019         single-dimension arrays as using the ldlen opcode.  
22020
22021         Daniel Lewis discovered this optimization.  
22022
22023         * typemanager.cs: Add signature for System.Array::get_Length
22024
22025 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22026
22027         * statement.cs: report the error when the foreach does not apply to an
22028         array nor a collection.
22029
22030 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
22031
22032         * expression.cs: Add implicit conversions to the operator ~.
22033
22034         * constant.cs (DecimalConstant.Emit): Emit decimal value.
22035
22036         * typemanager.cs: Locate the decimal constructor.
22037
22038 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22039
22040         * attribute.cs: use the new property of TypeOf.
22041         * expression.cs: added 'get' property around typearg.
22042
22043         These changes fix a build breaker reported by NickD. Is this the
22044         correct way to fix?  If not, please, revert my changes and make it
22045         work :-).
22046
22047 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
22048
22049         * attribute.cs: Add support for typeof in attribute invocations.
22050         I am not sure that this is right though.
22051
22052 2002-04-14  Duncan Mak  <duncan@ximian.com>
22053
22054         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
22055         Binary.Operator.Division case.
22056
22057 2002-04-13  Ravi Pratap  <ravi@ximian.com>
22058
22059         * class.cs (DefineType): Ensure that we do a proper check on
22060         attribute types and also register it with the TypeManager.
22061
22062         (TypeContainer.Targets): The default for attribute types is
22063         AttributeTargets.All.
22064
22065         * attribute.cs (ApplyAttributes): Registering the attribute type
22066         is done elsewhere, not when we discover we have a Usage attribute.
22067
22068 2002-04-12  Ravi Pratap  <ravi@ximian.com>
22069
22070         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
22071         and get rid of is_delegate parameter.
22072
22073         * everywhere : update.
22074
22075 2002-04-12  Ravi Pratap  <ravi@ximian.com>
22076
22077         * cs-parser.jay (compilation_unit): Revamp completely to use
22078         some new ideas that I got from Rhys' grammar to solve the problems
22079         with assembly level attributes.
22080
22081         (outer_declaration): New grammar production.
22082
22083         (attribute_sections): Add.
22084
22085         (opt_attributes): Base on attribute_sections
22086
22087         (namespace_declaration): Allow opt_attributes to tackle the case
22088         when we have assembly level attributes - we are clever in this
22089         regard now ;-)
22090
22091         * attribute.cs (ApplyAttributes): Do not worry about assembly 
22092         attributes in the non-global context.
22093
22094         * rootcontext.cs (AddGlobalAttributes): Go back to using this
22095         instead of SetGlobalAttributes.
22096
22097         * class.cs, rootcontext.cs : Ensure we define and generate 
22098         attribute types before anything else.
22099
22100         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
22101         and flag the new error -20 for the case when the attribute type
22102         does not have valid targets specified. csc does not catch this.
22103
22104         * ../errors/errors.txt : update for error # -20
22105
22106 2002-04-11  Ravi Pratap  <ravi@ximian.com>
22107
22108         * support.cs (InternalParameters.ParameterModifier): Do some null
22109         checking and return sane values.
22110
22111         * class.cs (Method.Define): If we are a PInvoke method, ensure
22112         that we are static and extern. Report error # 601
22113
22114         * ../errors/cs0601.cs : Add test case for the above error.
22115
22116 2002-04-07  Ravi Pratap  <ravi@ximian.com>
22117
22118         * rootcontext.cs (attribute_types): We need to keep type of
22119         all attribute types separately and emit code for them first.
22120
22121         (RegisterAttribute) : Implement.
22122
22123         * class.cs (DefineType): Check if the current Type is a custom
22124         attribute type and register it accordingly.
22125
22126         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
22127         adding the first attribute twice and rename to
22128
22129         (SetGlobalAttributes): this.
22130
22131         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
22132         lookups.
22133
22134         * attribute.cs (ApplyAttributes): Take an additional argument telling us
22135         if we are processing global arguments. Hmm, I am unsure of this.
22136
22137 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22138
22139         * expression.cs: added static array of strings to avoid calling
22140         Enum.ToString () for Operator in Binary. Significant recover of
22141         performance.
22142
22143 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
22144
22145         * class.cs (FindMembers): Allow the Builders of the various
22146         members to be null.  If they are skip them.  This only happens
22147         during the PInvoke declaration.
22148
22149 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
22150
22151         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
22152         failure, so we do not keep going afterwards.
22153
22154         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
22155         wanted to pass `false' as the `is_delegate' argument.  If this is
22156         the case, why not use delegate_type == null to mean `is_delegate =
22157         false' and anything else as is_delegate = true.
22158
22159 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
22160
22161         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
22162         code for the section, not the beginning of the tests.
22163
22164 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
22165
22166         * cfold.cs: Handle operator + (Enum x, Underlying x) 
22167
22168         * expression.cs (Binary): same.  Warn about errors where we have
22169         Enum/Enum in operator + as well.
22170
22171 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
22172
22173         * statement.cs:
22174                 - added support for switch(bool)
22175                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
22176                 - add TableSwitchEmit() to handle table-based switch statements
22177
22178 2002-04-05  Ravi Pratap  <ravi@ximian.com>
22179
22180         * expression.cs (Invocation.OverloadResolve): Factor out code which
22181         does parameter compatibility checking with arguments so that we can 
22182         re-use the code even from Delegate.VerifyApplicability
22183
22184         (VerifyArgumentsCompat): Move above code here.
22185
22186         * delegate.cs (VerifyApplicability): Get rid of duplicate code
22187         and instead make a call to the above method.
22188
22189 2002-03-31  Ravi Pratap  <ravi@ximian.com>
22190
22191         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
22192         We use it to keep track of classes which are attribute types.
22193
22194 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
22195
22196         * delegate.cs (Delegate.Define): Correctly define the types in the
22197         presence of fixed and array parameters.
22198
22199         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
22200         doing FindMembers.
22201
22202         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
22203         include NonPublic after the first iteration.
22204
22205         * class.cs (Indexer.CheckBase): Only check if both parents are
22206         non-null. 
22207
22208         * cs-parser.jay (accessor_body): If empty, set to null.
22209
22210         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
22211         same code path here to resolve constants names that we did have in
22212         MemberAccess.DoResolve.  There is too much code duplicated here.
22213
22214 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
22215
22216         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
22217
22218         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
22219         to MakeUnionSet.
22220
22221         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
22222         tokens, numbers and strings.
22223
22224         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
22225         parenthesis.
22226
22227         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
22228         asyncronous parameters and the regular parameters.  
22229
22230         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
22231         specify the target directory.
22232
22233         * expression.cs: (This.DoResolve): Simplify
22234         (As.Emit): Optimize, do not generate IsInst if the expression is
22235         always of the given type.
22236
22237         (Is.DoResolve): Bug fix, we were reporting both always/never for
22238         the is expression.
22239
22240         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
22241         creating too many unnecessary arrays.
22242
22243 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
22244
22245         * class.cs (EmitFieldInitializer): Use Assign expression to assign
22246         fields instead of rolling our own initializer.   Takes care of all
22247         implicit conversions, and drops unnecessary static checks/argument.
22248
22249 2002-03-31  Dick Porter  <dick@ximian.com>
22250
22251         * driver.cs: use the GetDirectories() return values properly, and
22252         use "/" as path separator.
22253
22254 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
22255
22256         * expression.cs (Unary): Optimize - - expr into expr.
22257         (Binary): Optimize a + (-b) into a -b.
22258
22259         * codegen.cs (CodeGen): Made all methods static.
22260
22261 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
22262
22263         * rootcontext.cs: 
22264
22265         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
22266         TypeBuilder property.
22267
22268         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
22269         instead. 
22270
22271         * tree.cs: Removed the various RecordXXXX, and replaced with a
22272         single RecordDecl.  Removed all the accessor methods, and just
22273         left a single access point Type 
22274
22275         * enum.cs: Rename DefineEnum to DefineType.
22276
22277         * decl.cs: New abstract method `DefineType' used to unify the
22278         Defines for Enumerations, Interfaces, TypeContainers and
22279         Delegates.
22280
22281         (FindType): Moved LookupInterfaceOrClass here.  Moved the
22282         LookupBaseClasses method that used to live in class.cs and
22283         interface.cs here, and renamed to FindType.
22284
22285         * delegate.cs: Implement DefineType.  Take advantage of the
22286         refactored pattern for locating the parent builder without taking
22287         the parent_builder argument (which we know does not work if we are
22288         nested, and triggering a toplevel definition).
22289
22290 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
22291
22292         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
22293         accessibility of a member has changed during override and report
22294         an error if so.
22295
22296         * class.cs (Method.Define, Property.Define): Only complain on
22297         overrides if the method is private, any other accessibility is
22298         fine (and since we just checked the permission is the same, we are
22299         good to go).
22300
22301         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
22302         and elif are processed always.  The other pre-processing
22303         directives are only processed if we are "taking" the path
22304
22305 2002-03-29  Martin Baulig  <martin@gnome.org>
22306
22307         * class.cs (Method.Emit): Only emit symbolic debugging info if the
22308         current location is not Null.
22309
22310         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
22311         a separate method so we can profile it.
22312
22313         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
22314         `span.Seconds' are just seconds, but no minutes or hours.
22315         (MainDriver): Profile the CodeGen.SaveSymbols calls.
22316
22317 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
22318
22319         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
22320         Remove the gratuitous set of Final:
22321
22322                                 // If an interface implementation, then we can set Final.
22323                                 if (((flags & MethodAttributes.Abstract) == 0) &&
22324                                     implementing.DeclaringType.IsInterface)
22325                                         flags |= MethodAttributes.Final;
22326
22327         I do not know what I was smoking when I used that.
22328
22329
22330         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
22331         step into fixing the name resolution issues for delegates and
22332         unifying the toplevel name resolution.
22333
22334 2002-03-28  Martin Baulig  <martin@gnome.org>
22335
22336         * class.cs (Method.Emit): If we have a symbol writer, call its
22337         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
22338         tell it about the current method.
22339
22340         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
22341         writer that we're going to emit the first byte of IL code for a new
22342         statement (a new source line).
22343         (EmitContext.EmitTopBlock): If we have a symbol writer, call
22344         EmitContext.Mark() before emitting any code.
22345
22346         * location.cs (SymbolDocument): Return null when we're Null.
22347
22348         * statement.cs (Statement): Moved the `Location loc' variable here.
22349         (Statement.EmitBoolExpression): If we have a symbol writer, call
22350         ec.Mark() before emitting any code to tell it that we're at the
22351         beginning of a new statement.
22352         (StatementExpression): Added `Location' argument to the constructor.
22353         (Block): Added public readonly variable `StartLocation' and public
22354         variable `EndLocation'.  The latter is to be set using SetEndLocation().
22355         (Block): Added constructor which takes a start and end location.
22356         (Block.SetEndLocation): New method. This sets the end location.
22357         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
22358         local variables we create.
22359         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
22360         each statement and do also mark the begin and end of the block.
22361
22362         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
22363         tell it the current lexer.Location, use Location.Null for the end of the
22364         block.
22365         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
22366         current block, set its end location using SetEndLocation().
22367         (statement_expression): StatementExpression constructor now takes the
22368         lexer.Location as additional argument.
22369         (for_statement, declare_local_variables): Likewise.
22370         (declare_local_variables): When creating a new implicit block, use the
22371         new Block constructor and pass it the lexer.Location.
22372
22373 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
22374
22375         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
22376         members also on the parent interfaces recursively.
22377
22378 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
22379
22380         * report.cs: Use new formats, since Gonzalo finished the missing
22381         bits. 
22382
22383         * expression.cs (Binary.ResolveOperator): added missing operator|
22384         operator& and operator^ for bool/bool.
22385
22386         * cs-parser.jay: CheckDef now takes a Location argument that is
22387         used to report errors more precisly (instead of reporting the end
22388         of a definition, we try to track something which is a lot closer
22389         to the source of the problem).
22390
22391         * cs-tokenizer.cs: Track global token use, so we can properly flag
22392         the use of #define/#undef after the first token has been seen.
22393
22394         Also, rename the reportXXXX to Error_DescriptiveName
22395
22396         * decl.cs (DeclSpace.IsTopLevel): Move property here from
22397         TypeContainer, so that Enum and Interface can use this too.
22398
22399         * class.cs (TypeContainer.LookupInterfaceOrClass,
22400         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
22401         `builder' argument.  Typically this was used to pass the parent
22402         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
22403         the definition).  
22404
22405         The problem is that a nested class could trigger the definition of
22406         a toplevel class, and the builder would be obviously wrong in that
22407         case. 
22408
22409         So we drop this argument, and we compute dynamically the
22410         TypeBuilder/ModuleBuilder (the correct information was available
22411         to us anyways from DeclSpace.Parent)
22412
22413         * interface.cs (Interface.DefineInterface): Drop builder
22414         parameter cleanup like class.cs
22415
22416         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
22417         like class.cs
22418
22419         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
22420         values. 
22421
22422         (Try.Emit): Propagate the returns value from the statement.
22423
22424         (Return.Emit): Even if we are leavning 
22425
22426         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
22427
22428         * modifiers.cs: Fix the computation of MethodAttributes flags.
22429
22430 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
22431
22432         * driver.cs: allow compilation of files that start with '/'.
22433         Add a default case when checking the argument of --target.
22434
22435 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
22436
22437         * interface.cs: Implement the same search algorithm for types in
22438         the interface code.
22439
22440         * delegate.cs: Do not allow multiple definition.
22441
22442         * Recovered ChangeLog that got accidentally amputated
22443
22444         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
22445
22446         * rootcontext.cs: Load manually enum to allow core classes to
22447         contain enumerations.
22448
22449         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
22450         Update to new static methods in TypeManager.
22451
22452         * typemanager.cs (GetMethod, GetConstructor): Use our
22453         implementation of FindMembers to find the members, since during
22454         corlib compilation, the types are TypeBuilders and GetMethod and
22455         GetConstructor do not work.
22456
22457         Make all methods in TypeManager static.
22458
22459         (InitCodeHelpers): Split the functionality from
22460         the InitCodeTypes function.
22461
22462         * driver.cs: Call InitCodeHelpers after we have populated the
22463         types. 
22464
22465         * cs-parser.jay (delegate_declaration): we did not used to compute
22466         the delegate name correctly for void delegates.
22467
22468 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
22469
22470         * rootcontext.cs (RootContext): Init the interface_resolve_order
22471         and type_container_resolve_order always.
22472
22473         (ResolveCore, BootstrapCorlib_ResolveClass,
22474         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
22475         compiler when compiling with --nostdlib
22476
22477         * class.cs (TypeContainer.DefineType): Check that our parent is
22478         not null.  This test is most important when we are bootstraping
22479         the core types.
22480
22481         * codegen.cs: Split out the symbol writing code.
22482
22483 2002-03-25  Martin Baulig  <martin@gnome.org>
22484
22485         * driver.cs (-g): Made -g an alias for --debug.
22486
22487 2002-03-24  Martin Baulig  <martin@gnome.org>
22488
22489         * codegen.cs (SymbolWriter): New public variable. Returns the
22490         current symbol writer.
22491         (CodeGen): Added `bool want_debugging_support' argument to the
22492          constructor. If true, tell the ModuleBuild that we want debugging
22493         support and ask it for the ISymbolWriter.
22494         (Save): If we have a symbol writer, call it's Close() method after
22495         saving the assembly.
22496
22497         * driver.c (--debug): New command line argument to create a
22498         debugger information file.
22499
22500         * location.cs (SymbolDocument): New public property. Returns an
22501         ISymbolDocumentWriter object for the current source file or null
22502         if we don't have a symbol writer.
22503
22504 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
22505
22506         * driver.cs (LoadAssembly): Correctly return when all the paths
22507         have been tried and not before.
22508
22509         * statement.cs (Switch.Emit): return the actual coverage for this
22510         statement (returns/not-returns)
22511
22512         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
22513         switch of the statement if we are the last switch section.  That
22514         kills two problems: try/catch problems (we used to emit an empty
22515         nop at the end) and switch statements where all branches would
22516         return. 
22517
22518 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
22519
22520         * driver.cs: Add default assemblies (the equivalent to the
22521         Microsoft CSC.RSP file)
22522
22523         * cs-tokenizer.cs: When updating `cols and setting it to zero,
22524         also update tokens_seen and set it to false.
22525
22526         * driver.cs: Implement --recurse for Mike.
22527
22528         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
22529         correctly splitting out the paths.
22530
22531 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
22532
22533         * interface.cs (Interface.PopulateProperty): Instead of using
22534         `parent' as the declaration space for the set parameters, use
22535         `this' 
22536
22537         * support.cs (InternalParameters): InternalParameters constructor
22538         takes a DeclSpace instead of a TypeContainer.
22539
22540         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
22541         types are being initialized, load the address of it before calling
22542         the function.  
22543
22544         (New): Provide a mechanism to disable the generation of local
22545         value type temporaries when the caller will be providing us with
22546         an address to store it.
22547
22548         (ArrayCreation.EmitDynamicInitializers): Use it.
22549
22550 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
22551
22552         * expression.cs (Invocation.EmitArguments): Only probe for array
22553         property if there is more than one argument.  Sorry about that.
22554
22555         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
22556         empty param arrays.
22557
22558         * class.cs (Method.LabelParameters): Fix incorrect code path that
22559         prevented the `ParamArrayAttribute' from being applied to the
22560         params attribute.
22561
22562 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
22563
22564         * support.cs (ReflectionParameters): Correctly compute whether the
22565         last argument is a params array.  Fixes the problem with
22566         string.Split ('a')
22567
22568         * typemanager.cs: Make the assemblies array always be non-null
22569         (empty, but non-null)
22570
22571         * tree.cs (RecordDecl): New function that abstracts the recording
22572         of names.  This reports error 101, and provides a pointer to the
22573         previous declaration.  Fixes a crash in the compiler.
22574
22575         * cs-parser.jay (constructor_declaration): Update to new grammar,
22576         and provide a constructor_body that can be empty.
22577
22578 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
22579
22580         * driver.cs: Add support for --resources.
22581
22582         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
22583         Make all types for the various array helper methods be integer.
22584
22585         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
22586         CheckState to ConvCast.
22587
22588         (ConvCast): Now it takes a `checked' state argument, to avoid
22589         depending on the emit context for the conversion, and just using
22590         the resolve time setting.
22591
22592         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
22593         instead of Invocation.EmitArguments.  We do not emit the original
22594         arguments, instead we emit those which have been converted to
22595         unsigned int expressions.
22596
22597         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
22598
22599         * codegen.cs: ditto.
22600
22601         * expression.cs (LocalVariableReference): Drop the use of the
22602         Store function that depended on the variable index.
22603
22604         * statement.cs (VariableInfo): Drop the `Idx' property from this
22605         class, as this is not taking into account the indexes for
22606         temporaries tat we generate during the execution, getting the
22607         indexes wrong.
22608
22609         * class.cs: First emit class initializers, then call the parent
22610         constructor. 
22611
22612         * expression.cs (Binary): Fix opcode emision.
22613         (UnaryMutator.EmitCode): Support checked code generation
22614
22615         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
22616         matches for events for both the Static and Instance scans,
22617         pointing to the same element.   Fix that.
22618
22619 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
22620
22621         * rootcontext.cs (ResolveTree): Always set the
22622         interface_resolve_order, because nested interfaces will be calling
22623         into us.
22624
22625         * class.cs (GetInterfaceOrClass): Track the same resolution
22626         process used by TypeManager.LookupType.  This fixes the nested
22627         type lookups in class declarations (separate path from
22628         LookupType). 
22629
22630         (TypeContainer.DefineType): Also define nested interfaces.
22631         (TypeContainer.RegisterOrder): New public function used to
22632         register the order in which child interfaces need to be closed.
22633
22634         Nested interfaces need to be closed after their parents have been
22635         created. 
22636
22637         * interface.cs (InterfaceAttr): Put all the logic for computing
22638         the interface attribute here. 
22639
22640         (DefineInterface): Register our interface order with the
22641         RootContext or with the TypeContainer depending on the case.
22642
22643 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
22644
22645         * cs-parser.jay: rework foreach statement to work with the new
22646         changes to the policy on SimpleNames.
22647
22648         * report.cs: support Stacktrace on warnings as well.
22649
22650         * makefile: drop --unsafe and /unsafe from the compile.
22651
22652 2002-03-13  Ravi Pratap  <ravi@ximian.com>
22653
22654         * ecore.cs (StandardConversionExists): Modify to take an Expression
22655         as the first parameter. Ensure we do null -> reference type conversion
22656         checking.
22657
22658         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
22659         temporary Expression objects.
22660
22661 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
22662
22663         * interface.cs: workaround bug in method overloading resolution
22664         (there is already a bugzilla bug for it).
22665
22666 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
22667
22668         We could also solve this problem by having a separate path for
22669         performing type lookups, instead of DoResolve, we could have a
22670         ResolveType entry point, and only participating pieces of the
22671         production (simplename, deref, array) would implement this. 
22672
22673         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
22674         signal SimpleName to only resolve type names and not attempt to
22675         resolve anything else.
22676
22677         * expression.cs (Cast): Set the flag.
22678
22679         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
22680
22681         * class.cs: Only report 108 if there is no `new' modifier.
22682
22683         * cs-parser.jay: rework foreach statement to work with the new
22684         changes to the policy on SimpleNames.
22685
22686         * report.cs: support Stacktrace on warnings as well.
22687
22688         * makefile: drop --unsafe and /unsafe from the compile.
22689
22690 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
22691
22692         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22693         lookups here, instead of doing that at parse time.  This means
22694         that our grammar will not introduce `LocalVariableReferences' as
22695         expressions at this point.  That solves the problem of code like
22696         this:
22697
22698         class X {
22699            static void Main ()
22700            { int X = 1;
22701             { X x = null }}}
22702
22703         This is only half the fix.  The full fix requires parameters to
22704         also be handled in this way.
22705
22706         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
22707         makes the use more obvious of the DeclSpace.  The
22708         ec.TypeContainer.TypeBuilder is now only used to pull the
22709         TypeBuilder for it.
22710
22711         My theory is that I can get rid of the TypeBuilder completely from
22712         the EmitContext, and have typecasts where it is used (from
22713         DeclSpace to where it matters).  
22714
22715         The only pending problem is that the code that implements Aliases
22716         is on TypeContainer, and probably should go in DeclSpace.
22717
22718         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22719         lookups here, instead of doing that at parse time.  This means
22720         that our grammar will not introduce `LocalVariableReferences' as
22721         expressions at this point.  That solves the problem of code like
22722         this:
22723
22724         class X {
22725            static void Main ()
22726            { int X = 1;
22727             { X x = null }}}
22728
22729         This is only half the fix.  The full fix requires parameters to
22730         also be handled in this way.
22731
22732         * class.cs (Property.DefineMethod): When implementing an interface
22733         method, set newslot, when implementing an abstract method, do not
22734         set the flag (before we tried never setting it, or always setting
22735         it, which is the difference).
22736         (Indexer.DefineMethod): same.
22737         (Method.DefineMethod): same.
22738
22739         * ecore.cs: Only set the status used flag if we get back a Field.
22740
22741         * attribute.cs: Temporary hack, so Paolo can keep working.
22742
22743 2002-03-08  Ravi Pratap  <ravi@ximian.com>
22744
22745         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
22746         the unmanaged type in the case we have a MarshalAs attribute.
22747
22748         (Resolve): Handle the case when we are parsing the special MarshalAs
22749         attribute [we need to store the unmanaged type to use later]
22750
22751         * typemanager.cs (marshal_as_attr_type): Built in type for the 
22752         MarshalAs Attribute.
22753
22754         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
22755         on parameters and accordingly set the marshalling info.
22756
22757 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
22758
22759         * class.cs: Optimizing slightly by removing redundant code after
22760         we switched to the `NoTypes' return value.
22761         (Property.DefineMethod): use NoTypes here too.
22762
22763         This fixes the bug I introduced in my last batch of changes.
22764
22765 2002-03-05  Ravi Pratap  <ravi@ximian.com>
22766
22767         * tree.cs (RecordEnum): Add. We now keep track of enums too.
22768
22769         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
22770         Enums since those are types too. 
22771
22772         * cs-parser.jay (enum_declaration): Record enums as we parse them.
22773
22774         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
22775         thanks to a call during the lookup process.
22776
22777 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
22778
22779         * statement.cs (Foreach): Lots of work to accomodate a particular
22780         kind of foreach statement that I had not kept in mind.  It is
22781         possible to have foreachs on classes that provide a GetEnumerator
22782         method that return objects that implement the "pattern" for using
22783         a foreach, there is no need to support GetEnumerator
22784         specifically. 
22785
22786         This is needed to compile nant.
22787
22788         * decl.cs: Only report 114 if the member is not `Finalize' and if
22789         the warning level is at least 2.
22790
22791         * class.cs: Moved the compare function from Method to
22792         MethodSignature. 
22793
22794         (MethodSignature.InheritableMemberSignatureCompare): Add new
22795         filter function that is used to extract inheritable methods from a
22796         class. 
22797
22798         (Method.Define): Use the new `inheritable_method_signature_filter'
22799         delegate
22800
22801         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
22802         command. 
22803
22804 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
22805
22806         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
22807
22808         * cs-parser.jay: Add opt_semicolon to the interface declaration.
22809
22810         * expression.cs: Pass location information to
22811         ConvertImplicitStandard. 
22812
22813         * class.cs: Added debugging code to track return values from
22814         interfaces. 
22815
22816 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
22817
22818         * expression.cs (Is.DoResolve): If either side of the `is' is an
22819         interface, do not flag the warning.
22820
22821         * ecore.cs (ImplicitReferenceConversion): We need a separate test
22822         for interfaces
22823
22824         * report.cs: Allow for --fatal to be used with --probe.
22825
22826         * typemanager.cs (NoTypes): Move the definition for the empty Type
22827         array here. 
22828
22829         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
22830         properties. 
22831         (TypeContainer.DefineProxy): New function used to proxy to parent
22832         implementations when implementing interfaces.
22833         (TypeContainer.ParentImplements): used to lookup if our parent
22834         implements a public function that is required by an interface.
22835         (TypeContainer.VerifyPendingMethods): Hook this up.
22836
22837         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
22838         `modules' and `assemblies' arraylists into arrays.  We only grow
22839         these are the very early start up of the program, so this improves
22840         the speedof LookupType (nicely measured).
22841
22842         * expression.cs (MakeByteBlob): Replaced unsafe code with
22843         BitConverter, as suggested by Paolo.
22844
22845         * cfold.cs (ConstantFold.Binary): Special case: perform constant
22846         folding of string concatenation, but if either side is a string,
22847         and the other is not, then return null, and let the runtime use
22848         the concatenation on the string plus the object (using
22849         `Object.ToString'). 
22850
22851 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
22852
22853         Constant Folding has been implemented now.
22854
22855         * expression.cs (Unary.Reduce): Do not throw an exception, catch
22856         the error instead on types that are not supported in one's
22857         complement. 
22858
22859         * constant.cs (Constant and all children): New set of functions to
22860         perform implict and explicit conversions.
22861
22862         * ecore.cs (EnumConstant): Implement the new functions to perform
22863         conversion by proxying to the child expression.
22864
22865         * codegen.cs: (ConstantCheckState): Constant evaluation has its
22866         own separate setting that can not be turned off from the command
22867         line using --unchecked or --checked and is only controlled using
22868         the checked/unchecked statements and expressions.  This setting is
22869         used by the constant folder to flag errors.
22870
22871         * expression.cs (CheckedExpr, UncheckedExpr): Set the
22872         ConstantCheckState as well.   
22873
22874         During Resolve, they also have to flag the state, because the
22875         constant folder runs completely in the Resolve phase.
22876
22877         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
22878         well.
22879
22880 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
22881
22882         * cfold.cs: New file, this file contains the constant folder.
22883
22884         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
22885         argument to track whether we are using the resulting address to
22886         load or store a value and provide better error messages. 
22887
22888         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
22889         new AddressOf arguments.
22890
22891         * statement.cs (Foreach.EmitCollectionForeach): Update
22892
22893         * expression.cs (Argument.Emit): Call AddressOf with proper
22894         arguments to track usage.
22895
22896         (New.DoEmit): Call AddressOf with new arguments.
22897
22898         (Unary.Emit): Adjust AddressOf call.
22899
22900 2002-03-01  Ravi Pratap  <ravi@ximian.com>
22901
22902         * cs-parser.jay (member_access): Change the case for pre-defined types
22903         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
22904         this suggestion.
22905
22906         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
22907         a method body.
22908
22909         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
22910         essentially like methods and apply attributes like MethodImplOptions to them too.
22911
22912         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
22913         not being null.
22914
22915         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
22916         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
22917         is the DeclSpace.
22918
22919         * Update code everywhere accordingly.
22920
22921         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
22922
22923         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
22924
22925 2002-02-28  Ravi Pratap  <ravi@ximian.com>
22926
22927         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
22928         try performing lookups against those instead of jumping straight into using
22929         the 'using' clauses.
22930
22931         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
22932
22933         (LookupType): Perform lookups in implicit parents too.
22934
22935         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
22936         sequence as RootContext.LookupType. 
22937
22938         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
22939         the various cases of namespace lookups into this method.
22940
22941 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
22942
22943         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
22944         in positional arguments)
22945
22946         * class.cs (Operator): Update the AllowedModifiers to contain
22947         extern. 
22948
22949         * cs-parser.jay: Update operator declaration to allow for the
22950         operator body to be empty.
22951
22952         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
22953         values. 
22954
22955 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
22956
22957         * class.cs (Method.Emit): Label parameters.
22958
22959         * driver.cs: Return 1 or 0 as the program exit code.
22960
22961 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
22962
22963         * expression.cs: Special case the `null' object when trying to
22964         auto-compute the type, as anything can be explicitly converted to
22965         that. 
22966
22967         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
22968         spotting this Paolo.
22969
22970         (Expression.ImplicitNumericConversion): Perform comparissions of
22971         the type using the underlying type in the case of an enumeration
22972         rather than using the enumeration type for the compare.
22973
22974         Cope with the underlying == type case, which is not possible to
22975         catch before. 
22976
22977         (Expression.ConvertNumericExplicit): Perform comparissions of
22978         the type using the underlying type in the case of an enumeration
22979         rather than using the enumeration type for the compare.
22980
22981         * driver.cs: If the user does not supply an extension, assume .exe
22982
22983         * cs-parser.jay (if_statement): Rewrote so that we can track the
22984         location for the if statement.
22985
22986         * expression.cs (Binary.ConstantFold): Only concat strings when
22987         the operation is "+", not everything ;-)
22988
22989         * statement.cs (Statement.EmitBoolExpression): Take a location
22990         argument. 
22991         (If, While, Do): Track location.
22992
22993         * expression.cs (Binary.ResolveOperator): In the object + string
22994         case, I was missing a call to ConvertImplicit
22995
22996 2002-02-25  Ravi Pratap  <ravi@ximian.com>
22997
22998         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
22999         Location arguments. Ensure we use RootContext.LookupType to do our work
23000         and not try to do a direct Type.GetType and ModuleBuilder.GetType
23001
23002         * interface.cs (PopulateMethod): Handle the type of the parameter being
23003         null gracefully.
23004
23005         * expression.cs (Invocation.BetterFunction): Handle the case when we 
23006         have a params method with no fixed arguments and a call is made with no
23007         arguments.
23008
23009 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
23010
23011         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
23012         the verbatim-string-literal
23013
23014         * support.cs (InternalParameters.ParameterModifier): handle null
23015         fixed parameters.
23016         (InternalParameters.ParameterType): ditto.
23017
23018         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
23019         duplicating the name of the variable parameter.
23020         (GetParameterByName): Fix bug where we were not looking up array
23021         paramters if they were the only present (thanks Paolo!).
23022         (GetParameterInfo): We only have an empty set of types if both
23023         fixed and array are set to null.
23024         (GetParameterInfo-idx): Handle FixedParameter == null
23025
23026         * cs-parser.jay: Handle the case where there is no catch
23027         statements (missing null test).
23028
23029 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
23030
23031         * driver.cs (MainDriver): Be conservative on our command line
23032         handling.
23033
23034         Catch DirectoryNotFoundException when calling GetFiles.
23035
23036         (SplitPathAndPattern): Used to split the input specification into
23037         a path and a pattern that we can feed to Directory.GetFiles.
23038
23039 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
23040
23041         * statement.cs (Fixed): Implement the last case of the Fixed
23042         statement (string handling).
23043
23044         * expression.cs (StringPtr): New class used to return a char * to
23045         a string;  Used by the Fixed statement.
23046
23047         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
23048
23049         * expression.cs (Binary.ResolveOperator): Remove redundant
23050         MemberLookup pn parent type.
23051         Optimize union call, we do not need a union if the types are the same.
23052         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
23053         type.
23054
23055         Specialize the use of MemberLookup everywhere, instead of using
23056         the default settings. 
23057
23058         (StackAlloc): Implement stackalloc keyword.
23059
23060         * cs-parser.jay: Add rule to parse stackalloc.
23061
23062         * driver.cs: Handle /h, /help, /?
23063
23064         * expression.cs (MakeByteBlob): Removed the hacks we had in place
23065         before we supported unsafe code.
23066
23067         * makefile: add --unsafe to the self compilation of mcs.
23068
23069 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
23070
23071         * expression.cs (PointerArithmetic): New class that is used to
23072         perform pointer arithmetic.
23073         (Binary.Resolve): Handle pointer arithmetic
23074         Handle pointer comparission.
23075         (ArrayPtr): Utility expression class that is used to take the
23076         address of an array.
23077
23078         (ElementAccess): Implement array access for pointers
23079
23080         * statement.cs (Fixed): Implement fixed statement for arrays, we
23081         are missing one more case before we are done.
23082
23083         * expression.cs (Indirection): Implement EmitAssign and set the
23084         ExprClass to Variable.  This allows pointer dereferences to be
23085         treated as variables, and to have values assigned to them.
23086
23087         * ecore.cs (Expression.StoreFromPtr): New utility function to
23088         store values dereferencing.
23089
23090 2002-02-20  Ravi Pratap  <ravi@ximian.com>
23091
23092         * expression.cs (Binary.ResolveOperator): Ensure that we are
23093         not trying to operate on a void type - this fixes the reported
23094         bug.
23095
23096         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
23097         the parent implementation is sealed.
23098
23099         * ../errors/cs0239.cs : Add.
23100
23101         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
23102
23103         * typemanager.cs (unverifiable_code_type): Corresponds to 
23104         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
23105         which have unsafe code in them.
23106
23107         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
23108         unsafe context.
23109
23110 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
23111
23112         * cs-tokenizer.cs: Add support for @"litreal strings"
23113
23114         Make tokenizer accept pre-processor directives
23115         on any column (remove the old C-like limitation). 
23116
23117         * rootcontext.cs (EmitCode): Emit any global attributes.
23118         (AddGlobalAttributes): Used to keep track of assembly attributes. 
23119
23120         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
23121
23122         * cs-parser.jay: Add support for global attributes.  
23123
23124 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
23125
23126         * expression.cs (Indirection): New helper class.  Unary will
23127         create Indirection classes to be able to implement the
23128         IMemoryLocation interface on it.
23129
23130 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
23131
23132         * cs-parser.jay (fixed_statement): reference the right statement.
23133
23134         * statement.cs (Fixed.Emit): Finish implementing the fixed
23135         statement for the &x case.
23136
23137 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
23138
23139         * class.cs (Property.Define, Method.Define): Remove newslot when
23140         `implementing'.  
23141
23142         * modifiers.cs: My use of NewSlot when `Abstract' was set was
23143         wrong.  NewSlot should only be used if the `new' keyword is present.
23144
23145         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
23146         locating our system dir.  Sorry about this.
23147
23148 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
23149
23150         * driver.cs (GetSystemDir): Compute correctly the location of our
23151         system assemblies.  I was using the compiler directory instead of
23152         the library directory.
23153
23154 2002-02-13  Ravi Pratap  <ravi@ximian.com>
23155
23156         * expression.cs (BetterFunction): Put back in what Miguel commented out
23157         since it is the correct fix. The problem is elsewhere ;-)
23158
23159         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
23160         parameters of the parms method are themselves compatible or not !
23161
23162         (StandardConversionExists): Fix very dangerous bug where we were forgetting
23163         to check that a class implements an interface before saying that an implicit
23164         conversion was allowed. Use ImplementsInterface to do the checking.
23165
23166 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
23167
23168         * class.cs (Method.Define): Track whether we are an explicit
23169         implementation or not.  And only call DefineMethodOverride if we
23170         are an explicit implementation.
23171
23172         (Property.DefineMethod): Ditto.
23173
23174 2002-02-11  Ravi Pratap  <ravi@ximian.com>
23175
23176         * expression.cs (BetterFunction): Catch hideous bug which was
23177          preventing us from detecting ambiguous calls due to implicit casts i.e
23178         cs0121.
23179
23180 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
23181
23182         * support.cs (Pair): Remove un-needed method.  I figured why I was
23183         getting the error in cs-parser.jay, the variable in a foreach loop
23184         is readonly, and the compiler does not really treat this as a variable.
23185
23186         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
23187         instead of EQUALS in grammar.  
23188
23189         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
23190
23191         * expression.cs (Unary.DoResolve): Check whether the argument is
23192         managed or not.
23193
23194 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
23195
23196         * support.cs: Api for Pair to set a value.  Despite the fact that
23197         the variables are public the MS C# compiler refuses to compile
23198         code that accesses the field if the variable is part of a foreach
23199         statement. 
23200
23201         * statement.cs (Fixed): Begin implementation of the fixed
23202         statement.
23203
23204         (Block.AddVariable): Return the VariableInfo on success and null
23205         on failure instead of true/false. 
23206
23207         * cs-parser.jay (foreach): Catch errors on variables already
23208         defined (we were ignoring this value before) and properly unwind
23209         the block hierarchy
23210
23211         (fixed_statement): grammar for the fixed statement.
23212
23213 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
23214
23215         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
23216         pointer types to be incretemented.
23217
23218         (SizeOf): Implement.
23219
23220         * cs-parser.jay (pointer_member_access): Implement
23221         expr->IDENTIFIER production.
23222
23223         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
23224         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
23225         on safe contexts.
23226
23227         (Unary): Implement indirection.
23228
23229         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
23230         use in non-unsafe context).
23231
23232         (SimpleName.DoResolve): Check for pointers in field access on safe
23233         contexts. 
23234
23235         (Expression.LoadFromPtr): Factor the load-indirect code in this
23236         function.  This was duplicated in UnboxCast and ParameterReference
23237
23238 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
23239
23240         * expression.cs (ComposedCast): report an error if a pointer cast
23241         is used in a safe region.
23242
23243         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
23244         pointer type casts in unsafe context.
23245
23246         * codegen.cs (EmitContext): Set up IsUnsafe.
23247
23248         * cs-parser.jay (non_expression_type): Add productions for pointer
23249         casts. 
23250
23251         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
23252         code.  We should not use force into static mode if the method is
23253         not virtual.  Fixes bug in MIS
23254
23255         * statement.cs (Do.Emit, While.Emit, For.Emit,
23256         Statement.EmitBoolExpression): Add support to Do and While to
23257         propagate infinite loop as `I do return' semantics.
23258
23259         Improve the For case to also test for boolean constants.
23260
23261         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
23262         to the list of attributes we can add.
23263
23264         Remove `EmitContext' argument.
23265
23266         * class.cs (Method.Define): Apply parameter attributes.
23267         (Constructor.Define): Apply parameter attributes.
23268         (MethodCore.LabelParameters): Move here the core of labeling
23269         parameters. 
23270
23271         * support.cs (ReflectionParameters.ParameterModifier,
23272         InternalParameters.ParameterModifier): Use IsByRef on the type and
23273         only return the OUT bit for these parameters instead of in/out/ref
23274         flags.
23275
23276         This is because I miss-understood things.  The ParameterInfo.IsIn
23277         and IsOut represent whether the parameter has the [In] and [Out]
23278         attributes set.  
23279
23280 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
23281
23282         * ecore.cs (FieldExpr.Emit): Release temporaries.
23283
23284         * assign.cs (LocalTemporary.Release): new function.
23285
23286         * codegen.cs (EmitContext.GetTemporaryStorage,
23287         EmitContext.FreeTemporaryStorage): Rework the way we deal with
23288         temporary storage.  Now we can "put back" localbuilders when we
23289         are done with them
23290
23291 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
23292
23293         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
23294         need to make a copy of the variable to generate verifiable code.
23295
23296 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
23297
23298         * driver.cs: Compute dynamically the system directory.
23299
23300         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
23301         Slower, but more generally useful.  Used by the abstract
23302         registering implementation. 
23303
23304         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
23305         the rules for the special rule on Type/instances.  First check if
23306         we have the same name, and if so, try that special static path
23307         rather than the instance path.
23308
23309 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
23310
23311         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
23312         for, while and if.
23313
23314         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
23315         Enum, ValueType, Delegate or Array for non-corlib compiles.
23316
23317         * cs-tokenizer.cs: Catch long identifiers (645)
23318
23319         * typemanager.cs (IndexerPropetyName): Ravi never tested this
23320         piece of code.
23321
23322         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
23323         fix, we were returning too early, so we were not registering
23324         pending methods from abstract classes.
23325
23326         Do not register pending methods if the class is abstract.
23327
23328         * expression.cs (Conditional.DoResolve): Report circular implicit
23329         conversions when we neecd to compute it for conditional
23330         expressions. 
23331
23332         (Is.DoResolve): If the expression is always of the provided type,
23333         flag warning 183.  If the expression can not ever be of the
23334         provided type flag warning 184.
23335
23336         * class.cs: Catch 169 as well.
23337
23338         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
23339         read. 
23340
23341 2002-01-18  Nick Drochak  <ndrochak@gol.com>
23342
23343         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
23344
23345 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
23346
23347         * interface.cs: (PopulateMethod): Check for pointers being defined
23348         only if the unsafe context is active.
23349         (PopulateProperty): ditto.
23350         (PopulateIndexer): ditto.
23351
23352         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
23353         specified.  If pointers are present, make sure that they are
23354         present in an unsafe context.
23355         (Constructor, Constructor.Define): ditto.
23356         (Field, Field.Define): ditto.
23357         (Property, Property.Define): ditto.
23358         (Event, Event.Define): ditto.
23359
23360         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
23361         hashtable if there are classes or structs defined.
23362
23363         * expression.cs (LocalVariableReference.DoResolve): Simplify this
23364         code, as the constant resolution moved.
23365
23366         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
23367         the metadata, so we can flag error 133. 
23368
23369         * decl.cs (MemberCore.UnsafeOK): New function to test that a
23370         pointer is being declared in an unsafe context.
23371
23372 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
23373
23374         * modifiers.cs (Modifiers.Check): Require a Location argument.
23375         Report error 227 for Unsafe use.
23376
23377         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
23378
23379         * statement.cs (For.Emit): If the test is null, then report that
23380         we do `return', as we wont reach anything afterwards.
23381
23382         (Switch.SwitchGoverningType): Track the expression that matched
23383         the conversion.
23384
23385         * driver.cs: Allow negative numbers as an error code to flag.
23386
23387         * cs-parser.jay: Handle 1551.
23388
23389         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
23390
23391 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
23392
23393         * cs-parser.jay: Report 1518 (type declaration can only contain
23394         class, struct, interface, enum or delegate)
23395
23396         (switch_label): Report 1523 (keywords `case' or `default' must
23397         preced code)
23398
23399         (opt_switch_sections): Report 1522 (empty switch)
23400
23401         * driver.cs: Report 1515 (response file specified multiple times)
23402         Report 1516 (Source file specified multiple times).
23403
23404         * expression.cs (Argument.Resolve): Signal 1510
23405
23406         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
23407         access not allowed in static code)
23408
23409 2002-01-11  Ravi Pratap  <ravi@ximian.com>
23410
23411         * typemanager.cs (IsPointerType): Utility method which we are going
23412         to need a lot.
23413
23414         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
23415         the object type, so we take care of that.
23416
23417         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
23418
23419         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
23420         added to non-params parameters :-)
23421
23422         * typemanager.cs (CSharpName): Include 'void' type too. 
23423
23424         (void_ptr_type): Include in the set of core types.
23425
23426         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
23427         duplicating code.
23428
23429         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
23430         an unsafe context.
23431
23432         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
23433         completely forgotten about it.
23434
23435 2002-01-10  Ravi Pratap  <ravi@ximian.com>
23436
23437         * cs-parser.jay (pointer_type): Add. This begins our implementation
23438         of parsing rules for unsafe code.
23439
23440         (unsafe_statement): Implement.
23441
23442         (embedded_statement): Modify to include the above.
23443
23444         * statement.cs (Unsafe): Implement new class for unsafe blocks.
23445
23446         * codegen.cs (EmitContext.InUnsafe): Add. This determines
23447         if the current context is an unsafe one.
23448
23449         * cs-parser.jay (local_variable_pointer_type): Since local variable types
23450         are handled differently, we need separate rules for them.
23451
23452         (local_variable_declaration): Update to use local_variable_pointer_type
23453         to allow variable declarations of unmanaged pointer types.
23454
23455         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
23456         in unsafe contexts.
23457
23458         * ../errors/cs0214.cs : Add.
23459
23460 2002-01-16  Nick Drochak  <ndrochak@gol.com>
23461
23462         * makefile: remove 'response' file when cleaning.
23463
23464 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
23465
23466         * cs-parser.jay: Report 1524.
23467
23468 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
23469
23470         * typemanager.cs (RegisterMethod): drop checking if we have
23471         registered this from here
23472
23473 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
23474
23475         * class.cs (Method.EmitDestructor): Implement calling our base
23476         destructor. 
23477
23478         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
23479         value of InFinally.
23480
23481         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
23482         this routine and will wrap the call in a try/catch block.  Deal
23483         with the case.
23484
23485 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
23486
23487         * ecore.cs (Expression.MemberLookup): instead of taking a
23488         parameter `same_type' that was used to tell whether we could
23489         access private members we compute our containing type from the
23490         EmitContext.
23491
23492         (FieldExpr): Added partial support for volatile fields.  This does
23493         not work for volatile fields exposed from assemblies, as I can not
23494         figure out how to extract the modreq from it.
23495
23496         Updated all the source files to use this.
23497
23498         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
23499         because it is referenced by MemberLookup very often. 
23500
23501 2002-01-09  Ravi Pratap  <ravi@ximian.com>
23502
23503         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
23504         TypeBuilder.GetCustomAttributes to retrieve what we need.
23505
23506         Get rid of redundant default_member_attr_type as this is the same as
23507         default_member_type which already exists.
23508
23509         * interface.cs, attribute.cs : Update accordingly.
23510
23511 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
23512
23513         * typemanager.cs: Enable IndexerPropertyName again.  It does not
23514         work for TYpeBuilders though.  Ravi, can you please fix this?
23515
23516         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
23517
23518         * expression.cs (Argument.Emit): Handle the case of ref objects
23519         being passed to ref functions;  
23520
23521         (ParameterReference.EmitLoad): Loads the content of the pointer
23522         without dereferencing.
23523
23524 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
23525
23526         * cs-tokenizer.cs: Implemented the pre-processing expressions.
23527
23528 2002-01-08  Ravi Pratap  <ravi@ximian.com>
23529
23530         * class.cs (Indexer.DefineMethod): Incorporate the interface
23531         type in the name of the method if we are doing explicit interface
23532         implementation.
23533
23534         * expression.cs (ConversionExists): Remove as it is completely obsolete.
23535
23536         (BetterConversion): Fix extremely trivial bug where we were referring to
23537         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
23538         again !
23539
23540         * ../errors/bug16.cs : Add although we have fixed it.
23541
23542 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
23543
23544         * expression.cs (BaseIndexer): Begin implementation.
23545
23546         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
23547
23548         * cs-parser.jay (indexer_declarator): Use qualified_identifier
23549         production directly to remove a shift/reduce, and implement
23550         explicit interface implementation.
23551
23552         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
23553         after a floating point suffix.
23554
23555         * expression.cs (DoNumericPromotions): Improved the conversion for
23556         uint/uint.  If we have a constant, we avoid doing a typecast to a
23557         larger type.
23558
23559         * class.cs (Indexer): Implement explicit interface implementation
23560         for indexers.
23561
23562 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
23563
23564         * class.cs: make the default instance constructor public and hidebysig.
23565
23566 2001-01-03  Ravi Pratap  <ravi@ximian.com>
23567
23568         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
23569         so we can call it from elsewhere.
23570
23571         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
23572         we emit it internally if the class has a defined indexer; otherwise the user
23573         emits it by decorating the class definition with the DefaultMemberAttribute.
23574
23575         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
23576         attribute is not used on a type which defines an indexer.
23577
23578         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
23579         character when we skip whitespace.
23580
23581         * ../errors/cs0646.cs : Add.
23582
23583 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
23584
23585         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
23586         again. 
23587
23588         * makefile: Add practical target `mcs3.exe' which builds the third
23589         generation compiler. 
23590
23591         * expression.cs (New): Fix structures constructor calling.
23592
23593         * class.cs (Property, Method, Indexer): Emit Final flag on the
23594         method if we are an interface implementation and we are not
23595         abstract. 
23596
23597         * ecore.cs (PropertyExpr): New public field `IsBase', tells
23598         whether this property is referencing a `base' method.
23599
23600         * expression.cs (Invocation.EmitCall): take an extra argument:
23601         is_base, this is used to determine whether the `call' or
23602         `callvirt' opcode should be used.
23603
23604
23605         * delegate.cs: update EmitCall.
23606
23607         * class.cs (Method.Define): Set NewSlot for the cases where we are
23608         not implementing an interface method.
23609
23610         (Property.Define): ditto.
23611
23612 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
23613
23614         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
23615         'r'.  Allows mcs to parse itself fully.
23616
23617 2002-01-02  Ravi Pratap  <ravi@ximian.com>
23618
23619         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
23620         of the number of initializers that require the InitializeArray method.
23621
23622         (CheckIndices): Store the Expression in all cases - not the plain value. Also
23623         update the above field where necessary.
23624
23625         (MakeByteBlob): Update accordingly.
23626
23627         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
23628         greater than 2.
23629
23630         (EmitDynamicInitializers): Update in accordance with the new optimization.
23631
23632         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
23633         same OpCode applies.
23634
23635         * cs-parser.jay : Fix some glaring errors I introduced.
23636
23637 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
23638
23639         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
23640         so that we can check for name clashes there too.
23641
23642         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
23643         for interface indexers.
23644
23645         * interfaces.cs (Define): Emit the default member attribute.
23646
23647         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
23648         variable was being referred to while setting the value ;-)
23649
23650 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
23651
23652         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
23653         byte-by-byte information when we know the data is zero.
23654
23655         Make the block always a multiple of 4, because
23656         DefineInitializedData has a bug.
23657
23658         * assign.cs: Fix, we should assign from the temporary, not from
23659         the source. 
23660
23661         * expression.cs (MakeByteBlob): Fix my incorrect code.
23662
23663 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
23664
23665         * typemanager.cs (EnumToUnderlying): This function is used to get
23666         the underlying type from an enumeration, because it does not
23667         always work. 
23668
23669         * constant.cs: Use the I4_S form for values between -128 and 127.
23670
23671         * statement.cs (Block.LookupLabel): Looks up a label.
23672         (Block): Drop support for labeled blocks.
23673
23674         (LabeledStatement): New kind of statement that represents a label
23675         only.
23676
23677         (Goto): Finally implement this bad boy.
23678
23679         * cs-parser.jay: Update to reflect new mechanism to implement
23680         labels.
23681
23682 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
23683
23684         * codegen.cs (EmitContext.This): a codegen property that keeps the
23685         a single instance of this instead of creating many different this
23686         instances. 
23687
23688         * delegate.cs (Delegate.DoResolve): Update to use the property;
23689
23690         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
23691
23692         * expression.cs (BaseAccess.DoResolve): Ditto.
23693
23694 2001-12-29  Ravi Pratap  <ravi@ximian.com>
23695
23696         * typemanager.cs (methodimpl_attr_type): Add to hold the type
23697         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
23698
23699         (InitCoreTypes): Update accordingly.
23700
23701         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
23702         so we can quickly store the state.
23703
23704         (ApplyAttributes): Set the correct implementation flags
23705         for InternalCall methods.
23706
23707 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
23708
23709         * expression.cs (EmitCall): if a method is not virtual, then do
23710         not use callvirt on it.
23711
23712         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
23713         user defined stuff) requires the use of stobj, which takes an
23714         address on the stack instead of an array and an index.  So emit
23715         the Ldelema operation for it.
23716
23717         (EmitStoreOpcode): Use stobj for valuetypes.
23718
23719         (UnaryMutator.EmitCode): Use the right 1 value depending on
23720         whether we are dealing with int64/uint64, float or doubles.
23721
23722         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
23723         constructors that I implemented last night.
23724
23725         (Constructor.IsDefault): Fix to work properly for static
23726         constructors.
23727
23728         * cs-parser.jay (CheckDef): report method signature errors.
23729         Update error number 103 to be 132.
23730
23731         * decl.cs: New AdditionResult enumeration value: MethodExists.
23732         Although we do this check for methods later on in the semantic
23733         analysis, catching repeated default constructors is so easy that
23734         we catch these here. 
23735
23736         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
23737         promotions code.
23738
23739         (ParameterReference.EmitAssign, Emit): handle
23740         bools as bytes.
23741
23742         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
23743         (ArrayAccess.EmitStoreOpcode): ditto.
23744
23745         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
23746
23747         * expression.cs (MakeByteBlob): Complete all the missing types
23748         (uint, short, ushort, byte, sbyte)
23749
23750         * class.cs: Only init instance field initializers on instance
23751         constructors. 
23752
23753         Rename `constructors' to instance_constructors. 
23754
23755         (TypeContainer.AddConstructor): Only add constructors to the list
23756         if it is not static.
23757
23758         Make sure that we handle default_static_constructor independently
23759         everywhere where we handle instance_constructors
23760
23761 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
23762
23763         * class.cs: Do not lookup or create a base initializer for a
23764         static constructor.
23765
23766         (ConstructorInitializer.Resolve): use the proper type to lookup
23767         for constructors.
23768
23769         * cs-parser.jay: Report error 1585 (modifiers between type and name).
23770
23771         * enum.cs, interface.cs: Remove CloseType, this is taken care by
23772         in DeclSpace. 
23773
23774         * decl.cs: CloseType is now an virtual method, the default
23775         implementation just closes this type.
23776
23777 2001-12-28  Ravi Pratap  <ravi@ximian.com>
23778
23779         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
23780         to PreserveSig by default. Also emit HideBySig on such methods.
23781
23782         Basically, set the defaults to standard values.
23783
23784         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
23785         argument, if candidate is better, it can't be worse than the best !
23786
23787         (Invocation): Re-write bits to differentiate between methods being
23788         applicable in their expanded form and their normal form - for params
23789         methods of course.
23790
23791         Get rid of use_standard everywhere as only standard conversions are allowed
23792         in overload resolution. 
23793
23794         More spec conformance.
23795
23796 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
23797
23798         * driver.cs: Add --timestamp, to see where the compiler spends
23799         most of its time.
23800
23801         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
23802         `this' in static code.
23803
23804         (SimpleName.DoResolve): Implement in terms of a helper function
23805         that allows static-references to be passed upstream to
23806         MemberAccess.
23807
23808         (Expression.ResolveWithSimpleName): Resolve specially simple
23809         names when called by MemberAccess to implement the special
23810         semantics. 
23811
23812         (Expression.ImplicitReferenceConversion): Handle conversions from
23813         Null to reference types before others, as Null's type is
23814         System.Object. 
23815
23816         * expression.cs (Invocation.EmitCall): Handle the special case of
23817         calling methods declared on a reference type from a ValueType
23818         (Base classes System.Object and System.Enum)
23819
23820         (MemberAccess.Resolve): Only perform lookups on Enumerations if
23821         the left hand side is a TypeExpr, not on every enumeration. 
23822
23823         (Binary.Resolve): If types are reference types, then do a cast to
23824         object on operators != and == of both arguments.
23825
23826         * typemanager.cs (FindMembers): Extract instance and static
23827         members if requested.
23828
23829         * interface.cs (PopulateProperty): Use void_type instead of null
23830         as the return type for the setter method.
23831
23832         (PopulateIndexer): ditto.
23833
23834 2001-12-27  Ravi Pratap  <ravi@ximian.com>
23835
23836         * support.cs (ReflectionParameters): Fix minor bug where we
23837         were examining the wrong parameter for the ParamArray attribute.
23838
23839         Cope with requests for the type of the parameter at position
23840         greater than the params parameter's. We now return the element
23841         type of the params array as that makes more sense.
23842
23843         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
23844         accordingly as we no longer have to extract the element type
23845         ourselves.
23846
23847         (Invocation.OverloadResolve): Update.
23848
23849 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
23850
23851         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
23852         against IEnumerator, test whether the return value is a descendant
23853         of the IEnumerator interface.
23854
23855         * class.cs (Indexer.Define): Use an auxiliary method to implement
23856         the other bits of the method definition.  Begin support for
23857         explicit interface implementation.
23858
23859         (Property.DefineMethod): Use TypeManager.void_type instead of null
23860         for an empty return value.
23861
23862 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
23863
23864         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
23865         dealing with a FieldExpr which is composed of a FieldBuilder, in
23866         the code path we did extract the constant, but we should have
23867         obtained the underlying value to be able to cast it (otherwise we
23868         end up in an infinite loop, this is what Ravi was running into).
23869
23870         (ArrayCreation.UpdateIndices): Arrays might be empty.
23871
23872         (MemberAccess.ResolveMemberAccess): Add support for section
23873         14.5.4.1 that deals with the special case of E.I when E is a type
23874         and something else, that I can be a reference to a static member.
23875
23876         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
23877         handle a particular array type to create byte blobs, it is just
23878         something we dont generate byteblobs for.
23879
23880         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
23881         arguments. 
23882
23883         * location.cs (Push): remove the key from the hashtable that we
23884         are about to add.   This happens for empty files.
23885
23886         * driver.cs: Dispose files after we have parsed them.
23887
23888         (tokenize): new function that only runs the tokenizer on its
23889         input, for speed testing.
23890
23891 2001-12-26  Ravi Pratap  <ravi@ximian.com>
23892
23893         * class.cs (Event.Define): Define the private field only if there
23894         are no accessors defined.
23895
23896         * expression.cs (ResolveMemberAccess): If there is no associated
23897         field with the event, that means we have an event defined with its
23898         own accessors and we should flag error cs0070 since transforming
23899         ourselves into a field is not valid in that case.
23900
23901         * ecore.cs (SimpleName.DoResolve): Same as above.
23902
23903         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
23904         and charset to sane values.
23905
23906 2001-12-25  Ravi Pratap  <ravi@ximian.com>
23907
23908         * assign.cs (DoResolve): Perform check on events only if they 
23909         are being accessed outside the declaring type.
23910
23911         * cs-parser.jay (event_declarations): Update rules to correctly
23912         set the type of the implicit parameter etc.
23913
23914         (add_accessor, remove_accessor): Set current local parameters.
23915
23916         * expression.cs (Binary): For delegate addition and subtraction,
23917         cast the return value from the method into the appropriate delegate
23918         type.
23919
23920 2001-12-24  Ravi Pratap  <ravi@ximian.com>
23921
23922         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
23923         of these as the workaround is unnecessary.
23924
23925         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
23926         delegate data - none of that is needed at all.
23927
23928         Re-write bits to extract the instance expression and the delegate method
23929         correctly.
23930
23931         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
23932         on delegates too.
23933
23934         * attribute.cs (ApplyAttributes): New method to take care of common tasks
23935         of attaching attributes instead of duplicating code everywhere.
23936
23937         * everywhere : Update code to do attribute emission using the above method.
23938
23939 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
23940
23941         * expression.cs (IsParamsMethodApplicable): if there are not
23942         parameters, return immediately.
23943
23944         * ecore.cs: The 0 literal can be implicity converted to an enum
23945         type. 
23946
23947         (SimpleName.DoResolve): First lookup the type, then lookup the
23948         members. 
23949
23950         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
23951         want to get its address.  If the InstanceExpression is not
23952         addressable, store the result in a temporary variable, then get
23953         the address of it.
23954
23955         * codegen.cs: Only display 219 errors on warning level or above. 
23956
23957         * expression.cs (ArrayAccess): Make it implement the
23958         IMemoryLocation interface.
23959
23960         (Binary.DoResolve): handle the operator == (object a, object b)
23961         and operator != (object a, object b) without incurring into a
23962         BoxedCast (because 5 != o should never be performed).
23963
23964         Handle binary enumerator operators.
23965
23966         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
23967         value type, otherwise use Ldelem_ref.
23968
23969         Use precomputed names;
23970
23971         (AddressOf): Implement address of
23972
23973         * cs-parser.jay (labeled_statement): Fix recursive block
23974         addition by reworking the production.
23975
23976         * expression.cs (New.DoEmit): New has a special case:
23977                 
23978                  If we are dealing with a ValueType, we have a few
23979                  situations to deal with:
23980                 
23981                     * The target of New is a ValueType variable, that is
23982                       easy, we just pass this as the variable reference
23983                 
23984                     * The target of New is being passed as an argument,
23985                       to a boxing operation or a function that takes a
23986                       ValueType.
23987                 
23988                       In this case, we need to create a temporary variable
23989                       that is the argument of New.
23990
23991
23992 2001-12-23  Ravi Pratap  <ravi@ximian.com>
23993
23994         * rootcontext.cs (LookupType): Check that current_type is not null before
23995         going about looking at nested types.
23996
23997         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
23998         not implement the IAssignMethod interface any more.
23999
24000         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
24001         where we tranform them into FieldExprs if they are being resolved from within
24002         the declaring type.
24003
24004         * ecore.cs (SimpleName.DoResolve): Do the same here.
24005
24006         * assign.cs (DoResolve, Emit): Clean up code considerably. 
24007
24008         * ../errors/bug10.cs : Add.
24009
24010         * ../errors/cs0070.cs : Add.
24011
24012         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
24013
24014         * assign.cs : Get rid of EventIsLocal everywhere.
24015
24016 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
24017
24018         * ecore.cs (ConvertIntLiteral): finished the implementation.
24019
24020         * statement.cs (SwitchLabel): Convert the value we are using as a
24021         key before looking up the table.
24022
24023 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
24024
24025         * codegen.cs (EmitTopBlock): Require a Location argument now.
24026
24027         * cs-parser.jay (constructor_declarator): We need to setup
24028         current_local_parameters before we parse the
24029         opt_constructor_initializer, to allow the variables to be bound
24030         to the constructor arguments.
24031
24032         * rootcontext.cs (LookupType): First lookup nested classes in our
24033         class and our parents before we go looking outside our class.
24034
24035         * expression.cs (ConstantFold): Extract/debox the values at the
24036         beginnning. 
24037
24038         * rootcontext.cs (EmitCode): Resolve the constants first before we
24039         resolve the types.  This is not really needed, but it helps debugging.
24040
24041         * statement.cs: report location.
24042
24043         * cs-parser.jay: pass location to throw statement.
24044
24045         * driver.cs: Small bug fix.
24046
24047         * report.cs: Updated format to be 4-zero filled digits.
24048
24049 2001-12-22  Ravi Pratap  <ravi@ximian.com>
24050
24051         * expression.cs (CheckIndices): Fix minor bug where the wrong
24052         variable was being referred to ;-)
24053
24054         (DoEmit): Do not call EmitStaticInitializers when the 
24055         underlying type is System.Object.
24056
24057 2001-12-21  Ravi Pratap  <ravi@ximian.com>
24058
24059         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
24060         and do the usual workaround for SRE.
24061
24062         * class.cs (MyEventBuilder.EventType): New member to get at the type
24063         of the event, quickly.
24064
24065         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
24066
24067         * assign.cs (Assign.DoResolve): Handle the case when the target
24068         is an EventExpr and perform the necessary checks.
24069
24070         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
24071         interface.
24072
24073         (SimpleName.MemberStaticCheck): Include check for EventExpr.
24074
24075         (EventExpr): Set the type in the constructor itself since we 
24076         are meant to be born fully resolved.
24077
24078         (EventExpr.Define): Revert code I wrote earlier.
24079                 
24080         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
24081         instance expression is null. The instance expression is a This in that case
24082         or a null, depending on whether it is a static method or not.
24083
24084         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
24085         refers to more than one method.
24086
24087         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
24088         and accordingly flag errors.
24089
24090 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
24091
24092         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
24093
24094 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
24095
24096         * location.cs (ToString): Provide useful rutine.
24097
24098 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
24099
24100         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
24101         objects, return the actual integral boxed.
24102
24103         * statement.cs (SwitchLabel): define an ILLabel for each
24104         SwitchLabel. 
24105
24106         (Switch.CheckSwitch): If the value is a Literal, extract
24107         the underlying literal.
24108
24109         Also in the unused hashtable we had, add the SwitchLabel so we can
24110         quickly look this value up.
24111
24112         * constant.cs: Implement a bunch of new constants.  Rewrite
24113         Literal based on this.  Made changes everywhere to adapt to this.
24114
24115         * expression.cs (Expression.MakeByteBlob): Optimize routine by
24116         dereferencing array only once, and also copes with enumrations.
24117
24118         bytes are two bytes wide, not one.
24119
24120         (Cast): Perform constant conversions.
24121
24122         * ecore.cs (TryImplicitIntConversion): Return literals instead of
24123         wrappers to the literals here.
24124
24125         * expression.cs (DoNumericPromotions): long literals can converted
24126         to ulong implicity (this is taken care of elsewhere, but I was
24127         missing this spot).
24128
24129         * ecore.cs (Expression.Literalize): Make the return type Literal,
24130         to improve type checking.
24131
24132         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
24133
24134 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
24135
24136         * literal.cs: Revert code from ravi that checked the bounds.  The
24137         bounds are sane by the definition of the type itself. 
24138
24139         * typemanager.cs: Fix implementation of ImplementsInterface.  We
24140         need to actually look up in our parent hierarchy for interfaces
24141         implemented. 
24142
24143         * const.cs: Use the underlying type for enumerations
24144
24145         * delegate.cs: Compute the basename for the delegate creation,
24146         that should fix the delegate test case, and restore the correct
24147         Type Lookup semantics in rootcontext
24148
24149         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
24150         referencing a nested type with the Reflection API is using the "+"
24151         sign. 
24152
24153         * cs-parser.jay: Do not require EOF token at the end.
24154
24155 2001-12-20  Ravi Pratap  <ravi@ximian.com>
24156
24157         * rootcontext.cs (LookupType): Concatenate type names with
24158         a '.' instead of a '+' The test suite passes again.
24159
24160         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
24161         field of the enumeration.
24162
24163         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
24164         the case when the member is an EventExpr.
24165
24166         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
24167         static has an associated instance expression.
24168
24169         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
24170
24171         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
24172
24173         * class.cs (Event.Define): Register event and perform appropriate checks
24174         for error #111.
24175
24176         We define the Add and Remove methods even if the use provides none because
24177         in that case, we provide default implementations ourselves.
24178
24179         Define a private field of the type of the event. This is done by the CSC compiler
24180         and we should be doing it too ;-)
24181
24182         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
24183         More methods we use in code we generate.
24184
24185         (multicast_delegate_type, delegate_type): Two separate types since the distinction
24186         is important.
24187
24188         (InitCoreTypes): Update accordingly for the above.
24189
24190         * class.cs (Event.Emit): Generate code for default accessors that we provide
24191
24192         (EmitDefaultMethod): Do the job in the above.
24193
24194         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
24195         appropriate place.
24196
24197 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
24198
24199         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
24200         builders even if we were missing one.
24201
24202         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
24203         pass the Basename as our class name instead of the Name.  The
24204         basename will be correctly composed for us.
24205
24206         * parameter.cs (Paramters): Now takes a Location argument.
24207
24208         * decl.cs (DeclSpace.LookupType): Removed convenience function and
24209         make all the code call directly LookupType in RootContext and take
24210         this chance to pass the Location information everywhere.
24211
24212         * Everywhere: pass Location information.
24213
24214 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
24215
24216         * class.cs (Constructor.Define): Updated way of detecting the
24217         length of the parameters.
24218
24219         (TypeContainer.DefineType): Use basename as the type name for
24220         nested types.
24221
24222         (TypeContainer.Define): Do not recursively define types here, as
24223         definition is taken care in order by the RootContext.
24224
24225         * tree.cs: Keep track of namespaces in a per-file basis.
24226
24227         * parameter.cs (Parameter.ComputeSignature): Update to use
24228         DeclSpace. 
24229
24230         (Parameters.GetSignature): ditto.
24231
24232         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
24233         instead of a TypeContainer.
24234
24235         (Interface.SemanticAnalysis): Use `this' instead of our parent to
24236         resolve names.  Because we need to be resolve in our context, not
24237         our parents.
24238
24239         * driver.cs: Implement response files.
24240
24241         * class.cs (TypeContainer.DefineType): If we are defined, do not
24242         redefine ourselves.
24243
24244         (Event.Emit): Emit the code for add/remove handlers.
24245         (Event.Define): Save the MethodBuilders for add/remove.
24246
24247         * typemanager.cs: Use pair here too.
24248
24249         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
24250         DictionaryEntry requires the first argument to be non-null.  
24251
24252         (enum_declaration): Compute full name for registering the
24253         enumeration.
24254
24255         (delegate_declaration): Instead of using
24256         formal_parameter_list, use opt_formal_parameter_list as the list
24257         can be empty.
24258
24259         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
24260         (EventParsing): New property that controls whether `add' and
24261         `remove' are returned as tokens or identifiers (for events);
24262
24263 2001-12-19  Ravi Pratap  <ravi@ximian.com>
24264
24265         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
24266         use MyEventBuilder only and let it wrap the real builder for us.
24267
24268         (MyEventBuilder): Revamp constructor etc.
24269
24270         Implement all operations that we perform on EventBuilder in precisely the same
24271         way here too.
24272
24273         (FindMembers): Update to use the EventBuilder member.
24274
24275         (Event.Emit): Update accordingly.
24276
24277 2001-12-18  Ravi Pratap  <ravi@ximian.com>
24278
24279         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
24280         by calling the appropriate methods.
24281
24282         (GetCustomAttributes): Make stubs as they cannot possibly do anything
24283         useful.
24284
24285         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
24286
24287 2001-12-17  Ravi Pratap  <ravi@ximian.com>
24288
24289         * delegate.cs (Delegate.Populate): Check that the return type
24290         and various parameters types are indeed accessible.
24291
24292         * class.cs (Constructor.Define): Same here.
24293
24294         (Field.Define): Ditto.
24295
24296         (Event.Define): Ditto.
24297
24298         (Operator.Define): Check that the underlying Method defined itself
24299         correctly - so it's MethodBuilder should not be null.
24300
24301         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
24302         expression happens to be null.
24303
24304         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
24305         members but as of now we don't seem to be able to do anything really useful with it.
24306
24307         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
24308         not the EventBuilder.
24309
24310 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
24311
24312         * cs-tokenizer.cs: Add support for defines.
24313         Add support for #if, #elif, #else, #endif
24314
24315         (eval_var): evaluates a variable.
24316         (eval): stubbed for evaluating functions.
24317
24318         * cs-parser.jay: Pass the defines information
24319
24320         * driver.cs: Add --define command line option.
24321
24322         * decl.cs: Move MemberCore here.
24323
24324         Make it the base class for DeclSpace.  This allows us to catch and
24325         report 108 and 109 for everything now.
24326
24327         * class.cs (TypeContainer.Define): Extract all the members
24328         before populating and emit the warning 108 (new keyword required
24329         to override) instead of having each member implement this.
24330
24331         (MemberCore.Define): New abstract method, we will be using this in
24332         the warning reporting engine in Populate.
24333
24334         (Operator.Define): Adjust to new MemberCore protocol. 
24335
24336         * const.cs (Const): This does not derive from Expression, it is a
24337         temporary object we use to create fields, it is a MemberCore. 
24338
24339         * class.cs (Method.Define): Allow the entry point to be in a
24340         specific class.
24341
24342         * driver.cs: Rewrite the argument handler to clean it up a bit.
24343
24344         * rootcontext.cs: Made it just an auxiliary namespace feature by
24345         making everything static.
24346
24347         * driver.cs: Adapt code to use RootContext type name instead of
24348         instance variable.
24349
24350         * delegate.cs: Remove RootContext argument.
24351
24352         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
24353         argument. 
24354
24355         * class.cs (Event.Define): The lookup can fail.
24356
24357         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
24358
24359         * expression.cs: Resolve the this instance before invoking the code.
24360
24361 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
24362
24363         * cs-parser.jay: Add a production in element_access that allows
24364         the thing to become a "type" reference.  This way we can parse
24365         things like "(string [])" as a type.
24366
24367         Note that this still does not handle the more complex rules of
24368         casts. 
24369
24370
24371         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
24372
24373         * ecore.cs: (CopyNewMethods): new utility function used to
24374         assemble the list of methods from running FindMembers.
24375
24376         (MemberLookup): Rework FindMembers so that 
24377
24378 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
24379
24380         * class.cs (TypeContainer): Remove Delegates who fail to be
24381         defined.
24382
24383         * delegate.cs (Populate): Verify that we dont get null return
24384         values.   TODO: Check for AsAccessible.
24385
24386         * cs-parser.jay: Use basename to emit error 574 (destructor should
24387         have the same name as container class), not the full name.
24388
24389         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
24390         possible representation.  
24391
24392         Also implements integer type suffixes U and L.
24393
24394 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
24395
24396         * expression.cs (ArrayCreation.DoResolve): We need to do the
24397         argument resolution *always*.
24398
24399         * decl.cs: Make this hold the namespace.  Hold the root context as
24400         well.
24401         (LookupType): Move here.
24402
24403         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
24404
24405         * location.cs (Row, Name): Fixed the code, it was always returning
24406         references to the first file.
24407
24408         * interface.cs: Register properties defined through interfaces.
24409
24410         * driver.cs: Add support for globbing on the command line
24411
24412         * class.cs (Field): Make it derive from MemberCore as well.
24413         (Event): ditto.
24414
24415 2001-12-15  Ravi Pratap  <ravi@ximian.com>
24416
24417         * class.cs (Event::Define): Check that the type of the event is a delegate
24418         type else flag error #66.
24419
24420         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
24421         same.
24422
24423         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
24424         values of EntryPoint, CharSet etc etc.
24425
24426         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
24427
24428         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
24429         be null and we should ignore this. I am not sure if this is really clean. Apparently,
24430         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
24431         which needs this to do its work.
24432
24433         * ../errors/cs0066.cs : Add.
24434
24435 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
24436
24437         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
24438         helper functions.
24439
24440         * class.cs: (MethodSignature.MethodSignature): Removed hack that
24441         clears out the parameters field.
24442         (MemberSignatureCompare): Cleanup
24443
24444         (MemberCore): New base class used to share code between MethodCore
24445         and Property.
24446
24447         (RegisterRequiredImplementations) BindingFlags.Public requires
24448         either BindingFlags.Instace or Static.  Use instance here.
24449
24450         (Property): Refactored code to cope better with the full spec.
24451
24452         * parameter.cs (GetParameterInfo): Return an empty array instead
24453         of null on error.
24454
24455         * class.cs (Property): Abstract or extern properties have no bodies.
24456
24457         * parameter.cs (GetParameterInfo): return a zero-sized array.
24458
24459         * class.cs (TypeContainer.MethodModifiersValid): Move all the
24460         method modifier validation to the typecontainer so we can reuse
24461         this on properties.
24462
24463         (MethodCore.ParameterTypes): return an empty sized array of types.
24464
24465         (Property.Define): Test property modifier validity.
24466
24467         Add tests for sealed/override too.
24468
24469         (Method.Emit): abstract or extern methods have no bodies.
24470
24471 2001-12-14  Ravi Pratap  <ravi@ximian.com>
24472
24473         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
24474         thing.
24475
24476         (Method::Define, ::Emit): Modify accordingly.
24477
24478         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
24479
24480         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
24481
24482         * makefile: Pass in /unsafe.
24483
24484 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
24485
24486         * class.cs (MakeKey): Kill routine.
24487
24488         * class.cs (TypeContainer.Define): Correctly define explicit
24489         method implementations (they require the full interface name plus
24490         the method name).
24491
24492         * typemanager.cs: Deply the PtrHashtable here and stop using the
24493         lame keys.  Things work so much better.
24494
24495         This of course broke everyone who depended on `RegisterMethod' to
24496         do the `test for existance' test.  This has to be done elsewhere.
24497
24498         * support.cs (PtrHashtable): A hashtable that avoid comparing with
24499         the object stupid Equals method (because, that like fails all over
24500         the place).  We still do not use it.
24501
24502         * class.cs (TypeContainer.SetRequiredInterface,
24503         TypeContainer.RequireMethods): Killed these two routines and moved
24504         all the functionality to RegisterRequiredImplementations.
24505
24506         (TypeContainer.RegisterRequiredImplementations): This routine now
24507         registers all the implementations required in an array for the
24508         interfaces and abstract methods.  We use an array of structures
24509         which can be computed ahead of time to reduce memory usage and we
24510         also assume that lookups are cheap as most classes will not
24511         implement too many interfaces.
24512
24513         We also avoid creating too many MethodSignatures.
24514
24515         (TypeContainer.IsInterfaceMethod): Update and optionally does not
24516         clear the "pending" bit if we find that there are problems with
24517         the declaration.
24518
24519         (TypeContainer.VerifyPendingMethods): Update to report errors of
24520         methods that look like implementations but are not.
24521
24522         (TypeContainer.Define): Add support for explicit interface method
24523         implementation. 
24524
24525 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
24526
24527         * typemanager.cs: Keep track of the parameters here instead of
24528         being a feature of the TypeContainer.
24529
24530         * class.cs: Drop the registration of parameters here, as
24531         InterfaceMethods are also interface declarations.
24532
24533         * delegate.cs: Register methods with the TypeManager not only with
24534         the TypeContainer.  This code was buggy.
24535
24536         * interface.cs: Full registation here.
24537
24538 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
24539
24540         * expression.cs: Remove reducer for binary expressions, it can not
24541         be done this way.
24542
24543         * const.cs: Put here the code that used to go into constant.cs
24544
24545         * constant.cs: Put here the code for constants, this is a new base
24546         class for Literals.
24547
24548         * literal.cs: Make Literal derive from Constant.
24549
24550 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
24551
24552         * statement.cs (Return.Emit): Report error 157 if the user
24553         attempts to return from a finally block.
24554
24555         (Return.Emit): Instead of emitting a return, jump to the end of
24556         the function.
24557
24558         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
24559         LocalBuilder to store the result of the function.  ReturnLabel is
24560         the target where we jump.
24561
24562
24563 2001-12-09  Radek Doulik  <rodo@ximian.com>
24564
24565         * cs-parser.jay: remember alias in current namespace
24566
24567         * ecore.cs (SimpleName::DoResolve): use aliases for types or
24568         namespaces
24569
24570         * class.cs (LookupAlias): lookup alias in my_namespace
24571
24572         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
24573         aliases hashtable
24574         (LookupAlias): lookup alias in this and if needed in parent
24575         namespaces
24576
24577 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
24578
24579         * support.cs: 
24580
24581         * rootcontext.cs: (ModuleBuilder) Made static, first step into
24582         making things static.  I need this to avoid passing the
24583         TypeContainer when calling ParameterType.
24584
24585         * support.cs (InternalParameters.ParameterType): Remove ugly hack
24586         that did string manipulation to compute the type and then call
24587         GetType.  Use Parameter.ParameterType instead.
24588
24589         * cs-tokenizer.cs: Consume the suffix for floating values.
24590
24591         * expression.cs (ParameterReference): figure out whether this is a
24592         reference parameter or not.  Kill an extra variable by computing
24593         the arg_idx during emission.
24594
24595         * parameter.cs (Parameters.GetParameterInfo): New overloaded
24596         function that returns whether a parameter is an out/ref value or not.
24597
24598         (Parameter.ParameterType): The type of the parameter (base,
24599         without ref/out applied).
24600
24601         (Parameter.Resolve): Perform resolution here.
24602         (Parameter.ExternalType): The full type (with ref/out applied).
24603
24604         * statement.cs (Using.Emit, Using.EmitExpression): Implement
24605         support for expressions on the using statement.
24606
24607 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
24608
24609         * statement.cs (Using.EmitLocalVariableDecls): Split the
24610         localvariable handling of the using statement.
24611
24612         (Block.EmitMeta): Keep track of variable count across blocks.  We
24613         were reusing slots on separate branches of blocks.
24614
24615         (Try.Emit): Emit the general code block, we were not emitting it. 
24616
24617         Check the type of the declaration to be an IDisposable or
24618         something that can be implicity converted to it. 
24619
24620         Emit conversions if required.
24621
24622         * ecore.cs (EmptyExpression): New utility class.
24623         (Expression.ImplicitConversionExists): New utility function.
24624
24625 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
24626
24627         * statement.cs (Using): Implement.
24628
24629         * expression.cs (LocalVariableReference): Support read only variables.
24630
24631         * statement.cs: Remove the explicit emit for the Leave opcode.
24632         (VariableInfo): Add a readonly field.
24633
24634 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
24635
24636         * ecore.cs (ConvCast): new class used to encapsulate the various
24637         explicit integer conversions that works in both checked and
24638         unchecked contexts.
24639
24640         (Expression.ConvertNumericExplicit): Use new ConvCast class to
24641         properly generate the overflow opcodes.
24642
24643 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
24644
24645         * statement.cs: The correct type for the EmptyExpression is the
24646         element_type, not the variable type.  Ravi pointed this out.
24647
24648 2001-12-04  Ravi Pratap  <ravi@ximian.com>
24649
24650         * class.cs (Method::Define): Handle PInvoke methods specially
24651         by using DefinePInvokeMethod instead of the usual one.
24652
24653         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
24654         above to do the task of extracting information and defining the method.
24655
24656 2001-12-04  Ravi Pratap  <ravi@ximian.com>
24657
24658         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
24659         of the condition for string type.
24660
24661         (Emit): Move that here. 
24662
24663         (ArrayCreation::CheckIndices): Keep string literals in their expression
24664         form.
24665
24666         (EmitDynamicInitializers): Handle strings appropriately.
24667
24668 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
24669
24670         * codegen.cs (EmitContext): Replace multiple variables with a
24671         single pointer to the current Switch statement.
24672
24673         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
24674         EmitContext.
24675
24676 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
24677
24678         * statement.cs 
24679
24680         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
24681         default'.
24682
24683         (Foreach.Emit): Foreach on arrays was not setting
24684         up the loop variables (for break/continue).
24685
24686         (GotoCase): Semi-implented.
24687
24688 2001-12-03  Ravi Pratap  <ravi@ximian.com>
24689
24690         * attribute.cs (CheckAttribute): Handle system attributes by using
24691         Attribute.GetAttributes to examine information we need.
24692
24693         (GetValidPlaces): Same here.
24694
24695         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
24696
24697         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
24698
24699         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
24700
24701         (Method::Define): Set appropriate flags if we have a DllImport attribute.
24702
24703         (Method::Emit): Handle the case when we are a PInvoke method.
24704
24705 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
24706
24707         * expression.cs: Use ResolveWithSimpleName on compound names.
24708
24709 2001-12-02  Ravi Pratap  <ravi@ximian.com>
24710
24711         * constant.cs (EmitConstant): Make sure we resolve the associated expression
24712         before trying to reduce it.
24713
24714         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
24715
24716         * constant.cs (LookupConstantValue): Implement.
24717
24718         (EmitConstant): Use the above in emitting the constant.
24719
24720         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
24721         that are user-defined by doing a LookupConstantValue on them.
24722
24723         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
24724         too, like above.
24725
24726 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
24727
24728         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
24729
24730         (BaseAccess.DoResolve): Implement.
24731
24732         (MemberAccess.DoResolve): Split this routine into a
24733         ResolveMemberAccess routine that can be used independently
24734
24735 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
24736
24737         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
24738         As that share bits of the implementation.  Is returns a boolean,
24739         while As returns the Type that is being probed.
24740
24741 2001-12-01  Ravi Pratap  <ravi@ximian.com>
24742
24743         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
24744         instead of a Literal - much easier.
24745
24746         (EnumInTransit): Remove - utterly useless :-)
24747
24748         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
24749
24750         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
24751
24752         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
24753         chain when we have no associated expression.
24754
24755 2001-11-30  Ravi Pratap  <ravi@ximian.com>
24756
24757         * constant.cs (Define): Use Location while reporting the errror.
24758
24759         Also emit a warning when 'new' is used and there is no inherited
24760         member to hide.
24761
24762         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
24763         populated.
24764
24765         (LookupEnumValue): Implement to lookup an enum member's value and define it
24766         if necessary.
24767
24768         (Populate): Re-write accordingly to use the above routine.
24769
24770 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
24771
24772         * expression.cs (This): Fix prototype for DoResolveLValue to
24773         override the base class DoResolveLValue.
24774
24775         * cs-parser.cs: Report errors cs574 and cs575 (destructor
24776         declarations) 
24777
24778         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
24779         (we need to load the address of the field here).  This fixes
24780         test-22. 
24781
24782         (FieldExpr.DoResolveLValue): Call the DoResolve
24783         function to initialize the Instance expression.
24784
24785         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
24786         correctly the GetEnumerator operation on a value type.
24787
24788         * cs-parser.jay: Add more simple parsing error catches.
24789
24790         * statement.cs (Switch): Add support for string switches.
24791         Handle null specially.
24792
24793         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
24794
24795 2001-11-28  Ravi Pratap  <ravi@ximian.com>
24796
24797         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
24798
24799         (declare_local_constant): New helper function.
24800
24801         * statement.cs (AddConstant): Keep a separate record of constants
24802
24803         (IsConstant): Implement to determine if a variable is a constant.
24804
24805         (GetConstantExpression): Implement.
24806
24807         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
24808
24809         * statement.cs (IsVariableDefined): Re-write.
24810
24811 2001-11-27  Ravi Pratap  <ravi@ximian.com>
24812
24813         * class.cs (TypeContainer::FindMembers): Look for constants
24814         in the case when we are looking for MemberTypes.Field
24815
24816         * expression.cs (MemberAccess::DoResolve): Check that in the
24817         case we are a FieldExpr and a Literal, we are not being accessed
24818         by an instance reference.
24819
24820         * cs-parser.jay (local_constant_declaration): Implement.
24821
24822         (declaration_statement): Implement for constant declarations.
24823
24824 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
24825
24826         * statement.cs (Switch): Catch double defaults.
24827
24828         (Switch): More work on the switch() statement
24829         implementation.  It works for integral values now, need to finish
24830         string support.
24831
24832
24833 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
24834
24835         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
24836         integer literals into other integer literals.  To be used by
24837         switch. 
24838
24839 2001-11-24  Ravi Pratap  <ravi@ximian.com>
24840
24841         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
24842         some memory.
24843
24844         (EmitDynamicInitializers): Cope with the above since we extract data
24845         directly from ArrayData now.
24846
24847         (ExpectInitializers): Keep track of whether initializers are mandatory
24848         or not.
24849
24850         (Bounds): Make it a hashtable to prevent the same dimension being 
24851         recorded for every element in that dimension.
24852
24853         (EmitDynamicInitializers): Fix bug which prevented the Set array method
24854         from being found.
24855
24856         Also fix bug which was causing the indices to be emitted in the reverse
24857         order.
24858
24859 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
24860
24861         * expression.cs (ArrayCreation): Implement the bits that Ravi left
24862         unfinished.  They do not work, because the underlying code is
24863         sloppy.
24864
24865 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
24866
24867         * cs-parser.jay: Remove bogus fixme.
24868
24869         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
24870         on Switch statement.
24871
24872 2001-11-23  Ravi Pratap  <ravi@ximian.com>
24873
24874         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
24875         the same. 
24876
24877         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
24878         parameter. Apparently, any expression is allowed. 
24879
24880         (ValidateInitializers): Update accordingly.
24881
24882         (CheckIndices): Fix some tricky bugs thanks to recursion.
24883
24884         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
24885         I was being completely brain-dead.
24886
24887         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
24888         and re-write acordingly.
24889
24890         (DelegateInvocation): Re-write accordingly.
24891
24892         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
24893
24894         (MakeByteBlob): Handle types more correctly.
24895
24896         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
24897         initialization from expressions but it is incomplete because I am a complete
24898         Dodo :-|
24899
24900 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
24901
24902         * statement.cs (If.Emit): Fix a bug that generated incorrect code
24903         on If.  Basically, we have to return `true' (ie, we do return to
24904         our caller) only if both branches of the if return.
24905
24906         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
24907         short-circuit operators, handle them as short circuit operators. 
24908
24909         (Cast.DoResolve): Resolve type.
24910         (Cast.Cast): Take an expression as the target type.
24911
24912         * cs-parser.jay (cast_expression): Remove old hack that only
24913         allowed a limited set of types to be handled.  Now we take a
24914         unary_expression and we resolve to a type during semantic
24915         analysis.
24916
24917         Use the grammar productions from Rhys to handle casts (this is
24918         not complete like Rhys syntax yet, we fail to handle that corner
24919         case that C# has regarding (-x), but we will get there.
24920
24921 2001-11-22  Ravi Pratap  <ravi@ximian.com>
24922
24923         * class.cs (EmitFieldInitializer): Take care of the case when we have a
24924         field which is an array type.
24925
24926         * cs-parser.jay (declare_local_variables): Support array initialization too.
24927
24928         * typemanager.cs (MakeKey): Implement.
24929
24930         (everywhere): Use the above appropriately.
24931
24932         * cs-parser.jay (for_statement): Update for array initialization while
24933         declaring variables.
24934
24935         * ecore.cs : The error message was correct, it's the variable's names that
24936         were misleading ;-) Make the code more readable.
24937
24938         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
24939         the correct type etc.
24940
24941         (ConvertExplicit): Handle Enum types by examining the underlying type.
24942
24943 2001-11-21  Ravi Pratap  <ravi@ximian.com>
24944
24945         * parameter.cs (GetCallingConvention): Always return
24946         CallingConventions.Standard for now.
24947
24948 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
24949
24950         * expression.cs (Binary.ResolveOperator): Update the values of `l'
24951         and `r' after calling DoNumericPromotions.
24952
24953         * ecore.cs: Fix error message (the types were in the wrong order).
24954
24955         * statement.cs (Foreach.ProbeCollectionType): Need to pass
24956         BindingFlags.Instance as well 
24957
24958         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
24959         implicit int literal conversion in an empty cast so that we
24960         propagate the right type upstream.
24961
24962         (UnboxCast): new class used to unbox value types.
24963         (Expression.ConvertExplicit): Add explicit type conversions done
24964         by unboxing.
24965
24966         (Expression.ImplicitNumericConversion): Oops, forgot to test for
24967         the target type before applying the implicit LongLiterals to ULong
24968         literal cast.
24969
24970 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
24971
24972         * cs-parser.jay (for_statement): Reworked the way For works: now
24973         we declare manually any variables that are introduced in
24974         for_initializer to solve the problem of having out-of-band code
24975         emition (that is what got for broken).
24976
24977         (declaration_statement): Perform the actual variable declaration
24978         that used to be done in local_variable_declaration here.
24979
24980         (local_variable_declaration): Do not declare anything, just pass
24981         the information on a DictionaryEntry
24982
24983 2001-11-20  Ravi Pratap  <ravi@ximian.com>
24984
24985         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
24986         re-write of the logic to now make it recursive.
24987
24988         (UpdateIndices): Re-write accordingly.
24989
24990         Store element data in a separate ArrayData list in the above methods.
24991
24992         (MakeByteBlob): Implement to dump the array data into a byte array.
24993
24994 2001-11-19  Ravi Pratap  <ravi@ximian.com>
24995
24996         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
24997         into CheckIndices.
24998
24999         * constant.cs (Define): Implement.
25000
25001         (EmitConstant): Re-write fully.
25002
25003         Pass in location info.
25004
25005         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
25006         respectively.
25007
25008         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
25009         DictionaryEntry since we need location info too.
25010
25011         (constant_declaration): Update accordingly.
25012
25013         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
25014         code into another method : UpdateIndices.
25015
25016 2001-11-18  Ravi Pratap  <ravi@ximian.com>
25017
25018         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
25019         some type checking etc.
25020
25021 2001-11-17  Ravi Pratap  <ravi@ximian.com>
25022
25023         * expression.cs (ArrayCreation::ValidateInitializers): Implement
25024         bits to provide dimension info if the user skips doing that.
25025
25026         Update second constructor to store the rank correctly.
25027
25028 2001-11-16  Ravi Pratap  <ravi@ximian.com>
25029
25030         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
25031         and try to implement.
25032
25033         * ../errors/cs0150.cs : Add.
25034
25035         * ../errors/cs0178.cs : Add.
25036
25037 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
25038
25039         * statement.cs: Implement foreach on multi-dimensional arrays. 
25040
25041         * parameter.cs (Parameters.GetParameterByName): Also lookup the
25042         name of the params argument.
25043
25044         * expression.cs: Use EmitStoreOpcode to get the right opcode while
25045         initializing the array.
25046
25047         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
25048         we can use this elsewhere.
25049
25050         * statement.cs: Finish implementation of foreach for single
25051         dimension arrays.
25052
25053         * cs-parser.jay: Use an out-of-band stack to pass information
25054         around, I wonder why I need this.
25055
25056         foreach_block: Make the new foreach_block the current_block.
25057
25058         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
25059         function used to return a static Parameters structure.  Used for
25060         empty parameters, as those are created very frequently.
25061
25062         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
25063
25064 2001-11-15  Ravi Pratap  <ravi@ximian.com>
25065
25066         * interface.cs : Default modifier is private, not public. The
25067         make verify test passes again.
25068
25069 2001-11-15  Ravi Pratap  <ravi@ximian.com>
25070
25071         * support.cs (ReflectionParameters): Fix logic to determine
25072         whether the last parameter is a params one. Test 9 passes again.
25073
25074         * delegate.cs (Populate): Register the builders we define with
25075         RegisterParameterForBuilder. Test 19 passes again.
25076
25077         * cs-parser.jay (property_declaration): Reference $6 instead
25078         of $$ to get at the location.
25079
25080         (indexer_declaration): Similar stuff.
25081
25082         (attribute): Ditto.
25083
25084         * class.cs (Property): Register parameters for the Get and Set methods
25085         if they exist. Test 23 passes again.
25086
25087         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
25088         call to EmitArguments as we are sure there aren't any params arguments. 
25089         Test 32 passes again.
25090
25091         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
25092         IndexOutOfRangeException. 
25093
25094         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
25095         Test 33 now passes again.
25096
25097 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
25098
25099         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
25100         broke a bunch of things.  Will have to come up with a better way
25101         of tracking locations.
25102
25103         * statement.cs: Implemented foreach for single dimension arrays.
25104
25105 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
25106
25107         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
25108         an error.  This removes the lookup from the critical path.
25109
25110         * cs-parser.jay: Removed use of temporary_loc, which is completely
25111         broken. 
25112
25113 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
25114
25115         * support.cs (ReflectionParameters.ParameterModifier): Report
25116         whether the argument is a PARAMS argument or not.
25117
25118         * class.cs: Set the attribute `ParamArrayAttribute' on the
25119         parameter argument.
25120
25121         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
25122         and cons_param_array_attribute (ConstructorInfo for
25123         ParamArrayAttribute)., 
25124
25125         * codegen.cs: Emit the return using the `Return' statement, that
25126         way we can report the error correctly for missing return values. 
25127
25128         * class.cs (Method.Emit): Clean up.
25129
25130         * expression.cs (Argument.Resolve): Take another argument: the
25131         location where this argument is used.  Notice that this is not
25132         part of the "Argument" class as to reduce the size of the
25133         structure (we know the approximate location anyways).
25134
25135         Test if the argument is a variable-reference, if not, then
25136         complain with a 206.
25137
25138         (Argument.Emit): Emit addresses of variables.
25139
25140         (Argument.FullDesc): Simplify.
25141
25142         (Invocation.DoResolve): Update for Argument.Resolve.
25143
25144         (ElementAccess.DoResolve): ditto.
25145
25146         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
25147         method should be virtual, as this method is always virtual.
25148
25149         (NewDelegate.DoResolve): Update for Argument.Resolve.
25150
25151         * class.cs (ConstructorInitializer.DoResolve): ditto.
25152
25153         * attribute.cs (Attribute.Resolve): ditto.
25154
25155 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
25156
25157         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
25158
25159         * expression.cs (ParameterReference): Drop IStackStorage and implement
25160         IAssignMethod instead. 
25161
25162         (LocalVariableReference): ditto.
25163
25164         * ecore.cs (FieldExpr): Drop IStackStorage and implement
25165         IAssignMethod instead. 
25166
25167 2001-11-13  Miguel de Icaza <miguel@ximian.com>
25168
25169         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
25170         enumerations that are used in heavily used structures derive from
25171         byte in a laughable and pathetic attempt to reduce memory usage.
25172         This is the kind of pre-optimzations that you should not do at
25173         home without adult supervision.
25174
25175         * expression.cs (UnaryMutator): New class, used to handle ++ and
25176         -- separatedly from the other unary operators.  Cleans up the
25177         code, and kills the ExpressionStatement dependency in Unary.
25178
25179         (Unary): Removed `method' and `Arguments' from this class, making
25180         it smaller, and moving it all to SimpleCall, so I can reuse this
25181         code in other locations and avoid creating a lot of transient data
25182         strucutres when not required.
25183
25184         * cs-parser.jay: Adjust for new changes.
25185
25186 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
25187
25188         * enum.cs (Enum.Populate): If there is a failure during
25189         definition, return
25190
25191         * cs-parser.jay (opt_enum_base): we used to catch type errors
25192         here, but this is really incorrect.  The type error should be
25193         catched during semantic analysis.
25194
25195 2001-12-11  Ravi Pratap  <ravi@ximian.com>
25196
25197         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
25198         current_local_parameters as expected since I, in my stupidity, had forgotten
25199         to do this :-)
25200
25201         * attribute.cs (GetValidPlaces): Fix stupid bug.
25202
25203         * class.cs (Method::Emit): Perform check on applicability of attributes.
25204
25205         (Constructor::Emit): Ditto.
25206
25207         (Field::Emit): Ditto.
25208
25209         (Field.Location): Store location information.
25210
25211         (Property, Event, Indexer, Operator): Ditto.
25212
25213         * cs-parser.jay (field_declaration): Pass in location for each field.
25214
25215         * ../errors/cs0592.cs : Add.
25216
25217 2001-11-12  Ravi Pratap  <ravi@ximian.com>
25218
25219         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
25220
25221         (InitCoreTypes): Update accordingly.
25222
25223         (RegisterAttrType, LookupAttr): Implement.
25224
25225         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
25226         info about the same.
25227
25228         (Resolve): Update to populate the above as necessary.
25229
25230         (Error592): Helper.
25231
25232         (GetValidPlaces): Helper to the above.
25233
25234         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
25235
25236         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
25237
25238 2001-11-12  Ravi Pratap  <ravi@ximian.com>
25239
25240         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
25241
25242         * ../errors/cs0617.cs : Add.
25243
25244 2001-11-11  Ravi Pratap  <ravi@ximian.com>
25245
25246         * enum.cs (Emit): Rename to Populate to be more consistent with what
25247         we expect it to do and when exactly it is called.
25248
25249         * class.cs, rootcontext.cs : Update accordingly.
25250
25251         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
25252         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
25253
25254         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
25255
25256         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
25257         of a fieldinfo using the above, when dealing with a FieldBuilder.
25258
25259 2001-11-10  Ravi Pratap  <ravi@ximian.com>
25260
25261         * ../errors/cs0031.cs : Add.
25262
25263         * ../errors/cs1008.cs : Add.
25264
25265         * ../errrors/cs0543.cs : Add.
25266
25267         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
25268         enum type.
25269
25270         (FindMembers): Implement.
25271
25272         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
25273         enums and delegates too.
25274
25275         (enum_types): Rename to builder_to_enum.
25276
25277         (delegate_types): Rename to builder_to_delegate.
25278
25279         * delegate.cs (FindMembers): Implement.
25280
25281 2001-11-09  Ravi Pratap  <ravi@ximian.com>
25282
25283         * typemanager.cs (IsEnumType): Implement.
25284
25285         * enum.cs (Emit): Re-write parts to account for the underlying type
25286         better and perform checking etc.
25287
25288         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
25289         of the underlying type.
25290
25291         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
25292         value
25293
25294         * enum.cs (error31): Helper to report error #31.
25295
25296         * cs-parser.jay (enum_declaration): Store location of each member too.
25297
25298         * enum.cs (member_to_location): New hashtable. 
25299
25300         (AddEnumMember): Update location hashtable.
25301
25302         (Emit): Use the location of each member while reporting errors.
25303
25304 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
25305
25306         * cs-parser.jay: A for_initializer if is a
25307         local_variable_declaration really ammount to have an implicit
25308         block with the variable declaration and no initializer for for.
25309
25310         * statement.cs (For.Emit): Cope with null initializers.
25311
25312         This fixes the infinite loop on for initializers.
25313
25314 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
25315
25316         * enum.cs: More cleanup.
25317
25318         * ecore.cs: Remove dead code.
25319
25320         * class.cs (Property.Emit): More simplification.
25321         (Event.Emit): ditto.
25322
25323         Reworked to have less levels of indentation.
25324
25325 2001-11-08  Ravi Pratap  <ravi@ximian.com>
25326
25327         * class.cs (Property): Emit attributes.
25328
25329         (Field): Ditto.
25330
25331         (Event): Ditto.
25332
25333         (Indexer): Ditto.
25334
25335         (Operator): Ditto.
25336
25337         * enum.cs (Emit): Ditto.
25338
25339         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
25340         Enums too.
25341
25342         * class.cs (Field, Event, etc.): Move attribute generation into the
25343         Emit method everywhere.
25344
25345         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
25346         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
25347         as we had no way of defining nested enums !
25348
25349         * rootcontext.cs : Adjust code accordingly.
25350
25351         * typemanager.cs (AddEnumType): To keep track of enum types separately.
25352
25353 2001-11-07  Ravi Pratap  <ravi@ximian.com>
25354
25355         * expression.cs (EvalConstantExpression): Move into ecore.cs
25356
25357         * enum.cs (Enum): Rename some members and make them public and readonly
25358         according to our convention.
25359
25360         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
25361         nothing else.
25362
25363         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
25364
25365         (Enum::Emit): Write a simple version for now which doesn't try to compute
25366         expressions. I shall modify this to be more robust in just a while.
25367
25368         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
25369
25370         (TypeContainer::CloseType): Create the Enum types too.
25371
25372         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
25373
25374         * expression.cs (EvalConstantExpression): Get rid of completely.
25375
25376         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
25377         user-defined values and other cases.
25378
25379         (IsValidEnumLiteral): Helper function.
25380
25381         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
25382         out there in the case we had a literal FieldExpr.
25383
25384         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
25385
25386         (Literalize): Revamp a bit to take two arguments.
25387
25388         (EnumLiteral): New class which derives from Literal to wrap enum literals.
25389
25390 2001-11-06  Ravi Pratap  <ravi@ximian.com>
25391
25392         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
25393
25394         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
25395
25396         (Resolve): Use the above to ensure we have proper initializers.
25397
25398 2001-11-05  Ravi Pratap  <ravi@ximian.com>
25399
25400         * expression.cs (Expression::EvalConstantExpression): New method to 
25401         evaluate constant expressions.
25402
25403         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
25404
25405 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
25406
25407         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
25408         in an array.
25409
25410         (Binary.ResolveOperator): Handle operator != (object a, object b)
25411         and operator == (object a, object b);
25412
25413         (Binary.DoNumericPromotions): Indicate whether the numeric
25414         promotion was possible.
25415
25416         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
25417         Implement.  
25418
25419         Made the ArrayAccess implement interface IAssignMethod instead of
25420         IStackStore as the order in which arguments are passed reflects
25421         this.
25422
25423         * assign.cs: Instead of using expr.ExprClass to select the way of
25424         assinging, probe for the IStackStore/IAssignMethod interfaces.
25425
25426         * typemanager.cs: Load InitializeArray definition.
25427
25428         * rootcontext.cs (RootContext.MakeStaticData): Used to define
25429         static data that can be used to initialize arrays. 
25430
25431 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
25432
25433         * expression.cs: Handle operator== and operator!= for booleans.
25434
25435         (Conditioal.Reduce): Implement reducer for the ?: operator.
25436
25437         (Conditional.Resolve): Implement dead code elimination.
25438
25439         (Binary.Resolve): Catch string literals and return a new
25440         concatenated string.
25441
25442         (Unary.Reduce): Implement reduction of unary expressions.
25443
25444         * ecore.cs: Split out the expression core handling here.
25445
25446         (Expression.Reduce): New method used to perform constant folding
25447         and CSE.  This is needed to support constant-expressions. 
25448
25449         * statement.cs (Statement.EmitBoolExpression): Pass true and false
25450         targets, and optimize for !x.
25451
25452 2001-11-04  Ravi Pratap  <ravi@ximian.com>
25453
25454         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
25455         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
25456         set custom atttributes.
25457
25458         * literal.cs (Literal::GetValue): New abstract method to return the actual
25459         value of the literal, cast as an object.
25460
25461         (*Literal): Implement GetValue method.
25462
25463         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
25464         expressions to the arraylist but objects of type Argument.
25465
25466         * class.cs (TypeContainer::Emit): Emit our attributes too.
25467
25468         (Method::Emit, Constructor::Emit): Ditto.
25469
25470         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
25471         to be ignoring earlier.
25472
25473 2001-11-03  Ravi Pratap  <ravi@ximian.com>
25474
25475         * attribute.cs (AttributeSection::Define): Implement to do the business
25476         of constructing a CustomAttributeBuilder.
25477
25478         (Attribute): New trivial class. Increases readability of code.  
25479
25480         * cs-parser.jay : Update accordingly.
25481
25482         (positional_argument_list, named_argument_list, named_argument): New rules
25483
25484         (attribute_arguments): Use the above so that we are more correct.
25485
25486 2001-11-02  Ravi Pratap  <ravi@ximian.com>
25487
25488         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
25489         to perform all checks for a method with a params parameter.
25490
25491         (Invocation::OverloadResolve): Update to use the above method and therefore
25492         cope correctly with params method invocations.
25493
25494         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
25495         params too.
25496
25497         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
25498         constructors in our parent too because we can't afford to miss out on 
25499         protected ones ;-)
25500
25501         * attribute.cs (AttributeSection): New name for the class Attribute
25502
25503         Other trivial changes to improve readability.
25504
25505         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
25506         use the new class names.
25507
25508 2001-11-01  Ravi Pratap  <ravi@ximian.com>
25509
25510         * class.cs (Method::Define): Complete definition for params types too
25511
25512         (Indexer::Define): Ditto.
25513
25514         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
25515         Cope everywhere with a request for info about the array parameter.
25516
25517 2001-11-01  Ravi Pratap  <ravi@ximian.com>
25518
25519         * tree.cs (RecordNamespace): Fix up to check for the correct key.
25520
25521         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
25522         local_variable_type to extract the string corresponding to the type.
25523
25524         (local_variable_type): Fixup the action to use the new helper method.
25525
25526         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
25527         go.
25528
25529         * expression.cs : Clean out code which uses the above.
25530
25531 2001-10-31  Ravi Pratap  <ravi@ximian.com>
25532
25533         * typemanager.cs (RegisterMethod): Check if we already have an existing key
25534         and bale out if necessary by returning a false.
25535
25536         (RegisterProperty): Ditto.
25537
25538         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
25539         and print out appropriate error messages.
25540
25541         * interface.cs (everywhere): Ditto.
25542
25543         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
25544         location to constructor.
25545
25546         * class.cs (Property, Event, Indexer): Update accordingly.
25547
25548         * ../errors/cs111.cs : Added.
25549
25550         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
25551         of a method, as laid down by the spec.
25552
25553         (Invocation::OverloadResolve): Use the above method.
25554
25555 2001-10-31  Ravi Pratap  <ravi@ximian.com>
25556
25557         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
25558         now take a TypeContainer and a Parameters object.
25559
25560         (ParameterData): Modify return type of ParameterModifier method to be 
25561         Parameter.Modifier and not a string.
25562
25563         (ReflectionParameters, InternalParameters): Update accordingly.
25564
25565         * expression.cs (Argument::GetParameterModifier): Same here.
25566
25567         * support.cs (InternalParameters::ParameterType): Find a better way of determining
25568         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
25569         symbol in it at all so maybe this is only for now.
25570
25571 2001-10-30  Ravi Pratap  <ravi@ximian.com>
25572
25573         * support.cs (InternalParameters): Constructor now takes an extra argument 
25574         which is the actual Parameters class.
25575
25576         (ParameterDesc): Update to provide info on ref/out modifiers.
25577
25578         * class.cs (everywhere): Update call to InternalParameters to pass in
25579         the second argument too.
25580
25581         * support.cs (ParameterData): Add ParameterModifier, which is a method 
25582         to return the modifier info [ref/out etc]
25583
25584         (InternalParameters, ReflectionParameters): Implement the above.
25585
25586         * expression.cs (Argument::ParameterModifier): Similar function to return
25587         info about the argument's modifiers.
25588
25589         (Invocation::OverloadResolve): Update to take into account matching modifiers 
25590         too.
25591
25592         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
25593         a new SetFormalParameters object which we pass to InternalParameters.
25594
25595 2001-10-30  Ravi Pratap  <ravi@ximian.com>
25596
25597         * expression.cs (NewArray): Merge into the ArrayCreation class.
25598
25599 2001-10-29  Ravi Pratap  <ravi@ximian.com>
25600
25601         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
25602         NewUserdefinedArray into one as there wasn't much of a use in having
25603         two separate ones.
25604
25605         * expression.cs (Argument): Change field's name to ArgType from Type.
25606
25607         (Type): New readonly property which returns the proper type, taking into 
25608         account ref/out modifiers.
25609
25610         (everywhere): Adjust code accordingly for the above.
25611
25612         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
25613         whether we are emitting for a ref or out parameter.
25614
25615         * expression.cs (Argument::Emit): Use the above field to set the state.
25616
25617         (LocalVariableReference::Emit): Update to honour the flag and emit the
25618         right stuff.
25619
25620         * parameter.cs (Attributes): Set the correct flags for ref parameters.
25621
25622         * expression.cs (Argument::FullDesc): New function to provide a full desc.
25623
25624         * support.cs (ParameterData): Add method ParameterDesc to the interface.
25625
25626         (ReflectionParameters, InternalParameters): Implement the above method.
25627
25628         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
25629         reporting errors.
25630
25631         (Invocation::FullMethodDesc): Ditto. 
25632
25633 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
25634
25635         * cs-parser.jay: Add extra production for the second form of array
25636         creation. 
25637
25638         * expression.cs (ArrayCreation): Update to reflect the above
25639         change. 
25640
25641         * Small changes to prepare for Array initialization.
25642
25643 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
25644
25645         * typemanager.cs (ImplementsInterface): interface might be null;
25646         Deal with this problem;
25647
25648         Also, we do store negative hits on the cache (null values), so use
25649         this instead of calling t.GetInterfaces on the type everytime.
25650
25651 2001-10-28  Ravi Pratap  <ravi@ximian.com>
25652
25653         * typemanager.cs (IsBuiltinType): New method to help determine the same.
25654
25655         * expression.cs (New::DoResolve): Get rid of array creation code and instead
25656         split functionality out into different classes.
25657
25658         (New::FormArrayType): Move into NewBuiltinArray.
25659
25660         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
25661         quite useless.
25662
25663         (NewBuiltinArray): New class to handle creation of built-in arrays.
25664
25665         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
25666         account creation of one-dimensional arrays.
25667
25668         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
25669
25670         (NewUserdefinedArray::DoResolve): Implement.
25671
25672         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
25673
25674         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
25675         we maintain inside the TypeManager. This is necessary to perform lookups on the
25676         module builder.
25677
25678         (LookupType): Update to perform GetType on the module builders too.     
25679
25680         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
25681
25682         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
25683
25684 2001-10-23  Ravi Pratap  <ravi@ximian.com>
25685
25686         * expression.cs (New::DoResolve): Implement guts of array creation.
25687
25688         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
25689
25690 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
25691
25692         * expression.cs: Fix bug I introduced lsat night that broke
25693         Delegates. 
25694
25695         (Expression.Resolve): Report a 246 error (can not resolve name)
25696         if we find a SimpleName in the stream.
25697
25698         (Expression.ResolveLValue): Ditto.
25699
25700         (Expression.ResolveWithSimpleName): This function is a variant of
25701         ResolveName, this one allows SimpleNames to be returned without a
25702         warning.  The only consumer of SimpleNames is MemberAccess
25703
25704 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
25705
25706         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
25707         might arrive here.  I have my doubts that this is correct.
25708
25709         * statement.cs (Lock): Implement lock statement.
25710
25711         * cs-parser.jay: Small fixes to support `lock' and `using'
25712
25713         * cs-tokenizer.cs: Remove extra space
25714
25715         * driver.cs: New flag --checked, allows to turn on integer math
25716         checking. 
25717
25718         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
25719         Threading.Monitor.Exit 
25720
25721 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
25722
25723         * expression.cs (IndexerAccess::DoResolveLValue): Set the
25724         Expression Class to be IndexerAccess.
25725
25726         Notice that Indexer::DoResolve sets the eclass to Value.
25727
25728 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
25729
25730         * class.cs (TypeContainer::Emit): Emit code for indexers.
25731
25732         * assign.cs (IAssignMethod): New interface implemented by Indexers
25733         and Properties for handling assignment.
25734
25735         (Assign::Emit): Simplify and reuse code. 
25736
25737         * expression.cs (IndexerAccess, PropertyExpr): Implement
25738         IAssignMethod, clean up old code. 
25739
25740 2001-10-22  Ravi Pratap  <ravi@ximian.com>
25741
25742         * typemanager.cs (ImplementsInterface): New method to determine if a type
25743         implements a given interface. Provides a nice cache too.
25744
25745         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
25746         method.
25747
25748         (ConvertReferenceExplicit): Ditto.
25749
25750         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
25751         various methods, with correct names etc.
25752
25753         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
25754         Operator.UnaryNegation.
25755
25756         * cs-parser.jay (operator_declarator): Be a little clever in the case where
25757         we have a unary plus or minus operator.
25758
25759         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
25760         UnaryMinus.
25761
25762         * everywhere : update accordingly.
25763
25764         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
25765         respectively.
25766
25767         * class.cs (Method::Define): For the case where we are implementing a method
25768         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
25769         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
25770
25771 2001-10-21  Ravi Pratap  <ravi@ximian.com>
25772
25773         * interface.cs (FindMembers): Implement to work around S.R.E
25774         lameness.
25775
25776         * typemanager.cs (IsInterfaceType): Implement.
25777
25778         (FindMembers): Update to handle interface types too.
25779
25780         * expression.cs (ImplicitReferenceConversion): Re-write bits which
25781         use IsAssignableFrom as that is not correct - it doesn't work.
25782
25783         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
25784         and accordingly override EmitStatement.
25785
25786         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
25787         using the correct logic :-)
25788
25789 2001-10-19  Ravi Pratap  <ravi@ximian.com>
25790
25791         * ../errors/cs-11.cs : Add to demonstrate error -11 
25792
25793 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
25794
25795         * assign.cs (Assign::Resolve): Resolve right hand side first, and
25796         then pass this as a hint to ResolveLValue.
25797
25798         * expression.cs (FieldExpr): Add Location information
25799
25800         (FieldExpr::LValueResolve): Report assignment to readonly
25801         variable. 
25802
25803         (Expression::ExprClassFromMemberInfo): Pass location information.
25804
25805         (Expression::ResolveLValue): Add new method that resolves an
25806         LValue. 
25807
25808         (Expression::DoResolveLValue): Default invocation calls
25809         DoResolve. 
25810
25811         (Indexers): New class used to keep track of indexers in a given
25812         Type. 
25813
25814         (IStackStore): Renamed from LValue, as it did not really describe
25815         what this did.  Also ResolveLValue is gone from this interface and
25816         now is part of Expression.
25817
25818         (ElementAccess): Depending on the element access type
25819
25820         * typemanager.cs: Add `indexer_name_type' as a Core type
25821         (System.Runtime.CompilerServices.IndexerNameAttribute)
25822
25823         * statement.cs (Goto): Take a location.
25824
25825 2001-10-18  Ravi Pratap  <ravi@ximian.com>
25826
25827         * delegate.cs (Delegate::VerifyDelegate): New method to verify
25828         if two delegates are compatible.
25829
25830         (NewDelegate::DoResolve): Update to take care of the case when
25831         we instantiate a delegate from another delegate.
25832
25833         * typemanager.cs (FindMembers): Don't even try to look up members
25834         of Delegate types for now.
25835
25836 2001-10-18  Ravi Pratap  <ravi@ximian.com>
25837
25838         * delegate.cs (NewDelegate): New class to take care of delegate
25839         instantiation.
25840
25841         * expression.cs (New): Split the delegate related code out into 
25842         the NewDelegate class.
25843
25844         * delegate.cs (DelegateInvocation): New class to handle delegate 
25845         invocation.
25846
25847         * expression.cs (Invocation): Split out delegate related code into
25848         the DelegateInvocation class.
25849
25850 2001-10-17  Ravi Pratap  <ravi@ximian.com>
25851
25852         * expression.cs (New::DoResolve): Implement delegate creation fully
25853         and according to the spec.
25854
25855         (New::DoEmit): Update to handle delegates differently.
25856
25857         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
25858         because of which we were printing out arguments in reverse order !
25859
25860         * delegate.cs (VerifyMethod): Implement to check if the given method
25861         matches the delegate.
25862
25863         (FullDelegateDesc): Implement.
25864
25865         (VerifyApplicability): Implement.
25866
25867         * expression.cs (Invocation::DoResolve): Update to accordingly handle
25868         delegate invocations too.
25869
25870         (Invocation::Emit): Ditto.
25871
25872         * ../errors/cs1593.cs : Added.
25873
25874         * ../errors/cs1594.cs : Added.
25875
25876         * delegate.cs (InstanceExpression, TargetMethod): New properties.
25877
25878 2001-10-16  Ravi Pratap  <ravi@ximian.com>
25879
25880         * typemanager.cs (intptr_type): Core type for System.IntPtr
25881
25882         (InitCoreTypes): Update for the same.
25883
25884         (iasyncresult_type, asynccallback_type): Ditto.
25885
25886         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
25887         correct.
25888
25889         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
25890         too.
25891
25892         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
25893         the builders for the 4 members of a delegate type :-)
25894
25895         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
25896         type.
25897
25898         * expression.cs (New::DoResolve): Implement guts for delegate creation.
25899
25900         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
25901
25902 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
25903
25904         * statement.cs (Break::Emit): Implement.   
25905         (Continue::Emit): Implement.
25906
25907         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
25908         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
25909         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
25910         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
25911         end loop
25912
25913         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
25914         properties that track the label for the current loop (begin of the
25915         loop and end of the loop).
25916
25917 2001-10-15  Ravi Pratap  <ravi@ximian.com>
25918
25919         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
25920         use of emitting anything at all.
25921
25922         * class.cs, rootcontext.cs : Get rid of calls to the same.
25923
25924         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
25925
25926         (Populate): Define the constructor correctly and set the implementation
25927         attributes.
25928
25929         * typemanager.cs (delegate_types): New hashtable to hold delegates that
25930         have been defined.
25931
25932         (AddDelegateType): Implement.
25933
25934         (IsDelegateType): Implement helper method.
25935
25936         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
25937
25938         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
25939         and accordingly handle it.
25940
25941         * delegate.cs (Populate): Take TypeContainer argument.
25942         Implement bits to define the Invoke method. However, I still haven't figured out
25943         how to take care of the native int bit :-(
25944
25945         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
25946         Qualify the name of the delegate, not its return type !
25947
25948         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
25949         conversion.
25950
25951         (StandardConversionExists): Checking for array types turns out to be recursive.
25952
25953         (ConvertReferenceExplicit): Implement array conversion.
25954
25955         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
25956
25957 2001-10-12  Ravi Pratap  <ravi@ximian.com>
25958
25959         * cs-parser.jay (delegate_declaration): Store the fully qualified
25960         name as it is a type declaration.
25961
25962         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
25963         readonly.
25964
25965         (DefineDelegate): Renamed from Define. Does the same thing essentially,
25966         as TypeContainer::DefineType.
25967
25968         (Populate): Method in which all the definition of the various methods (Invoke)
25969         etc is done.
25970
25971         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
25972         see.
25973
25974         (CloseDelegate): Finally creates the delegate.
25975
25976         * class.cs (TypeContainer::DefineType): Update to define delegates.
25977         (Populate, Emit and CloseType): Do the same thing here too.
25978
25979         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
25980         delegates in all these operations.
25981
25982 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
25983
25984         * expression.cs: LocalTemporary: a new expression used to
25985         reference a temporary that has been created.
25986
25987         * assign.cs: Handle PropertyAccess back here, so that we can
25988         provide the proper semantic access to properties.
25989
25990         * expression.cs (Expression::ConvertReferenceExplicit): Implement
25991         a few more explicit conversions. 
25992
25993         * modifiers.cs: `NEW' modifier maps to HideBySig.
25994
25995         * expression.cs (PropertyExpr): Make this into an
25996         ExpressionStatement, and support the EmitStatement code path. 
25997
25998         Perform get/set error checking, clean up the interface.
25999
26000         * assign.cs: recognize PropertyExprs as targets, and if so, turn
26001         them into toplevel access objects.
26002
26003 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
26004
26005         * expression.cs: PropertyExpr::PropertyExpr: use work around the
26006         SRE.
26007
26008         * typemanager.cs: Keep track here of our PropertyBuilders again to
26009         work around lameness in SRE.
26010
26011 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
26012
26013         * expression.cs (LValue::LValueResolve): New method in the
26014         interface, used to perform a second resolution pass for LValues. 
26015
26016         (This::DoResolve): Catch the use of this in static methods.
26017
26018         (This::LValueResolve): Implement.
26019
26020         (This::Store): Remove warning, assigning to `this' in structures
26021         is 
26022
26023         (Invocation::Emit): Deal with invocation of
26024         methods on value types.  We need to pass the address to structure
26025         methods rather than the object itself.  (The equivalent code to
26026         emit "this" for structures leaves the entire structure on the
26027         stack instead of a pointer to it). 
26028
26029         (ParameterReference::DoResolve): Compute the real index for the
26030         argument based on whether the method takes or not a `this' pointer
26031         (ie, the method is static).
26032
26033         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
26034         value types returned from functions when we need to invoke a
26035         method on the sturcture.
26036
26037
26038 2001-10-11  Ravi Pratap  <ravi@ximian.com>
26039
26040         * class.cs (TypeContainer::DefineType): Method to actually do the business of
26041         defining the type in the Modulebuilder or Typebuilder. This is to take
26042         care of nested types which need to be defined on the TypeBuilder using
26043         DefineNestedMethod.
26044
26045         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
26046         methods in RootContext, only ported to be part of TypeContainer.
26047
26048         (TypeContainer::GetInterfaceOrClass): Ditto.
26049
26050         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
26051
26052         * interface.cs (Interface::DefineInterface): New method. Does exactly
26053         what RootContext.CreateInterface did earlier, only it takes care of nested types 
26054         too.
26055
26056         (Interface::GetInterfaces): Move from RootContext here and port.
26057
26058         (Interface::GetInterfaceByName): Same here.
26059
26060         * rootcontext.cs (ResolveTree): Re-write.
26061
26062         (PopulateTypes): Re-write.
26063
26064         * class.cs (TypeContainer::Populate): Populate nested types too.
26065         (TypeContainer::Emit): Emit nested members too.
26066
26067         * typemanager.cs (AddUserType): Do not make use of the FullName property,
26068         instead just use the name argument passed in as it is already fully
26069         qualified.
26070
26071         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
26072         to TypeContainer mapping to see if a type is user-defined.
26073
26074         * class.cs (TypeContainer::CloseType): Implement. 
26075
26076         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
26077         the default constructor.
26078
26079         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
26080         twice.
26081
26082         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
26083
26084         * interface.cs (CloseType): Create the type here.
26085
26086         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
26087         the hierarchy.
26088
26089         Remove all the methods which are now in TypeContainer.
26090
26091 2001-10-10  Ravi Pratap  <ravi@ximian.com>
26092
26093         * delegate.cs (Define): Re-write bits to define the delegate
26094         correctly.
26095
26096 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
26097
26098         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
26099
26100         * expression.cs (ImplicitReferenceConversion): handle null as well
26101         as a source to convert to any reference type.
26102
26103         * statement.cs (Return): Perform any implicit conversions to
26104         expected return type.  
26105
26106         Validate use of return statement.  
26107
26108         * codegen.cs (EmitContext): Pass the expected return type here.
26109
26110         * class.cs (Method, Constructor, Property): Pass expected return
26111         type to EmitContext.
26112
26113 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
26114
26115         * expression.cs: Make DoResolve take an EmitContext instead of a
26116         TypeContainer.
26117
26118         Replaced `l' and `location' for `loc', for consistency.
26119
26120         (Error, Warning): Remove unneeded Tc argument.
26121
26122         * assign.cs, literal.cs, constant.cs: Update to new calling
26123         convention. 
26124
26125         * codegen.cs: EmitContext now contains a flag indicating whether
26126         code is being generated in a static method or not.
26127
26128         * cs-parser.jay: DecomposeQI, new function that replaces the old
26129         QualifiedIdentifier.  Now we always decompose the assembled
26130         strings from qualified_identifier productions into a group of
26131         memberaccesses.
26132
26133 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
26134
26135         * rootcontext.cs: Deal with field-less struct types correctly now
26136         by passing the size option to Define Type.
26137
26138         * class.cs: Removed hack that created one static field. 
26139
26140 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
26141
26142         * statement.cs: Moved most of the code generation here. 
26143
26144 2001-10-09  Ravi Pratap  <ravi@ximian.com>
26145
26146         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
26147         seem very right.
26148
26149         (ElementAccess): Remove useless bits for now - keep checks as the spec
26150         says.
26151
26152 2001-10-08  Ravi Pratap  <ravi@ximian.com>
26153
26154         * expression.cs (ElementAccess::DoResolve): Remove my crap code
26155         and start performing checks according to the spec.
26156
26157 2001-10-07  Ravi Pratap  <ravi@ximian.com>
26158
26159         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
26160         rank_specifiers instead.
26161
26162         (rank_specifiers): Change the order in which the rank specifiers are stored
26163
26164         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
26165
26166         * expression.cs (ElementAccess): Implement the LValue interface too.
26167
26168 2001-10-06  Ravi Pratap  <ravi@ximian.com>
26169
26170         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
26171         except that user defined conversions are not included.
26172
26173         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
26174         perform the conversion of the return type, if necessary.
26175
26176         (New::DoResolve): Check whether we are creating an array or an object
26177         and accordingly do the needful.
26178
26179         (New::Emit): Same here.
26180
26181         (New::DoResolve): Implement guts of array creation.
26182
26183         (New::FormLookupType): Helper function.
26184
26185 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
26186
26187         * codegen.cs: Removed most of the code generation here, and move the
26188         corresponding code generation bits to the statement classes. 
26189
26190         Added support for try/catch/finalize and throw.
26191
26192         * cs-parser.jay: Added support for try/catch/finalize.
26193
26194         * class.cs: Catch static methods having the flags override,
26195         virtual or abstract.
26196
26197         * expression.cs (UserCast): This user cast was not really doing
26198         what it was supposed to do.  Which is to be born in fully resolved
26199         state.  Parts of the resolution were being performed at Emit time! 
26200
26201         Fixed this code.
26202
26203 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
26204
26205         * expression.cs: Implicity convert the result from UserCast.
26206
26207 2001-10-05  Ravi Pratap  <ravi@ximian.com>
26208
26209         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
26210         prevented it from working correctly. 
26211
26212         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
26213         merely ConvertImplicit.
26214
26215 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
26216
26217         * typemanager.cs: Make the LookupTypeContainer function static,
26218         and not per-instance.  
26219
26220         * class.cs: Make static FindMembers (the one that takes a Type
26221         argument). 
26222
26223         * codegen.cs: Add EmitForeach here.
26224
26225         * cs-parser.jay: Make foreach a toplevel object instead of the
26226         inline expansion, as we need to perform semantic analysis on it. 
26227
26228 2001-10-05  Ravi Pratap  <ravi@ximian.com>
26229
26230         * expression.cs (Expression::ImplicitUserConversion): Rename to
26231         UserDefinedConversion.
26232
26233         (Expression::UserDefinedConversion): Take an extra argument specifying 
26234         whether we look for explicit user conversions too.
26235
26236         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
26237
26238         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
26239
26240         (ExplicitUserConversion): Make it a call to UserDefinedConversion
26241         with the appropriate arguments.
26242
26243         * cs-parser.jay (cast_expression): Record location too.
26244
26245         * expression.cs (Cast): Record location info.
26246
26247         (Expression::ConvertExplicit): Take location argument.
26248
26249         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
26250         to determine if we are doing explicit conversions.
26251
26252         (UserCast::Emit): Update accordingly.
26253
26254         (Expression::ConvertExplicit): Report an error if everything fails.
26255
26256         * ../errors/cs0030.cs : Add.
26257
26258 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
26259
26260         * modifiers.cs: If the ABSTRACT keyword is present, also set the
26261         virtual and newslot bits. 
26262
26263         * class.cs (TypeContainer::RegisterRequiredImplementations):
26264         Record methods we need.
26265
26266         (TypeContainer::MakeKey): Helper function to make keys for
26267         MethodBases, since the Methodbase key is useless.
26268
26269         (TypeContainer::Populate): Call RegisterRequiredImplementations
26270         before defining the methods.   
26271
26272         Create a mapping for method_builders_to_methods ahead of time
26273         instead of inside a tight loop.
26274
26275         (::RequireMethods):  Accept an object as the data to set into the
26276         hashtable so we can report interface vs abstract method mismatch.
26277
26278 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
26279
26280         * report.cs: Make all of it static.
26281
26282         * rootcontext.cs: Drop object_type and value_type computations, as
26283         we have those in the TypeManager anyways.
26284
26285         Drop report instance variable too, now it is a global.
26286
26287         * driver.cs: Use try/catch on command line handling.
26288
26289         Add --probe option to debug the error reporting system with a test
26290         suite. 
26291
26292         * report.cs: Add support for exiting program when a probe
26293         condition is reached.
26294
26295 2001-10-03  Ravi Pratap  <ravi@ximian.com>
26296
26297         * expression.cs (Binary::DoNumericPromotions): Fix the case when
26298         we do a forcible conversion regardless of type, to check if 
26299         ForceConversion returns a null.
26300
26301         (Binary::error19): Use location to report error.
26302
26303         (Unary::error23): Use location here too.
26304
26305         * ../errors/cs0019.cs : Check in.
26306
26307         * ../errors/cs0023.cs : Check in.
26308
26309         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
26310         case of a non-null MethodInfo object with a length of 0 !
26311
26312         (Binary::ResolveOperator): Flag error if overload resolution fails to find
26313         an applicable member - according to the spec :-)
26314         Also fix logic to find members in base types.
26315
26316         (Unary::ResolveOperator): Same here.
26317
26318         (Unary::report23): Change name to error23 and make first argument a TypeContainer
26319         as I was getting thoroughly confused between this and error19 :-)
26320
26321         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
26322         (::FindMostEncompassedType): Implement.
26323         (::FindMostEncompassingType): Implement.
26324         (::StandardConversionExists): Implement.
26325
26326         (UserImplicitCast): Re-vamp. We now need info about most specific
26327         source and target types so that we can do the necessary conversions.
26328
26329         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
26330         mathematical union with no duplicates.
26331
26332 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
26333
26334         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
26335         in order from base classes to child classes, so that we can in
26336         child classes look up in our parent for method names and
26337         attributes (required for handling abstract, virtual, new, override
26338         constructs: we need to instrospect our base class, and if we dont
26339         populate the classes in order, the introspection might be
26340         incorrect.  For example, a method could query its parent before
26341         the parent has any methods and would determine that the parent has
26342         no abstract methods (while it could have had them)).
26343
26344         (RootContext::CreateType): Record the order in which we define the
26345         classes.
26346
26347 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
26348
26349         * class.cs (TypeContainer::Populate): Also method definitions can
26350         fail now, keep track of this.
26351
26352         (TypeContainer::FindMembers): Implement support for
26353         DeclaredOnly/noDeclaredOnly flag.
26354
26355         (Constructor::Emit) Return the ConstructorBuilder.
26356
26357         (Method::Emit) Return the MethodBuilder. 
26358         Check for abstract or virtual methods to be public.
26359
26360         * rootcontext.cs (RootContext::CreateType): Register all the
26361         abstract methods required for the class to be complete and the
26362         interface methods that must be implemented. 
26363
26364         * cs-parser.jay: Report error 501 (method requires body if it is
26365         not marked abstract or extern).
26366
26367         * expression.cs (TypeOf::Emit): Implement.
26368
26369         * typemanager.cs: runtime_handle_type, new global type.
26370
26371         * class.cs (Property::Emit): Generate code for properties.
26372
26373 2001-10-02  Ravi Pratap  <ravi@ximian.com>
26374
26375         * expression.cs (Unary::ResolveOperator): Find operators on base type
26376         too - we now conform exactly to the spec.
26377
26378         (Binary::ResolveOperator): Same here.
26379
26380         * class.cs (Operator::Define): Fix minor quirk in the tests.
26381
26382         * ../errors/cs0215.cs : Added.
26383
26384         * ../errors/cs0556.cs : Added.
26385
26386         * ../errors/cs0555.cs : Added.
26387
26388 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
26389
26390         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
26391         single integer which is really efficient
26392
26393 2001-10-01  Ravi Pratap  <ravi@ximian.com>
26394
26395         *  expression.cs (Expression::ImplicitUserConversion): Use location
26396         even in the case when we are examining True operators.
26397  
26398         * class.cs (Operator::Define): Perform extensive checks to conform
26399         with the rules for operator overloading in the spec.
26400
26401         * expression.cs (Expression::ImplicitReferenceConversion): Implement
26402         some of the other conversions mentioned in the spec.
26403
26404         * typemanager.cs (array_type): New static member for the System.Array built-in
26405         type.
26406
26407         (cloneable_interface): For System.ICloneable interface.
26408
26409         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
26410         we start resolving the tree and populating types.
26411
26412         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
26413  
26414 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
26415
26416         * expression.cs (Expression::ExprClassFromMemberInfo,
26417         Expression::Literalize): Create literal expressions from
26418         FieldInfos which are literals.
26419
26420         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
26421         type casts, because they were wrong.  The test suite in tests
26422         caught these ones.
26423
26424         (ImplicitNumericConversion): ushort to ulong requires a widening
26425         cast. 
26426
26427         Int32 constant to long requires widening cast as well.
26428
26429         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
26430         for integers because the type on the stack is not i4.
26431
26432 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
26433
26434         * expression.cs (report118): require location argument. 
26435
26436         * parameter.cs: Do not dereference potential null value.
26437
26438         * class.cs: Catch methods that lack the `new' keyword when
26439         overriding a name.  Report warnings when `new' is used without
26440         anything being there to override.
26441
26442         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
26443
26444         * class.cs: Only add constructor to hashtable if it is non-null
26445         (as now constructors can fail on define).
26446
26447         (TypeManager, Class, Struct): Take location arguments.
26448
26449         Catch field instance initialization in structs as errors.
26450
26451         accepting_filter: a new filter for FindMembers that is static so
26452         that we dont create an instance per invocation.
26453
26454         (Constructor::Define): Catch errors where a struct constructor is
26455         parameterless 
26456
26457         * cs-parser.jay: Pass location information for various new
26458         constructs. 
26459
26460         * delegate.cs (Delegate): take a location argument.
26461
26462         * driver.cs: Do not call EmitCode if there were problesm in the
26463         Definition of the types, as many Builders wont be there. 
26464
26465         * decl.cs (Decl::Decl): Require a location argument.
26466
26467         * cs-tokenizer.cs: Handle properly hex constants that can not fit
26468         into integers, and find the most appropiate integer for it.
26469
26470         * literal.cs: Implement ULongLiteral.
26471
26472         * rootcontext.cs: Provide better information about the location of
26473         failure when CreateType fails.
26474
26475 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
26476
26477         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
26478         as well.
26479
26480         * expression.cs (Binary::CheckShiftArguments): Add missing type
26481         computation.
26482         (Binary::ResolveOperator): Add type to the logical and and logical
26483         or, Bitwise And/Or and Exclusive Or code paths, it was missing
26484         before.
26485
26486         (Binary::DoNumericPromotions): In the case where either argument
26487         is ulong (and most signed types combined with ulong cause an
26488         error) perform implicit integer constant conversions as well.
26489
26490 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
26491
26492         * expression.cs (UserImplicitCast): Method should always be
26493         non-null. 
26494         (Invocation::BetterConversion): Simplified test for IntLiteral.
26495
26496         (Expression::ImplicitNumericConversion): Split this routine out.
26497         Put the code that performs implicit constant integer conversions
26498         here. 
26499
26500         (Expression::Resolve): Become a wrapper around DoResolve so we can
26501         check eclass and type being set after resolve.
26502
26503         (Invocation::Badness): Remove this dead function
26504
26505         (Binary::ResolveOperator): Do not compute the expensive argumnets
26506         unless we have a union for it.
26507
26508         (Probe::Emit): Is needs to do an isinst and then
26509         compare against null.
26510
26511         (::CanConvert): Added Location argument.  If the Location argument
26512         is null (Location.Null), then we do not report errors.  This is
26513         used by the `probe' mechanism of the Explicit conversion.  We do
26514         not want to generate an error for something that the user
26515         explicitly requested to be casted.  But the pipeline for an
26516         explicit cast first tests for potential implicit casts.
26517
26518         So for now, if the Location is null, it means `Probe only' to
26519         avoid adding another argument.   Might have to revise this
26520         strategy later.
26521
26522         (ClassCast): New class used to type cast objects into arbitrary
26523         classes (used in Explicit Reference Conversions).
26524
26525         Implement `as' as well.
26526
26527         Reverted all the patches from Ravi below: they were broken:
26528
26529                 * The use of `level' as a mechanism to stop recursive
26530                   invocations is wrong.  That was there just to catch the
26531                   bug with a strack trace but not as a way of addressing
26532                   the problem.
26533
26534                   To fix the problem we have to *understand* what is going
26535                   on and the interactions and come up with a plan, not
26536                   just get things going.
26537
26538                 * The use of the type conversion cache that I proposed
26539                   last night had an open topic: How does this work across
26540                   protection domains.  A user defined conversion might not
26541                   be public in the location where we are applying the
26542                   conversion, a different conversion might be selected
26543                   (ie, private A->B (better) but public B->A (worse),
26544                   inside A, A->B applies, but outside it, B->A will
26545                   apply).
26546
26547                 * On top of that (ie, even if the above is solved),
26548                   conversions in a cache need to be abstract.  Ie, `To
26549                   convert from an Int to a Short use an OpcodeCast', not
26550                   `To convert from an Int to a Short use the OpcodeCast on
26551                   the variable 5' (which is what this patch was doing).
26552
26553 2001-09-28  Ravi Pratap  <ravi@ximian.com>
26554
26555         * expression.cs (Invocation::ConversionExists): Re-write to use
26556         the conversion cache
26557
26558         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
26559         cache all conversions done, not just user-defined ones.
26560
26561         (Invocation::BetterConversion): The real culprit. Use ConversionExists
26562         to determine if a conversion exists instead of acutually trying to 
26563         perform the conversion. It's faster too.
26564
26565         (Expression::ConvertExplicit): Modify to use ConversionExists to check
26566         and only then attempt the implicit conversion.
26567
26568 2001-09-28  Ravi Pratap  <ravi@ximian.com>
26569
26570         * expression.cs (ConvertImplicit): Use a cache for conversions
26571         already found. Check level of recursion and bail out if necessary.
26572
26573 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
26574
26575         * typemanager.cs (string_concat_string_string, string_concat_object_object):
26576         Export standard methods that we expect for string operations.
26577
26578         * statement.cs (Block::UsageWarning): Track usage of variables and
26579         report the errors for not used variables.
26580
26581         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
26582         operator. 
26583
26584 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
26585
26586         * codegen.cs: remove unnneded code 
26587
26588         * expression.cs: Removed BuiltinTypeAccess class
26589
26590         Fix the order in which implicit conversions are
26591         done.  
26592
26593         The previous fixed dropped support for boxed conversions (adding a
26594         test to the test suite now)
26595
26596         (UserImplicitCast::CanConvert): Remove test for source being null,
26597         that code is broken.  We should not feed a null to begin with, if
26598         we do, then we should track the bug where the problem originates
26599         and not try to cover it up here.
26600
26601         Return a resolved expression of type UserImplicitCast on success
26602         rather than true/false.  Ravi: this is what I was talking about,
26603         the pattern is to use a static method as a "constructor" for
26604         objects. 
26605
26606         Also, do not create arguments until the very last minute,
26607         otherwise we always create the arguments even for lookups that
26608         will never be performed. 
26609
26610         (UserImplicitCast::Resolve): Eliminate, objects of type
26611         UserImplicitCast are born in a fully resolved state. 
26612
26613         * typemanager.cs (InitCoreTypes): Init also value_type
26614         (System.ValueType). 
26615
26616         * expression.cs (Cast::Resolve): First resolve the child expression.
26617
26618         (LValue): Add new method AddressOf to be used by
26619         the `&' operator.  
26620
26621         Change the argument of Store to take an EmitContext instead of an
26622         ILGenerator, because things like FieldExpr need to be able to call
26623         their children expression to generate the instance code. 
26624
26625         (Expression::Error, Expression::Warning): Sugar functions for
26626         reporting errors.
26627
26628         (Expression::MemberLookup): Accept a TypeContainer instead of a
26629         Report as the first argument.
26630
26631         (Expression::ResolvePrimary): Killed.  I still want to improve
26632         this as currently the code is just not right.
26633
26634         (Expression::ResolveMemberAccess): Simplify, but it is still
26635         wrong. 
26636
26637         (Unary::Resolve): Catch errors in AddressOf operators.
26638
26639         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
26640         index to a byte for the short-version, or the compiler will choose
26641         the wrong Emit call, which generates the wrong data.
26642
26643         (ParameterReference::Emit, ::Store): same.
26644
26645         (FieldExpr::AddressOf): Implement.
26646
26647         * typemanager.cs: TypeManager: made public variable instead of
26648         property.
26649
26650         * driver.cs: document --fatal.
26651
26652         * report.cs (ErrorMessage, WarningMessage): new names for the old
26653         Error and Warning classes.
26654
26655         * cs-parser.jay (member_access): Turn built-in access to types
26656         into a normal simplename
26657
26658 2001-09-27  Ravi Pratap  <ravi@ximian.com>
26659
26660         * expression.cs (Invocation::BetterConversion): Fix to cope
26661         with q being null, since this was introducing a bug.
26662
26663         * expression.cs (ConvertImplicit): Do built-in conversions first.
26664
26665 2001-09-27  Ravi Pratap  <ravi@ximian.com>
26666
26667         * expression.cs (UserImplicitCast::Resolve): Fix bug.
26668
26669 2001-09-27  Ravi Pratap  <ravi@ximian.com>
26670
26671         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
26672         I had introduced long ago (what's new ?).
26673
26674         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
26675         the work of all the checking. 
26676         (ConvertImplicit): Call CanConvert and only then create object if necessary.
26677         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
26678
26679         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
26680         that is the right way. 
26681
26682         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
26683         overloading resolution. Use everywhere instead of cutting and pasting code.
26684
26685         (Binary::ResolveOperator): Use MakeUnionSet.
26686
26687         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
26688         we have to convert to bool types. Not complete yet.
26689
26690 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
26691
26692         * typemanager.cs (TypeManager::CSharpName): support ushort.
26693
26694         * expression.cs (Expression::TryImplicitIntConversion): Attempts
26695         to provide an expression that performsn an implicit constant int
26696         conversion (section 6.1.6).
26697         (Expression::ConvertImplicitRequired): Reworked to include
26698         implicit constant expression conversions.
26699
26700         (Expression::ConvertNumericExplicit): Finished.
26701
26702         (Invocation::Emit): If InstanceExpression is null, then it means
26703         that we perform a call on this.
26704
26705 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
26706
26707         * expression.cs (Unary::Emit): Remove some dead code.
26708         (Probe): Implement Resolve and Emit for `is'.
26709         (Expression::ConvertImplicitRequired): Attempt to do constant
26710         expression conversions here.  Maybe should be moved to
26711         ConvertImplicit, but I am not sure.
26712         (Expression::ImplicitLongConstantConversionPossible,
26713         Expression::ImplicitIntConstantConversionPossible): New functions
26714         that tell whether is it possible to apply an implicit constant
26715         expression conversion.
26716
26717         (ConvertNumericExplicit): Started work on explicit numeric
26718         conversions.
26719
26720         * cs-parser.jay: Update operator constants.
26721
26722         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
26723         (Parameters::GetSignature): Hook up VerifyArgs here.
26724         (Parameters::VerifyArgs): Verifies that no two arguments have the
26725         same name. 
26726
26727         * class.cs (Operator): Update the operator names to reflect the
26728         ones that the spec expects (as we are just stringizing the
26729         operator names).
26730
26731         * expression.cs (Unary::ResolveOperator): Fix bug: Use
26732         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
26733         previous usage did only work for our methods.
26734         (Expression::ConvertImplicit): Handle decimal implicit numeric
26735         conversions as well.
26736         (Expression::InternalTypeConstructor): Used to invoke constructors
26737         on internal types for default promotions.
26738
26739         (Unary::Emit): Implement special handling for the pre/post
26740         increment/decrement for overloaded operators, as they need to have
26741         the same semantics as the other operators.
26742
26743         (Binary::ResolveOperator): ditto.
26744         (Invocation::ConversionExists): ditto.
26745         (UserImplicitCast::Resolve): ditto.
26746
26747 2001-09-26  Ravi Pratap  <ravi@ximian.com>
26748
26749         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
26750         operator, return after emitting body. Regression tests pass again !
26751
26752         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
26753         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
26754         (Invocation::OverloadResolve): Ditto.
26755         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
26756
26757         * everywhere : update calls to the above methods accordingly.
26758
26759 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
26760
26761         * assign.cs (Assign): Make it inherit from ExpressionStatement.
26762
26763         * expression.cs (ExpressionStatement): New base class used for
26764         expressions that can appear in statements, so that we can provide
26765         an alternate path to generate expression that do not leave a value
26766         on the stack.
26767
26768         (Expression::Emit, and all the derivatives): We no longer return
26769         whether a value is left on the stack or not.  Every expression
26770         after being emitted leaves a single value on the stack.
26771
26772         * codegen.cs (EmitContext::EmitStatementExpression): Use the
26773         facilties of ExpressionStatement if possible.
26774
26775         * cs-parser.jay: Update statement_expression.
26776
26777 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
26778
26779         * driver.cs: Change the wording of message
26780
26781 2001-09-25  Ravi Pratap  <ravi@ximian.com>
26782
26783         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
26784         the type of the expression to the return type of the method if
26785         we have an overloaded operator match ! The regression tests pass again !
26786         (Unary::ResolveOperator): Ditto.
26787
26788         * expression.cs (Invocation::ConversionExists): Correct the member lookup
26789         to find "op_Implicit", not "implicit" ;-)
26790         (UserImplicitCast): New class to take care of user-defined implicit conversions.
26791         (ConvertImplicit, ForceConversion): Take TypeContainer argument
26792
26793         * everywhere : Correct calls to the above accordingly.
26794
26795         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
26796         (ConvertImplicit): Do user-defined conversion if it exists.
26797
26798 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
26799
26800         * assign.cs: track location.
26801         (Resolve): Use implicit conversions on assignment.
26802
26803         * literal.cs: Oops.  Not good, Emit of short access values should
26804         pass (Bytes) or the wrong argument will be selected.
26805
26806         * expression.cs (Unary::Emit): Emit code for -expr.
26807
26808         (Unary::ResolveOperator): Handle `Substract' for non-constants
26809         (substract from zero from the non-constants).
26810         Deal with Doubles as well. 
26811
26812         (Expression::ConvertImplicitRequired): New routine that reports an
26813         error if no implicit conversion exists. 
26814
26815         (Invocation::OverloadResolve): Store the converted implicit
26816         expressions if we make them
26817
26818 2001-09-24  Ravi Pratap  <ravi@ximian.com>
26819
26820         * class.cs (ConstructorInitializer): Take a Location argument.
26821         (ConstructorBaseInitializer): Same here.
26822         (ConstructorThisInitializer): Same here.
26823
26824         * cs-parser.jay : Update all calls accordingly.
26825
26826         * expression.cs (Unary, Binary, New): Take location argument.
26827         Update accordingly everywhere.
26828
26829         * cs-parser.jay : Update all calls to the above to take a location
26830         argument.
26831
26832         * class.cs : Ditto.
26833
26834 2001-09-24  Ravi Pratap  <ravi@ximian.com>
26835
26836         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
26837         (Invocation::BetterConversion): Same here
26838         (Invocation::ConversionExists): Ditto.
26839
26840         (Invocation::ConversionExists): Implement.
26841
26842 2001-09-22  Ravi Pratap  <ravi@ximian.com>
26843
26844         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
26845         Also take an additional TypeContainer argument.
26846
26847         * All over : Pass in TypeContainer as argument to OverloadResolve.
26848
26849         * typemanager.cs (CSharpName): Update to check for the string type and return
26850         that too.
26851
26852         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
26853         a given method.
26854
26855 2001-09-21  Ravi Pratap  <ravi@ximian.com>
26856
26857         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
26858         (Invocation::BetterFunction): Implement.
26859         (Invocation::BetterConversion): Implement.
26860         (Invocation::ConversionExists): Skeleton, no implementation yet.
26861
26862         Okay, things work fine !
26863
26864 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
26865
26866         * typemanager.cs: declare and load enum_type, delegate_type and
26867         void_type. 
26868
26869         * expression.cs (Expression::Emit): Now emit returns a value that
26870         tells whether a value is left on the stack or not.  This strategy
26871         might be reveted tomorrow with a mechanism that would address
26872         multiple assignments.
26873         (Expression::report118): Utility routine to report mismatches on
26874         the ExprClass.
26875
26876         (Unary::Report23): Report impossible type/operator combination
26877         utility function.
26878
26879         (Unary::IsIncrementableNumber): Whether the type can be
26880         incremented or decremented with add.
26881         (Unary::ResolveOperator): Also allow enumerations to be bitwise
26882         complemented. 
26883         (Unary::ResolveOperator): Implement ++, !, ~,
26884
26885         (Invocation::Emit): Deal with new Emit convetion.
26886
26887         * All Expression derivatives: Updated their Emit method to return
26888         whether they leave values on the stack or not.
26889
26890         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
26891         stack for expressions that are statements. 
26892
26893 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
26894
26895         * expression.cs (LValue): New interface.  Must be implemented by
26896         LValue objects.
26897         (LocalVariableReference, ParameterReference, FieldExpr): Implement
26898         LValue interface.
26899
26900         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
26901         interface for generating code, simplifies the code.
26902
26903 2001-09-20  Ravi Pratap  <ravi@ximian.com>
26904
26905         * expression.cs (everywhere): Comment out return statements in ::Resolve
26906         methods to avoid the warnings.
26907
26908 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
26909
26910         * driver.cs (parse): Report error 2001 if we can not open the
26911         source file.
26912
26913         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
26914         not resolve it.
26915
26916         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
26917         object. 
26918
26919         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
26920         otherwise nested blocks end up with the same index.
26921
26922         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
26923
26924         * expression.cs:  Instead of having FIXMEs in the Resolve
26925         functions, throw exceptions so it is obvious that we are facing a
26926         bug. 
26927
26928         * cs-parser.jay (invocation_expression): Pass Location information.
26929
26930         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
26931         Use a basename for those routines because .NET does not like paths
26932         on them. 
26933
26934         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
26935         already defined.
26936
26937 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
26938
26939         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
26940         are loading the correct data types (throws an exception if not).
26941         (TypeManager::InitCoreTypes): Use CoreLookupType
26942
26943         * expression.cs (Unary::ResolveOperator): return the child
26944         expression for expressions which are just +expr.
26945         (Unary::ResolveOperator): Return negative literals for -LITERAL
26946         expressions (otherwise they are Unary {Literal}).
26947         (Invocation::Badness): Take into account `Implicit constant
26948         expression conversions'.
26949
26950         * literal.cs (LongLiteral): Implement long literal class.
26951         (IntLiteral): export the `Value' of the intliteral. 
26952
26953 2001-09-19  Ravi Pratap  <ravi@ximian.com>
26954
26955         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
26956
26957         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
26958         instead of 'Operator'
26959
26960         * expression.cs (Binary::ResolveOperator): Update accordingly.
26961         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
26962         and 'Minus'
26963
26964         * cs-parser.jay (unary_expression): Update to use the new names.
26965
26966         * gen-treedump.cs (GetUnary): Same here.
26967
26968         * expression.cs (Unary::Resolve): Implement.
26969         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
26970         operators are found instead of making noise ;-)
26971         (Unary::ResolveOperator): New method to do precisely the same thing which
26972         Binary::ResolveOperator does for Binary expressions.
26973         (Unary.method, .Arguments): Add.
26974         (Unary::OperName): Implement.   
26975         (Unary::ForceConversion): Copy and Paste !
26976
26977         * class.cs (Operator::Define): Fix a small bug for the case when we have 
26978         a unary operator.
26979
26980         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
26981         for the inbuilt operators. Only overloading works for now ;-)
26982
26983 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
26984
26985         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
26986         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
26987
26988         * expression.cs (This::Emit): Implement. 
26989         (This::Resolve): Implement.
26990         (TypeOf:Resolve): Implement.
26991         (Expression::ResolveSimpleName): Add an implicit this to instance
26992         field references. 
26993         (MemberAccess::Resolve): Deal with Parameters and Fields. 
26994         Bind instance variable to Field expressions.
26995         (FieldExpr::Instance): New field used to track the expression that
26996         represents the object instance.
26997         (FieldExpr::Resolve): Track potential errors from MemberLookup not
26998         binding 
26999         (FieldExpr::Emit): Implement.
27000
27001         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
27002         the last instruction contains a return opcode to avoid generating
27003         the last `ret' instruction (this generates correct code, and it is
27004         nice to pass the peverify output).
27005
27006         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
27007         initializer for static and instance variables.
27008         (Constructor::Emit): Allow initializer to be null in the case of
27009         static constructors.  Only emit initializer for instance
27010         constructors. 
27011
27012         (TypeContainer::FindMembers): Return a null array if there are no
27013         matches.
27014
27015         Also fix the code for the MemberTypes.Method branch, as it was not
27016         scanning that for operators (or tried to access null variables before).
27017
27018         * assign.cs (Assign::Emit): Handle instance and static fields. 
27019
27020         * TODO: Updated.
27021
27022         * driver.cs: Stop compilation if there are parse errors.
27023
27024         * cs-parser.jay (constructor_declaration): Provide default base
27025         initializer for non-static constructors.
27026         (constructor_declarator): Do not provide a default base
27027         initializers if none was specified.
27028         Catch the fact that constructors should not have parameters.
27029
27030         * class.cs: Do not emit parent class initializers for static
27031         constructors, that should be flagged as an error.
27032
27033 2001-09-18  Ravi Pratap  <ravi@ximian.com>
27034
27035         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
27036         Move back code into TypeContainer::Populate.
27037
27038 2001-09-18  Ravi Pratap  <ravi@ximian.com>
27039
27040         * class.cs (TypeContainer::AddConstructor): Fix the check to
27041         compare against Name, not Basename. 
27042         (Operator::OpType): Change Plus and Minus to Add and Subtract.
27043
27044         * cs-parser.jay : Update accordingly.
27045
27046         * class.cs (TypeContainer::FindMembers): For the case where we are searching
27047         for methods, don't forget to look into the operators too.
27048         (RegisterMethodBuilder): Helper method to take care of this for
27049         methods, constructors and operators.
27050         (Operator::Define): Completely revamp.
27051         (Operator.OperatorMethod, MethodName): New fields.
27052         (TypeContainer::Populate): Move the registering of builders into
27053         RegisterMethodBuilder.
27054         (Operator::Emit): Re-write.
27055
27056         * expression.cs (Binary::Emit): Comment out code path to emit method
27057         invocation stuff for the case when we have a user defined operator. I am
27058         just not able to get it right !
27059
27060 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
27061
27062         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
27063         argument. 
27064
27065         (Expression::MemberLookup): Provide a version that allows to
27066         specify the MemberTypes and BindingFlags. 
27067
27068         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
27069         so it was not fetching variable information from outer blocks.
27070
27071         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
27072         Beforefieldinit as it was buggy.
27073
27074         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
27075         that Ravi put here.  
27076
27077         * class.cs (Constructor::Emit): Only emit if block is not null.
27078         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
27079         deal with this by semantically definining it as if the user had
27080         done it.
27081
27082         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
27083         constructors as we now "emit" them at a higher level.
27084
27085         (TypeContainer::DefineDefaultConstructor): Used to define the
27086         default constructors if none was provided.
27087
27088         (ConstructorInitializer): Add methods Resolve and Emit. 
27089
27090         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
27091
27092 2001-09-17  Ravi Pratap  <ravi@ximian.com>
27093
27094         * class.cs (TypeContainer::EmitDefaultConstructor): Register
27095         the default constructor builder with our hashtable for methodbuilders
27096         to methodcores.
27097
27098         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
27099         and argument_count is 0 in which case we have a match.
27100         (Binary::ResolveOperator): More null checking and miscellaneous coding
27101         style cleanup.
27102
27103 2001-09-17  Ravi Pratap  <ravi@ximian.com>
27104
27105         * rootcontext.cs (IsNameSpace): Compare against null.
27106
27107         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
27108
27109         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
27110         and Unary::Operator.
27111
27112         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
27113         accordingly.
27114
27115         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
27116         we have overloaded operators.
27117         (Binary::ResolveOperator): Implement the part which does the operator overload
27118         resolution.
27119
27120         * class.cs (Operator::Emit): Implement.
27121         (TypeContainer::Emit): Emit the operators we have too.
27122
27123         * expression.cs (Binary::Emit): Update to emit the appropriate code for
27124         the case when we have a user-defined operator.
27125
27126 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
27127
27128         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
27129
27130 2001-09-16  Ravi Pratap  <ravi@ximian.com>
27131
27132         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
27133         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
27134         (Constructor::Emit): Implement.
27135         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
27136         if we have no work to do. 
27137         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
27138         Emit method.
27139
27140         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
27141         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
27142
27143         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
27144         of parent.parent.
27145
27146 2001-09-15  Ravi Pratap  <ravi@ximian.com>
27147
27148         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
27149         in the source.
27150         (Tree::RecordNamespace): Method to do what the name says ;-)
27151         (Tree::Namespaces): Property to get at the namespaces hashtable.
27152
27153         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
27154         keep track.
27155
27156         * rootcontext.cs (IsNamespace): Fixed it :-)
27157
27158 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
27159
27160         * class.cs (TypeContainer::FindMembers): Add support for
27161         constructors. 
27162         (MethodCore): New class that encapsulates both the shared aspects
27163         of a Constructor and a Method.  
27164         (Method, Constructor): Factored pieces into MethodCore.
27165
27166         * driver.cs: Added --fatal which makes errors throw exceptions.
27167         Load System assembly as well as part of the standard library.
27168
27169         * report.cs: Allow throwing exceptions on errors for debugging.
27170
27171         * modifiers.cs: Do not use `parent', instead use the real type
27172         container to evaluate permission settings.
27173
27174         * class.cs: Put Ravi's patch back in.  He is right, and we will
27175         have to cope with the
27176
27177 2001-09-14  Ravi Pratap  <ravi@ximian.com>
27178
27179         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
27180         FamORAssem, not FamANDAssem.
27181
27182 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
27183
27184         * driver.cs: Added --parse option that only parses its input files
27185         and terminates.
27186
27187         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
27188         incorrect.  IsTopLevel is not used to tell whether an object is
27189         root_types or not (that can be achieved by testing this ==
27190         root_types).  But to see if this is a top-level *class* (not
27191         necessarly our "toplevel" container). 
27192
27193 2001-09-14  Ravi Pratap  <ravi@ximian.com>
27194
27195         * enum.cs (Enum::Define): Modify to call the Lookup method on the
27196         parent instead of a direct call to GetType.
27197
27198 2001-09-14  Ravi Pratap  <ravi@ximian.com>
27199
27200         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
27201         Modifiers.TypeAttr. This should just be a call to that method.
27202
27203         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
27204         object so that we can determine if we are top-level or not.
27205
27206         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
27207         TypeContainer too.
27208
27209         * enum.cs (Enum::Define): Ditto.
27210
27211         * modifiers.cs (FieldAttr): Re-write.
27212
27213         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
27214         (TypeContainer::HaveStaticConstructor): New property to provide access
27215         to precisely that info.
27216
27217         * modifiers.cs (MethodAttr): Re-write.
27218         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
27219
27220         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
27221         of top-level types as claimed.
27222
27223 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
27224
27225         * expression.cs (MemberLookup): Fruitless attempt to lookup
27226         constructors.  Maybe I need to emit default constructors?  That
27227         might be it (currently .NET emits this for me automatically).
27228         (Invocation::OverloadResolve): Cope with Arguments == null.
27229         (Invocation::EmitArguments): new function, shared by the new
27230         constructor and us.
27231         (Invocation::Emit): Handle static and instance methods.  Emit
27232         proper call instruction for virtual or non-virtual invocations.
27233         (New::Emit): Implement.
27234         (New::Resolve): Implement.
27235         (MemberAccess:Resolve): Implement.
27236         (MethodGroupExpr::InstanceExpression): used conforming to the spec
27237         to track instances.
27238         (FieldExpr::Resolve): Set type.
27239
27240         * support.cs: Handle empty arguments.
27241                 
27242         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
27243         SimpleLookup): Auxiliary routines to help parse a qualifier
27244         identifier.  
27245
27246         Update qualifier_identifier rule.
27247
27248         * codegen.cs: Removed debugging messages.
27249
27250         * class.cs: Make this a global thing, this acts just as a "key" to
27251         objects that we might have around.
27252
27253         (Populate): Only initialize method_builders_to_methods once.
27254
27255         * expression.cs (PropertyExpr): Initialize type from the
27256         PropertyType. 
27257
27258         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
27259         Resolve pattern.  Attempt to implicitly convert value to boolean.
27260         Emit code.
27261
27262         * expression.cs: Set the type for the int32/int32 argument case.
27263         (Binary::ResolveOperator): Set the return type to boolean for
27264         comparission operators
27265
27266         * typemanager.cs: Remove debugging print code.
27267
27268         (Invocation::Resolve): resolve type.
27269
27270         * class.cs: Allocate a MemberInfo of the correct size, as the code
27271         elsewhere depends on the test to reflect the correct contents.
27272
27273         (Method::) Keep track of parameters, due to System.Reflection holes
27274
27275         (TypeContainer::Populate): Keep track of MethodBuilders to Method
27276         mapping here.
27277
27278         (TypeContainer::FindMembers): Use ArrayList and then copy an array
27279         of the exact size and return that.
27280
27281         (Class::LookupMethodByBuilder): New function that maps
27282         MethodBuilders to its methods.  Required to locate the information
27283         on methods because System.Reflection bit us again.
27284
27285         * support.cs: New file, contains an interface ParameterData and
27286         two implementations: ReflectionParameters and InternalParameters
27287         used to access Parameter information.  We will need to grow this
27288         as required.
27289
27290         * expression.cs (Invocation::GetParameterData): implement a cache
27291         and a wrapper around the ParameterData creation for methods. 
27292         (Invocation::OverloadResolve): Use new code.
27293
27294 2001-09-13  Ravi Pratap  <ravi@ximian.com>
27295
27296         * class.cs (TypeContainer::EmitField): Remove and move into 
27297         (Field::Define): here and modify accordingly.
27298         (Field.FieldBuilder): New member.
27299         (TypeContainer::Populate): Update accordingly.
27300         (TypeContainer::FindMembers): Implement.
27301
27302 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
27303
27304         * statement.cs: (VariableInfo::VariableType): New field to be
27305         initialized with the full type once it is resolved. 
27306
27307 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
27308
27309         * parameter.cs (GetParameterInfo): Use a type cache to compute
27310         things only once, and to reuse this information
27311
27312         * expression.cs (LocalVariableReference::Emit): Implement.
27313         (OpcodeCast::Emit): fix.
27314
27315         (ParameterReference::Resolve): Implement.
27316         (ParameterReference::Emit): Implement.
27317
27318         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
27319         that are expressions need to stay as Expressions.
27320
27321         * typemanager.cs (CSharpName): Returns the C# name of a type if
27322         possible. 
27323
27324         * expression.cs (Expression::ConvertImplicit): New function that
27325         implements implicit type conversions.
27326
27327         (Expression::ImplicitReferenceConversion): Implements implicit
27328         reference conversions.
27329
27330         (EmptyCast): New type for transparent casts.
27331
27332         (OpcodeCast): New type for casts of types that are performed with
27333         a sequence of bytecodes.
27334
27335         (BoxedCast): New type used for casting value types into reference
27336         types.  Emits a box opcode.
27337
27338         (Binary::DoNumericPromotions): Implements numeric promotions of
27339         and computation of the Binary::Type.
27340
27341         (Binary::EmitBranchable): Optimization.
27342
27343         (Binary::Emit): Implement code emission for expressions.
27344
27345         * typemanager.cs (TypeManager): Added two new core types: sbyte
27346         and byte.
27347
27348 2001-09-12  Ravi Pratap  <ravi@ximian.com>
27349
27350         * class.cs (TypeContainer::FindMembers): Method which does exactly
27351         what Type.FindMembers does, only we don't have to use reflection. No
27352         implementation yet.
27353
27354         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
27355         typecontainer objects as we need to get at them.
27356         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
27357
27358         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
27359         typecontainer object.
27360
27361         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
27362         of just a Report object.
27363
27364 2001-09-11  Ravi Pratap  <ravi@ximian.com>
27365
27366         * class.cs (Event::Define): Go back to using the prefixes "add_" and
27367         "remove_"
27368         (TypeContainer::Populate): Now define the delegates of the type too.
27369         (TypeContainer.Delegates): Property to access the list of delegates defined
27370         in the type.
27371
27372         * delegates.cs (Delegate::Define): Implement partially.
27373
27374         * modifiers.cs (TypeAttr): Handle more flags.
27375
27376 2001-09-11  Ravi Pratap  <ravi@ximian.com>
27377
27378         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
27379         and not <=
27380         (Operator::Define): Re-write logic to get types by using the LookupType method
27381         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
27382         (Indexer::Define): Ditto.
27383         (Event::Define): Ditto.
27384         (Property::Define): Ditto.
27385
27386 2001-09-10  Ravi Pratap  <ravi@ximian.com>
27387
27388         * class.cs (TypeContainer::Populate): Now define operators too. 
27389         (TypeContainer.Operators): New property to access the list of operators
27390         in a type.
27391         (Operator.OperatorMethodBuilder): New member to hold the method builder
27392         for the operator we are defining.
27393         (Operator::Define): Implement.
27394
27395 2001-09-10  Ravi Pratap  <ravi@ximian.com>
27396
27397         * class.cs (Event::Define): Make the prefixes of the accessor methods
27398         addOn_ and removeOn_ 
27399
27400         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
27401         of the location being passed in too. Ideally, this should go later since all
27402         error reporting should be done through the Report object.
27403
27404         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
27405         (Populate): Iterate thru the indexers we have and define them too.
27406         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
27407         for the get and set accessors.
27408         (Indexer::Define): Implement.
27409
27410 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
27411
27412         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
27413         my previous implementation, did not work.
27414
27415         * typemanager.cs: Add a couple of missing types (the longs).
27416
27417         * literal.cs: Use TypeManager.bool_type instead of getting it.
27418
27419         * expression.cs (EventExpr): New kind of expressions.
27420         (Expressio::ExprClassFromMemberInfo): finish
27421
27422 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
27423
27424         * assign.cs: Emit stores to static fields differently.
27425
27426 2001-09-08  Ravi Pratap  <ravi@ximian.com>
27427
27428         * Merge in changes and adjust code to tackle conflicts. Backed out my
27429         code in Assign::Resolve ;-) 
27430
27431 2001-09-08  Ravi Pratap  <ravi@ximian.com>
27432
27433         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
27434         instead Report.Error and also pass in the location.
27435         (CSharpParser::Lexer): New readonly property to return the reference
27436         to the Tokenizer object.
27437         (declare_local_variables): Use Report.Error with location instead of plain 
27438         old error.
27439         (CheckDef): Ditto.
27440
27441         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
27442         (Operator.CheckBinaryOperator): Ditto.
27443
27444         * cs-parser.jay (operator_declarator): Update accordingly.
27445
27446         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
27447         (CheckBinaryOperator): Same here.
27448
27449         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
27450         on the name without any prefixes of namespace names etc. This is because we
27451         already might have something already fully qualified like 
27452         'System.Console.WriteLine'
27453
27454         * assign.cs (Resolve): Begin implementation. Stuck ;-)
27455
27456 2001-09-07  Ravi Pratap  <ravi@ximian.com>
27457
27458         * cs-tokenizer.cs (location): Return a string which also contains
27459         the file name.
27460
27461         * expression.cs (ElementAccess): New class for expressions of the
27462         type 'element access.'
27463         (BaseAccess): New class for expressions of the type 'base access.'
27464         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
27465         respectively.
27466
27467         * cs-parser.jay (element_access): Implement action.
27468         (base_access): Implement actions.
27469         (checked_expression, unchecked_expression): Implement.
27470
27471         * cs-parser.jay (local_variable_type): Correct and implement.
27472         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
27473
27474         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
27475
27476         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
27477         name and the specifiers.
27478
27479         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
27480
27481         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
27482         making them all public ;-)
27483
27484         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
27485         class anyways.
27486
27487 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
27488
27489         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
27490         PropertyExprs.
27491         (FieldExpr, PropertyExprs): New resolved expressions.
27492         (SimpleName::MemberStaticCheck): Perform static checks for access
27493         to non-static fields on static methods. Maybe this should be
27494         generalized for MemberAccesses. 
27495         (SimpleName::ResolveSimpleName): More work on simple name
27496         resolution. 
27497
27498         * cs-parser.jay (primary_expression/qualified_identifier): track
27499         the parameter index.
27500
27501         * codegen.cs (CodeGen::Save): Catch save exception, report error.
27502         (EmitContext::EmitBoolExpression): Chain to expression generation
27503         instead of temporary hack.
27504         (::EmitStatementExpression): Put generic expression code generation.
27505
27506         * assign.cs (Assign::Emit): Implement variable assignments to
27507         local variables, parameters and fields.
27508
27509 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
27510
27511         * statement.cs (Block::GetVariableInfo): New method, returns the
27512         VariableInfo for a variable name in a block.
27513         (Block::GetVariableType): Implement in terms of GetVariableInfo
27514
27515         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
27516         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
27517
27518 2001-09-06  Ravi Pratap  <ravi@ximian.com>
27519
27520         * cs-parser.jay (operator_declaration): Continue on my quest : update
27521         to take attributes argument.
27522         (event_declaration): Ditto.
27523         (enum_declaration): Ditto.
27524         (indexer_declaration): Ditto.
27525
27526         * class.cs (Operator::Operator): Update constructor accordingly.
27527         (Event::Event): Ditto.
27528
27529         * delegate.cs (Delegate::Delegate): Same here.
27530
27531         * enum.cs (Enum::Enum): Same here.
27532
27533 2001-09-05  Ravi Pratap  <ravi@ximian.com>
27534
27535         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
27536
27537         * ../tests/cs0658.cs : New file to demonstrate error 0658.
27538
27539         * attribute.cs (Attributes): New class to encapsulate all attributes which were
27540         being passed around as an arraylist.
27541         (Attributes::AddAttribute): Method to add attribute sections.
27542
27543         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
27544         (struct_declaration): Update accordingly.
27545         (constant_declaration): Update.
27546         (field_declaration): Update.
27547         (method_header): Update.
27548         (fixed_parameter): Update.
27549         (parameter_array): Ditto.
27550         (property_declaration): Ditto.
27551         (destructor_declaration): Ditto.
27552
27553         * class.cs (Struct::Struct): Update constructors accordingly.
27554         (Class::Class): Ditto.
27555         (Field::Field): Ditto.
27556         (Method::Method): Ditto.
27557         (Property::Property): Ditto.
27558         (TypeContainer::OptAttribute): update property's return type.
27559
27560         * interface.cs (Interface.opt_attributes): New member.
27561         (Interface::Interface): Update to take the extra Attributes argument.
27562
27563         * parameter.cs (Parameter::Parameter): Ditto.
27564
27565         * constant.cs (Constant::Constant): Ditto.
27566
27567         * interface.cs (InterfaceMemberBase): New OptAttributes field.
27568         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
27569         the attributes as a parameter.
27570         (InterfaceProperty): Update constructor call.
27571         (InterfaceEvent): Ditto.
27572         (InterfaceMethod): Ditto.
27573         (InterfaceIndexer): Ditto.
27574
27575         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
27576         pass the attributes too.
27577         (interface_event_declaration): Ditto.
27578         (interface_property_declaration): Ditto.
27579         (interface_method_declaration): Ditto.
27580         (interface_declaration): Ditto.
27581
27582 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
27583
27584         * class.cs (Method::Define): Track the "static Main" definition to
27585         create an entry point. 
27586
27587         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
27588         EntryPoint if we find it. 
27589
27590         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
27591         (EmitContext::ig): Make this variable public.
27592
27593         * driver.cs: Make the default output file be the first file name
27594         with the .exe extension.  
27595
27596         Detect empty compilations
27597
27598         Handle various kinds of output targets.  Handle --target and
27599         rename -t to --dumper.
27600
27601         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
27602         methods inherited from Expression return now an Expression.  This
27603         will is used during the tree rewriting as we resolve them during
27604         semantic analysis.
27605
27606         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
27607         the spec.  Missing entirely is the information about
27608         accessability of elements of it.
27609
27610         (Expression::ExprClassFromMemberInfo): New constructor for
27611         Expressions that creates a fully initialized Expression based on
27612         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
27613         a Type.
27614
27615         (Invocation::Resolve): Begin implementing resolution of invocations.
27616
27617         * literal.cs (StringLiteral):  Implement Emit.
27618
27619 2001-09-05  Ravi Pratap  <ravi@ximian.com>
27620
27621         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
27622         member.
27623
27624 2001-09-04  Ravi Pratap  <ravi@ximian.com>
27625
27626         * cs-parser.jay (attribute_arguments): Implement actions.
27627         (attribute): Fix bug in production. Implement action.
27628         (attribute_list): Implement.
27629         (attribute_target): Implement.
27630         (attribute_target_specifier, opt_target_specifier): Implement
27631         (CheckAttributeTarget): New method to check if the attribute target
27632         is valid.
27633         (attribute_section): Implement.
27634         (opt_attributes): Implement.
27635
27636         * attribute.cs : New file to handle attributes.
27637         (Attribute): Class to hold attribute info.
27638
27639         * cs-parser.jay (opt_attribute_target_specifier): Remove production
27640         (attribute_section): Modify production to use 2 different rules to 
27641         achieve the same thing. 1 s/r conflict down !
27642         Clean out commented, useless, non-reducing dimension_separator rules.
27643
27644         * class.cs (TypeContainer.attributes): New member to hold list
27645         of attributes for a type.
27646         (Struct::Struct): Modify to take one more argument, the attribute list.
27647         (Class::Class): Ditto.
27648         (Field::Field): Ditto.
27649         (Method::Method): Ditto.
27650         (Property::Property): Ditto.
27651
27652         * cs-parser.jay (struct_declaration): Update constructor call to
27653         pass in the attributes too.
27654         (class_declaration): Ditto.
27655         (constant_declaration): Ditto.
27656         (field_declaration): Ditto.
27657         (method_header): Ditto.
27658         (fixed_parameter): Ditto.
27659         (parameter_array): Ditto.
27660         (property_declaration): Ditto.
27661
27662         * constant.cs (Constant::Constant): Update constructor similarly.
27663         Use System.Collections.
27664
27665         * parameter.cs (Parameter::Parameter): Update as above.
27666
27667 2001-09-02  Ravi Pratap  <ravi@ximian.com>
27668
27669         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
27670         (TypeContainer.delegates): New member to hold list of delegates.
27671
27672         * cs-parser.jay (delegate_declaration): Implement the action correctly 
27673         this time as I seem to be on crack ;-)
27674
27675 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
27676
27677         * rootcontext.cs (RootContext::IsNamespace): new function, used to
27678         tell whether an identifier represents a namespace.
27679
27680         * expression.cs (NamespaceExpr): A namespace expression, used only
27681         temporarly during expression resolution.
27682         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
27683         utility functions to resolve names on expressions.
27684
27685 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
27686
27687         * codegen.cs: Add hook for StatementExpressions. 
27688
27689         * class.cs: Fix inverted test for static flag in methods.
27690
27691 2001-09-02  Ravi Pratap  <ravi@ximian.com>
27692
27693         * class.cs (Operator::CheckUnaryOperator): Correct error number used
27694         to make it coincide with MS' number.
27695         (Operator::CheckBinaryOperator): Ditto.
27696
27697         * ../errors/errors.txt : Remove error numbers added earlier.
27698
27699         * ../errors/cs1019.cs : Test case for error # 1019
27700
27701         * ../errros/cs1020.cs : Test case for error # 1020
27702
27703         * cs-parser.jay : Clean out commented cruft.
27704         (dimension_separators, dimension_separator): Comment out. Ostensibly not
27705         used anywhere - non-reducing rule.
27706         (namespace_declarations): Non-reducing rule - comment out.
27707
27708         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
27709         with TypeContainer::AddEnum.
27710
27711         * delegate.cs : New file for delegate handling classes.
27712         (Delegate): Class for declaring delegates.
27713
27714         * makefile : Update.
27715
27716         * cs-parser.jay (delegate_declaration): Implement.
27717
27718 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
27719
27720         * class.cs (Event::Define): Implement.
27721         (Event.EventBuilder): New member.
27722
27723         * class.cs (TypeContainer::Populate): Update to define all enums and events
27724         we have.
27725         (Events): New property for the events arraylist we hold. Shouldn't we move to using
27726         readonly fields for all these cases ?
27727
27728 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
27729
27730         * class.cs (Property): Revamp to use the convention of making fields readonly.
27731         Accordingly modify code elsewhere.
27732
27733         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
27734         the Define method of the Property class.
27735
27736         * class.cs : Clean up applied patch and update references to variables etc. Fix 
27737         trivial bug.
27738         (TypeContainer::Populate): Update to define all the properties we have. Also
27739         define all enumerations.
27740
27741         * enum.cs (Define): Implement.
27742
27743 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
27744
27745         * cs-parser.jay (overloadable_operator): The semantic value is an
27746         enum of the Operator class.
27747         (operator_declarator): Implement actions.
27748         (operator_declaration): Implement.
27749
27750         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
27751         validity of definitions.
27752         (Operator::CheckBinaryOperator): Static method to check for binary operators
27753         (TypeContainer::AddOperator): New method to add an operator to a type.
27754
27755         * cs-parser.jay (indexer_declaration): Added line to actually call the
27756         AddIndexer method so it gets added ;-)
27757
27758         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
27759         already taken care of by the MS compiler ?  
27760
27761 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
27762
27763         * class.cs (Operator): New class for operator declarations.
27764         (Operator::OpType): Enum for the various operators.
27765
27766 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
27767
27768         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
27769         ostensibly handle this in semantic analysis.
27770
27771         * cs-parser.jay (general_catch_clause): Comment out
27772         (specific_catch_clauses, specific_catch_clause): Ditto.
27773         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
27774         (catch_args, opt_catch_args): New productions.
27775         (catch_clause): Rewrite to use the new productions above
27776         (catch_clauses): Modify accordingly.
27777         (opt_catch_clauses): New production to use in try_statement
27778         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
27779         and re-write the code in the actions to extract the specific and
27780         general catch clauses by being a little smart ;-)
27781
27782         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
27783         Hooray, try and catch statements parse fine !
27784
27785 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
27786
27787         * statement.cs (Block::GetVariableType): Fix logic to extract the type
27788         string from the hashtable of variables.
27789
27790         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
27791         I end up making that mistake ;-)
27792         (catch_clauses): Fixed gross error which made Key and Value of the 
27793         DictionaryEntry the same : $1 !!
27794
27795 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
27796
27797         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
27798
27799         * cs-parser.jay (event_declaration): Correct to remove the semicolon
27800         when the add and remove accessors are specified. 
27801
27802 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
27803
27804         * cs-parser.jay (IndexerDeclaration): New helper class to hold
27805         information about indexer_declarator.
27806         (indexer_declarator): Implement actions.
27807         (parsing_indexer): New local boolean used to keep track of whether
27808         we are parsing indexers or properties. This is necessary because 
27809         implicit_parameters come into picture even for the get accessor in the 
27810         case of an indexer.
27811         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
27812
27813         * class.cs (Indexer): New class for indexer declarations.
27814         (TypeContainer::AddIndexer): New method to add an indexer to a type.
27815         (TypeContainer::indexers): New member to hold list of indexers for the
27816         type.
27817
27818 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
27819
27820         * cs-parser.jay (add_accessor_declaration): Implement action.
27821         (remove_accessor_declaration): Implement action.
27822         (event_accessors_declaration): Implement
27823         (variable_declarators): swap statements for first rule - trivial.
27824
27825         * class.cs (Event): New class to hold information about event
27826         declarations.
27827         (TypeContainer::AddEvent): New method to add an event to a type
27828         (TypeContainer::events): New member to hold list of events.
27829
27830         * cs-parser.jay (event_declaration): Implement actions.
27831
27832 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
27833
27834         * cs-parser.jay (dim_separators): Implement. Make it a string
27835         concatenating all the commas together, just as they appear.
27836         (opt_dim_separators): Modify accordingly
27837         (rank_specifiers): Update accordingly. Basically do the same
27838         thing - instead, collect the brackets here.
27839         (opt_rank_sepcifiers): Modify accordingly.
27840         (array_type): Modify to actually return the complete type string
27841         instead of ignoring the rank_specifiers.
27842         (expression_list): Implement to collect the expressions
27843         (variable_initializer): Implement. We make it a list of expressions
27844         essentially so that we can handle the array_initializer case neatly too.
27845         (variable_initializer_list): Implement.
27846         (array_initializer): Make it a list of variable_initializers
27847         (opt_array_initializer): Modify accordingly.
27848
27849         * expression.cs (New::NType): Add enumeration to help us
27850         keep track of whether we have an object/delegate creation
27851         or an array creation.
27852         (New:NewType, New::Rank, New::Indices, New::Initializers): New
27853         members to hold data about array creation.
27854         (New:New): Modify to update NewType
27855         (New:New): New Overloaded contructor for the array creation
27856         case.
27857
27858         * cs-parser.jay (array_creation_expression): Implement to call
27859         the overloaded New constructor.
27860
27861 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
27862
27863         * class.cs (TypeContainer::Constructors): Return member
27864         constructors instead of returning null.
27865
27866 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
27867
27868         * typemanager.cs (InitCoreTypes): Initialize the various core
27869         types after we have populated the type manager with the user
27870         defined types (this distinction will be important later while
27871         compiling corlib.dll)
27872
27873         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
27874         on Expression Classification.  Now all expressions have a method
27875         `Resolve' and a method `Emit'.
27876
27877         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
27878         generation from working.     Also add some temporary debugging
27879         code. 
27880
27881 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
27882
27883         * codegen.cs: Lots of code generation pieces.  This is only the
27884         beginning, will continue tomorrow with more touches of polish.  We
27885         handle the fundamentals of if, while, do, for, return.  Others are
27886         trickier and I need to start working on invocations soon.
27887
27888         * gen-treedump.cs: Bug fix, use s.Increment here instead of
27889         s.InitStatement. 
27890
27891         * codegen.cs (EmitContext): New struct, used during code
27892         emission to keep a context.   Most of the code generation will be
27893         here. 
27894
27895         * cs-parser.jay: Add embedded blocks to the list of statements of
27896         this block.  So code generation proceeds in a top down fashion.
27897
27898 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
27899
27900         * statement.cs: Add support for multiple child blocks.
27901
27902 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
27903
27904         * codegen.cs (EmitCode): New function, will emit the code for a
27905         Block of code given a TypeContainer and its ILGenerator. 
27906
27907         * statement.cs (Block): Standard public readonly optimization.
27908         (Block::Block constructors): Link children. 
27909         (Block::Child): Child Linker.
27910         (Block::EmitVariables): Emits IL variable declarations.
27911
27912         * class.cs: Drop support for MethodGroups here, delay until
27913         Semantic Analysis.
27914         (Method::): Applied the same simplification that I did before, and
27915         move from Properties to public readonly fields.
27916         (Method::ParameterTypes): Returns the parameter types for the
27917         function, and implements a cache that will be useful later when I
27918         do error checking and the semantic analysis on the methods is
27919         performed.
27920         (Constructor::GetCallingConvention): Renamed from CallingConvetion
27921         and made a method, optional argument tells whether this is a class
27922         or a structure to apply the `has-this' bit.
27923         (Method::GetCallingConvention): Implement, returns the calling
27924         convention. 
27925         (Method::Define): Defines the type, a second pass is performed
27926         later to populate the methods.
27927
27928         (Constructor::ParameterTypes): implement a cache similar to the
27929         one on Method::ParameterTypes, useful later when we do semantic
27930         analysis. 
27931
27932         (TypeContainer::EmitMethod):  New method.  Emits methods.
27933
27934         * expression.cs: Removed MethodGroup class from here.
27935
27936         * parameter.cs (Parameters::GetCallingConvention): new method.
27937
27938 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
27939
27940         * class.cs (TypeContainer::Populate): Drop RootContext from the
27941         argument. 
27942
27943         (Constructor::CallingConvention): Returns the calling convention.
27944         (Constructor::ParameterTypes): Returns the constructor parameter
27945         types. 
27946
27947         (TypeContainer::AddConstructor): Keep track of default constructor
27948         and the default static constructor.
27949
27950         (Constructor::) Another class that starts using `public readonly'
27951         instead of properties. 
27952
27953         (Constructor::IsDefault): Whether this is a default constructor. 
27954
27955         (Field::) use readonly public fields instead of properties also.
27956
27957         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
27958         track of static constructors;  If none is used, turn on
27959         BeforeFieldInit in the TypeAttributes. 
27960
27961         * cs-parser.jay (opt_argument_list): now the return can be null
27962         for the cases where there are no arguments. 
27963
27964         (constructor_declarator): If there is no implicit `base' or
27965         `this', then invoke the default parent constructor. 
27966
27967         * modifiers.cs (MethodAttr): New static function maps a set of
27968         modifiers flags into a MethodAttributes enum
27969         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
27970         MethodAttr, TypeAttr to represent the various mappings where the
27971         modifiers are used.
27972         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
27973
27974 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
27975
27976         * parameter.cs (GetParameterInfo): Fix bug where there would be no
27977         method arguments.
27978
27979         * interface.cs (PopulateIndexer): Implemented the code generator
27980         for interface indexers.
27981
27982 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
27983
27984         * interface.cs (InterfaceMemberBase): Now we track the new status
27985         here.  
27986
27987         (PopulateProperty): Implement property population.  Woohoo!  Got
27988         Methods and Properties going today. 
27989
27990         Removed all the properties for interfaces, and replaced them with
27991         `public readonly' fields. 
27992
27993 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
27994
27995         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
27996         initialize their hashtables/arraylists only when they are needed
27997         instead of doing this always.
27998
27999         * parameter.cs: Handle refs and out parameters.
28000
28001         * cs-parser.jay: Use an ArrayList to construct the arguments
28002         instead of the ParameterCollection, and then cast that to a
28003         Parameter[] array.
28004
28005         * parameter.cs: Drop the use of ParameterCollection and use
28006         instead arrays of Parameters.
28007
28008         (GetParameterInfo): Use the Type, not the Name when resolving
28009         types. 
28010
28011 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
28012
28013         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
28014         and instead use public readonly fields.
28015
28016         * class.cs: Put back walking code for type containers.
28017
28018 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
28019
28020         * class.cs (MakeConstant): Code to define constants.
28021
28022         * rootcontext.cs (LookupType): New function.  Used to locate types 
28023
28024
28025 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
28026
28027         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
28028         this System.Reflection code is.  Kudos to Microsoft
28029
28030         * typemanager.cs: Implement a type cache and avoid loading all
28031         types at boot time.  Wrap in LookupType the internals.  This made
28032         the compiler so much faster.  Wow.  I rule!
28033
28034         * driver.cs: Make sure we always load mscorlib first (for
28035         debugging purposes, nothing really important).
28036
28037         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
28038         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
28039
28040         * rootcontext.cs: Lookup types on their namespace;  Lookup types
28041         on namespaces that have been imported using the `using' keyword.
28042
28043         * class.cs (TypeContainer::TypeAttr): Virtualize.
28044         (Class::TypeAttr): Return attributes suitable for this bad boy.
28045         (Struct::TypeAttr): ditto.
28046         Handle nested classes.
28047         (TypeContainer::) Remove all the type visiting code, it is now
28048         replaced with the rootcontext.cs code
28049
28050         * rootcontext.cs (GetClassBases): Added support for structs. 
28051
28052 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
28053
28054         * interface.cs, statement.cs, class.cs, parameter.cs,
28055         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
28056         Drop use of TypeRefs, and use strings instead.
28057
28058 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
28059
28060         * rootcontext.cs: 
28061
28062         * class.cs (Struct::Struct): set the SEALED flags after
28063         checking the modifiers.
28064         (TypeContainer::TypeAttr): new property, returns the
28065         TypeAttributes for a class.  
28066
28067         * cs-parser.jay (type_list): Oops, list production was creating a
28068         new list of base types.
28069
28070         * rootcontext.cs (StdLib): New property.
28071         (GetInterfaceTypeByName): returns an interface by type name, and
28072         encapsulates error handling here.
28073         (GetInterfaces): simplified.
28074         (ResolveTree): Encapsulated all the tree resolution here.
28075         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
28076         types. 
28077
28078         * driver.cs: Add support for --nostdlib, to avoid loading the
28079         default assemblies.
28080         (Main): Do not put tree resolution here. 
28081
28082         * rootcontext.cs: Beginning of the class resolution.
28083
28084 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
28085
28086         * rootcontext.cs: Provide better error reporting. 
28087
28088         * cs-parser.jay (interface_base): set our $$ to be interfaces.
28089
28090         * rootcontext.cs (CreateInterface): Handle the case where there
28091         are no parent interfaces.
28092
28093         (CloseTypes): Routine to flush types at the end.
28094         (CreateInterface): Track types.
28095         (GetInterfaces): Returns an array of Types from the list of
28096         defined interfaces.
28097
28098         * typemanager.c (AddUserType): Mechanism to track user types (puts
28099         the type on the global type hash, and allows us to close it at the
28100         end). 
28101
28102 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
28103
28104         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
28105         RecordInterface instead.
28106
28107         * cs-parser.jay: Updated to reflect changes above.
28108
28109         * decl.cs (Definition): Keep track of the TypeBuilder type that
28110         represents this type here.  Not sure we will use it in the long
28111         run, but wont hurt for now.
28112
28113         * driver.cs: Smaller changes to accomodate the new code.
28114
28115         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
28116         when done. 
28117
28118         * rootcontext.cs (CreateInterface):  New method, used to create
28119         the System.TypeBuilder type for interfaces.
28120         (ResolveInterfaces): new entry point to resolve the interface
28121         hierarchy. 
28122         (CodeGen): Property, used to keep track of the code generator.
28123
28124 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
28125
28126         * cs-parser.jay: Add a second production for delegate_declaration
28127         with `VOID'.
28128
28129         (enum_body): Put an opt_comma here instead of putting it on
28130         enum_body or enum_member_declarations so we can handle trailing
28131         commas on enumeration members.  Gets rid of a shift/reduce.
28132
28133         (type_list): Need a COMMA in the middle.
28134
28135         (indexer_declaration): Tell tokenizer to recognize get/set
28136
28137         * Remove old targets.
28138
28139         * Re-add the parser target.
28140
28141 2001-07-13  Simon Cozens <simon@simon-cozens.org>
28142
28143         * cs-parser.jay: Add precendence rules for a number of operators
28144         ot reduce the number of shift/reduce conflicts in the grammar.
28145
28146 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
28147
28148         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
28149         and put it here.
28150
28151         Get rid of old crufty code.
28152
28153         * rootcontext.cs: Use this to keep track of the parsed
28154         representation and the defined types available to the program. 
28155
28156         * gen-treedump.cs: adjust for new convention.
28157
28158         * type.cs: Split out the type manager, and the assembly builder
28159         from here. 
28160
28161         * typemanager.cs: the type manager will live here now.
28162
28163         * cil-codegen.cs: And the code generator here. 
28164
28165 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
28166
28167         * makefile: Fixed up for easy making.
28168
28169 2001-07-13  Simon Cozens <simon@simon-cozens.org>
28170
28171         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
28172         the 
28173
28174         (unary_expression): Expand pre_increment_expression and
28175         post_decrement_expression to reduce a shift/reduce.
28176
28177 2001-07-11  Simon Cozens
28178
28179         * cs-tokenizer.cs: Hex numbers should begin with a 0.
28180
28181         Improve allow_keyword_as_indent name.
28182
28183 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
28184
28185         * Adjustments for Beta2. 
28186
28187 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
28188
28189         * decl.cs: Added `Define' abstract method.
28190         (InTransit): new property, used to catch recursive definitions. 
28191
28192         * interface.cs: Implement `Define'. 
28193
28194         * modifiers.cs: Map Modifiers.constants to
28195         System.Reflection.TypeAttribute flags.
28196
28197         * class.cs: Keep track of types and user-defined types.
28198         (BuilderInit): New method for creating an assembly
28199         (ResolveType): New function to launch the resolution process, only
28200         used by interfaces for now.
28201
28202         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
28203         that are inserted into the name space. 
28204
28205 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
28206
28207         * ARGH.  I have screwed up my tree so many times due to the use of
28208         rsync rather than using CVS.  Going to fix this at once. 
28209
28210         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
28211         load types.
28212
28213 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
28214
28215         * Experiment successful: Use System.Type rather that our own
28216         version of Type.  
28217
28218 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
28219
28220         * cs-parser.jay: Removed nsAliases from here.
28221
28222         Use new namespaces, handle `using XXX;' 
28223
28224         * namespace.cs: Reimplemented namespace handling, use a recursive
28225         definition of the class.  Now we can keep track of using clauses
28226         and catch invalid using clauses.
28227
28228 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
28229
28230         * gen-treedump.cs: Adapted for all the renaming.
28231
28232         * expression.cs (Expression): this class now has a Type property
28233         which returns an expression Type.
28234
28235         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
28236         `Type', as this has a different meaning now in the base
28237
28238 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
28239
28240         * interface.cs, class.cs: Removed from all the sources the
28241         references to signature computation, as we can not do method
28242         signature computation during the parsing time, as we are not
28243         trying to solve at that point distinguishing:
28244
28245         class X {
28246                 void a (Blah x) {}
28247                 void a (NS.Blah x) {}
28248         }
28249
28250         Which depending on the context might be valid or not, as we do not
28251         know if Blah is the same thing as NS.Blah at that point.
28252
28253         * Redid everything so the code uses TypeRefs now instead of
28254         Types.  TypeRefs are just temporary type placeholders, that need
28255         to be resolved.  They initially have a pointer to a string and the
28256         current scope in which they are used.  This is used later by the
28257         compiler to resolve the reference to an actual Type. 
28258
28259         * DeclSpace is no longer a CIR.Type, and neither are
28260         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
28261         are all DeclSpaces, but no Types. 
28262
28263         * type.cs (TypeRefManager): This implements the TypeRef manager,
28264         which keeps track of all the types that need to be resolved after
28265         the parsing has finished. 
28266
28267 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
28268
28269         * ARGH.  We are going to have to store `foreach' as a class rather
28270         than resolving it, as we need to verify error 1579 after name
28271         resolution.   *OR* we could keep a flag that says `This request to
28272         IEnumerator comes from a foreach statement' which we can then use
28273         to generate the error.
28274
28275 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
28276
28277         * class.cs (TypeContainer.AddMethod): we now add methods to the
28278         MethodGroup instead of the method hashtable.  
28279
28280         * expression.cs: Add MethodGroup abstraction, which gets us one
28281         step closer to the specification in the way we handle method
28282         declarations.  
28283
28284         * cs-parser.jay (primary_expression): qualified_identifier now
28285         tried to match up an identifier to a local variable reference or
28286         to a parameter reference.
28287
28288         current_local_parameters is now a parser global variable that
28289         points to the current parameters for the block, used during name
28290         lookup.
28291
28292         (property_declaration): Now creates an implicit `value' argument to
28293         the set accessor.
28294
28295 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
28296
28297         * parameter.cs: Do not use `param' arguments as part of the
28298         signature, per the spec.
28299
28300 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
28301
28302         * decl.cs: Base class for classes, structs and interfaces.  This
28303         is the "Declaration Space" 
28304
28305         * cs-parser.jay: Use CheckDef for checking declaration errors
28306         instead of having one on each function.
28307
28308         * class.cs: Factor out some code for handling error handling in
28309         accordance to the "Declarations" section in the "Basic Concepts"
28310         chapter in the ECMA C# spec.
28311
28312         * interface.cs: Make all interface member classes derive from
28313         InterfaceMemberBase.
28314
28315 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
28316
28317         * Many things: all interfaces are parsed and generated in
28318         gen-treedump.  Support for member variables, constructors,
28319         destructors, properties, constants is there.
28320
28321         Beginning of the IL backend, but very little done, just there for
28322         testing purposes. 
28323
28324 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
28325
28326         * cs-parser.jay: Fix labeled statement.
28327
28328         * cs-tokenizer.cs (escape): Escape " and ' always.
28329         ref_line, ref_name: keep track of the line/filename as instructed
28330         by #line by the compiler.
28331         Parse #line.
28332
28333 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
28334
28335         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
28336         to match the values in System.CodeDOM.
28337
28338         Divid renamed to Divide.
28339
28340         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
28341         statements. 
28342         (Statements.set): remove.
28343
28344         * System.CodeDOM/CodeCatchClause.cs: always have a valid
28345         statements. 
28346
28347         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
28348         falseStatements always have valid values. 
28349
28350         * cs-parser.jay: Use System.CodeDOM now.
28351