997e387102aa64fcd339053a96818475ca5a04e2
[mono.git] / mcs / mcs / ChangeLog
1 2009-01-30  Marek Safar  <marek.safar@gmail.com>
2
3         A fix for bug #470767
4         * statement.cs: Introduced BlockScopeExpression, needed when 
5         expression tree conversion has to emit scope variables.
6
7 2009-01-29  Marek Safar  <marek.safar@gmail.com>
8
9         * class.cs: Remove duplicate CallingConvention.
10
11 2009-01-29  Marek Safar  <marek.safar@gmail.com>
12
13         *.cs: Rename Parameters to ParametersCompiled and ParametersImported
14         when I finally found the right naming convention.
15
16 2009-01-29  Marek Safar  <marek.safar@gmail.com>
17
18         * cs-tokenizer.cs: Put back different open parens optimization.
19
20 2009-01-28  Marek Safar  <marek.safar@gmail.com>
21
22         A fix for bug #470227
23         * cs-tokenizer.cs: Remove too agressive parser optimization.
24
25 2009-01-28  Marek Safar  <marek.safar@gmail.com>
26
27         A fix for bug #324319
28         * class.cs: Remove too early base type resolve.
29
30 2009-01-27  Marek Safar  <marek.safar@gmail.com>
31
32         A fix for bug #324319
33         * ecore.cs: Explicitly type null when assigning to type argument to
34         make pass verifier check.
35
36 2009-01-27  Marek Safar  <marek.safar@gmail.com>
37
38         * anonymous.cs: Fixed recent regression when initializing captured 
39         this.
40
41 2009-01-26  Marek Safar  <marek.safar@gmail.com>
42
43         A fix for bug #469019
44         * anonymous.cs: Use all parent type parameters when instantiating
45         nested generic storey.
46
47 2009-01-26  Marek Safar  <marek.safar@gmail.com>
48
49         * expression.cs: Check for null instance methodgroup expression.
50
51 2009-01-26  Marek Safar  <marek.safar@gmail.com>
52
53         A fix for bug #469244
54         * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
55         instance inside a conditional expression.
56
57 2009-01-23  Marek Safar  <marek.safar@gmail.com>
58
59         * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
60         expression.cs, report.cs, ecore.cs, attribute.cs: Use common 
61         GetElementType and HasElementType. IsValueType clean up.
62
63 2009-01-23  Marek Safar  <marek.safar@gmail.com>
64
65         * nullable.cs: Use common EmitCall.
66         
67         * expression.cs: Emit constraint. for virtual calls only.
68
69 2009-01-23  Marek Safar  <marek.safar@gmail.com>
70
71         * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs, 
72         expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
73         driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
74         checks.
75
76 2009-01-22  Jb Evain  <jbevain@novell.com>
77
78         * anonymous.cs: make anonymous types' ToString implementation
79         match what csc outputs.
80
81 2009-01-21  Marek Safar  <marek.safar@gmail.com>
82
83         * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
84         up.
85
86 2009-01-17  Marek Safar  <marek.safar@gmail.com>
87
88         * convert.cs, ecore.cs: Explicitly casts type arguments to pass
89         verifier checks.
90
91 2009-01-16  Marek Safar  <marek.safar@gmail.com>
92
93         * nullable.cs (LiftedBinaryOperator): Check for all possible null
94         expressions.
95
96 2009-01-15  Marek Safar  <marek.safar@gmail.com>
97
98         A fix for bug #466634
99         * statement.cs: Add reference for nested storey when only this
100         is captured.
101
102 2009-01-15  Marek Safar  <marek.safar@gmail.com>
103
104         A fix for bug #466474
105         * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
106         was specified.
107
108 2009-01-15  Marek Safar  <marek.safar@gmail.com>
109
110         * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
111         Fixed nested stories parent referencing process. Also fixes #463985.
112
113 2009-01-06  Marek Safar  <marek.safar@gmail.com>
114
115         * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs, 
116         class.cs, cs-parser.jay, codegen.cs: Clean up destructor
117         implementation. Also fixes #463108.
118
119 2009-01-05  Marek Safar  <marek.safar@gmail.com>
120
121         A fix for bug #416109
122         * decl.cs: Issue correct CLSAttribute warning location.
123
124 2009-01-05  Marek Safar  <marek.safar@gmail.com>
125
126         A fix for bug #456775
127         * attribute.cs: Use attribute owner scope when resolving attribute
128         arguments.
129
130 2009-01-05  Marek Safar  <marek.safar@gmail.com>
131
132         A fix for bug #457257
133         * decl.cs: Fixed incorrect member declaring type comparison.
134
135 2009-01-05  Marek Safar  <marek.safar@gmail.com>
136
137         A fix for bug #460896
138         * driver.cs: Handle /RES resources as embeddable.
139
140 2009-01-05  Marek Safar  <marek.safar@gmail.com>
141
142         A fix for bug #462515
143         * ecore.cs: Report inacessible members upwards.
144
145 2009-01-05  Marek Safar  <marek.safar@gmail.com>
146
147         A fix for bug #463190, #463192
148         * decl.cs, namespace.cs: Also import internal extension classes.
149
150 2009-01-04  Marek Safar  <marek.safar@gmail.com>
151
152         A fix for bug #463415
153         * generic.cs: Use right index for RemoveDependentTypes.
154
155 2009-01-02  Marek Safar  <marek.safar@gmail.com>
156
157         A fix for bug #463196
158         * expression.cs: Fixed enum to null comparison.
159
160 2009-01-02  Marek Safar  <marek.safar@gmail.com>
161
162         A fix for bug #463121
163         * nullable.cs: Fixed nullable user equality operator comparison.
164
165 2009-01-02  Marek Safar  <marek.safar@gmail.com>
166
167         A fix for bug #462950
168         * class.cs, decl.cs: Use full explicit name when defining automatic
169         property backing field.
170
171 2009-01-02  Marek Safar  <marek.safar@gmail.com>
172
173         A fix for bug #462592
174         * pending.cs: Emit type arguments for generic proxy method.
175
176 2008-12-30  Marek Safar  <marek.safar@gmail.com>
177
178         * expression.cs (As): Mutate all type arguments.
179
180 2008-12-29  Marek Safar  <marek.safar@gmail.com>
181
182         A fix for bug #462622
183         * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
184         context.
185
186 2008-12-29  Marek Safar  <marek.safar@gmail.com>
187
188         A fix for bug #450782
189         * ecore.cs: Consider more variables of form V.I to be fixed.
190
191 2008-12-29  Marek Safar  <marek.safar@gmail.com>
192
193         A fix for bug #460712
194         * typemanager.cs: Core types could be imported.
195
196 2008-12-28  Marek Safar  <marek.safar@gmail.com>
197
198         A fix for bugs #460847, #460772, #458049, #457339, #447807
199         * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
200         statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
201         cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
202         user lambdas used inside query clauses.
203
204 2008-12-18  Marek Safar  <marek.safar@gmail.com>
205
206         A fix for bug #460229
207         * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
208
209 2008-12-18  Marek Safar  <marek.safar@gmail.com>
210
211         A fix for bug #459952
212         * decl.cs, namespace.cs: Use common CheckAccessLevel.
213
214 2008-12-18  Marek Safar  <marek.safar@gmail.com>
215
216         A fix for bug #459630
217         * convert.cs: Enum to valuetype conversion is not allowed.
218
219 2008-12-18  Marek Safar  <marek.safar@gmail.com>
220
221         A fix for bug #457087
222         * generic.cs: Don't crash when constraint comes from type
223         declaration.
224
225 2008-12-16  Marek Safar  <marek.safar@gmail.com>
226
227         A fix for bug #459221
228         * anonymous.cs, statement.cs: Delay only captured this
229         initialization.
230
231 2008-12-12  Marek Safar  <marek.safar@gmail.com>
232
233         A fix for bug #457489
234         * anonymous.cs, statement.cs: Split anonymous storey instantiation
235         and initialization to capture scope initializers correctly.
236
237 2008-12-11  Marek Safar  <marek.safar@gmail.com>
238
239         * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
240         ParameterReference refactoring.
241
242 2008-12-03  Marek Safar  <marek.safar@gmail.com>
243
244         * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
245         to be imported from any assembly.
246
247 2008-12-03  Marek Safar  <marek.safar@gmail.com>
248
249         * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
250         statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
251         from anonymous method and lambda expression.
252
253 2008-12-01  Marek Safar  <marek.safar@gmail.com>
254
255         A fix for bug #448560
256         * expression.cs (As): Box any generic type arguments to be
257         verifiable.
258
259 2008-11-29  Raja R Harinath  <harinath@hurrynot.org>
260
261         Add tripwire for implicit conversion bugs
262         * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
263         for CS1501 error.
264         (MethodGroupExpr.OverloadResolve): Add sanity check between
265         IsApplicable and VerifyArgumentsCompat.
266         (VerifyArgumentsCompat): Report CS1501 where appropriate.
267
268 2008-11-29  Raja R Harinath  <harinath@hurrynot.org>
269
270         Fix build break in System.Data_test
271         * convert.cs (ImplicitConversionExists): Move NullLiteral
272         conversions ...
273         (ImplicitStandardConversionExists): ... here.
274
275 2008-11-28  Marek Safar  <marek.safar@gmail.com>
276
277         * literal.cs: Emit correctly explicit null to nullable cast.
278
279 2008-11-28  Marek Safar  <marek.safar@gmail.com>
280
281         * ecore.cs, generics.cs: Fixed crash when type arguments fail to
282         resolve.
283
284 2008-11-28  Marek Safar  <marek.safar@gmail.com>
285
286         A fix for bug #449005
287         * convert.cs, nullable.cs: Use only one implicit nullable
288         conversion.
289
290 2008-11-27  Marek Safar  <marek.safar@gmail.com>
291
292         * convert.cs, literal.cs: More Convert cleanup is needed.
293
294 2008-11-27  Marek Safar  <marek.safar@gmail.com>
295
296         * decl.cs, class.cs: Fixed misleading error message.
297
298 2008-11-26  Marek Safar  <marek.safar@gmail.com>
299
300         A fix for bug #449005
301         * nullable.cs (EmitEquality): Disable optimization for user operator
302         operands.
303
304 2008-11-25  Marek Safar  <marek.safar@gmail.com>
305
306         A fix for bug #447027
307         * anonymous.cs (HoistedVariable): Cache also outer access to deal
308         with context variables stored as expression instances.
309
310 2008-11-25  Marek Safar  <marek.safar@gmail.com>
311
312         A fix for bug #447027
313         * delegate.cs: Fixed delegate VerifyMethod logic.
314
315 2008-11-24  Marek Safar  <marek.safar@gmail.com>
316
317         * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
318         but not verifiable.
319
320 2008-11-21  Marek Safar  <marek.safar@gmail.com>
321
322         * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
323         member type resolve to follow normal flow, instead of random
324         property access.
325
326 2008-11-21  Marek Safar  <marek.safar@gmail.com>
327
328         * iterators.cs (GetEnumeratorStatement): Re-use already resolved
329         type.
330
331 2008-11-21  Marek Safar  <marek.safar@gmail.com>
332
333         * const.cs: Emit decimal array constant as literal.
334
335 2008-11-20  Marek Safar  <marek.safar@gmail.com>
336
337         * iterators.cs, ecore.cs: Removed CurrentBlock statement.
338
339 2008-11-19  Marek Safar  <marek.safar@gmail.com>
340
341         * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
342         into real property (saves 8 MB for corlib compilation).
343
344 2008-11-19  Marek Safar  <marek.safar@gmail.com>
345
346         * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
347         nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
348         generic-mcs.cs: Small cleanup of TypeArguments.
349
350 2008-11-18  Marek Safar  <marek.safar@gmail.com>
351
352         * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
353         expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
354         of ConstructedType expression, renamed to GenericTypeExpr.
355
356 2008-11-17  Marek Safar  <marek.safar@gmail.com>
357
358         A fix for bug #445303
359         * location.cs (IsConditionalDefined): Handle undefined global
360         defines.
361
362 2008-11-17  Marek Safar  <marek.safar@gmail.com>
363
364         A fix for bug #444678
365         * expression.cs (TryReduceConstant): Always create new constant
366         instance.
367
368 2008-11-17  Marek Safar  <marek.safar@gmail.com>
369
370         A fix for bug #444673
371         * ecore.cs: Ignore open generic types when used as generic type
372         instance fields.
373
374 2008-11-17  Marek Safar  <marek.safar@gmail.com>
375
376         A fix for bug #445458
377         * expression.cs, cs-parser.jay: Don't crash when an expression
378         statement is null.
379
380 2008-11-17  Marek Safar  <marek.safar@gmail.com>
381
382         A fix for bug #445464
383         * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
384         inside unbound type.
385
386 2008-11-14  Jb Evain  <jbevain@novell.com>
387
388         * driver.cs: ignore empty -nowarn argument such as
389         the one in -nowarn:12,13,,.
390
391 2008-11-13  Marek Safar  <marek.safar@gmail.com>
392
393         A fix for bug #444271
394         * anonymous.cs: Rescan parent storeys when best candidate was
395         undone.
396
397 2008-11-13  Marek Safar  <marek.safar@gmail.com>
398
399         * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
400         useless UnboundTypeExpression.
401         
402         * attribute.cs: Do check obsolete attribute on generic types.
403
404 2008-11-12  Marek Safar  <marek.safar@gmail.com>
405
406         A fix for bugs #425680, #400139
407         * ecore.cs, expression.cs: Trying to do some almost_matched_members
408         refactoring.
409
410 2008-11-11  Marek Safar  <marek.safar@gmail.com>
411
412         A fix for bug #435747
413         * assign.cs, expression.cs: Cleanup New assignment to emit correcly
414         compound value types assignment. Few micro optimizations added.
415
416 2008-11-10  Marek Safar  <marek.safar@gmail.com>
417
418         A fix for bug #442610
419         * anonymous.cs (MutateConstructor): More SRE hacking.
420
421 2008-11-10  Marek Safar  <marek.safar@gmail.com>
422
423         A fix for bug #442579
424         * ecore.cs: Also initialize expanded form of a method with 1 params
425         parameter.
426
427 2008-11-06  Marek Safar  <marek.safar@gmail.com>
428
429         * expression.cs (UnaryMutator): Do early l-side check.
430
431 2008-11-05  Miguel de Icaza  <miguel@novell.com>
432
433         * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
434         Init, otherwise we would crash later on when checking for friend
435         assemblies. 
436
437         * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
438         Otherwise we never get any meaningful information as to what
439         failed. 
440
441 2008-11-05  Marek Safar  <marek.safar@gmail.com>
442
443         A fix for bug #436318
444         * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
445
446 2008-11-05  Miguel de Icaza  <miguel@novell.com>
447
448         * namespace.cs: Turns out that it was a really bad idea to hide
449         the errors for namespaces not found here in eval mode.    
450
451         * eval.cs: When we process using clauses, only enter those into
452         the list of valid using clauses after they have been validated.   
453
454         The above change gives the proper semantics: it does not
455         senselessly report the same errors with broken using statements by
456         never storing them in the first place when they are invalid.
457
458 2008-11-05  Marek Safar  <marek.safar@gmail.com>
459
460         A fix for bug #421839
461         * cs-parser.jay: Remove expression from coalesce rule to force lower
462         priority than the assignment operator.
463
464 2008-11-05  Marek Safar  <marek.safar@gmail.com>
465
466         A fix for bug #437875
467         * nullable.cs: Compile correctly method group operand used with null
468         coalescing operator.
469
470 2008-11-04  Marek Safar  <marek.safar@gmail.com>
471
472         A fix for bug #434589
473         * expression.cs (Binary): Ignore lifted conversions when at least
474         one operand is of reference type.
475
476 2008-11-04  Marek Safar  <marek.safar@gmail.com>
477
478         * cs-parser.jay: Better syntax error report.
479
480 2008-11-03  Marek Safar  <marek.safar@gmail.com>
481
482         A fix for bug #436792
483         * cs-parser.jay: Use GetLocation to access location.
484
485 2008-11-03  Marek Safar  <marek.safar@gmail.com>
486
487         A fix for bug #440774
488         * cs-parser.jay: Also set current_array_type when parsing local
489         variables types.
490
491 2008-11-03  Marek Safar  <marek.safar@gmail.com>
492
493         A fix for bug #440785
494         * expression.cs (As): Don't resolve self modifing expression
495         multiple times.
496
497 2008-11-03  Marek Safar  <marek.safar@gmail.com>
498
499         A fix for bug #439447
500         * cs-tokenizer.cs: Tokenize surrogates only where allowed.
501
502 2008-11-03  Marek Safar  <marek.safar@gmail.com>
503
504         A fix for bug #437571
505         * cs-parser.jay: Fixes internal error for invalid expression
506         statements.
507
508 2008-10-17  Marek Safar  <marek.safar@gmail.com>
509
510         * ecore.cs: Resolve correctly ambiguous params delegate methods.
511
512 2008-10-17  Marek Safar  <marek.safar@gmail.com>
513
514         * generic.cs, anonymous.cs: Simplified GetDeclarations.
515
516 2008-10-17  Marek Safar  <marek.safar@gmail.com>
517
518         * cs-tokenizer.cs: More precise cast parsing.
519
520 2008-10-16  Martin Baulig  <martin@ximian.com>
521
522         * anonymous.cs (AnonymousMethodStorey): Put back the
523         `hoisted_locals' hashtable and use it in EmitType().
524
525 2008-10-15  Marek Safar  <marek.safar@gmail.com>
526
527         * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
528         cs-parser.jay: Tokenizer optimizations and memory reduction, saves
529         ~5MB for corlib.
530
531 2008-10-14  Marek Safar  <marek.safar@gmail.com>
532
533         * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
534
535 2008-10-14  Marek Safar  <marek.safar@gmail.com>
536
537         * statement.cs: Mutate scope initializers.
538
539 2008-10-14  Marek Safar  <marek.safar@gmail.com>
540
541         * expression.cs: Use typeless value for This constant.
542         
543         * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
544
545 2008-10-14  Marek Safar  <marek.safar@gmail.com>
546
547         * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
548         tokenizer.
549
550 2008-10-13  Marek Safar  <marek.safar@gmail.com>
551
552         * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
553         type to type cast.
554
555 2008-10-13  Marek Safar  <marek.safar@gmail.com>
556
557         * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
558         parser and tokenizer. Fixes many ambiguities including #433258.
559
560 2008-10-10  Marek Safar  <marek.safar@gmail.com>
561
562         * cs-parser.jay: Fixed missing accessor recovery.
563
564 2008-10-10  Marek Safar  <marek.safar@gmail.com>
565
566         A fix for bug #433701
567         * expression.cs: Better error message.
568
569 2008-10-10  Marek Safar  <marek.safar@gmail.com>
570
571         * cs-parser.jay, expression.cs: Start reporting real parser errors.
572         
573         * Makefile: Disabled unused debug symbols.
574
575         Also fixes: #320556, #321097, #321656, #321876, #351316
576
577 2008-10-09  Miguel de Icaza  <miguel@novell.com>
578
579         * eval.cs: rename "<interactive>" to "{interactive}", to work
580         around a requirement in the compiler that this be a valid
581         filename, and in Windows it is not (433886).
582
583 2008-10-09  Marek Safar  <marek.safar@gmail.com>
584
585         * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
586
587 2008-10-08  Marek Safar  <marek.safar@gmail.com>
588
589         * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
590         cs-parser.jay: Generic type declaration and type arguments cleanup.
591
592 2008-10-05  Marek Safar  <marek.safar@gmail.com>
593
594         * cs-parser.jay: Allow parsing weird array creation construct.
595
596 2008-10-05  Marek Safar  <marek.safar@gmail.com>
597
598         * cs-parser.jay: Conflicts reduction.
599
600 2008-10-04  Marek Safar  <marek.safar@gmail.com>
601
602         * cs-parser.jay: Conflicts reduction.
603
604 2008-10-04  Raja R Harinath  <harinath@hurrynot.org>
605
606         Fix #398325
607         * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
608         property.  Add a 'count' hint about the use of the shared vector.
609         Ensure that we don't leak out dirty bits.
610         (UsageVector.MergeChild): Throw away information about variables
611         in child vectors.
612         Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
613
614 2008-10-03  Marek Safar  <marek.safar@gmail.com>
615
616         A fix for bug #431746
617         * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
618         parameters when iterator is created.
619
620 2008-10-03  Marek Safar  <marek.safar@gmail.com>
621
622         A fix for bug #431827
623         * expression.cs: Fixed right based pointer arithmetic operations
624         emit.
625
626 2008-10-03  Marek Safar  <marek.safar@gmail.com>
627
628         A fix for bug #353779
629         * assign.cs, expression.cs: Fixed compound assignment conversions.
630
631 2008-10-02  Marek Safar  <marek.safar@gmail.com>
632
633         A fix for bug #375262
634         * statement.cs: Refactor ArrayForeach to be usable with string
635         indexer. Optimized single dimentional arrays foreach.
636
637 2008-10-02  Marek Safar  <marek.safar@gmail.com>
638
639         A fix for bug #431255
640         * anonymous.cs, expression.cs: Removed broken optimization.
641
642 2008-10-01  Marek Safar  <marek.safar@gmail.com>
643
644         * anonymous.cs: Use full type parameters of parent generic
645         containers. Removed unnecessary AddParentStoreyReference call.
646
647 2008-10-01  Marek Safar  <marek.safar@gmail.com>
648
649         A fix for bug #324702
650         * class.cs: Use better shorter names for explicit interface member
651         implementations.
652
653         * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
654
655 2008-10-01  Marek Safar  <marek.safar@gmail.com>
656         
657         * expression.cs: Use new interface to check fixed expression.
658
659 2008-10-01  Marek Safar  <marek.safar@gmail.com>
660
661         A fix for bug #421101
662         * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
663         interface to check for fixed fixed-buffers.
664
665 2008-10-01  Marek Safar  <marek.safar@gmail.com>
666
667         A fix for bug #429264
668         * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
669         
670         * delegate.cs: Removed unnecessary casts.
671
672 2008-09-30  Marek Safar  <marek.safar@gmail.com>
673
674         A fix for bug #352151
675         * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
676         class.cs: Fixed already defined explicit interface members check.
677
678 2008-09-29  Rodrigo Kumpera  <rkumpera@novell.com>
679
680         cs-tokenizer.cs: Fix typo.
681
682 2008-09-28  Miguel de Icaza  <miguel@novell.com>
683
684         * eval.cs (InteractiveBase): The quit command now just sets a
685         flag, instead of calling Environment.Exit(), it is milder on
686         embedded hosts. 
687
688         CompiledMethod is now in Mono.CSharp, not nested inside
689         the Evaluator, it was inconvenient to use.
690
691 2008-09-27  Miguel de Icaza  <miguel@novell.com>
692
693         * eval.cs (Evaluator): Introduce Compile method, to allow compiled
694         code to be invoked without having to reparse.
695
696 2008-09-27  Miguel de Icaza  <miguel@novell.com>
697
698         * ecore.cs: The recent changes to FieldExpr broke this as well.
699         Fixes LINQ queries in the interactive shell.
700
701         * Multiple files: indentation fixing for the Mono coding
702         guidelines for the switch statement.
703
704         * eval.cs: Make the Evaluator API thread safe.
705
706 2008-09-26  Marek Safar  <marek.safar@gmail.com>
707
708         * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
709         constructor parsing.
710
711 2008-09-26  Marek Safar  <marek.safar@gmail.com>
712
713         A fix for bug #325326
714         * statement.cs: Check possible mistaken empty statement using
715         explicit blocks only.
716
717 2008-09-25  Miguel de Icaza  <miguel@novell.com>
718
719         * eval.cs (LoadAssembly, ReferenceAssembly): Call
720         RootNamespace.ComputeNamespaces to update the internal list of
721         namespaces, this is no longer done for us.
722
723         (InteractiveBase): Use the Evaluator APIs instead of calling into
724         Driver directly
725
726 2008-09-25  Marek Safar  <marek.safar@gmail.com>
727
728         A fix for bug #429264
729         * expression.cs: Missing mutator for access to multidimensional
730         arrays.
731
732 2008-09-25  Marek Safar  <marek.safar@gmail.com>
733
734         * class.cs, statement: Emit DebuggerHidden attribute for iterator
735         entry wrapper.
736         
737         * driver.cs: Missing input argument check.
738
739 2008-09-25  Marek Safar  <marek.safar@gmail.com>
740
741         * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
742         expression.cs, statement.cs, rootcontext.cs, class.cs, 
743         cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
744         DefineMembers.
745
746 2008-09-24  Miguel de Icaza  <miguel@novell.com>
747
748         * ecore.cs (FieldExpr): Only initialize eclass when we return a
749         fully constructed FieldExpr, fixes the regression introduced in
750         the last commit.
751         
752         * ecore.cs, expression.cs: Plug back the eclass initialization as
753         otherwise it regresses `csharp'. 
754
755 2008-09-24  Marek Safar  <marek.safar@gmail.com>
756
757         * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
758         ecore.cs, attribute.cs: Moved obsolete method checks from emit
759         phase to resolve phase. It resolves problems with expression trees
760         and fixes bugs #323796, #325156.
761
762 2008-09-23  Marek Safar  <marek.safar@gmail.com>
763
764         * codegen.cs: Report better error when symbol writer is missing.
765
766 2008-09-23  Marek Safar  <marek.safar@gmail.com>
767
768         * codegen.cs: Set .NET symbol writer.
769         
770         * decl.cs: Guard against null generic arguments.
771         
772         * report.cs: Don't report exactly same additional details.
773
774 2008-09-22  Marek Safar  <marek.safar@gmail.com>
775
776         A fix for bug #324917
777         * cs-parser.jay: Add missing multidimensional non-expression type
778         ranks.
779         
780 2008-09-22  Marek Safar  <marek.safar@gmail.com>
781
782         A fix for bug #428191
783         * anonymous.cs: Create an outer generic fields also for non-storey
784         anonymous methods.
785
786 2008-09-22  Marek Safar  <marek.safar@gmail.com>
787
788         A fix for bug #378294
789         * class.cs: Make fixed size buffers gmcs feature only.
790
791 2008-09-22  Marek Safar  <marek.safar@gmail.com>
792
793         A fix for bug #355622, #324993
794         * assign.cs, const.cs, class.cs: Create new EmitContext for each
795         field initializer.
796
797 2008-09-19  Marek Safar  <marek.safar@gmail.com>
798
799         * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
800         error reporting.
801
802 2008-09-19  Marek Safar  <marek.safar@gmail.com>
803
804         A fix for bug #416110
805         * generic.cs: Struct constraint results in default ctor and
806         ValueType base type constraint to be set.
807
808 2008-09-19  Marek Safar  <marek.safar@gmail.com>
809
810         A fix for bug #423791
811         * generic.cs: Fixed params output type type-inference.
812
813 2008-09-19  Marek Safar  <marek.safar@gmail.com>
814
815         * cs-parser.jay, expression.cs: Fixed few expression crashes.
816         
817 2008-09-19  Marek Safar  <marek.safar@gmail.com>
818
819         * cs-tokenizer.cs: Don't break on extra partial modifier.
820
821 2008-09-19  Marek Safar  <marek.safar@gmail.com>
822
823         A fix for bug #427592
824         * generic.cs: Use common parameter resolve method.
825
826 2008-09-18  Marek Safar  <marek.safar@gmail.com>
827
828         A fix for bug #414758
829         * expression.cs, ecore.cs: Fixed crash when accessing non-static
830         property.
831
832 2008-09-18  Marek Safar  <marek.safar@gmail.com>
833
834         * driver.cs, namespace.cs: Read types and namespaces after all
835         requested assemblies are loaded, fixes issues with System.Core
836         auto-reference, and #419888.
837
838 2008-09-18  Marek Safar  <marek.safar@gmail.com>
839
840         A fix for bug #417705
841         * cs-parser.jay: Fixed as/is operator expression split.
842
843 2008-09-18  Marek Safar  <marek.safar@gmail.com>
844
845         * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
846         Fixed expression tree representation of empty new expression and
847         new initializer expression.
848
849 2008-09-18  Miguel de Icaza  <miguel@novell.com>
850
851         * eval.cs: Remove warning, keep reference to driver around.
852
853         * Hide fields that do not need to be public.
854
855 2008-09-17  Marek Safar  <marek.safar@gmail.com>
856
857         A fix for bug #426385
858         * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
859         conversion for array elements.
860
861 2008-09-17  Marek Safar  <marek.safar@gmail.com>
862
863         * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
864         void parsing conflicts.
865
866 2008-09-15  Marek Safar  <marek.safar@gmail.com>
867
868         A fix for bug #425601
869         * driver.cs, typemanager.cs, namespace.cs: Automatically reference
870         System.Core only when there is no custom ExtensionAttribute
871         implementation.
872
873 2008-09-15  Miguel de Icaza  <miguel@novell.com>
874
875         * namespace.cs: Do not report CS0246 (name
876
877 2008-09-12  Marek Safar  <marek.safar@gmail.com>
878
879         A fix for bug #425669
880         * generic.cs: Don't cache generic static anonymous method 
881         containers.
882
883 2008-09-12  Marek Safar  <marek.safar@gmail.com>
884
885         * generic.cs, class.cs, delegate.cs: Check recursive inherited
886         conflicting constraints.
887
888 2008-09-12  Raja R Harinath  <harinath@hurrynot.org>
889
890         * cs-tokenizer.cs (consume_identifier): Allow partial methods in
891         mcs too.
892
893 2008-09-12  Marek Safar  <marek.safar@gmail.com>
894
895         * literal.cs, convert.cs, expression.cs, statement.cs: More null
896         to null pointer conversion fixes.
897
898 2008-09-11  Marek Safar  <marek.safar@gmail.com>
899
900         * cs-parser.jay, expression.cs: An implicitly typed local variable
901         declarator cannot use an array initializer.
902
903 2008-09-11  Marek Safar  <marek.safar@gmail.com>
904
905         * cs-parser.jay: Reduced number of printed tokens, add sorting.
906
907 2008-09-11  Marek Safar  <marek.safar@gmail.com>
908
909         * generic.cs (InflatedConstraints): Don't crash when constraints
910         are different.
911         
912         * cs-parser.jay: const_declarator is a block.
913
914         * constant.cs: Check for not allowed NaN conversions.
915
916 2008-09-10  Miguel de Icaza  <miguel@novell.com>
917
918         * driver.cs: Drop --shell argument, the compiler is no longer a
919         REPL. 
920
921         * eval.cs: Move most of the code that deals with evaluation into
922         this file and document the public API from repl.cs
923
924         * repl.cs: Remove from here.
925         
926 2008-09-10  Marek Safar  <marek.safar@gmail.com>
927
928         A fix for bug #424684
929         * generic.cs: Generic class constraints must come first.
930
931 2008-09-09  Miguel de Icaza  <miguel@novell.com>
932
933         * cs-parser.jay: Improve error reporting for syntax errors in
934         statements and expressions, we now report the expected tokens
935         instead of reporting the useless "; expected".
936
937         Drop the strings from the token declaration, it turns out that
938         they did not do what I thought they did.  Instead they were adding
939         two sets of tokens to the tables.
940
941 2008-09-09  Marek Safar  <marek.safar@gmail.com>
942
943         * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
944         delegate.cs: Share special type check.
945
946 2008-09-09  Marek Safar  <marek.safar@gmail.com>
947
948         A fix for bug #423981
949         * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
950
951 2008-09-09  Marek Safar  <marek.safar@gmail.com>
952
953         * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
954         ConvertImplicitly.
955
956 2008-09-09  Marek Safar  <marek.safar@gmail.com>
957
958         A fix for bugs: #324750, #335946
959         * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom 
960         lookup rule to determine ?-based tokens.
961
962 2008-09-08  Miguel de Icaza  <miguel@novell.com>
963
964         * repl.cs (OptionalAssign.EmitStatement): It is possible that some
965         expressions (like event adding or removing) end up here, so we
966         need to treat those as statements.
967
968         Add LoadAssembly method.
969
970 2008-09-04  Miguel de Icaza  <miguel@novell.com>
971
972         * repl.cs: Add Time method.
973
974 2008-09-05  Marek Safar  <marek.safar@gmail.com>
975
976         * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
977
978 2008-09-05  Miguel de Icaza  <miguel@novell.com>
979
980         * repl.cs: Add workaround for old compilers.
981
982 2008-09-04  Jb Evain  <jbevain@novell.com>
983
984         * repl.cs (PrettyPrint): pretty print everything that
985         implements IDictionary, as well as IEnumerables. Also,
986         add a quit helper property.
987
988 2008-09-04  Marek Safar  <marek.safar@gmail.com>
989
990         * constant.cs: Better error reporting for decimal literals.
991         
992         * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
993         field attributes.
994         
995 2008-09-04  Marek Safar  <marek.safar@gmail.com>
996                         Miguel de Icaza  <miguel@novell.com>
997
998         A fix for bug #422951
999         * assign.cs (Assign.DoResolve): Perform the type conversions
1000         checks before we attempt to initialize `New' initializers. 
1001
1002 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1003
1004         A fix for bug #422853
1005         * delegate.cs (DelegateCreation): Add special handling for
1006         EmptyExpression.Null instance expression which is just another
1007         hack for undecided member instance exression.
1008
1009 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1010
1011         * expression.cs, ecore.cs: Emit full expression tree for reduced
1012         binary expressions.
1013
1014 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1015
1016         * expression.cs (This): Guard against multi-resolving.
1017         
1018         * ecore.cs, statement.cs (Throw): Simplified.
1019         
1020         * flowanalysis.cs: Also verify event fields.
1021
1022 2008-09-04  Miguel de Icaza  <miguel@novell.com>
1023
1024         * assign.cs (Assign.DoResolve): Perform the type conversions
1025         checks before we attempt to initialize `New' initializers. 
1026
1027         * repl.cs (PrettyPrint): Add Hashtable prettyprint
1028
1029         * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
1030         public. 
1031
1032         * repl.cs: Update help.
1033
1034 2008-09-03  Miguel de Icaza  <miguel@novell.com>
1035
1036         * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
1037         handling of the default config handling, including the special
1038         treatment of System.Core assembly. 
1039
1040         Fixes the REPL processing for LINQ.
1041
1042 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1043
1044         A fix for bug #422507
1045         * expression.cs (UnboxCast): Add missing child expression mutator.
1046
1047 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1048
1049         * driver.cs: Don't self reference System.Core assembly.
1050
1051 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1052
1053         A fix for bug #422507
1054         * expression.cs (StringConcat): Add missing type mutator.
1055
1056 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1057
1058         * generic.cs (TypeInferenceContext): Follow equality rule for
1059         constructed type lower bound type inference.
1060
1061 2008-09-02  Miguel de Icaza  <miguel@novell.com>
1062
1063         * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
1064         <dblank@cs.brynmawr.edu> which updates the cursor position on
1065         refresh.
1066         
1067 2008-09-02  Marek Safar  <marek.safar@gmail.com>
1068
1069         A fix for bug #367145
1070         * driver.cs: Fixed import of extension methods when using -noconfig
1071         option.
1072
1073 2008-09-02  Marek Safar  <marek.safar@gmail.com>
1074
1075         * iterator.cs: Don't emit GetEnumerator method twice but call a generic
1076         version from non-generic implementation instead.
1077
1078 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1079
1080         A fix for bug #418908
1081         * class.cs: Use AddScopeStatement for field initializers.
1082
1083 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1084
1085         A fix for bug #415385
1086         * ecore.cs, convert.cs: Do method group conversion for equal group types.
1087
1088 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1089
1090         A fix for bug #421736
1091         * iterators.cs: Don't crash on unreachable iterators.
1092
1093 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1094
1095         A fix for bug #421628
1096         * parameter.cs, attribute.cs: Clone also parameter attributes.
1097
1098 2008-08-30  Miguel de Icaza  <miguel@novell.com>
1099
1100         * namespace.cs (LookupType): In EvalMode, try to replace
1101         the TypeBuilder from our cache with a Type as Reflection.Emit does
1102         not  like to mix code from older assemblies emitted and new
1103         assemblies emitted. 
1104
1105         This sounds like a serious Mono bug that prevents multiple
1106         assemblies to be generated and consumed at the same time.
1107
1108         * cs-parser.jay (push_current_class): Do not make interactive
1109         classes internal or private, make them public as we currently
1110         generate each new class in a new assembly.   
1111
1112 2008-08-29  Miguel de Icaza  <miguel@novell.com>
1113
1114         * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
1115         remove types that are entered into the global namespace during
1116         parsing so that we can remove them on failure.
1117  
1118         * cs-parser.jay: Parsing: we now keep track of types that are
1119         entered into global variables and queue those in case the parsing
1120         or resolution fail.
1121  
1122         This happens in a few situations: during partial-input, we invoke
1123         the parser repeatedly for example with the string "class X", this
1124         would cause X to be registed, and we need to remove this
1125         registration so that another parse attempt later with say "class X {"
1126         would actually work.
1127  
1128         Additionally, if there is an error in the resolution phase, for
1129         example: "class X : NonExistant {}" th
1130         
1131         * cs-parser.jay: Be more precise with the errors being raised,
1132         instead of flagging all exceptions during parsing to be attributed
1133         to the parsing process, distinguish those from errors happening in
1134         the actions and hint that using -v would produce the actual
1135         exception. 
1136
1137         * repl.cs: Do not load all compiler references on each reset,
1138         doing the partial reset takes care of this.
1139         
1140 2008-08-28  Miguel de Icaza  <miguel@novell.com>
1141
1142         * repl.cs: Add support for loading all the files from
1143         ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
1144         as shell libraries.
1145
1146         Introduce a micro-parser that is able to deambiguate on its input
1147         whether we are dealing with a compilation unit (namespace, class,
1148         interface, struct, delegate) declaration or a statement.   This
1149         allows both declarations and statements to be entered. 
1150
1151         Set history size by default to 300 lines.
1152
1153         Instead of distinguishing based on the parser.InteractiveResult,
1154         have only two cases: statements were parsed, or a compilation unit
1155         was.   Always pull the Using statement additions from the
1156         compilation unit parse.
1157         
1158         * cs-tokenizer.cs: Rename tokens to better describe their intent
1159         (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
1160         
1161         * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
1162         EvalMode is used to trigger the lookup of global variables while
1163         StatementMode is used turn variable declarations into static
1164         fields.
1165
1166         * getline.cs: Allow history size to be set.
1167         
1168 2008-08-29  Marek Safar  <marek.safar@gmail.com>
1169
1170         A fix for bug #360755
1171         * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
1172
1173 2008-08-29  Marek Safar  <marek.safar@gmail.com>
1174
1175         * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
1176         
1177         * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
1178         member name, it is too confusing
1179         
1180         * decl.cs, class.cs: Don't report unused fields with attached attribute.
1181         
1182         * rootcontext.cs: Finally default to warning level 4.
1183
1184 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1185
1186         * class.cs (CheckBase): Ignore overloaded operators.
1187
1188 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1189
1190         A fix for bug #420830
1191         * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
1192
1193 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1194
1195         A fix for bug #420832
1196         * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
1197
1198 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1199
1200         A fix for bug #420386
1201         * nullables.cs: Fixed logic of nullable user comparison operators involving
1202         null values.
1203
1204 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1205         
1206         * attribute (IsClsCompliant): Use FALSE value for pointer types.
1207
1208 2008-08-27  Miguel de Icaza  <miguel@novell.com>
1209
1210         * repl.cs: Add support for aborting the running code with C-c. 
1211
1212 2008-08-27  Raja R Harinath  <harinath@hurrynot.org>
1213
1214         * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
1215
1216 2008-08-27  Miguel de Icaza  <miguel@novell.com>
1217
1218         * cs-parser.jay (interactive_statement_list): A new set of rules
1219         for hosting statements that uses the "interactive_" prefix.   
1220
1221         * repl.cs: Add support for parsing `using' as a statement or as a
1222         directive.  Deambiguating before passing this to the parser.
1223
1224         We need to distinguish statement_expressions that occur at the
1225         toplevel vs those that occur embedded into expressions.
1226
1227         * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com> 
1228         that fixes the cursor key handling, and a history bug.
1229         
1230 2008-08-26  Miguel de Icaza  <miguel@novell.com>
1231
1232         * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
1233         limitations in Console, instead the 2.0 bootstrap libraries now
1234         include the Console bits.
1235
1236         Also, remove the use of Nullables from getline.cs
1237
1238         ------------
1239         
1240         Interactive support for the C# compiler.   Use gmcs --shell to
1241         enter a read-eval-print loop shell.
1242
1243         Docs: http://www.mono-project.com/CsharpRepl
1244         
1245         * sources: include repl.cs here and getline.cs for gmcs.exe,
1246         everything else is getline.cs impaired.
1247
1248         * Makefile: when bootstrapping pass a special flag
1249         BOOTSTRAP_COMPILER which we use to prevent failures in compilation
1250         as we use NET_2_0 define to pull 2.0 APIs from System.Console.
1251         This distinguishes those two cases.
1252
1253         * repl.cs: Support for a read-eval-print loop.   Will be soon
1254         refactored into eval support and then REPL on top of it.
1255
1256         * ecore.cs: If a simplename lookup fails, before erroring out,
1257         if we are in EvalMode to resolve the name to a declaration in the
1258         Eval-land.    
1259
1260         This means that variable declarations that happened in previous
1261         classes (as repl puts every statement in a separate class) are
1262         made visible in this way.
1263
1264         * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
1265         triggered an error due to the end of file being reached.   This is
1266         used to do multi-line input, and notify the caller that the user
1267         needs to provide more text before a successful parse.
1268
1269         Add new grammar rules after the INTERACTIVE_PARSER token is seen
1270         to drive the evaluation with a custom wrapper. 
1271
1272         * driver.cs: Add support for --shell, and refactor some code to be
1273         reused from repl.cs
1274         
1275         * namespace.cs: Add support for serializing the contents of the
1276         namespaces and reloading them.  
1277
1278         * getline.cs: A managed implementation of ReadLine under
1279         X11/Apache2 license terms.  Easy to embed in other applications as
1280         well.
1281
1282         * namespace.cs: Add some functions to save and restore the
1283         namespace state.
1284
1285         * rootcontext.cs: New public field.
1286
1287         * cs-tokenizer.cs: Add support for one of the possible characters
1288         we introduce into the token stream.  
1289
1290         This patch does not affect the regular tokenization process, the
1291         only performance hit would happen if there is an invalid character
1292         on the input string.
1293
1294         * support.cs: Move isatty helper routine here.
1295
1296         * codegen.cs: Small cleanup, and add a mechanism to initialize the
1297         code generator for in-memory assemblies.
1298
1299 2008-08-26  Marek Safar  <marek.safar@gmail.com>
1300
1301         * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
1302         parameter cannot be always used as a type.
1303
1304 2008-08-21  Marek Safar  <marek.safar@gmail.com>
1305
1306         * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
1307
1308 2008-08-21  Marek Safar  <marek.safar@gmail.com>
1309
1310         * convert.cs: Implement explicit array to IList<T> conversion.
1311
1312 2008-08-20  Marek Safar  <marek.safar@gmail.com>
1313
1314         A fix for bug #362740
1315         * cs-tokenizer.cs: Handle UTF-16 surrogates.
1316
1317 2008-08-20  Marek Safar  <marek.safar@gmail.com>
1318         
1319         * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
1320         pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
1321         flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
1322         expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
1323         handling to use just one type of infrastructure and deal with generics
1324         more effectivelly.
1325
1326 2008-07-23  Martin Baulig  <martin@ximian.com>
1327
1328         *** Merged this from trunk revision 108527 ***
1329
1330         * statement.cs
1331         (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
1332         (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
1333         scope variable.
1334
1335 2008-08-15  Marek Safar  <marek.safar@gmail.com>
1336         
1337         * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
1338         error checks.
1339
1340 2008-08-15  Marek Safar  <marek.safar@gmail.com>
1341         
1342         * delegate.cs: Fixed compiler crash when creating delegate using partial
1343         method.
1344         
1345         * typemanager.cs: MulticastDelegate is not a delegate.
1346
1347 2008-08-14  Marek Safar  <marek.safar@gmail.com>
1348         
1349         * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
1350         checks.
1351
1352 2008-08-14  Raja R Harinath  <harinath@hurrynot.org>
1353
1354         * cs-parser.jay (type): Allow 'var' in mcs too.
1355         (local_variable_type): Likewise.
1356
1357 2008-08-14  Marek Safar  <marek.safar@gmail.com>
1358         
1359         * driver.cs: Removed broken -noconfig variants.
1360
1361 2008-08-14  Marek Safar  <marek.safar@gmail.com>
1362         
1363         A fix for bug #417078
1364         * expression.cs: Emit correctly left side pointer operators.
1365
1366 2008-08-13  Marek Safar  <marek.safar@gmail.com>
1367
1368         * generic.cs, lambda.cs: Inflate method generic arguments only.
1369
1370 2008-08-12  Marek Safar  <marek.safar@gmail.com>
1371
1372         * class.cs: Fixed struct layout check regression.
1373
1374 2008-08-12  Marek Safar  <marek.safar@gmail.com>
1375
1376         * cs-parser.jay, enum.cs: Simplified enum parsing.
1377         
1378         * decl.cs: Check all type parameters conflicts.
1379         
1380         * expression.cs, statement.cs, attribute.cs: More expression checks.
1381
1382 2008-08-11  Marek Safar  <marek.safar@gmail.com>
1383
1384         * generic.cs: Add type inference types restriction.
1385         
1386         * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
1387         anonymous.cs, expression.cs: Allocate less accessor parameters.
1388
1389 2008-08-08  Marek Safar  <marek.safar@gmail.com>
1390
1391         * typemanager.cs, ecore.cs: Ambiguous operators can come from different
1392         classes.
1393
1394 2008-08-08  Marek Safar  <marek.safar@gmail.com>
1395
1396         * convert.cs, delegate.cs: Fixed delegate compatibility conversion. 
1397
1398 2008-08-07  Marek Safar  <marek.safar@gmail.com>
1399
1400         * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
1401         Also fixes #362146 and #381592.
1402
1403 2008-08-07  Marek Safar  <marek.safar@gmail.com>
1404
1405         * ecore.cs: Reduced constant cannot be used as an attribute value.
1406         
1407         * cs-parser.jay: Base expression has to be a type.
1408         
1409         * expression.cs (Conditional): Uses ReducedExpression.
1410
1411 2008-08-06  Marek Safar  <marek.safar@gmail.com>
1412
1413         A fix for bug #376826
1414         * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
1415         address of hoisted local variable or parameter cannot be taken.
1416
1417 2008-08-05  Marek Safar  <marek.safar@gmail.com>
1418
1419         * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly 
1420         anonymous method inside checked/unchecked expression.
1421
1422 2008-08-05  Marek Safar  <marek.safar@gmail.com>
1423
1424         * typemanager.cs (IsEqual): Guard against null.
1425         
1426         * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
1427         attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
1428         routine. Fixed few misleading conversion errors.
1429
1430 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1431
1432         * class.cs: Consider generics when checking cycles in struct layout.
1433
1434 2008-08-04  Raja R Harinath  <harinath@hurrynot.org>
1435
1436         * cs-tokenizer.cs (get_cmd_arg): Simplify.  Don't be too pedantic.
1437
1438 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1439
1440         A fix for bug #414165
1441         * anonymous.cs: Use same anonymous implementation method for all anonymous
1442         method emits.
1443
1444 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1445
1446         * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
1447         constraints.
1448
1449 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1450
1451         * cs-parser.jay: Typeof argument has to be a type expression.
1452         
1453         * namespace.cs: Check alias and namespace definitions collisions.
1454         
1455         * class.cs, pending.cs: Moved explicit interface accessor implementation
1456         check.
1457         
1458         * delegate.cs, expression.cs: Verify special name invocations.
1459         
1460 2008-08-01  Marek Safar  <marek.safar@gmail.com>
1461
1462         * cs-parser.jay: Don't choke on empty generic type arguments.
1463         
1464         * cs-tokenizer.cs: Handle escaped preprocessor directives.
1465         
1466         * expression.cs, ecore.cs: Minor expressions bugs.
1467
1468 2008-08-01  Marek Safar  <marek.safar@gmail.com>
1469
1470         * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
1471         and added more error handling.
1472         
1473         * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
1474         
1475         *  modifiers.cs, enum.cs: Fixed.
1476
1477 2008-07-31  Jb Evain  <jbevain@novell.com>
1478
1479         * driver.cs: remove -pkg ability of smcs.
1480
1481 2008-07-30  Marek Safar  <marek.safar@gmail.com>
1482
1483         * statement.cs (Switch): Correctly set empty default target for single
1484         blocks.
1485
1486 2008-07-30  Marek Safar  <marek.safar@gmail.com>
1487
1488         * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
1489         string switch statement implementation to use string dictionary which
1490         significantly (2-8x) improves performance of generated code.
1491
1492 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1493
1494         A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
1495         * modifiers.cs (GetDescription): Fixed FamANDAssem case.
1496         
1497 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1498
1499         A fix for bug #412595
1500         * typemanager.cs, convert.cs, expression.cs: Some types are never
1501         convertible to each other.
1502
1503 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1504
1505         * nullable.cs (CreateNullConstant): An error messages update.
1506
1507 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1508
1509         A fix for bug #412595
1510         * cfold.cs: Don't cast undefined bool constant.
1511
1512 2008-07-29  Martin Baulig  <martin@ximian.com>
1513
1514         * symbolwriter.cs
1515         (SymbolWriter.Reset): New public static method.
1516
1517         * driver.cs
1518         (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
1519
1520 2008-07-28  Marek Safar  <marek.safar@gmail.com>
1521
1522         * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
1523         
1524         * expression.cs (ElementAccess): Exact size allocation.
1525
1526 2008-07-26  Marek Safar  <marek.safar@gmail.com>
1527
1528         * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
1529
1530 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1531
1532         * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
1533         
1534         * class.cs: Removed $PRIVATE$ field hack which caused problems during
1535         flow analysis.
1536
1537 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1538
1539         A fix for bug #412217
1540         * assign.cs: Mutate also assignment type.
1541
1542 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1543
1544         A fix for bug #323644
1545         * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
1546         indexers.
1547
1548 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1549
1550         A fix for bug #412134
1551         * expression.cs (ResolveOperatorEnum): Do implicit conversion of
1552         non-enumerable operands when overloading equality or bitwise operators.
1553
1554 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1555
1556         * anonymous.cs: Cache closed generic anonymous method delegates.
1557
1558 2008-07-24  Marek Safar  <marek.safar@gmail.com>
1559
1560         * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs, 
1561         anonymous.cs, statement.cs: Always emit anonymous method as static method
1562         when is instance free. Use nesting for nested anynomous methods blocks.
1563         
1564 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1565
1566         * anonymous.cs (MutateGenericMethod): Added extra code path for imported
1567         types.
1568
1569 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1570
1571         * expression.cs: Removed MakeSimpleCall.
1572
1573 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1574
1575         A fix for bug #323012
1576         * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
1577         Base method implementing interface has to be public.
1578
1579 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1580
1581         * cs-parser.jay: Don't break on missing argument.
1582
1583 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1584
1585         A fix for bug #320993
1586         * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
1587           enum.cs, codegen.cs: Report CLS compliance errors as warnings.
1588
1589 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1590
1591         A fix for bug #320748
1592         * convert.cs: Implicit user operators cannot convert to interfaces
1593
1594 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1595
1596         A fix for bug #312686
1597         * driver.cs: Ignore empty assembly references.
1598
1599 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1600
1601         A fix for bug #387040
1602         * ecore.cs: Skip constrains check for an explicit implementation.
1603
1604 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1605
1606         A fix for bug #409045
1607         * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
1608           cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
1609           identifiers are file specific unless passed as input arguments.
1610
1611 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1612
1613          * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
1614          to emit UnmanagedMarshal data under 2.0 profile.
1615
1616 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1617
1618         A fix for bug #410369
1619         * parameter.cs: Clone correctly ParamsParameter.
1620
1621 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1622
1623         * expression.cs (Argument): Always report type for type based expressions
1624         errors.
1625
1626 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1627
1628         A fix for bug #410666
1629         * anonymous.cs: Correctly initialize generic storey reference.
1630
1631 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1632
1633         * convert.cs: Don't box same type arguments.
1634
1635 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1636
1637         * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
1638         Finished missing generic type mutators.
1639
1640 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1641
1642         * iterators.cs, statement.cs: Finished statements CloneTo.
1643
1644 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1645
1646         * anonymous.cs: ExpressionTreeProxy is of Value type expression.
1647         
1648         * expression.cs: Emit optimized default value expressions in expression tree
1649         array initializer.
1650
1651 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1652
1653         * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
1654
1655 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1656
1657         A fix for bug #367536
1658         * cs-parser.jay: Check static constructor of generic types for an access
1659         modifier.
1660
1661 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1662
1663         A fix for bug #353800
1664         * lambda.cs: Emit ret for contextual statements.
1665         
1666         * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
1667         up emitting redundant ret for all anonymous methods with return.
1668
1669 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1670
1671         A fix for bug #365188
1672         * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
1673         create anonymous method storey in unreachable block.
1674
1675 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1676
1677         * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
1678         class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
1679         driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
1680         statement.cs: Fixed relevant defects found by Gendarme.
1681
1682 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1683
1684         A fix for bug #325291
1685         * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs, 
1686         statement.cs: Replaced IAnonymousHost with top level block flag.
1687
1688 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1689
1690         * cs-parser.jay: Clean up unused open_parens.
1691
1692 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1693
1694         * ecore.cs: Custom error message for a range variable assignment.
1695
1696 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1697
1698         * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
1699         load.
1700
1701 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1702
1703         * literal.cs: Null literal is of object type.
1704
1705 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1706
1707         * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
1708         expression of nullable equality comparison.
1709
1710 2008-07-15  Marek Safar  <marek.safar@gmail.com>
1711
1712         * expression.cs(PointerArithmetic): Removed redundant assignment.
1713
1714 2008-07-15  Marek Safar  <marek.safar@gmail.com>
1715
1716         * decl.cs (GetSignatureForError): Report full namespace name for containers.
1717
1718 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1719
1720         A fix for bug #408361
1721         * anonymous.cs (MutateGenericMethod): Store generic type arguments before
1722         they are replaced by GetMethod.
1723
1724 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1725
1726         A fix for bug #408721 by jeremie.laval@gmail.com
1727         * expression.cs (Indirection): Implemented CloneTo.
1728
1729 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1730
1731         * statement.cs (AssignableSlots): Temporary disabled variable initialization
1732         assert check.
1733
1734 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1735
1736         * report.cs (EnableReporting): Don't reinitialize 0-based values.
1737
1738 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1739
1740         * linq.cs: Reset tranparent parameter counter in probing mode.
1741
1742 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1743
1744         * anonymous.cs: Mutate anonymous method type.
1745
1746 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1747
1748         * ecore.cs, anonymous.cs: Mutate field expressions.
1749
1750 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1751
1752         A fix for bug #369670
1753         * linq.cs, statement.cs: Use explicit block for query expressions variables.
1754
1755 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1756
1757         * report.cs, ecore.cs: Flush recorder only when silent mode is off.
1758
1759 2008-07-10  Raja R Harinath  <harinath@hurrynot.org>
1760
1761         Fix bug #314902
1762         * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
1763         only one '>', and finds a '>>', abort the generic lookahead.
1764
1765 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1766
1767         A fix for bug #319902
1768         * cs-tokenizer.cs: Always look-ahed for `>='  when tokenizing `>'.
1769
1770 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1771
1772         A fix for bug #406371
1773         * statement.cs: Moved EmitSymbolInfo to Block.
1774
1775 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1776
1777         * ecore.cs: Report better error for extension method overload failures.
1778
1779 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1780
1781         * expression.cs (Is): No need to box reference values.
1782
1783 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1784
1785         * class.cs: Use event resolve context when initializing CreateEmitContext.
1786
1787 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1788
1789         A fix for bug #394436
1790         * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
1791         method used inside expression trees. Added more LINQ to expression tree
1792         conversions.
1793
1794 2008-07-08  Marek Safar  <marek.safar@gmail.com>
1795
1796         A fix for bug #378189, #370577
1797         * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
1798         from expression.
1799
1800 2008-07-08  Marek Safar  <marek.safar@gmail.com>
1801
1802         * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
1803         hierarchically.
1804
1805 2008-07-08  Marek Safar  <marek.safar@gmail.com>
1806
1807         A fix for bug #406702
1808         * anonymous.cs: Always park anonymous method in the nearest parent storey.
1809
1810 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1811
1812         A fix for bug #406648
1813         * cs-parser.jay: Report nullable use in mcs for some cases.
1814
1815 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1816
1817         * ecore.cs: Improved argument mismatch error messages.
1818
1819 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1820
1821         * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
1822
1823 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1824
1825         * expression.cs (TypeOf): Mutate type argument.
1826
1827 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1828
1829         * class.cs: Report missing partial modifier for correct type.
1830
1831 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1832
1833         * ecore.cs, expression.cs (VariableReference): Variable property is 
1834         protected.
1835
1836 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1837
1838         * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
1839         
1840 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1841
1842         * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
1843         method delegates.
1844
1845 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1846
1847         * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
1848         anonymous method storey to an instance method when only "this" is hoisted.
1849
1850 2008-07-03  Marek Safar  <marek.safar@gmail.com>
1851
1852         A fix for bug #321615
1853         * expression.cs: Pointer comparisons use unsigned operator.
1854
1855 2008-07-03  Marek Safar  <marek.safar@gmail.com>
1856
1857         * expression.cs: Fixed native pointer conversions. Also fixes #321615.
1858
1859 2008-07-02  Marek Safar  <marek.safar@gmail.com>
1860
1861         A fix for bug #404905
1862         * class.cs: Always initialize local unsafe variables.
1863
1864 2008-06-30  Marek Safar  <marek.safar@gmail.com>
1865
1866         A fix for bug #396987
1867         * expression.cs (NewInitialize): Clear local temporary variable for next run
1868
1869 2008-06-27  Marek Safar  <marek.safar@gmail.com>
1870
1871         A fix for bug #401020
1872         * ecore.cs: Both types and modifiers have to match for ref and out arguments
1873
1874 2008-06-27  Marek Safar  <marek.safar@gmail.com>
1875
1876         A fix for bug #398319
1877         * cs-parser.jay: Implemented undocumented base access expression inside
1878         anonymous types.
1879
1880 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1881
1882         A fix for bug #404227
1883         * cs-parser.jay: Parse namespace declaration using qualified identifier.
1884
1885 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1886
1887         A fix for bug #404227
1888         * convert.cs: Fixed explicit array to interface cast.
1889
1890 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1891
1892         A fix for bug #403894
1893         * delegate.cs: Mutate DelegateInvocation type.
1894
1895 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1896
1897         A fix for bug #379348
1898         * delegate.cs: Box a load of generic parameters.
1899
1900 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1901
1902         * expression.cs: Add an array creation arguments mutate.
1903
1904 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1905
1906         A fix for bug #386068
1907         * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
1908         parameter.
1909
1910 2008-06-25  Marek Safar  <marek.safar@gmail.com>
1911
1912         * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
1913         CloneTo.
1914
1915 2008-06-25  Marek Safar  <marek.safar@gmail.com>
1916
1917         A fix for bug #403518
1918         * delegate.cs: Type correctly anonymous method new invocation.
1919
1920 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1921
1922         A fix for bug #394826
1923         * anonymous.cs: Fully qualify members when resolving anonymous type internal
1924         calls.
1925
1926 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1927
1928         A fix for bug #394826
1929         * anonymous.cs, iterators.cs: Construct generic storey only when is really
1930         needed.
1931
1932 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1933
1934         * class.cs: Clone indexer parameters for localized capturing.
1935
1936 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1937
1938         A fix for bug #402379
1939         * expression.cs: Don't crash when an object initializer resolve fails.
1940
1941 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1942
1943         A fix for bug #402888
1944         * expression.cs: Mutate conditional expression.
1945
1946 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1947
1948         A fix for bug #401012
1949         * class.cs: Keep StructLayout in shared container.
1950
1951 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1952
1953         A fix for bug #400438
1954         * decl.cs, class.cs: Only properties can be automatically implemented.
1955
1956 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1957
1958         * statement.cs (ChangeToIterator): Copy also labels.
1959
1960 2008-06-23  Marek Safar  <marek.safar@gmail.com>
1961
1962         * ecore.cs: Pass type argument details to parent extension method.
1963
1964 2008-06-23  Marek Safar  <marek.safar@gmail.com>
1965
1966         A fix for bug #375966
1967         * delegate.cs: Fixed IsTypeCovariant generic type conversions.
1968
1969 2008-06-23  Raja R Harinath  <harinath@hurrynot.org>
1970
1971         * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
1972
1973 2008-06-22  Marek Safar  <marek.safar@gmail.com>
1974
1975         A fix for bug #394347
1976         * anonymous.cs: Cache compatible delegates as compatibility check produces
1977         a new method every time.
1978
1979 2008-06-20  Marek Safar  <marek.safar@gmail.com>
1980
1981         * anonymous.cs: Propagate storey reference for single references.
1982
1983 2008-06-20  Marek Safar  <marek.safar@gmail.com>
1984
1985         A fix for bug #387615
1986         * assign.cs, expression.cs: Correctly clone compound assignment.
1987
1988 2008-06-19  Marek Safar  <marek.safar@gmail.com>
1989
1990         A fix for bug #359611, #359604
1991         * anonymous.cs: Mutate all types of hoisted parameters.
1992
1993 2008-06-19  Marek Safar  <marek.safar@gmail.com>
1994
1995         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
1996         delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
1997         expression.cs, codegen.cs, statement.cs
1998         
1999         Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
2000         #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
2001         
2002         ** Anonymous methods, lambda expressions rewrite **
2003         
2004         Anonymous expressions are now resolved when an explicit block is resolved 
2005         and they don't require any registration procedure anymore. Further,
2006         anonymous methods are defined when explicit block is emitted which allows
2007         better control of whole process and opens possibilities for more
2008         optimizations as well as alternative to reverse whole process.
2009         
2010         A concept of `MutateHoistedGenericType' was introduced to keep the resolve
2011         process consistent and to correctly emit hoisted generic methods when they
2012         have at least 1 hoisted variable.
2013         
2014 2008-06-17  Martin Baulig  <martin@ximian.com>
2015
2016         * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
2017         iterator method.
2018         (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
2019         virtual property; check it in Emit().
2020         (PropertyMethod.IsDebuggerHidden): Override, check whether we're
2021         an iterator.
2022         (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
2023         an iterator.
2024         (Indexer.Define): Likewise.
2025
2026 2008-06-17  Marek Safar  <marek.safar@gmail.com>
2027
2028         * convert.cs: Don't use IsInterface on type arguments.
2029         
2030         * delegate.cs: DelegateInvocation uses MethodInfo.
2031         
2032         * parameter.cs: Removed IsTypeParameter.
2033         
2034         * generic-mcs.cs: More missing stuff.
2035
2036 2008-06-16  Martin Baulig  <martin@ximian.com>
2037
2038         * modifiers.cs
2039         (Modifiers.DEBUGGER_HIDDEN): New public const.
2040
2041         * typemanager.cs
2042         (TypeManager.GetDebuggerHiddenAttribute): New public static method.
2043
2044         * class.cs
2045         (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
2046         (AbstractPropertyEventMethod): Likewise.
2047         (Constructor.Emit): Likewise.
2048         (SourceMethod.SetCompilerGenerated): Removed.
2049
2050         * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
2051         on MoveNext().
2052
2053         * anonymous.cs
2054         (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
2055         if we're an `IteratorHost'.
2056         (AnonymousMethodMethod..ctor): Don't set
2057         `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
2058         not on the method.
2059
2060 2008-06-16  Marek Safar  <marek.safar@gmail.com>
2061
2062         * statement.cs: Clean-up foreach statements.
2063
2064 2008-06-12  Marek Safar  <marek.safar@gmail.com>
2065
2066         * class.cs: Stop using public method which should not exist
2067         (MethodBuilder.SetGenericMethodSignature).
2068
2069 2008-06-11  Martin Baulig  <martin@ximian.com>
2070
2071         * location.cs
2072         (Location.LookupFile): Add `CompilationUnit' argument; when given
2073         a relative file name, make it relative to the directory the .cs
2074         file is located in instead of using the current directory.
2075
2076 2008-06-11  Martin Baulig  <martin@ximian.com>
2077
2078         * class.cs
2079         (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
2080         (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
2081         (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
2082         (SourceMethod.SetCompilerGenerated): Likewise.
2083
2084 2008-06-11  Marek Safar  <marek.safar@gmail.com>
2085
2086         * codegen.cs, driver: Only write symbol file when it's asked for.
2087
2088 2008-06-11  Marek Safar  <marek.safar@gmail.com>
2089
2090         * codegen.cs: Don't use assembly writer error handling for symbol writer.
2091
2092 2008-06-10  Martin Baulig  <martin@ximian.com>
2093
2094         * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
2095
2096 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2097
2098         A fix for bug #316290
2099         * expression.cs: Include decimal operators in predefined table.
2100         
2101         * parameters.cs: More readonlyness.
2102
2103 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2104
2105         A fix for bug #397213
2106         * cs-parser.jay: One more missing current_local_parameters reset.
2107
2108 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2109
2110         A fix for bug #396633
2111         * class.cs: Host backing field in partial container.
2112
2113 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2114
2115         A fix for bug #397068
2116         * expression.cs: Check both operand types when predefined operator is used.
2117
2118 2008-06-05  Martin Baulig  <martin@ximian.com>
2119
2120         Merged the `debugger-kahalo' branch.
2121
2122         * class.cs
2123         (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
2124         we're an iterator method.
2125         (SourceMethod): Reflect latest symbol writer changes;
2126         SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
2127         now `start_row' and `end_row'.
2128         (Constructor.Emit): Fix the logic whether to emit symbol information.
2129
2130         * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
2131         generated methods.
2132
2133         * location.cs
2134         (CompilationUnit): New public class; derives from `SourceFile'.
2135         (SourceFileEntry.DefineSymbolInfo): New public method.
2136         (SourceFileEntry.SetChecksum): New public method.
2137         (Location): Encode hidden line numbers by using `column == 255';
2138         the .ctor now accepts `column == -1' to mark a hidden line number.
2139         (Location.Hidden): New public property.
2140         (Location.CheckPoint): Add `CompilationUnit'.
2141         (Location.SourceFiles): Change return type to `CompilationUnit[]'.
2142         (Location.Push): Add `CompilationUnit compile_unit' argument.
2143         (Location.CompilationUnit): New public property.
2144
2145         * statement.cs
2146         (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
2147
2148         * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
2149
2150         * driver.cs: `SourceFile' -> `CompilationUnit'.
2151
2152         * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
2153
2154         * namespace.cs: `SourceFile' -> `CompilationUnit'.
2155
2156         * cs-tokenizer.cs: Add support for `#pragma checksum' and
2157         `#line hidden'.
2158
2159         * symbolwriter.cs
2160         (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
2161         new symbol writer API to also pass the file.
2162
2163 2008-06-05  Marek Safar  <marek.safar@gmail.com>
2164
2165         * statement.cs: Emit catch variable assignment using variable expression.
2166         
2167 2008-06-05  Marek Safar  <marek.safar@gmail.com>
2168
2169         * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
2170         with other variable types.
2171
2172 2008-06-04  Marek Safar  <marek.safar@gmail.com>
2173
2174         * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
2175         GetLength method emit, it breaks resolve rules.
2176         
2177 2008-06-02  Atsushi Enomoto  <atsushi@ximian.com>
2178             Marek Safar  <marek.safar@gmail.com>
2179                         
2180         A fix for bug #395542
2181         * cs-parser.jay: The trailing comma is allowed in anonymous type member
2182         declaration.
2183         
2184 2008-06-02  Marek Safar  <marek.safar@gmail.com>
2185
2186         A fix for bug #395287
2187         * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
2188
2189 2008-05-31  Marek Safar  <marek.safar@gmail.com>
2190
2191         A fix for bug #395845
2192         * class.cs, nullable.cs: User unary operator is allowed to have nullable and
2193         non-nullable parameter type.
2194         
2195 2008-05-31  Marek Safar  <marek.safar@gmail.com>
2196
2197         * class.cs: Handle contructor initializer as a statement in top-level block.
2198
2199 2008-05-30  Marek Safar  <marek.safar@gmail.com>
2200
2201         * attribute.cs: Don't mix old and new corlib types when emitting corlib
2202         security attributes.
2203
2204 2008-05-24  Marek Safar  <marek.safar@gmail.com>
2205
2206         * ecore.cs, expression.cs: Small IVariable refactoring.
2207
2208 2008-05-22  Marek Safar  <marek.safar@gmail.com>
2209
2210         * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
2211
2212 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2213
2214         * cs-parser.jay: Removed redundant catch type check.
2215
2216 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2217
2218         A fix for bug #390372
2219         * nullable.cs: Set correct return type.
2220
2221 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2222
2223         A fix for bug #391062
2224         * typemanager.cs: Fixed crash when comparing null types.
2225
2226 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2227
2228         A fix for bug #391871
2229         * cs-parser.jay: Better error handling for invalid catch type.
2230
2231 2008-05-20  Marek Safar  <marek.safar@gmail.com>
2232
2233         A fix for bug #392155
2234         * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
2235
2236 2008-05-15  Marek Safar  <marek.safar@gmail.com>
2237
2238         A fix for bug #390666
2239         * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
2240         expressions.
2241
2242 2008-05-15  Marek Safar  <marek.safar@gmail.com>
2243
2244         * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
2245         in getter.
2246
2247 2008-05-13  Marek Safar  <marek.safar@gmail.com>
2248
2249         A fix for bug #389625
2250         * delegate.cs, generic.cs: Some progress on method group return type
2251         inference.
2252
2253 2008-05-13  Marek Safar  <marek.safar@gmail.com>
2254
2255         A fix for bug #378419
2256         * namespace.cs: Inspect also parent namespaces not only namespace entries.
2257
2258 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2259
2260         * class.cs (Constructor): Added IsCompilerGenerated.
2261
2262 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2263
2264         * expression.cs: Enum binary operators can accept non-enum operand only when
2265         is implicitly convertible to underlying type.
2266
2267 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2268
2269         A fix for bug #389272
2270         * support.cs: Workaround System.InvalidOperationException for enums.
2271
2272 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2273
2274         A fix for bug #389073
2275         * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
2276
2277 2008-05-10  Marek Safar  <marek.safar@gmail.com>
2278
2279         * driver.cs: Split Parse.
2280         
2281         * location.cs (LookupFile): Uses string.Empty.
2282
2283 2008-05-07  Marek Safar  <marek.safar@gmail.com>
2284
2285         * expression.cs, parameter.cs: Small ParameterReference clean up.
2286
2287 2008-05-07  Marek Safar  <marek.safar@gmail.com>
2288
2289         * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
2290         hack. Fixes #387502.
2291
2292 2008-05-06  Martin Baulig  <martin@ximian.com>
2293
2294         * class.cs (Constructor.Emit): Fix the logic whether to emit
2295         symbol information.
2296
2297 2008-05-06  Raja R Harinath  <harinath@hurrynot.org>
2298
2299         Fix #385503
2300         * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
2301         InvalidOperationException when the iterator is before the start or
2302         after the end.
2303
2304 2008-05-06  Marek Safar  <marek.safar@gmail.com>
2305
2306         * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
2307         when left is nullable type.
2308
2309 2008-05-06  Marek Safar  <marek.safar@gmail.com>
2310
2311         A fix for bug #386628
2312         * expression.cs (LocalVariableReference): Continue in resolving when
2313         variable is not assigned.
2314
2315 2008-05-05  Marek Safar  <marek.safar@gmail.com>
2316
2317         * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
2318         nullable operations.
2319
2320 2008-05-04  Marek Safar  <marek.safar@gmail.com>
2321
2322         * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
2323         it saves many redundant temporary variables for nullable operations.
2324
2325 2008-05-03  Marek Safar  <marek.safar@gmail.com>
2326
2327         * assign.cs: EventAddOrRemove is a statement and cannot have a type.
2328         
2329         * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
2330         method.
2331         
2332         * nullable.cs: Constant coalescing operator optimizations.
2333
2334 2008-05-03  Marek Safar  <marek.safar@gmail.com>
2335
2336         * constant.cs: Use unsigned conversion for values which are unsigned only.
2337
2338 2008-05-03  Marek Safar  <marek.safar@gmail.com>
2339
2340         * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null 
2341         coalescing operator as it should be.
2342
2343 2008-05-02  Marek Safar  <marek.safar@gmail.com>
2344
2345         A fix for bug #371016
2346         * expression.cs: All predefined delegate operators require implicit method
2347         group conversion.
2348         
2349 2008-05-02  Marek Safar  <marek.safar@gmail.com>
2350
2351         * constant.cs: Emit long constant as uint when fits the range.
2352         
2353         * convert.cs, expression.cs: Fixed few unsafe conversions.
2354
2355 2008-05-02  Marek Safar  <marek.safar@gmail.com>
2356
2357         * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
2358
2359 2008-05-02  Raja R Harinath  <harinath@hurrynot.org>
2360
2361         Fix #385758
2362         * convert.cs (ImplicitNumericConversion): Don't modify the type of
2363         'expr'.
2364         * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
2365
2366 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2367
2368         * constant.cs, literal.cs: IsLiteral property for error reporting.
2369         
2370         * ecore.cs, expression.cs: Implemented Property expression.
2371
2372 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2373
2374         * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
2375         
2376         * nullable.cs: Implemented nullable coalescing null operator.
2377
2378         * ecore.cs, expression.cs: Expression trees work.
2379
2380 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2381
2382         * ecore.cs: CreateExpressionTree is finally abstract.
2383
2384         * expression.cs, linq.cs: Updated.
2385
2386 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2387
2388         * expression.cs, ecore.cs: Block base access expression inside expression
2389         tree.
2390
2391 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2392
2393         A fix for bug #385058
2394         * expression.cs: User-defined operator implementations always take
2395         precedence over predefined operator implementations.
2396
2397 2008-04-30  Marek Safar  <marek.safar@gmail.com>
2398
2399         * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
2400         class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
2401         expression tree conversions.
2402         
2403 2008-04-30  Marek Safar  <marek.safar@gmail.com>
2404
2405         * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
2406         operators method details to Operator class.
2407
2408 2008-04-30  Marek Safar  <marek.safar@gmail.com>
2409
2410         * anonymous.cs: Pass unsafe flags to anonymous container.
2411         
2412         * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
2413         inside expression tree.
2414
2415 2008-04-29  Martin Baulig  <martin@ximian.com>
2416
2417         * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
2418         (Tokenizer.PopPosition): Also restore the `line'.
2419
2420 2008-04-29  Marek Safar  <marek.safar@gmail.com>
2421
2422         * delegate.cs: Implemented Invoke expression.
2423
2424 2008-04-29  Marek Safar  <marek.safar@gmail.com>
2425
2426         * expression.cs: Fixed equality reference comparison regression.
2427
2428 2008-04-29  Marek Safar  <marek.safar@gmail.com>
2429
2430         * ecore.cs: Clean up EmptyCast hack.
2431         
2432         * expression.cs, nullable.cs: Implemented enum binary and unary operations
2433         using correct conversion rules. Also fixes #383993.
2434
2435 2008-04-28  Martin Baulig  <martin@ximian.com>
2436
2437         * class.cs (Constructor.Emit): Don't emit debugging information
2438         for generated default .ctor's.
2439
2440 2008-04-28  Marek Safar  <marek.safar@gmail.com>
2441
2442         * convert.cs: Empty-cast ushort to int conversion.
2443
2444 2008-04-28  Marek Safar  <marek.safar@gmail.com>
2445
2446         A fix for bug #384191
2447         * ecore.cs, expression.cs: Fixed expression cloning.
2448
2449 2008-04-28  Marek Safar  <marek.safar@gmail.com>
2450
2451         * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
2452
2453 2008-04-28  Raja R Harinath  <harinath@hurrynot.org>
2454
2455         Fix #381559, test-638.cs, test-639.cs
2456         * assign.cs (CompoundAssign.Helper): New wrapper.
2457         (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
2458         access.
2459         * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
2460         Pass unconverted expressions to the params array creation expression.
2461         (FieldExpr.EmitAssign): Don't special-case StringConcat.
2462         (PropertyExpr.EmitAssign): Likewise.
2463         * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
2464         element if it is of kind CompoundAssign.Helper.
2465         (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
2466         first before anything else.
2467         (ArrayAccess.EmitAssign): Don't special-case StringConcat.
2468         (ArrayAccess.LoadArrayAndArguments): Simplify.
2469
2470 2008-04-27  Marek Safar  <marek.safar@gmail.com>
2471
2472         * expression.cs: Fixed cloning of typeof(void).
2473
2474 2008-04-27  Raja R Harinath  <harinath@hurrynot.org>
2475
2476         * assign.cs (Assign.DoResolve): Remove support for EventExprs.
2477         (Assign.Emit): Likewise.  Move it to ...
2478         (CompoundAssign.DoResolve): ... here and ...
2479         (CompoundAssign.Emit): ... here.
2480         (EventAddOrRemove): New helper to handle += and -= on events, and
2481         avoid the use of BinaryDelegates.
2482         * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
2483         (EventExpr.EmitAddOrRemove): Improve.
2484         * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
2485
2486         * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
2487         create VarExprs for 'foo.bar.var'.
2488         * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
2489         is a highly inappropriate name for its functionality.
2490
2491 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
2492
2493         Simplify handling of multiple assignments
2494         * assign.cs (Assign): Clear out all 'embedded assign' gunk.  Make
2495         inheritable-only.
2496         (SimpleAssign): New.  Class to be used for normal assignments.
2497         * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
2498         * expression.cs, parameter.cs, statement.cs: Likewise.
2499
2500 2008-04-25  Marek Safar  <marek.safar@gmail.com>
2501
2502         * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
2503         for incompatible underlying types, more to come, uff.
2504
2505 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
2506
2507         Fix gtest-388.cs
2508         * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
2509         Handle 'leave_copy'.
2510
2511 2008-04-25  Marek Safar  <marek.safar@gmail.com>
2512
2513         * expression.cs, nullable.cs: Implemented UnaryPlus expression.
2514
2515 2008-04-24  Raja R Harinath  <harinath@hurrynot.org>
2516
2517         Fix test-636.cs.  Sprinkle a few more 'EmitSideEffect's around
2518         * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
2519         * statement.cs (While, Do, For): Allow test to have side effects.
2520         (For.DoEmit): Always emit InitStatement.
2521
2522         Fix test-635.cs
2523         * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
2524         Always create SideEffectConstant.
2525         (Binary.EnumLiftUp): Don't assume that the enumeration constant is
2526         of type EnumConstant.
2527
2528         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
2529         Handle 'right' being SideEffectConstant of type 'bool'.
2530
2531         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
2532         Use left.EmitBranchable instead of open coding it, so as to
2533         improve optimization opportunities.
2534
2535         * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
2536
2537         * ecore.cs (Expression.EmitBranchable): Document some non-obvious
2538         assumptions.
2539         (Expression.EmitSideEffect): Document.
2540
2541 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2542
2543         * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
2544
2545 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2546
2547         * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
2548
2549 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2550
2551         * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
2552         conversion to expression tree.
2553
2554 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2555
2556         * ecore.cs: Removed unused expression.
2557
2558 2008-04-22  Marek Safar  <marek.safar@gmail.com>
2559
2560         * expression.cs: Implemented NegateChecked and New expressions.
2561
2562 2008-04-22  Marek Safar  <marek.safar@gmail.com>
2563
2564         * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
2565
2566 2008-04-22  Raja R Harinath  <harinath@hurrynot.org>
2567
2568         Fix #351102
2569         * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
2570         needing final 'ret' instruction.
2571
2572 2008-04-22  Marek Safar  <marek.safar@gmail.com>
2573
2574         * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
2575
2576 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2577
2578         * expression.cs: Emit ldnull and not null expression as an instance argument
2579          of static method expression calls.
2580
2581 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2582
2583         A fix for bug #378200
2584         * expression.cs: Fixed crash when creating parameterless expression tree
2585         method call.
2586
2587 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2588
2589         A fix for bug #375297
2590         * anonymous.cs: Fixed crash when inferring from null argument anonymous
2591         method.
2592
2593 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2594
2595         A fix for bug #377596
2596         * decl.cs, class.cs: Emit delegate type argument attributes.
2597
2598 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2599
2600         A fix for bug #365314
2601         * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
2602         
2603 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2604
2605         * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
2606         only.
2607
2608 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2609
2610         * generic.cs (TypeParameter): Removed redundant location.
2611
2612 2008-04-19  Marek Safar  <marek.safar@gmail.com>
2613
2614         * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
2615         delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
2616         FullNamedExpression in all declaration type expression, statements will come
2617         later.
2618
2619 2008-04-18  Marek Safar  <marek.safar@gmail.com>
2620
2621         * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
2622         nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
2623
2624 2008-04-18  Marek Safar  <marek.safar@gmail.com>
2625
2626         * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
2627         code.
2628
2629 2008-04-17  Marek Safar  <marek.safar@gmail.com>
2630
2631         * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
2632         constraints.
2633
2634 2008-04-17  Marek Safar  <marek.safar@gmail.com>
2635
2636         * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
2637         name expressions.
2638         Also fixes #340463.
2639
2640 2008-04-17  Raja R Harinath  <harinath@hurrynot.org>
2641
2642         Hook up 'EmitSideEffect'
2643         * constant.cs (Constant.EmitSideEffect): New.
2644         (SideEffectConstant.Emit): Simplify.  Use EmitSideEffect.
2645         (SideEffectConstant.EmitSideEffect): New.
2646         * ecore.cs (BoxedCast.EmitBranchable): Remove.  We can't use an
2647         unconditional branch in EmitBranchable.
2648         (FieldExpr.EmitBranchable): New.
2649         * expression.cs (Unary.EmitSideEffect): New.
2650         (Binary.EmitSideEffect): New.
2651         (VariableReference.EmitSideEffect): New.  Do nothing.
2652
2653 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
2654
2655         Introduce 'EmitSideEffect'
2656         * ecore.cs (Expression.EmitSideEffect): New.
2657         (TypeCast): Rename from EmptyCast.
2658         (EmptyCast): New.
2659         (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
2660         (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
2661         * convert.cs, nullable.cs: Update to changes.
2662
2663 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2664
2665         * class.cs, cs-parser.jay: Early check for base types expression.
2666
2667 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2668
2669         * decl.cs (MemberName): Declare PrettyName as obsolete.
2670
2671 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2672
2673         * namespace.cs: Use MemberName comparison.
2674
2675 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
2676
2677         Fix build break
2678         * decl.cs (MemberName.PrettyName): New.  Replaces the misnamed
2679         FullName.
2680         (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
2681         (MemberName.FullyQualifiedName): New.  Provides the functionality
2682         that users assume FullName would have.
2683         * ecore.cs, namespace.cs: Update to changes.
2684
2685         * statement.cs (Using.assign): Make into ExpressionStatement.
2686         (Using.EmitPreTryBody): Simplify.
2687
2688 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2689
2690         * report.cs: ColorFormat is protected.
2691         
2692         * rootcontext.cs: Unused fields clean-up.
2693         
2694         * namespace.cs: Made UsingEntry name private.
2695
2696 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2697
2698         * cs-tokenizer.cs, location.cs: Removed unused field.
2699
2700 2008-04-16  Jan Oravec <jan.oravec@6com.sk>
2701             Raja R Harinath  <harinath@hurrynot.org>
2702
2703         Fix #379822
2704         * constant.cs (SideEffectConstant.value): Rename from 'left'.
2705         (SideEffectConstant.side_effect): Rename from 'right'.
2706         (SideEffectConstant..ctor): Normalize 'side_effect'.
2707         (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
2708         value of this constant.
2709         * cfold.cs: Update to changes.
2710
2711 2008-04-15  Marek Safar  <marek.safar@gmail.com>
2712
2713         * cs-paser.jay: Removed unused variable.
2714         
2715         * driver.cs: Made Compile instance method.
2716
2717 2008-04-15  Raja R Harinath  <harinath@hurrynot.org>
2718
2719         * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
2720
2721 2008-04-15  Marek Safar  <marek.safar@gmail.com>
2722
2723         * cs-paser.jay, namespace.cs: Simplified handling of namespace imports. 
2724
2725 2008-04-13  Jb Evain  <jbevain@novell.com>
2726
2727         * namespace.cs: update the System.Core fullname for 2.1
2728         * driver.cs: update the list of required assemblies for 2.1.
2729         Merged from the Moonlight 2 branch.
2730
2731 2008-04-11  Marek Safar  <marek.safar@gmail.com>
2732
2733         * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
2734         types and user defined operators. User operators arguments has to be checked
2735         for null value before invocation, which also means no operator is called
2736         when any argument is not convertible to unwrapped nullable type.
2737         
2738 2008-04-09  Marek Safar  <marek.safar@gmail.com>
2739
2740         * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
2741         of Unary expressions to follow operator overloading rules precisely.
2742         Also fixes #321794, #323794
2743         
2744 2008-04-08  Marek Safar  <marek.safar@gmail.com>
2745
2746         * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
2747         expression.
2748         
2749 2008-04-08  Marek Safar  <marek.safar@gmail.com>
2750
2751         * expression.cs, ecore.cs: Implemented MemberInit expression.
2752         
2753 2008-04-08  Raja R Harinath  <harinath@hurrynot.org>
2754
2755         Fix mono/tests/exception4.cs
2756         * statement.cs (ExceptionStatement, TryCatch): Revert to using
2757         ec.NeedReturnLabel () rather emitting a 'nop'.
2758
2759         * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
2760         simple heuristic.
2761         (TryCatch.SomeCodeFollows): Likewise.
2762         * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
2763         for 'break', 'continue' and 'return' statements inside a try.
2764         We're fairly sure that the generated IL stream will have more
2765         instructions textually following the try.
2766         (FlowBranchingTryCatch): Likewise.
2767
2768         * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
2769         * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
2770         overrides.
2771
2772         * statement.cs (CollectionForeach.DisposableWrapper): Make a true
2773         wrapper -- forward everything to CollectionForeach.
2774         (CollectionForeach.NonDisposableWrapper): New.
2775         (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
2776         instead of a pop + branch to end.
2777
2778 2008-04-07  Marek Safar  <marek.safar@gmail.com>
2779
2780         A fix for bug #377485
2781         * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs: 
2782         Propagate location for extension method groups. Report conversion failure at
2783         right place.
2784
2785 2008-04-07  Marek Safar  <marek.safar@gmail.com>
2786
2787         * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
2788         ListInit and Field expressions.
2789
2790 2008-04-06  Raja R Harinath  <harinath@hurrynot.org>
2791
2792         * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
2793         Since $PC is always -1 inside the body of MoveNext, the fault
2794         handler is a no-op.
2795         * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
2796         * statement.cs (ExceptionStatement.emit_finally): Likewise.
2797         (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
2798
2799         The denouement!  Fix #324708
2800         * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
2801         (Iterator.EmitYieldBreak): We no longer need to reset $PC.
2802         * statement.cs (ExceptionStatement.DoEmit): Actually emit the
2803         'finally' inside the finally clause.
2804
2805         * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
2806         inside an iterator.  Don't emit the body of the 'finally' inside
2807         the finally clause yet.
2808
2809         Use the ResumableStatement infrastructure for MoveNext ()
2810         * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
2811         (Iterator.EmitMoveNext): Use 'resume_points'.  Get rid of
2812         'old_resume_points'.  Move dispatcher upfront.
2813         (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
2814         * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
2815         in an enumerator.  This encodes the main fix in this patch series
2816         -- we can only jump into the first instruction of a try from the
2817         outside, but we want to emit try/finally regions in iterators and
2818         resume in the middle of them.
2819
2820 2008-04-05  Raja R Harinath  <harinath@hurrynot.org>
2821
2822         * statement.cs (ExceptionStatement.ResolveFinally): Move setting
2823         of NeedReturnLabel here.
2824
2825         Introduce a common point for emitting try/finally to IL
2826         * statement.cs (ExceptionStatement.DoEmit): New.  Combines all the
2827         features of the various subclasses, which are now driven by ...
2828         (ExceptionStatement.EmitPreTryBody): ... this and ...
2829         (ExceptionStatement.EmitTryBody): ... this and the original
2830         EmitFinallyBody.
2831         (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
2832         Remove DoEmit and update to follow above protocol.
2833
2834         * statement.cs (ExceptionStatement.EmitForDispose): If all labels
2835         of the dispatcher are the same, skip emitting the 'switch'.
2836         * iterator.cs (Iterator.EmitDispose): Update to changes.
2837
2838         Clean up handling of 'using' statement
2839         * statement.cs (UsingTemporary): New.  Carved out of ...
2840         (Using): ... this.  Simplify drastically.  Handle exactly
2841         one variable.
2842         * cs-parser.jay (using_statement): Split.  Create UsingTemporary
2843         or Using as appropriate.  If there are multiple variable declared,
2844         create nested Using statements.
2845         (resource_acquisition): Kill.
2846
2847         * statement.cs (ExceptionStatement.EmitForDispose): Use
2848         EmitFinallyBody, not EmitFinally.
2849
2850         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
2851         * iterator.cs: Update to changes.
2852
2853         Start using the ResumableStatement infrastructure
2854         * statement.cs (ResumeableStatement.PrepareForDispose): New.
2855         (ResumableStatement.EmitForDispose): New.
2856         (ExceptionStatement): Override them.
2857         * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
2858         EmitForDispose to create the body of the Dispose method.  Don't
2859         use OldResumePoint.
2860
2861         * iterator.cs (Iterator.AddResumePoint): Move here from ...
2862         * statement.cs (Toplevel.AddResumePoint): ... here.
2863         (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
2864         * flowanalysis.cs (FlowBranchingIterator): New.
2865         * codegen.cs (EmitContext): Update to changes.
2866
2867         * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
2868         (Iterator.old_resume_points): Rename from 'resume_points'.
2869         (Iterator.MoveNextStatement): Remove unused class.
2870
2871         New infrastructure for try/finally in iterators (still unused)
2872         * flowanalysis.cs (FlowBranching.AddResumePoint): New.
2873         (FlowBranchingToplevel.AddResumePoint): Hook into
2874         ToplevelBlock.AddResumePoint.
2875         (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
2876         (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
2877         * statement.cs (ToplevelBlock.AddResumePoint): New.  Collect
2878         resume points and assign program-counter values.
2879         (ExceptionBlock.AddResumePoint): Collect resume points for
2880         de-muxer at the top of try block.
2881         * iterators.cs (Yield.CheckContext): Simplify.
2882         (Yield.Resolve): Use FlowBranching.AddResumePoint.
2883
2884 2008-04-04  Raja R Harinath  <harinath@hurrynot.org>
2885
2886         * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
2887         argument to an ExitStatement.
2888         (FlowBranchingException): Refactor saved origins code.
2889         * statement.cs (ExitStatement): Update to cahges.
2890         * iterator.cs (YieldBreak): Likewise.
2891
2892         * statement.cs (ResumableStatement): New.  Common base class for
2893         YieldReturn and ExceptionStatement.
2894         (ExitStatement): New.  Common base class for Return and YieldBreak.
2895         (Return): Update to changes.
2896         * iterator.cs (YieldBreak): Likewise.
2897         * lambda.cs (ContextualReturn): Likewise.
2898
2899         Fix #377028
2900         * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
2901         emit a meaningful error message.
2902
2903         Fix #324765, #319508
2904         * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
2905         (VariableInfo.SetAssigned): Set it.
2906         * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
2907         determine if CS0219 or CS0168 is appropriate.  Don't use
2908         flow-analysis information.
2909         (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
2910         * codegen.cs (EmitContext.DoEndFlowBranching): Kill.  Inline into ...
2911         (EmitContext.EndFlowBranching): ... this.
2912
2913 2008-04-03  Marek Safar  <marek.safar@gmail.com>
2914
2915         * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
2916
2917 2008-04-03  Marek Safar  <marek.safar@gmail.com>
2918
2919         A fix for bug #376508
2920         * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
2921         ImplicitConversionExists.
2922
2923 2008-04-03  Marek Safar  <marek.safar@gmail.com>
2924
2925         * expression.cs (Binary): Added remaining binary operators to expression
2926         tree builder.
2927
2928         * nullable.cs: Optimize shift with null argument.
2929
2930 2008-04-03  Raja R Harinath  <harinath@hurrynot.org>
2931
2932         Fix minor IL regression
2933         * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
2934         (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
2935         * cs-parser.jay (try_statement): Update to changes.
2936
2937         * statement.cs (TryFinally.need_exc_block): Delete.
2938         (TryFinally): Update to changes.
2939
2940         Now all ExceptionStatements are unconditional
2941         * statement.cs (CollectionForeach.DisposableWrapper): New.
2942         Extract out the try/finally code into a new wrapper.
2943         (CollectionForeach.Resolve): Use it to simplify the code.
2944
2945 2008-04-02  Raja R Harinath  <harinath@hurrynot.org>
2946
2947         Start at simplifying ExceptionStatement semantics a bit
2948         * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
2949         * cs-parser.jay (try_statement): Update to changes.
2950         (opt_catch_clauses): Remove.
2951         * flowanalysis.cs: Update to changes.
2952         (FlowBranching.BranchingType.TryCatch): New.
2953         (FlowBranchingTryCatch): New.
2954
2955         * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
2956         (FlowBranching.CreateBranching): Update to changes.
2957         (FlowBranchingBlock.AddSibling): Add sanity check.
2958         * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
2959         Update to changes.
2960
2961         * iterators.cs (Iterator.MarkFinally): Remove.
2962         * statement.cs (ExceptionStatement): Update to changes.
2963
2964         Add support for skipping over finally blocks at runtime.  First
2965         in a series to fix #324708
2966         * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
2967         (Iterator.EmitMoveNext): Initialize it.
2968         * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
2969         branch over the body of the 'finally' clause.
2970
2971 2008-03-31  Raja R Harinath  <harinath@hurrynot.org>
2972
2973         Avoid lopsided use of Foo/DoFoo names
2974         * statement.cs (ExpressionStatement.EmitFinallyBody):
2975         Rename from EmitFinally.
2976         (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
2977         * iterator.cs: Update to changes.
2978
2979 2008-04-02  Marek Safar  <marek.safar@gmail.com>
2980
2981         * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
2982         based on UserOperatorCall. More binary nullable operators clean up.
2983
2984 2008-04-02  Martin Baulig  <martin@ximian.com>
2985
2986         * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
2987
2988 2008-04-02  Marek Safar  <marek.safar@gmail.com>
2989
2990         * nullable.cs: Merge user and empty conversions when lifting expression
2991         trees.
2992         
2993         * expression.cs (StringConcat): Implemented expression tree representation.
2994
2995 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2996
2997         * nullable.cs: When lifting null literal and a user operator exists, no call 
2998         is made.
2999         
3000 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3001
3002         * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
3003         null.
3004
3005 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3006
3007         * nullable.cs, expression.cs: Use namespace instead heavily nested
3008         monster abstract class.
3009
3010 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3011
3012         * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
3013         lifting of null literal and user operators. Clean up of some temporary
3014         nullable hacks.
3015
3016 2008-03-30  Raja R Harinath  <harinath@hurrynot.org>
3017
3018         Fix #368224, test-629.cs
3019         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
3020         if it crossed an unwind-protect boundary.
3021         * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
3022         (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
3023         inside an unwind-protected region.
3024         (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
3025         (Iterator.MarkYield): Add 'unwind_protect' parameter.  Emit a
3026         'leave' instead of a 'br' if unwind-protected.
3027         (Iterator.EmitYieldBreak): Likewise.
3028
3029 2008-03-29  Gert Driesen  <drieseng@users.sourceforge.net>
3030
3031         * driver.cs: Only define versioninfo resources if no win32 resource
3032         file was specified.
3033
3034 2008-03-28  Marek Safar  <marek.safar@gmail.com>
3035
3036         A fix for bug #372375
3037         * convert.cs: Fixed boxing of nullable types.
3038
3039 2008-03-28  Marek Safar  <marek.safar@gmail.com>
3040
3041         * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
3042         type.
3043
3044 2008-03-28  Marek Safar  <marek.safar@gmail.com>
3045
3046         A fix for bug #374619
3047         * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
3048         
3049 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3050
3051         * lambda.cs: Check return type only for invocation.
3052         
3053 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3054
3055         A fix for bug #374214
3056         * ecore.cs: Correctly report argument type mismatch.
3057
3058 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3059
3060         * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
3061         and not rely on broken IsEnum.
3062
3063 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3064
3065         * nullable.cs: New file, extracted from generic.cs.
3066         
3067         * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
3068
3069 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3070
3071         * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
3072         predefined comparison operators and null literals.
3073         
3074         * report.cs: New warning ID.
3075         
3076 2008-03-25  Marek Safar  <marek.safar@gmail.com>
3077
3078         A fix for bug #370577
3079         * lambda.cs: Check return type too.
3080
3081 2008-03-25  Marek Safar  <marek.safar@gmail.com>
3082
3083         A fix for bug #372846
3084         * class.cs: Automatic properties can be declared as unsafe.
3085
3086 2008-03-20  Marek Safar  <marek.safar@gmail.com>
3087
3088         * location.cs: Use string based concatenation.
3089         
3090         * expression.cs: LiftedBinaryOperator is gmcs only.
3091         
3092 2008-03-20  Marek Safar  <marek.safar@gmail.com>
3093
3094         * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
3095         conversions rules and expression trees.
3096
3097 2008-03-19  Marek Safar  <marek.safar@gmail.com>
3098
3099         * delegate.cs: Use extension method source as delegate target.
3100
3101 2008-03-19  Marek Safar  <marek.safar@gmail.com>
3102
3103         * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
3104         binary operations to be purely based on binary operations and optimized
3105         emitted code (30% less in some cases). Introduced ReducedExpression for ETs
3106         and other ET refactoring.
3107         
3108         * typemanager.cs: Fixed warning.
3109         
3110 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3111
3112         * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
3113         
3114         * symbolwriter.cs: Fixed.
3115
3116 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3117
3118         * anonymous.cs, driver.cs: Reset anonymous types counters.
3119
3120 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3121
3122         * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
3123         
3124         * class.cs: Use fullname for all type member definitions.
3125         
3126 2008-02-19  Martin Baulig  <martin@ximian.com>
3127
3128         * class.cs
3129         (IMethodData.EmitExtraSymbolInfo): New interface method.
3130         (MethodData.Emit): Call method.EmitExtraSymbolInfo().
3131         (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
3132         interface method here as an empty public virtual method.
3133
3134         * anonymous.cs
3135         (AnonymousMethodMethod.ctor): Added `string real_name' argument.
3136         (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
3137         CodeGen.SymbolWriter.SetRealMethodName().       
3138
3139 2008-02-18  Martin Baulig  <martin@ximian.com>
3140
3141         * anonymous.cs
3142         (ScopeInfo.EmitType): Override this and emit debugging
3143         information for captured variables.
3144         (RootScopeInfo.EmitType): Override this and emit symbol
3145         information for a captured `this'.
3146
3147 2008-02-15  Martin Baulig  <martin@ximian.com>
3148
3149         * iterators.cs: Emit debugging info.
3150
3151         * codegen.cs
3152         (EmitContext.Flags): Add `OmitDebuggingInfo'.
3153         (EmitContext.OmitDebuggingInfo): New public property.
3154
3155         * statement.cs
3156         (While): Override Emit() and don't emit symbol info there; do it
3157         inside DoEmit() instead.
3158         (Block.Emit): Omit symbol information while emitting the scope
3159         initializers; don't ec.Mark() the `EndLocation'.  Fix the lexical
3160         block logic.
3161         (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
3162         (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
3163         .ctor to make `IsIterator' work.
3164
3165 2008-03-14  Martin Baulig  <martin@ximian.com>
3166
3167         * symbolwriter.cs: Added the new symbol writer function from the
3168         debugger's `terrania' branch; temporarily enclose them inside
3169         `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
3170         my vacations.
3171
3172 2008-03-14  Martin Baulig  <martin@ximian.com>
3173
3174         * symbolwriter.cs
3175         (SymbolWriter): Make this a public static class.
3176
3177         * codegen.cs
3178         (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
3179         class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
3180
3181 2008-03-14  Marek Safar  <marek.safar@gmail.com>
3182
3183         A fix for bug #370577
3184         * statement.cs, lambda.cs: Added extra limitations when dealing with void
3185         return type.
3186         
3187 2008-03-14  Marek Safar  <marek.safar@gmail.com>
3188
3189         * typemanager.cs (CSharpName): Made 250 times faster.
3190
3191 2008-03-13  Marek Safar  <marek.safar@gmail.com>
3192
3193         * ecore.cs, expression.cs: Emit conversion for ET shift argument.
3194         
3195 2008-03-12  Marek Safar  <marek.safar@gmail.com>
3196
3197         * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
3198         crash when predefined field does not exist.
3199         
3200 2008-03-12  Marek Safar  <marek.safar@gmail.com>
3201
3202         * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
3203         
3204 2008-03-12  Marek Safar  <marek.safar@gmail.com>
3205
3206         * class.cs (FixedField): Don't crash when contructors are missing.
3207
3208 2008-03-11  Marek Safar  <marek.safar@gmail.com>
3209
3210         * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
3211         convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
3212         check internal types accessibility for internal and external types.
3213         Replaced EnumToUnderlying by GetEnumUnderlyingType.
3214
3215 2008-03-11  Marek Safar  <marek.safar@gmail.com>
3216
3217         * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
3218         convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
3219         attribute.cs, statement: Use corect instance of predefined types (work
3220         related to #364674).
3221
3222 2008-03-07  Marek Safar  <marek.safar@gmail.com>
3223
3224         * expression.cs (TypeOfVoid): Fixed predefined method initialization.
3225         
3226 2008-03-07  Marek Safar  <marek.safar@gmail.com>
3227
3228         * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, 
3229         class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
3230         expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
3231         predefined types clean up, delayed predefined types members initialization
3232         (work related to #364674).
3233
3234 2008-03-05  Marek Safar  <marek.safar@gmail.com>
3235
3236         * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
3237         
3238 2008-03-05  Marek Safar  <marek.safar@gmail.com>
3239
3240         * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
3241         delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
3242         predefined types clean up (work related to #364674).
3243
3244 2008-03-04  Marek Safar  <marek.safar@gmail.com>
3245
3246         * ecore.cs: Print an error message instead of throwing exception.
3247         
3248 2008-03-04  Marek Safar  <marek.safar@gmail.com>
3249
3250         * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
3251         expression.cs, statement.cs: Unififed null literal representation.
3252
3253 2008-03-03  Marek Safar  <marek.safar@gmail.com>
3254
3255         * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
3256         expression.cs: Refactored binary operators resolve phase and improved speed.
3257         The nullable code is still missing and won't work correctly, more fixes
3258         required.
3259
3260         It also fixes #323726, #324312, #324248, and many other unreported issues.
3261
3262 2008-02-29  Zoltan Varga  <vargaz@gmail.com>
3263
3264         * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs' 
3265         instead of 'gmcs'.
3266
3267 2008-02-27  Marek Safar  <marek.safar@gmail.com>
3268
3269         * ecore.cs: Clean-up and split BetterConversion.
3270         
3271 2008-02-25  Raja R Harinath  <harinath@hurrynot.org>
3272
3273         Fix #363791
3274         * enum.cs (EnumMember.Value): Only access 'value' if
3275         ResolveValue says it's ok.
3276         (EnumMember.DoResolveValue): Don't set prev_member.value.
3277         (Enum.GetDefinition): Reverse arguments of Equals --
3278         EnumMember.Value can return 'null'.
3279
3280         * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
3281
3282 2008-02-22  Marek Safar  <marek.safar@gmail.com>
3283
3284         * generic.cs, expression.cs: More ongoing work on expression trees.
3285         
3286 2008-02-21  Marek Safar  <marek.safar@gmail.com>
3287
3288         * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
3289         handle missing matches when mutiple operators exist.
3290         
3291 2008-02-20  Marek Safar  <marek.safar@gmail.com>
3292
3293         A fix for bug #363218
3294         * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
3295         initializers.
3296         
3297 2008-02-20  Marek Safar  <marek.safar@gmail.com>
3298
3299         * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
3300         update. This time to deal correctly with SideEffectConstant expression used
3301         as an argument for another constant folding.
3302
3303 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
3304
3305         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
3306         MethodBuilder.
3307
3308 2008-02-19  Marek Safar  <marek.safar@gmail.com>
3309
3310         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
3311
3312 2008-02-19  Marek Safar  <marek.safar@gmail.com>
3313
3314         A fix for bug #328136
3315         * expression.cs: Do not fold immediately LogicalAnd operators when the left
3316         side is a false constant, because we still need to evaluate the right-hand
3317         side.
3318
3319         * statement.cs (If): Emit two types of boolean constants (simple constant,
3320         side-effect constant).
3321
3322 2008-02-19  Marek Safar  <marek.safar@gmail.com>
3323
3324         * constant.cs (SideEffectConstant): Don't emit boolean constant.
3325
3326         * expression.cs: Fold immediately LogicalAnd operators when both sides are
3327         constants.
3328
3329 2008-02-18  Marek Safar  <marek.safar@gmail.com>
3330
3331         A fix for bug #361457
3332         * ecore.cs (IsApplicable): Params methods have lower priority.
3333
3334         * support.cs: Return correct parameter modifier for params types.
3335
3336 2008-02-18  Marek Safar  <marek.safar@gmail.com>
3337
3338         * generic.cs (TypeParameter): Cache attribute target name.
3339
3340         * support.cs: Removed unused variable.
3341
3342         * typemanager.cs: Removed debugging leftover.
3343
3344         * ecore.cs: Use local type instead of a property;
3345
3346         * class.cs (VerifyMembers): Consider also parent to test whether type member
3347         is local or public.
3348
3349         * expression.cs (FullMethodDesc): Removed.
3350
3351         * attribute.cs (IsValidArgumentType): Made static.
3352
3353 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
3354
3355         Cleanup to be more readable.
3356         * Makefile (GMCS_PROFILE): Remove.
3357         (COMPILER_NAME): New helper.
3358
3359 2008-02-15  Miguel de Icaza  <miguel@novell.com>
3360
3361         * cs-tokenizer.cs: if a conditional expression happens inside a
3362         (...) this also means that we do not need to de-ambiguate between
3363         an parenthesized expression and a cast.
3364
3365         Fixes 346484.
3366
3367         * constant.cs (SideEffectConstant): a constant value that happens
3368         to have a side effect.
3369
3370         Fixes the build regressions introduced by the fix for #359789
3371
3372 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
3373
3374         * expression.cs (Conditional.Emit): when emitting the ternary
3375         operator, use local variables to generate code verifiable code.
3376
3377         The verifier cannot infer that the type on stack before the
3378         stloc.0 is executed is of type ParentB. This happens because the
3379         stack merge algorithm uses only parent types when deciding which
3380         is the common type.  This is described in Part III 1.8.1.3 of ECMA
3381         335.
3382
3383         This code compiled with mcs is not verifiable under MS. The MS
3384         verifier picks the first common interface of Foo and Bar, which is
3385         wrong, but doesn't use a full join type of the 2 interfaces.
3386
3387         CSC uses a clever hack to compile such code in a verifiable
3388         way. It stores the intermediate values in a local variable with
3389         the expected type.
3390
3391         Fixes: #358102
3392
3393 2008-02-14  Miguel de Icaza  <miguel@novell.com>
3394
3395         * expression.cs: Do not fold BitwiseAnd operators when the left
3396         side is a false constant, because we still need to evaluate the
3397         right-hand side.
3398
3399         Fixes #359789
3400
3401         * support.cs: Instead of throwing an InternalErrorException when
3402         the position of the stream is outside the boundary of our buffer,
3403         reset the state of the reader, and restart the reading from the
3404         beginning of the file.
3405
3406 2008-02-14  Marek Safar  <marek.safar@gmail.com>
3407
3408         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
3409
3410 2008-02-14  Marek Safar  <marek.safar@gmail.com>
3411
3412         A fix for bug #361686
3413         * decl.cs: A protected types used inside a private class which parents
3414         derives from the protected class are accessible.
3415
3416 2008-02-13  Marek Safar  <marek.safar@gmail.com>
3417
3418         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
3419         the parameterless constructor.
3420
3421 2008-02-13  Marek Safar  <marek.safar@gmail.com>
3422
3423         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
3424         lookup methods to use standard member cache when doing member lookup.
3425
3426 2008-02-12  Marek Safar  <marek.safar@gmail.com>
3427
3428         * driver.cs: Don't report full path for referenced module as assembly error.
3429
3430 2008-02-12  Marek Safar  <marek.safar@gmail.com>
3431
3432         * Makefile: Fixed `qh' target to work on all machines.
3433
3434         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
3435         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
3436         and HasElementType with TypeManager implementation.
3437
3438 2008-02-08  Marek Safar  <marek.safar@gmail.com>
3439
3440         A fix for bugs #325134, #359749
3441         * expression.cs, ecore.cs: Try to resolve an extension method even if the
3442         first binds point to non-method member expression.
3443
3444 2008-02-08  Marek Safar  <marek.safar@gmail.com>
3445
3446         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
3447
3448 2008-02-08  Marek Safar  <marek.safar@gmail.com>
3449
3450         A fix for bugs #321394, #323028
3451         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
3452         Reworked naive IsAccessibleAs implementation to handle nested types.
3453
3454 2008-02-05  Jb Evain  <jbevain@novell.com>
3455
3456         * class.cs: use generic type comparison for parameters
3457         as well.
3458
3459 2008-02-05  Marek Safar  <marek.safar@gmail.com>
3460
3461         A fix for bug #325372
3462         * class.cs: Use generic type comparison when testing method signatures.
3463
3464 2008-02-05  Marek Safar  <marek.safar@gmail.com>
3465
3466         A fix for bug #357047
3467         * ecore.cs: Applied C# 3.0 changes to better conversion.
3468
3469 2008-02-05  Marek Safar  <marek.safar@gmail.com>
3470
3471         A fix for bug #358374
3472         * cs-parser.jay: Correctly set modifiers for all constructor types.
3473
3474 2008-02-04  Marek Safar  <marek.safar@gmail.com>
3475
3476         A fix for bug #355251
3477         * generic.cs: Added base class constraint based type inference.
3478
3479 2008-02-01  Marek Safar  <marek.safar@gmail.com>
3480
3481         A fix for bug #357255
3482         * decl.cs: One more missing visibility check.
3483
3484 2008-02-01  Marek Safar  <marek.safar@gmail.com>
3485
3486         * support.cs: Fixed broken return.
3487
3488 2008-01-25  Marek Safar  <marek.safar@gmail.com>
3489
3490         * report.cs: Correctly reset warnings count after probing.
3491
3492 2008-01-25  Martin Baulig  <martin@ximian.com>
3493
3494         * namespace.cs
3495         (NamespaceEntry.SymbolFileID): Make this work again after
3496         MemberName.ToString() is gone.
3497
3498 2008-01-25  Marek Safar  <marek.safar@gmail.com>
3499
3500         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
3501         expressions.
3502
3503 2008-01-25  Marek Safar  <marek.safar@gmail.com>
3504
3505         * generic.cs: Use full implicit conversion for type inference fixing.
3506
3507 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3508
3509         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
3510         Fixed user operator conversions.
3511
3512 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3513
3514         * generic.cs: Do nullable type to null comparison optimization during
3515         resolve phase.
3516
3517 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3518
3519         A fix for bug #355163
3520         * generic.cs: Enabled l-value resolve on nullable expressions.
3521
3522 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3523
3524         A fix for bug #353986
3525         * class.cs: Ingore static ctors with parameters for any further checks.
3526
3527 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3528
3529         A fix for bug #354310
3530         * namespace.cs: Removed redundant check.
3531
3532 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3533
3534         A fix for bug #354928
3535         * expression.cs: ElementInitializers can be resolved only once.
3536
3537 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3538
3539         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
3540         Condition expressions.
3541
3542 2008-01-23  Marek Safar  <marek.safar@gmail.com>
3543
3544         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
3545
3546 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3547
3548         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
3549         not allowed.
3550
3551         * generic.cs: Implemented coalesce expression.
3552
3553 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3554
3555         A fix for bug #355145
3556         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
3557         expression tree type inference.
3558
3559 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
3560
3561         Fix #354663
3562         * expression.cs (Binary.IsUnsignedType): Fix typo.
3563
3564 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3565
3566         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
3567
3568 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3569
3570         A fix for bug #355161
3571         * ecore.cs, expression.cs: Wider range of extension method supported
3572         expressions.
3573
3574 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
3575
3576         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
3577         AssemblyBuilder to operate in compiler context. Fixes mcs part of
3578         bug #354970.
3579
3580 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3581
3582         A fix for bug #355148
3583         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
3584
3585 2008-01-22  Miguel de Icaza  <miguel@novell.com>
3586
3587         * expression.cs (CreateExpressionTree): Add support for or and
3588         logical or, and indent following the coding conventions.
3589
3590         * typemanager.cs (LinqExpression): renamed from
3591         ExpressionTreeManager, for a shorter name.
3592
3593         Use TypeManager.CoreLookupType to lookup types from our core
3594         assemblies and turn those into "Type" variables.
3595
3596         Consumers that previously used "Namespace" and "Type" from this
3597         class should instead use the TypeExpression which is a type that
3598         is fully resolved (without involving the regular C# resolution
3599         rules). 
3600
3601         This typically looks like this:
3602
3603         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
3604         new MemberAccess (texpr, name, type_arguments, loc)
3605
3606         This avoids the problem in: #355178
3607
3608 2008-01-21  Marek Safar  <marek.safar@gmail.com>
3609
3610         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
3611         feature in parser only as we do in other cases.
3612         
3613 2008-01-21  Marek Safar  <marek.safar@gmail.com>
3614
3615         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
3616         typemanager.cs: A refactoring of params arguments to reuse existing
3617         expressions (params -> array initializer) to emit params argument instead
3618         of specialized handling.
3619         It was required by expression tree implementation and it has other benefits
3620         as well, we now apply same optimization for params arguments as we do for
3621         array initializers.
3622         
3623 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3624
3625         A fix for bug #353526
3626         * generic.cs: A type inference of params arguments may not required any
3627         temporary array creation.
3628         
3629 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3630
3631         A fix for bug #353534
3632         * generic.cs, ecore.cs, expression.cs: A method group type inference is
3633         supported for delegates only.
3634         
3635 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3636
3637         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
3638         type for more than 1 candidates.
3639         
3640 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3641
3642         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
3643         expressions.
3644         
3645 2008-01-16  Marek Safar  <marek.safar@gmail.com>
3646
3647         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
3648         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
3649         operator) expressions. 
3650                 
3651 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
3652
3653         * statement.cs: Avoid declaring an IL variable for this_variable since it is
3654         not accessed from the generated IL.
3655
3656 2008-01-14  Marek Safar  <marek.safar@gmail.com>
3657
3658         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
3659         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
3660         statement.cs: The first expression tree implementation drop, mostly
3661         infrastructure work.
3662
3663 2008-01-14  Marek Safar  <marek.safar@gmail.com>
3664
3665         * ecore.cs (IsNestedChild): Refactored.
3666
3667 2008-01-11  Marek Safar  <marek.safar@gmail.com>
3668
3669         * lambda.cs: Don't use a cast on unknown expression statement.
3670
3671 2008-01-10  Geoff Norton  <gnorton@novell.com>
3672
3673         * cs-tokenizer.cs: One more token to distinguish between method and lambda
3674         arguments
3675
3676 2008-01-09  Marek Safar  <marek.safar@gmail.com>
3677
3678         * doc.cs: Report better /doc crash details.
3679         
3680 2008-01-09  Marek Safar  <marek.safar@gmail.com>
3681
3682         A fix for bug #352536
3683         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
3684
3685 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3686
3687         A fix for bug #352287
3688         * ecore.cs, expression.cs: Do `this' access checking in all member access
3689         expressions.
3690         
3691 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3692
3693         * rootcontext.cs, driver.cs: Switch to linq mode by default.
3694         
3695         * report.cs: Reset message stacks.
3696         
3697 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3698
3699         * generic.cs (InferInPhases): Correctly calculate params position.
3700         
3701 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3702
3703         * cs-tokenizer.cs: No need to parse full string when parsing lambda
3704         arguments.
3705
3706 2008-01-07  Marek Safar  <marek.safar@gmail.com>
3707
3708         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
3709         
3710         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
3711         
3712         * driver.cs: Updated --help option.
3713         
3714 2008-01-07  Marek Safar  <marek.safar@gmail.com>
3715
3716         * generic.cs (InferParamsTypeArguments): Removed.
3717         (InferInPhases): Add params type inference.
3718         (LowerBoundInference): Fixed scoring mechanism.
3719         
3720         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
3721         
3722 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
3723
3724         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
3725         byte array for unsigned "baked" assemblies.
3726
3727 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
3728
3729         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
3730         array for assemblies that are not strongnamed.
3731
3732 2008-01-04  Marek Safar  <marek.safar@gmail.com>
3733
3734         A fix for bug #351481
3735         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
3736         declaring type for nested generic types.
3737         
3738 2008-01-04  Marek Safar  <marek.safar@gmail.com>
3739
3740         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
3741         instead of ToString.
3742         
3743 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3744
3745         A fix for bug #351047
3746         * expression.cs (Binary.ResolveOperator): Allow equality operators between
3747         null and structs only when equality and inequality operators are defined
3748         either as an user-operators or predefined operators.
3749         
3750 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3751
3752         A fix for bug #351047
3753         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
3754         
3755 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3756
3757         A fix for bug #351257
3758         * cs-tokenizer.cs: Advance line number for '\r' correctly.
3759         
3760 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3761
3762         A fix for bug #351157
3763         * class.cs (Using): Fixed yet another broken cloning.
3764         
3765         (Block): Put back more sensible default value for statements.
3766         
3767 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
3768
3769         * codegen.cs: Allow AssemblyVersion with only major version component.
3770         Fixes bug #351055.
3771
3772 2007-12-29  Marek Safar  <marek.safar@gmail.com>
3773
3774         A fix for bug #324654
3775         * class.cs: Use FullName property as member name.
3776
3777 2007-12-28  Marek Safar  <marek.safar@gmail.com>
3778
3779         A fix for bug #342117
3780         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
3781         constructor constraint.
3782
3783 2007-12-28  Marek Safar  <marek.safar@gmail.com>
3784
3785         A fix for bug #338273
3786         * class.cs (ProbertyBase): Access modifier checks are required for overrides
3787         only.
3788
3789 2007-12-28  Marek Safar  <marek.safar@gmail.com>
3790
3791         A fix for bug #350839
3792         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
3793
3794 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
3795
3796         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3797         GHOP:
3798         
3799         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
3800
3801         * statement.cs: Changed some Hashtables to use HybridDictionaries
3802         instead. It was observed that some HashTables only contained a few
3803         items in the vast majority of cases. Since HybridDictionary is
3804         more efficient on small sets (<10 elements), "known_variables"
3805         from class ExplicitBlock as well as "labels" and "constants " from
3806         class Block were changed to HybridDictionaries. 
3807
3808         Atsai results: (56216kb->54987kb)
3809
3810         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
3811
3812
3813 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
3814
3815         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3816         GHOP:
3817         
3818         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
3819         
3820         * expression.cs: foreach loop to for loop, saved on allocation of
3821         enumerator (59333kb->59141kb)
3822
3823         * statement.cs. Changed foreach loops to for loops, saved on
3824         allocation of enumerator (59141kb->59006kb)
3825
3826         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
3827         when constructed with no specified capacity. This was causing a
3828         few ArrayLists to allocate more memory than they would potentially
3829         need in the Block class and MemberCache class. Setting the
3830         ArrayLists to construct with a capacity of 1 saves some
3831         memory. (56216kb->55585kb)
3832
3833 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3834
3835         A fix for bug #347189 (2nd issue)
3836         * expression.cs (MemberAccess): Nested type can be found in base non-generic
3837         type.
3838
3839 2007-12-27  Miguel de Icaza  <miguel@novell.com>
3840         
3841         * report.cs: Do not use colors if stdout and stderr are not a
3842         terminal.
3843
3844 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3845
3846         A fix for bug #346998
3847         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
3848         overloads.
3849
3850 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3851
3852         A fix for bug #343465
3853         * class.cs: Explicit method name for nested types uses dots only.
3854
3855 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3856
3857         A fix for bug #343707
3858         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
3859
3860 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3861
3862         * ecore.cs: Report type inference errors only when arguments count matches
3863         parameter count.
3864         
3865         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
3866         
3867         * expression.cs, report.cs: New warning.
3868         
3869         * typemanager.cs: Catch anonymous method type too.
3870
3871 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3872
3873         A fix for bug #346379
3874         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
3875
3876 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3877
3878         A fix for bug #347359
3879         * expression.cs (Invocation): Don't resolve already resolved expression.
3880
3881 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3882
3883         A fix for bug #347189
3884         * class.cs (FixedField): Use non-dependent code only in the define phase.
3885
3886 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3887
3888         A fix for bug #348076
3889         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
3890
3891 2007-12-22  Marek Safar  <marek.safar@gmail.com>
3892
3893         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
3894         discovered extension methods.
3895
3896 2007-12-22  Marek Safar  <marek.safar@gmail.com>
3897
3898         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
3899         method.
3900
3901 2007-12-21  Miguel de Icaza  <miguel@novell.com>
3902
3903         * report.cs (ErrorMessage): Add support for using colors on
3904         terminals that support it. 
3905
3906 2007-12-21  Marek Safar  <marek.safar@gmail.com>
3907
3908         * ecore.cs: Use information about expanded params for error reporting.
3909
3910 2007-12-21  Marek Safar  <marek.safar@gmail.com>
3911
3912         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
3913         and logic for params overloads.
3914         
3915 2007-12-15  Miguel de Icaza  <miguel@novell.com>
3916
3917         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
3918         as this is also created from the parser.  Fixes #349034
3919
3920 2007-12-12  Miguel de Icaza  <miguel@novell.com>
3921
3922         * statement.cs (Throw.CloneTo): it is valid to have empty
3923         expressions for throw. 
3924
3925 2007-12-03  Marek Safar  <marek.safar@gmail.com>
3926
3927         * cs-parser.jay: Set delegate constraint parsing region correctly.
3928
3929 2007-12-03  Marek Safar  <marek.safar@gmail.com>
3930
3931         A fix for bug #345467
3932         * typemanager.cs (IsEqual): Compare generic parameters position only.
3933         
3934 2007-11-28  Marek Safar  <marek.safar@gmail.com>
3935
3936         * expression.cs (BaseAccess): Type arguments can be null.
3937
3938 2007-11-27  Raja R Harinath  <harinath@gmail.com>
3939
3940         * statement.cs (Block.Resolve): Ensure flow-branching tree is
3941         consistent even when an error has occured.
3942         (Switch.Resolve): Likewise.
3943
3944 2007-11-22  Marek Safar  <marek.safar@gmail.com>
3945
3946         A fix for bug #334505
3947         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
3948         overrides.
3949         
3950 2007-11-22  Marek Safar  <marek.safar@gmail.com>
3951
3952         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
3953         refactorings required to resolve extension methods correctly when mixing
3954         generics and non-generics members.
3955         
3956 2007-11-20  Marek Safar  <marek.safar@gmail.com>
3957
3958         A fix for bug #342584
3959         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
3960         conversion.
3961         
3962 2007-11-19  Marek Safar  <marek.safar@gmail.com>
3963
3964         A fix for bug #342512
3965         * delegate.cs: Use delegate argument expression when is available. Don't
3966         emit virtual call when class is sealed.
3967         
3968 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3969
3970         A fix for bug #325423
3971         * assign.cs (FieldInitializer): Use resolved expression for emit.
3972         
3973         * class.cs: Print less confusing error message.
3974         
3975 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3976
3977         * cs-tokenizer.cs: Removed GMCS ifdefs.
3978         
3979         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
3980         mcs.
3981         
3982         * cs-parser.jay: Disabled nullable check.
3983         
3984         * generic-mcs: Copied more generic stuff.
3985                 
3986 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3987
3988         * gcs-parser.jay: Merged to cs-parser.jay.
3989         
3990         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
3991         * *.csproj, *.sources: Updated to use only jay parser file.
3992
3993 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3994
3995         * gcs-parser.jay: Added nullable and default expression feature checks.
3996         
3997 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3998
3999         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
4000         it fixes many TODOs and hidden bugs.
4001         
4002         * expression: Removed duplicate error check.
4003
4004 2007-11-15  Marek Safar  <marek.safar@gmail.com>
4005
4006         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
4007         implicitly type local variable only when it is used in a declaration.
4008
4009 2007-11-15  Marek Safar  <marek.safar@gmail.com>
4010
4011         * attribute.cs: Use CS0612 for empty strings.
4012
4013 2007-11-14  Marek Safar  <marek.safar@gmail.com>
4014
4015         * lambda.cs, statement.cs: Contextual return may act as a statement.
4016
4017 2007-11-14  Marek Safar  <marek.safar@gmail.com>
4018
4019         A fix for a regression cause by #324222
4020         * class.cs: Don't report unused even when it implements an interface.
4021         
4022 2007-11-13  Marek Safar  <marek.safar@gmail.com>
4023
4024         A fix for bug #341205
4025         * ecore.cs, expression.cs: Method group expression cannot do static
4026         method access with an instance reference check before overloading takes
4027         a place.
4028         
4029 2007-11-13  Marek Safar  <marek.safar@gmail.com>
4030
4031         A fix for bug #325359
4032         * class.cs: Use predictable name for automatically generated property.
4033         
4034 2007-11-12  Marek Safar  <marek.safar@gmail.com>
4035
4036         A fix for bug #324996
4037         * expression.cs (Is): Handle case where D is nullable and T is not
4038         correctly.
4039         
4040         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
4041         
4042 2007-11-12  Marek Safar  <marek.safar@gmail.com>
4043
4044         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
4045         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
4046         Flush small error reporting changes.
4047         
4048 2007-11-09  Marek Safar  <marek.safar@gmail.com>
4049
4050         A fix for bug #324996
4051         * expression.cs: Rewrote Is expression implementation to work with
4052         generics, nullable types, anonymous method. A const result expression 
4053         uses existing infrastructure instead of custom not fully-featured one.
4054         
4055 2007-11-08  Marek Safar  <marek.safar@gmail.com>
4056
4057         A fix for bug #340202
4058         * class.cs: Consider generics for volatile field.
4059
4060 2007-11-08  Marek Safar  <marek.safar@gmail.com>
4061
4062         A fix for bug #335594
4063         * expression.cs: Use conversion rules when handling string addition.
4064         
4065 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4066
4067         A fix for bug #336651
4068         * expression.cs: Fixed a crash when probing is on.
4069         
4070 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4071
4072         A fix for bug #324242
4073         * covert.cs: Added a conversion from any nullable-type with an 
4074         underlying enum-type to the type System.Enum.
4075         
4076 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4077
4078         A fix for bug #324222
4079         * class.cs: Report all non-used event fields.
4080         
4081 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4082
4083         A fix for bug #325161
4084         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
4085         qualifier for generic types.
4086         
4087 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4088
4089         A fix for bug #322971
4090         * expression.cs, ecore.cs: Added intermediate result value check for
4091         indexers. 
4092         
4093 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4094
4095         A fix for bug #324754
4096         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
4097         when it was requested.
4098
4099 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4100
4101         A fix for bug #325101
4102         * expression.cs: Do type not value comparison for `is' expression.
4103
4104 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4105
4106         A fix for bug #320236
4107         * convert.cs: Don't apply user conversion on underlying target type.
4108
4109 2007-11-06  Marek Safar  <marek.safar@gmail.com>
4110
4111         * expression.cs: Don't use unresolved expression for error reporting.
4112  
4113 2007-11-06  Marek Safar  <marek.safar@gmail.com>
4114
4115         A fix for bugs #337712, #324490
4116         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
4117         overloading resolution too.
4118         
4119         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
4120         the process consistent and more robust.
4121         
4122         * expression.cs, linq.cs, report.cs: Update.
4123
4124 2007-11-02  Marek Safar  <marek.safar@gmail.com>
4125
4126         A fix for bug #332909
4127         * attribute.cs: Resolve attributes in correct context using error
4128         handling procedure.
4129         
4130         * rootcontext.cs: Define Obsolete attribute members as core members.
4131         
4132 2007-11-02  Marek Safar  <marek.safar@gmail.com>
4133
4134         * statement.cs: Removed unused methods.
4135         
4136 2007-10-31  Wade Berrier  <wberrier@novell.com>
4137
4138         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
4139         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
4140         during 'make dist')
4141
4142 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4143
4144         A fix for bug #338102
4145         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
4146         methods registered as non-generics.
4147         
4148 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4149
4150         A fix for bugs #337712, #324490
4151         * delegate.cs: Delegate covariance and contravariance is not allowed for
4152         value types.
4153         
4154 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4155
4156         A fix for bug #337719 
4157         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
4158         `from' keyword.
4159         
4160 2007-10-30  Marek Safar  <marek.safar@gmail.com>
4161  
4162         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
4163
4164 2007-10-29  Marek Safar  <marek.safar@gmail.com>
4165  
4166         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
4167         query expressions.
4168
4169 2007-10-29  Raja R Harinath  <rharinath@novell.com>
4170
4171         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
4172
4173 2007-10-29  Marek Safar  <marek.safar@gmail.com>
4174  
4175         A fix for bug #334652
4176         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
4177         extension methods when we have not found the best candidate in normal
4178         container.
4179
4180 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4181
4182         * AssemblyInfo.cs: Keep up-to-date.
4183
4184 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4185
4186         * Makefile: Fixed generics compiler name.
4187         
4188 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4189
4190         * lambda.test: removed, lambda parsing is done differently.
4191         
4192         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
4193
4194 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
4195
4196         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
4197
4198 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4199
4200         * Makefile, *.sources : All C# compilers are in mcs folder.
4201         
4202         * *.cs: Use existing 2_1 define for smcs.
4203
4204 2007-10-26  Marek Safar  <marek.safar@gmail.com>
4205
4206         A fix for bug #335847
4207         * assign.cs, expression.cs: Couple of changes to avoid creating a
4208         temporary variable for each object initializer assignment statement. It
4209         simplifies struct initialization too, otherwise two temporary variables
4210         would be required.
4211         Implemented optimization of redundant default element initializers.
4212         
4213 2007-10-25  Marek Safar  <marek.safar@gmail.com>
4214
4215         A fix for bug #336766
4216         * expression.cs (Class.CheckBase): Use generic name when method is
4217         generic.
4218         
4219 2007-10-25  Marek Safar  <marek.safar@gmail.com>
4220
4221         A fix for bug #334737
4222         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
4223         variable and not variable argument for prepared copies.
4224
4225 2007-10-24  Marek Safar  <marek.safar@gmail.com>
4226
4227         A fix for bug #325110
4228         * class.cs, expression.cs, attribute.cs: Use open generic method when
4229         checking conditional attribute.
4230         
4231 2007-10-24  Marek Safar  <marek.safar@gmail.com>
4232
4233         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
4234         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
4235         FeatureIsNotAvailable.
4236
4237 2007-10-24  Marek Safar  <marek.safar@gmail.com>
4238
4239         ** C# 3.0 Partial methods
4240         
4241         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
4242         methods support. Because of member cache issue with generics only
4243         non-generics partial methods are fully supported.
4244         
4245 2007-10-23  Marek Safar  <marek.safar@gmail.com>
4246         
4247         * class.cs, decl.cs: Rewrote member overloads check to cope with 
4248         generics and to use member cache for member checking. It also improves
4249         performance and fixes remaining overloads issues.
4250         
4251 2007-10-20  Marek Safar  <marek.safar@gmail.com>
4252         
4253         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
4254         roottypes.cs, typemanager.cs:
4255                 
4256         A member cache creation logic changed to add members immediately and
4257         not rely on fallback. The member cache is now only prefered way
4258         how to access and find type declaration members. It saves 5 MB of memory
4259         during MWF compilation and makes code ready for more optimizations and
4260         clean-ups, it's also a pre-requirement for partial methods.
4261         
4262 2007-10-18  Raja R Harinath  <harinath@gmail.com>
4263
4264         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
4265         handling for generic parameters.
4266
4267 2007-10-15  Marek Safar  <marek.safar@gmail.com>
4268         
4269         * class.cs (FixedField): Removed redundant volatile check.
4270         
4271 2007-10-15  Marek Safar  <marek.safar@gmail.com>
4272         
4273         * class.cs, decl.cs: Fixed overload members verification to do only one
4274         check per possible collision.
4275         
4276 2007-10-13  Marek Safar  <marek.safar@gmail.com>
4277         
4278         A fix for bug #325478
4279         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
4280         and create only one disposable flags container.
4281         
4282 2007-10-12  Marek Safar  <marek.safar@gmail.com>
4283         
4284         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
4285         * statement.cs (Fixed): Fixed variables cloning.
4286         
4287 2007-10-12  Marek Safar  <marek.safar@gmail.com>
4288         
4289         A fix for bug #333342
4290         * class.cs (EventField): Don't mark value type event as synchronized. 
4291         
4292 2007-10-12  Marek Safar  <marek.safar@gmail.com>
4293         
4294         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
4295         inference to identify best candidate method correctly.
4296         (ProperyExpr): A range variable is read only and cannot be modified.
4297         
4298 2007-10-11  Marek Safar  <marek.safar@gmail.com>
4299         
4300         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
4301         logic to identify best candidate method correctly.
4302         
4303 2007-10-11  Marek Safar  <marek.safar@gmail.com>
4304         
4305         * location.cs (Equals, GetHashCode): Removed.
4306         
4307 2007-10-11  Marek Safar  <marek.safar@gmail.com>
4308         
4309         * report.cs: Implemented message recorder. It is used mainly for lambda
4310         expressions to capture otherwise swallowed error messages.
4311         
4312         * anonymous.cs, lambda.cs.cs: Do full parameters check.
4313
4314         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
4315         and not at the top.
4316         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
4317                 
4318         * expression.cs (MemberAccess): Always report lookup failure.
4319         
4320         * location.cs: Implemented Equals, GetHashCode.
4321         
4322         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
4323         
4324 2007-10-10  Jb Evain  <jbevain@novell.com>
4325
4326         * codegen.cs: re-enable assembly version check.
4327
4328 2007-10-09  Marek Safar  <marek.safar@gmail.com>
4329         
4330         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
4331         checks.
4332         
4333         * namespace.cs (UsingAlias): Do correct version check.
4334         
4335 2007-10-08  Marek Safar  <marek.safar@gmail.com>
4336         
4337         * expresison.cs, ecore.cs: Issue extension method error message when
4338         appropriate.
4339         
4340         * rootcontext.cs: Added ISO_2 compiler mode option.
4341
4342 2007-10-08  Marek Safar  <marek.safar@gmail.com>
4343         
4344         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
4345          message.
4346         
4347 2007-10-08  Marek Safar  <marek.safar@gmail.com>
4348         
4349         * attribute.cs (GetString, GetBoolean): Work with both literal and
4350         constant.
4351         
4352         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
4353         Moved method overload specific methods to MethodGroupExpr.
4354         
4355         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
4356         it should be less memory consuming.
4357         
4358 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
4359
4360         * codegen.cs: remove the assembly version check until the buildbot is
4361         fixed.
4362
4363 2007-10-07  Jb Evain  <jbevain@novell.com>
4364
4365         * attribute.cs (Attribute.GetString): if the value
4366         expression is a StringConstant, return its string value.
4367
4368 2007-10-07  Jb Evain  <jbevain@novell.com>
4369
4370         * typemanager.cs: add `assembly_version_attribute_type`.
4371         * codegen.cs: on attribute emission, check that the
4372         AssemblyVersionAttribute doesn't overflow.
4373
4374 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4375         
4376         A fix for bug #324677
4377         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
4378         parent container of a scope container with currently resolved one. 
4379         
4380 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4381         
4382         A fix for bug #325534
4383         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
4384         only.
4385         
4386 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4387         
4388         A fix for bug #327504
4389         * class.cs (Operator.Define): Refactored implicit and explicit user
4390         operator conversion rules.
4391         
4392 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4393         
4394         A fix for bug #327520
4395         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
4396         
4397 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4398         
4399         A fix for bug #328022
4400         * class.cs (MethodData.Define): Use correct method to check whether
4401         a method implementents an accessor.
4402         
4403 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4404         
4405         A fix for bug #330069
4406         * statement.cs (Fixed.Resolve): Read the first array element only when
4407         an array is instantiated. 
4408         
4409 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4410         
4411         * expression.cs, assign.cs, generics.cs: Print correct operator when
4412         compound assignment is used.
4413         
4414 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4415         
4416         A fix for bug #325841
4417         * expression.cs (ArrayAccess): Use full argument cloning only for
4418         string compound concatenation.
4419         
4420 2007-10-03  Marek Safar  <marek.safar@gmail.com>
4421         
4422         A fix for bug #328774
4423         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
4424         assignment.
4425         (PropertyExpr.EmitAssign): Fixed string concatenation compound
4426         assignment.
4427
4428 2007-10-03  Raja R Harinath  <rharinath@novell.com>
4429
4430         Fix #328490
4431         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
4432         Event accessibility checks here.  Remove some bogus code that
4433         accidently made GenericMethods work.
4434         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
4435
4436 2007-09-25  Marek Safar  <marek.safar@gmail.com>
4437         
4438         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
4439         
4440         * statement.cs (Block): Refactored AddVariable to allow error handling
4441         customization.
4442         
4443         * generic.cs: New stub.
4444         
4445 2007-09-23  Marek Safar  <marek.safar@gmail.com>
4446         
4447         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
4448         flag.
4449         
4450 2007-09-17  Marek Safar  <marek.safar@gmail.com>
4451
4452         * class.cs: Use partial container to record whether any partial part
4453         contains static field initializer and therefore default contructor has
4454         to be defined.
4455         
4456 2007-09-14  Marek Safar  <marek.safar@gmail.com>
4457
4458         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
4459         mono-list when only one of two partial parts has defined accessibility
4460         modifier.
4461         
4462 2007-09-14  Marek Safar  <marek.safar@gmail.com>
4463
4464         A fix for bug #82845
4465         
4466         * class.cs (TypeContainer): Set correct resolve context for all field
4467         initializers.
4468         
4469 2007-09-13  Marek Safar  <marek.safar@gmail.com>
4470
4471         * assign.cs: Fixed a crash when field is resolved twice with an error.
4472         
4473         * codegen.cs: Changed InFieldInitializer to be flag.
4474         
4475         * anonymous.cs, ecore.cs, expression.cs: Update after
4476         IsInFieldInitializer rename.
4477         
4478         * const.cs: Removed unused parameter.
4479         
4480         * class.cs: Changed the way how we resolve and emit field initializers.
4481         The field initilizers have to have access to contructor block to emit
4482         compiler generated code.
4483
4484 2007-09-13  Marek Safar  <marek.safar@gmail.com>
4485
4486         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
4487         generics use TypeContainer instead.
4488         
4489 2007-09-12  Marek Safar  <marek.safar@gmail.com>
4490         
4491         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
4492
4493         * lambda.cs (ResolveParameters): Use more powerful
4494         InflateGenericArgument.
4495         
4496         * parameters.cs: Better exception message.
4497                 
4498 2007-09-10  Marek Safar  <marek.safar@gmail.com>
4499
4500         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
4501         correct expression block type. 
4502         
4503         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
4504         
4505         * expression.cs (Invocation): Extracted method group resolve to
4506         DoResolveOverload.
4507         
4508 2007-09-07  Marek Safar  <marek.safar@gmail.com>
4509
4510         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
4511         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
4512         
4513         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
4514         generic extension methods.
4515
4516 2007-09-06  Marek Safar  <marek.safar@gmail.com>
4517
4518         A fix for bug #82676 (Do I get it right now?)
4519         * convert.cs (Binary.ResolveOperator): An interface is converted to the
4520         object before a standard conversion is applied.
4521         
4522 2007-09-06  Marek Safar  <marek.safar@gmail.com>
4523
4524         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
4525         #82676.
4526         
4527 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4528
4529         A fix for bug #82676
4530         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
4531         non-generic interface types.
4532         
4533 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4534
4535         A fix for bug #82690
4536         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
4537         
4538 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4539
4540         A fix for bug #82571
4541         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
4542         modifier for container based methods.
4543         
4544 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4545
4546         A fix for bug #82676
4547         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
4548         any interface-type T means to any of interface type T.
4549
4550 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4551
4552         * namespace.cs: We have 2 versions of System.Core assembly.
4553
4554 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4555
4556         A fix for bug #82652
4557         * class.cs (Class.GetClassBases): Compare types and not expressions.
4558
4559 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4560
4561         A fix for bug #82620
4562         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
4563         actually never worked before.
4564         (IndexerAccess): Emit prepared arguments before they are modified.
4565         
4566 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4567
4568         A fix for bug #82563
4569         * assign.cs: Revert wrong fix.
4570         
4571         * expression.cs (VariableReference.EmitAssign): Handle ref reference
4572         correctly.
4573         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
4574         Instead of ldelema/stdind we have to use temporary variables to handle
4575         cases like String.Concat (params string[]).
4576         
4577 2007-08-31  Marek Safar  <marek.safar@gmail.com>
4578
4579         * class.cs: EmitAttributes to Emit rename.
4580         
4581         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
4582         null.
4583         (MemberCore.HasClsCompliantAttribute): Don't depend on 
4584         GetClsCompliantAttributeValue execution.
4585         
4586 2007-08-31  Marek Safar  <marek.safar@gmail.com>
4587
4588         * anonymous.cs: Use shorter type prefix.
4589         
4590         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
4591         when exist.
4592         
4593         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
4594         variables when probing is on.
4595         
4596         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
4597         unresolved variables.
4598         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
4599         handle transparent identifiers.
4600         
4601 2007-08-26  Marek Safar  <marek.safar@gmail.com>
4602
4603         * attribute.cs (IsClsCompliant): Add nullable types test.
4604         
4605 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
4606
4607         * doc.cs : catch other types of exception than XmlException to
4608           report CS1570. Fixed bug #82565.
4609
4610 2007-08-23  Marek Safar  <marek.safar@gmail.com>
4611
4612         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
4613         The number of delegate parameters has to match.
4614         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
4615         arrays.
4616
4617 2007-08-21  Marek Safar  <marek.safar@gmail.com>
4618
4619         * anonymous.cs (AnonymousMethod): Generate private anonymous method
4620         to fix problem with private arguments.
4621
4622 2007-08-20  Marek Safar  <marek.safar@gmail.com>
4623
4624         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
4625         
4626         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
4627         
4628         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
4629         empty. Add cloning suport.
4630         
4631         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
4632
4633 2007-08-20  Marek Safar  <marek.safar@gmail.com>
4634
4635         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
4636         to create EmptyCast. It handles EmptyConstantCast specialization for
4637         constants.
4638         
4639 2007-08-18  Marek Safar  <marek.safar@gmail.com>
4640
4641         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
4642         (EmitArrayArgument): One routine for array arguments.
4643         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
4644         
4645 2007-08-17  Marek Safar  <marek.safar@gmail.com>
4646
4647         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
4648
4649 2007-08-17  Marek Safar  <marek.safar@gmail.com>
4650
4651         * anonymous.cs: MemberLookupFinal update.
4652
4653         * class.cs (ConstructorInitializer): Is expression based.
4654         
4655         * delegate.cs: MethodGroupExpr update.
4656         
4657         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
4658         messages.
4659         (Error_MemberLookupFailed): Customizable error override.
4660         (MethodGroupExpr): Keep queried type for later usage.
4661         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
4662         resolve.
4663         
4664         * expression.cs: Error_MemberLookupFailed refactoring.
4665         (New.DoResolve): Resolve as much as possible.
4666         (ElementInitializer.Error_MemberLookupFailed): Object initializer
4667         customization for invalid member types.
4668
4669         * statement.cs: MethodGroupExpr update.
4670         
4671 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4672
4673         * modifier.cs (Check): Check all modifiers and not only accessibility
4674         ones.
4675
4676 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4677
4678         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
4679         type and not an expression.
4680
4681 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4682
4683         * statement.cs (Catch.Clone): Type and variable can be null.
4684
4685 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4686
4687         A fix for bug #81979
4688         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
4689         I am really not sure whether this is the best fix.
4690         
4691         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
4692         only once.
4693         
4694 2007-08-14  Marek Safar  <marek.safar@gmail.com>
4695
4696         ** C# 3.0 Object and collection initializers (major re-write)
4697         
4698         * assign.cs (DoResolve): Initializers are not assign related.
4699         
4700         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
4701         used during collection or object initialization.
4702         
4703         * expression.cs (Error_InvalidArguments): Add initializers specific
4704         messages. More will come later because it requires some general
4705         refactoring.
4706         (New.DoResolve): Better error handling for unsafe types.
4707         (EmptyExpressionStatement): New class.
4708         (ElementInitializer): An object initializer expression.
4709         (CollectionElementInitializer): A collection initializer expression.
4710         (CollectionOrObjectInitializers): A block of object or collection
4711         initializers.
4712         (NewInitialize): New expression with element/object initializers.
4713         
4714         * statement.cs: Reverted object/collection initializer hacks.
4715         
4716         * typemanager.cs (CSharpName): Filter __arglist type.
4717         
4718 2007-08-09  Marek Safar  <marek.safar@gmail.com>
4719
4720         ** C# 3.0 Anonymous Types (update to the latest standard)
4721         
4722         * expression.cs (Binary.ResolveOperator): Threat all null based types
4723         same.
4724         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
4725         (AnonymousTypeParameter): Updated.
4726         
4727         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
4728         (AnonymousTypeClass): New anonymous type container.
4729         
4730         * class.cs (AddField): Return operation result.
4731         
4732         * generic.cs: Another empty TypeArguments overload.
4733         
4734         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
4735         are stored at top of normal hierarchy.
4736         
4737         * typemanager.cs (CSharpName): Filter anonymous types.
4738         
4739 2007-08-09  Marek Safar  <marek.safar@gmail.com>
4740
4741         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
4742         as single Concat call. How could we miss that :-(
4743         
4744 2007-08-08  Marek Safar  <marek.safar@gmail.com>
4745
4746         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
4747         
4748 2007-08-07  Miguel de Icaza  <miguel@novell.com>
4749
4750         * expression.cs: Fix the previous commit, the creation of the
4751         arguments array list needs also to be conditional on the arguments
4752         not being null.
4753
4754         * class.cs: Add a little bit of help to help narrow down problems.
4755
4756         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
4757         not try to copy in that case. 
4758
4759         * driver.cs: When building SMCS, include a new different set of
4760         default assemblies here.   Do this here so we can control whether
4761         to include the default assemblies with /noconfig.
4762
4763 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4764
4765         A fix for bug #81979
4766         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
4767         only.
4768
4769 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4770
4771         A fix for bug #82300
4772
4773         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
4774         we are in probing scope.
4775
4776 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4777
4778         A fix for bug #82301
4779
4780         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
4781         (Statement.CloneTo): Clone and not map children blocks.
4782
4783 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4784
4785         A fix for bug #82299
4786
4787         * expression.cs (LocalVariableReference.CloneTo): Remap local info
4788         variable too.
4789         
4790         * statement.cs (Statement.CloneTo): Clone variables before statements
4791         to allow remaping of local variables.
4792
4793 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4794
4795         A fix for bug #82296
4796
4797         * anonymous.cs,
4798         * report.cs: Log crash details for future clone problems.
4799         
4800         * statement.cs (Return.Clone): Don't clone non-existent expression.
4801
4802 2007-08-03  Raja R Harinath  <harinath@gmail.com>
4803
4804         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
4805         (Class.AddBasesForPart): Move CS0537 check here from ...
4806         * cs-parser.jay (class_declaration): ... here.  Move calling of
4807         'AddBasesForPart' to ...
4808         (class_bases): ... here.
4809         (struct_declaration, interface_declaration): Update to changes.
4810
4811 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4812
4813         A fix for bug #81923
4814
4815         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
4816         conversion is allowed.
4817
4818 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4819
4820         A fix for bug #81564
4821
4822         * ecore.cs (EventExpr): Add IsBase handling.
4823
4824         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
4825         too.    
4826         
4827 2007-08-02  Raja R Harinath  <harinath@gmail.com>
4828
4829         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
4830         * cs-parser.jay: Some whitespace cleanups.
4831         (current_delegate): New.
4832         (type_name): New.
4833         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
4834         a dummy code block, and use 'type_name' instead of 'member_name'.
4835         (interface_declaration, class_declaration): Likewise.
4836         (delegate_declaration): Likewise.  Rearrange slightly and use
4837         'current_delegate'.
4838         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
4839         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
4840
4841 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4842
4843         A fix for bug #82039
4844
4845         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
4846         available.
4847
4848         * typemanager.cs (CSharpName): Split to string overload.
4849
4850 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4851
4852         * expression.cs,
4853         * report.cs: Updated warning CS0472.
4854
4855 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4856
4857         A fix for bug #82181
4858         * cs-parser.jay,
4859         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
4860
4861 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4862
4863         A fix for bug #82277
4864         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
4865
4866 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4867
4868         ** C# 3.0 Type Inference (major bits are working)
4869         
4870         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
4871         (.ImplicitStandardConversionExists): Uses compatible.
4872         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
4873         (.InferReturnType): New method.
4874         (.Compatible): Refactored.
4875         (.ResolveParameters): Uses factory to create resolved parameters.
4876         (.CompatibleMethod): Add probing mode support.
4877         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
4878         clearly distinguish between 2 different operations.
4879         (LambdaMethod): Moved to lambda.cs.
4880         (AnonymousMethod): Removed unused fields and methods.
4881         (AnonymousDelegate): Simplified.
4882         
4883         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
4884         
4885         * convert. cs (ImplicitConversionStandard): Compatible works differently.
4886         
4887         * delegate.cs (Delegate): New mehods to reduce code duplication.
4888         (.GetConstructor): New method.
4889         (.GetInvokeMethod): New method.
4890         (DelegateCreation): Updated.
4891         
4892         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
4893         does not exist.
4894         (OverloadResolve): Made probing little bit faster.
4895         
4896         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
4897         when probing is on.
4898         
4899         * generic.cs (TypeInferenceContext): Dummy implementation.
4900         
4901         * iterators.cs: Updated after Resolve/Define rename.
4902         
4903         * lambda.cs (LambdaExpression)
4904         (.ResolveParameters): Handles both type of arguments and type inference too.
4905         
4906         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
4907         (InflateTypes): Updated.
4908         
4909         * support.cs (InflateTypes): Changed signature and updated.
4910         
4911         * typemanager.cs (LookupMemberCache): Better dynamic type check.
4912         (MemberLookup_FindMembers): More MS tricks.
4913         (GetParameterData): Ditto.
4914         (GetDelegateParameters): Uses quick path for dynamic types.
4915         
4916 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4917
4918         * class.cs (MethodData.Define): EmitContext is required for generic stuff
4919         only.
4920
4921 2007-07-31  Marek Safar  <marek.safar@gmail.com>
4922
4923         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
4924         syntax.
4925         
4926 2007-07-26  Jb Evain  <jbevain@novell.com>
4927
4928         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
4929         which takes a boolean 'report_errors', similar to the GetMethod.
4930         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
4931         in .net 2.1, do not report errors here.
4932
4933         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
4934         System.Runtime.CompilerServices.RequiredAttributeAttribute and
4935         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
4936         in .net 2.1.
4937
4938         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
4939         of the type InternalsVisibleToAttribute before the first call
4940         to CoreLookupType which is allowed to fail (third boolean parameter
4941         to true). Because, during the resolution for a type that is not
4942         immediately found, we try to check if the type is not defined in
4943         a friend assembly, and to do so, we need the
4944         InternalVisibleToAttribute.
4945
4946 2007-07-23  Miguel de Icaza  <miguel@novell.com>
4947
4948         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
4949         feature that allows structs to be compared against null and inline
4950         the result as true or false.
4951
4952         Notice that the same code is not permitted inside a generic block
4953         of code that would do:
4954
4955         class Foo<T> where T : struct {
4956             bool Eval (T x)
4957             {
4958                  return x == null;
4959             }
4960         }
4961
4962         It is only allowed if the type of T is not bound (no where
4963         clause).   In my opinion, this CSC 2 behavior is broken but people
4964         seem to be using it (IronRuby does, a few bug reports on bugzilla
4965         have it and some people have complained about it).
4966
4967         All of the users that depend on this behavior have code that is
4968         very likely broken. 
4969         
4970         * report.cs (Warning, Error): make these take object arguments,
4971         not strings, as that allows us to take advantage of Format.
4972
4973 2007-07-20  William Holmes  <billholmes54@gmail.com>
4974
4975         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
4976           Left member variable for the Count.
4977         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
4978           MemberName.CountTypeArguments to avoid a NRE. 
4979
4980         This code is contributed under the MIT X11 license
4981
4982 2007-07-18  Marek Safar  <marek.safar@gmail.com>
4983
4984         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
4985
4986 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
4987
4988         * doc.cs : generic method arguments are written as ``x while generic
4989           type arguments are `x. Combined with the previous change, fixed bug
4990           #79706.
4991
4992 2007-07-18  Raja R Harinath  <rharinath@novell.com>
4993
4994         Fix #82120
4995         * expression.cs (Binary.ResolveOperator): When converting
4996         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
4997
4998 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
4999
5000         * doc.cs : when T: or whatever x: is specified, it does not really
5001           check the doc comment's syntax correctness. Fixed bug #82006.
5002
5003 2007-07-18  Marek Safar  <marek.safar@gmail.com>
5004
5005         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
5006         LambdaExpression better.
5007         
5008         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
5009         
5010         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
5011         
5012         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
5013         as it can be generated.
5014         
5015         * expression.cs (Invocation.Error_InvalidArguments): Show correct
5016         modifiers.
5017         
5018         * lambda.cs (LambdaExpression): Refactored to share same code with
5019         AnonymousMethodExpression.
5020         
5021 2007-07-17  Marek Safar  <marek.safar@gmail.com>
5022
5023         * anonymous.cs (MakeName): Include host name for easier debugging.
5024         (LambdaMethod): New class for lambda spcecific stuff.
5025         
5026         * attribute.cs: Set EmitContext return type.
5027
5028         * class.cs: Set EmitContext return type.
5029         
5030         * codegen.cs (EmitContext): Return type cannot be null to stop messing
5031         with null/void meaning.
5032         
5033         * iterators.cs (ContainerType): Implemented.
5034         
5035         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
5036         
5037         * statement.cs (Return): Updated to lambda expressions.
5038         (Block.CloneTo): Parent can be null.
5039                 
5040 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5041
5042         A fix for bug #81917
5043         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
5044         
5045         * class.cs (FixedField): Check whether field is in unsafe scope.
5046
5047         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
5048         (FieldExpr.Emit): Fixed buffers cannot be volatile.
5049
5050         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
5051         FieldExpr.
5052         
5053         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
5054                 
5055 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5056
5057         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
5058         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
5059         from Report class.
5060
5061 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5062
5063         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
5064         
5065 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5066
5067         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
5068         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
5069         
5070         * codegen.cs(EmitContext): Add ProbingMode flag.
5071         
5072         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
5073         
5074         * driver.cs: For now set both warning values.
5075         
5076         * ecore.cs (SimpleName): Name is readonly.
5077         (MethodGroup.OverloadResolve): One quick path for probing.
5078         
5079         * expression.cs (Unary): Set Oper r/o.
5080         (Binary): Set Oper r/o.
5081         (ParameterReference): Set few instance variables as r/o.
5082         (ParameterReference.DoResolveBase): Don't capture aruments when 
5083         the probing is on.
5084         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
5085         (Arglist): arguments are private.
5086         (SizeOf): type is private and r/o.
5087         (MemberAccess): arguments are private.
5088
5089         * report.cs: Enhanced reporting on/off capabilities.
5090         
5091         * lambda.cs: Uses ec.IsInProbingMode.
5092         (ContextualReturn): Derives from return.
5093         
5094         * rootcontext.cs: For now set both warning values.
5095         
5096         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
5097         copy if one exists.
5098         (Return.Resolve): Don't die immediately.
5099         (Block.Resolve): Speed-up probing.
5100         (Block.CloneTo): Clone only child blocks.
5101
5102 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
5103
5104         * iterators.cs: reverted Miguel's latest change (r81925) as it
5105         breaks the build in System.
5106
5107 2007-07-13  Miguel de Icaza  <miguel@novell.com>
5108
5109         * iterators.cs (Yield.CheckContext): Check for the iterator type
5110         also here as we can call into Yield even in codepaths that are not
5111         directly checked by
5112         (MethodOrOperator is the only path that was checked).
5113
5114         In addition to the standard check, use a more specific check for
5115         constructors to report a more verbose error. 
5116
5117 2007-07-12  Miguel de Icaza  <miguel@novell.com>
5118
5119         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
5120         report the warning and continue 
5121
5122         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
5123         values on the stack on the call to Emit.   Use EmitStatement if
5124         possible, or using Emit + Pop if not possible.   Fixes #82064
5125
5126 2007-07-12  Raja R Harinath  <rharinath@novell.com>
5127
5128         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
5129         avoid try...finally in some cases.
5130
5131 2007-07-10  Marek Safar  <marek.safar@gmail.com>
5132
5133         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
5134         
5135         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
5136         instead of method. Re-use standard error handling.
5137         (ConstructorInitializer.Emit): Simplified.
5138         
5139         * delegate.cs: Updated after Invocation.EmitCall change.
5140         
5141         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
5142         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
5143         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
5144         method and don't permanently changing input arguments.
5145         (MethodGroupExpr): Introduced resolved best_candidate, when method group
5146         is resolved it has one of the candidates is the best one which is later
5147         used to emit. Removed a few unused method.
5148         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
5149
5150         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
5151         (Binary.ResolveOperator): Ditto.
5152         (ConditionalLogicalOperator.DoResolve): Ditto.
5153         (Invocation): Uses method group.
5154         (Invocation.DoResolve): Simplified.
5155         (Invocation.EmitCall): Removed useless is_static.
5156         (Invocation.Emit): Delegate to method group.
5157         (Invocation.EmitStatement): Simplified.
5158         (New): Uses method group.
5159         (MemberAccess.DoResolve): Don't destroy original expression.
5160         
5161         * statement.cs (ForEach.Resolve): Use null for no method arguments.
5162         
5163 2007-07-04  Marek Safar  <marek.safar@gmail.com>
5164
5165         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
5166         
5167         * anonymous.cs,
5168         * lambda.cs: Add custom error message type.
5169
5170 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5171
5172         * lambda.cs: Simplified little bit.
5173         
5174         * parameter.cs: Introduced ImplicitLambdaParameter.
5175         (Parameters.CreateFullyResolved): New factory instead of ctor.
5176         
5177         * anonymous.cs,
5178         * class.cs,
5179         * delegate.cs: Updated parameter creation.
5180         
5181 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5182
5183         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
5184         arguments.
5185         
5186         * generic.cs: Synchronized with gmcs.
5187         
5188 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5189
5190         * class.cs (Indexer): Check return type as soon as possible.
5191         
5192         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
5193         members too.
5194         
5195         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
5196         
5197         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
5198         
5199         * parameter.cs (Parameter): Use expression type when it is available.
5200         
5201         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
5202         method modifier for the first parameter only.
5203
5204 2007-06-24  Marek Safar  <marek.safar@gmail.com>
5205
5206         A fix for bug #81938
5207         * typemanager.cs (ChangeType): Fixed couple of char conversions.
5208         
5209         * constant.cs: Tide up an exception message.
5210
5211 2007-06-22  Marek Safar  <marek.safar@gmail.com>
5212
5213         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
5214         an uninitialized variable is used.
5215         
5216         * expression.cs (LocalVariableReference.DoResolve): Ditto.
5217
5218 2007-06-22  Marek Safar  <marek.safar@gmail.com>
5219
5220         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
5221         not found error handling.
5222
5223         * expression.cs (ArrayCreation): Removed redundant fields and little bit
5224         simplified.
5225         (ArrayCreation.ResolveArrayElement): To be ready to customization.
5226         (ArrayCreation.DoResolve): Simplified.
5227         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
5228         its own resolve process.
5229         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
5230
5231 2007-06-20  Marek Safar  <marek.safar@gmail.com>
5232
5233         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
5234         more error details.
5235         
5236 2007-06-20  Marek Safar  <marek.safar@gmail.com>
5237
5238         * cs-tokenizer.cs: Removed var related stuff.
5239         
5240         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
5241         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
5242         a type and a keyword at same time.
5243         
5244         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
5245         matches to "var".
5246         
5247         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
5248         implicitly typed arrays, more changes will follow.
5249         
5250         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
5251         
5252 2007-06-19  Marek Safar  <marek.safar@gmail.com>
5253
5254         * ecore.cs (VarExpr): Removed Handled field.
5255         
5256         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
5257         build-in assign functionality.
5258         (ForEach.Resolve): Removed all implicitly typed local variable code and
5259         simplified.
5260         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
5261         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
5262
5263 2007-06-18  Marek Safar  <marek.safar@gmail.com>
5264
5265         * assign.cs: Removed implicitly typed local variable check.
5266         
5267         * expression.cs (LocalVariableReference.DoResolve): Add check for self
5268         referencing implicitly typed local variable.
5269         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
5270         variable here.
5271         
5272         * statement.cs (Fixed): Removed unsupported implicitly typed local
5273         variable code.
5274
5275 2007-06-15  Marek Safar  <marek.safar@gmail.com>
5276
5277         * decl.cs (MemberName): Moved all Unbound stuff to parser.
5278
5279 2007-06-14  Marek Safar  <marek.safar@gmail.com>
5280
5281         A fix for bugs #81855 and #76274
5282         * attribute.cs (AttachTo): Always set owner for global attributes to
5283         prefined owner.
5284         
5285         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
5286         usefull too.
5287         
5288         * cs-parser.jay: Assembly and module attributes must precede all other
5289         elements except using clauses and extern alias declarations.
5290
5291 2007-06-13  Marek Safar  <marek.safar@gmail.com>
5292
5293         A fix for bug #81748
5294         * cs-tokenizer.cs,
5295         * expression.cs: More checks for non ISO-1 features.
5296
5297 2007-06-12  Marek Safar  <marek.safar@gmail.com>
5298
5299         A fix for bug #81807
5300         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
5301         present inside switch statement and it is required by nullable check.
5302
5303 2007-06-12  Marek Safar  <marek.safar@gmail.com>
5304
5305         A fix for bug #81840
5306         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
5307         when type matching fails.
5308         
5309         * namespace.cs: Tiny error message change.
5310
5311 2007-06-12  Marek Safar  <marek.safar@gmail.com>
5312
5313         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
5314         reporting. Added automatic property check.
5315         
5316         * class.cs: Updated after CheckAbstractAndExtern relocation.
5317         (AEventPropertyAccessor.GetSignatureForError): Customized.
5318         
5319 2007-06-11  Marek Safar  <marek.safar@gmail.com>
5320
5321         * class.cs (DefineBaseTypes): Base type can be undefined.
5322         
5323         * ecore.cs (TypeLookup): Minor refactoring.
5324         (DoResolveAsTypeStep): Removed redundant check.
5325
5326         * namespace.cs (Lookup): Removed redundant check.
5327                 
5328         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
5329         ResolveAsTypeTerminal step.
5330         (BootstrapCorlib_*): Simplified.
5331         (PopulateCoreType): Core types can be now external.
5332
5333 2007-06-07  Marek Safar  <marek.safar@gmail.com>
5334
5335         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
5336          verification only.
5337          (InferTypeArguments): Infers anonymous expression type arguments.
5338          (Compatible): Split to Compatible and InferTypeArguments. 
5339         
5340         * lambda.cs: Updated.
5341
5342 2007-06-08  Marek Safar  <marek.safar@gmail.com>
5343
5344         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
5345
5346 2007-06-07  Raja R Harinath  <harinath@gmail.com>
5347
5348         Fix #80477, cs0135-2.cs, cs0135-3.cs
5349         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
5350         names to the "known" variables list.
5351         (Block.CheckInvariantMeaningInBlock): Handle the fact the
5352         parameter names are also "known".
5353         (Block.CheckError136): Remove.
5354         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
5355         null.
5356
5357 2007-06-07  Marek Safar  <marek.safar@gmail.com>
5358
5359         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
5360
5361 2007-06-06  Marek Safar  <marek.safar@gmail.com>
5362
5363         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
5364         internal error not an user error.
5365          
5366         * expression.cs (IsApplicable): Refactored to make debugging easier.
5367
5368         * support.cs: More tricks for non-mono runtimes.
5369         
5370         * typemanager.cs (CoreLookupType): Made public.
5371         (InitSystemCore): All linq specific stuff moved to linq.cs
5372
5373 2007-06-05  Marek Safar  <marek.safar@gmail.com>
5374
5375         * typemanager.cs (CSharpSignature): One more missing build-in types
5376         replacement.
5377         More tricks for non-mono runtime.
5378
5379 2007-06-05  Raja R Harinath  <harinath@gmail.com>
5380
5381         * statement.cs (Block.CheckError136_InParents): Remove.
5382         (Block.AddVariable): Use GetParameterInfo instead.
5383         (ToplevelBlock.ProcessArguments): Likewise.
5384
5385 2007-06-04  Raja R Harinath  <rharinath@novell.com>
5386
5387         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
5388         information too.
5389         (ToplevelBlock.GetParameterInfo): Split out of ...
5390         (ToplevelBlock.GetParameterRefernce): ... this.
5391         (ToplevelBlock.ParameterMap): Remove.
5392         * expression.cs (ParameterReference): Update to use
5393         ToplevelParameterInfo.
5394
5395         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
5396         regression.
5397
5398         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
5399         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
5400
5401         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
5402         (ToplevelBlock.ProcessParameters) ... here.
5403         (ToplevelBlock..ctor): Invoke it.
5404
5405         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
5406         new parameters.
5407
5408         * statement.cs (IKnownVariable): New interface.
5409         (LocalInfo): Implement it.
5410         (ToplevelParameterInfo): New class.
5411         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
5412         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
5413         GetKnownVariableInfo.
5414
5415 2007-06-03  Raja R Harinath  <harinath@gmail.com>
5416
5417         Partly speed up CS0136 error checks.
5418         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
5419         'recurse' parameter.
5420         (Block.DoCheckError136): Only check errors in parameters.  Move
5421         local variable checks ...
5422         (Block.AddVariable): ... here, and ...
5423         (ToplevelBlock.ResolveMeta): ... here.
5424
5425 2007-06-02  Raja R Harinath  <harinath@gmail.com>
5426
5427         * statement.cs (Block.IsChildOf): Remove.
5428
5429         * statement.cs (Statement.Clone): Move special case code ...
5430         (Block.CloneTo): ... here.
5431
5432 2007-05-29  Raja R Harinath  <rharinath@novell.com>
5433
5434         * statement.cs (ToplevelBlock.container): Remove field.  It's
5435         redundant with 'Parent'.
5436         (ToplevelBlock.ContainerBlock): Remove accessor.
5437         (ToplevelBlock..ctor): Update to changes.  Register anonymous
5438         child with parent here, ...
5439         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
5440         current_block.
5441         (start_anonymous): Don't save current_block.
5442         (top_current_block): Remove.
5443
5444         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
5445         (Block.Resolve): Update to changes.
5446         (Block..ctor): Move setting of "correct" 'Toplevel'
5447         and 'Explicit' fields to ...
5448         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
5449
5450 2007-05-27  Raja R Harinath  <harinath@gmail.com>
5451
5452         Kill Block.Implicit
5453         * statement.cs (Block.Implicit): Remove.
5454         (Block): Update to changes.
5455         * flowanalysis.cs: Likewise.
5456
5457         Mildly speed up CheckInvariantMeaningInBlock
5458         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
5459         Recursively call AddKnownVariable to all enclosing blocks.
5460         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
5461         Remove recursive calls.
5462         (Block): Update to changes.
5463
5464         New ExplicitBlock invariants
5465         * statement.cs (Block.Explicit): New field.  It points to the
5466         immediately enclosing non-implicit block.
5467         (Block..ctor): Maintain the invariant.
5468         * cs-parser.jay: Take advantage of invariant.
5469
5470         Introduce ExplicitBlock
5471         * statement.cs (ExplicitBlock): New.
5472         (ToplevelBlock): Derive from it.
5473         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
5474         sense of flag.
5475         (Block.Implicit): Update to changes.
5476         * cs-parser.jay: Update to changes.
5477
5478         Remove unused field
5479         * codegen.cs (EmitContext.IsLastStatement): Remove.
5480         * statement.cs (Block.DoEmit): Update to changes.
5481
5482 2007-05-25  Raja R Harinath  <rharinath@novell.com>
5483
5484         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
5485         modifying current_block directly.
5486
5487 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
5488         
5489         * class.cs: Implemented automatic properties (C# 3.0)
5490           Thanks to Marek for the help.
5491
5492 2007-05-23  Raja R Harinath  <rharinath@novell.com>
5493
5494         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
5495         variable as assigned, note also that all its components are
5496         assigned too.
5497         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
5498
5499 2007-05-19  Marek Safar  <marek.safar@gmail.com>
5500
5501         * anonymous.cs, class.cs: Emit Compiler generated attribute when
5502         member is marked as compiler generated.
5503         
5504         * decl.cs (MemberCore): Refactored ModFlags into property.
5505
5506         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
5507         (Check): Check only accessibility modifiers.
5508
5509 2007-05-18  Raja R Harinath  <rharinath@novell.com>
5510
5511         Track all assignable slots in one bit array
5512         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
5513         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
5514         logic from VariableMap constructor here.  Use the same 'offset'
5515         variable that's later used for computing offsets of local
5516         variables.
5517         * flowanalysis.cs (UsageVector.parameters): Remove.
5518         (UsageVector): Update to changes.
5519         (VariableMap): Remove.
5520
5521         Avoid creating ParameterMap in every block
5522         * statement.cs (Block.ParameterMap): Move ...
5523         (ToplevelBlock.ParameterMap): ... here.
5524         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
5525         only once.
5526         * flowanalysis.cs (FlowBranching.param_map): Remove.
5527         (FlowBranching.UsageVector): Update to changes.
5528         (FlowBranchingToplevel.CheckOutParameters): Likewise.
5529
5530         * statement.cs (Block.CloneTo): Clone Toplevel field too.
5531
5532         * expression.cs (ParameterReference): Distinguish between block
5533         where parameter was referenced and declared.
5534
5535 2007-05-18  Marek Safar  <marek.safar@gmail.com>
5536
5537         * flowanalysis.cs, statement.cs: Put back improved error handling.
5538
5539 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
5540         
5541         * assign.cs:
5542         * expression.cs:
5543           Imporved object and collection initialization (C# 3.0).
5544
5545 2007-05-15  Marek Safar  <marek.safar@gmail.com>
5546
5547         A fix for bug #81380
5548         * expression.cs (Is.DoResolve): Only value types have constant `is'
5549         behaviour.
5550
5551 2007-05-15  Raja R Harinath  <rharinath@novell.com>
5552
5553         * statement.cs (ToplevelBlock.child): Remove.
5554
5555 2007-05-15  Raja R Harinath  <harinath@gmail.com>
5556
5557         Rationalize ResolveMeta: refactoring
5558         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
5559         out constant handling code into ...
5560         (Block.DoResolveConstants): ... this.
5561
5562         Rationalize ResolveMeta: kill local_map
5563         * statement.cs (Block.local_map, Block.LocalMap): Remove.
5564         (Block.AssignableSlots): New.
5565         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
5566         for locals -- move code from VariableMap here.  Avoid unnecessary
5567         allocations.
5568         * flowanalysis.cs (FlowBranching.local_map): Remove.
5569         (FlowBranching..ctor): Use Block.AssignableSlots.
5570         (VariableMap): Remove unused constructors.
5571
5572 2007-05-11  Raja R Harinath  <rharinath@novell.com>
5573
5574         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
5575
5576 2007-05-11  Marek Safar  <marek.safar@gmail.com>
5577
5578         * typemanager.cs (IsFriendAssembly): Should not be called for building
5579         assembly.
5580
5581 2007-05-09  Marek Safar  <marek.safar@gmail.com>
5582
5583         * literal.cs (NullConstant): Print null in all cases.
5584         
5585         * expression.cs (Binary.ResolveOperator): Implemented delegate
5586          comparison based on C# 2.0 changes.
5587
5588 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
5589
5590         This code is contributed under the MIT X11 license
5591         
5592         The following enables support for several C# 3.0 language features:
5593         
5594         * cs-tokenizer.cs: Added support for the "var" keyword.
5595         
5596         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
5597           Added VarExpr class to facilitate type inferencing.
5598         
5599         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
5600           to support anonymous types.
5601         
5602         * assign.cs: Added support for type inferencing and initialization.
5603         
5604         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
5605         
5606         * expression.cs: Added implicit array support to ArrayCreation.
5607           Added 5 types and 1 interface:
5608           
5609           IInitializable                Implementing classes can inject initializing
5610                                         statements after object instantiation.
5611           
5612           Initializer                   Stores data for object initialization.
5613           
5614           AnonymousType                 An expression for anonymous types.
5615           
5616           AnonymousTypeParameter        Stores data about an anonymous type's field.
5617           
5618           NewInitialize                 An expression for object initialization.
5619           
5620           CollectionInitialize          An expression for collection initialization.
5621         
5622         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
5623           statements.
5624
5625 2007-05-06  Marek Safar  <marek.safar@gmail.com>
5626
5627         A fix for bug #81500
5628         * cs-tokenizer.cs: Add special handling for coalescing operator.
5629
5630 2007-05-06  Marek Safar  <marek.safar@gmail.com>
5631
5632         A fix for bug #81529
5633         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
5634         its value from base class until it is redefined.
5635
5636 2007-05-02  Raja R Harinath  <rharinath@novell.com>
5637
5638         Fix regression in cs0631-3.cs
5639         * cs-parser.jay (operator_declarator): Add opt_attributes to error
5640         fallback.  Make error fallback catch more cases.
5641
5642 2007-05-01  Miguel de Icaza  <miguel@novell.com>
5643
5644         * cs-parser.jay: Allow parameters in operator declarations to have
5645         attributes. 
5646
5647 2007-04-27  Miguel de Icaza  <miguel@novell.com>
5648
5649         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
5650         exists. 
5651
5652         * lambda.cs (ContextualReturn.Resolve): An expression is valid
5653         inside the ContextualReturn, it does not have to be an
5654         ExpressionStatement. 
5655
5656 2007-04-24  Miguel de Icaza  <miguel@novell.com>
5657
5658         * lambda.cs (ContextualReturn.Resolve): if the return type is not
5659         set, set it.
5660
5661 2007-04-23  Miguel de Icaza  <miguel@novell.com>
5662
5663         * anonymous.cs (AnonymousContainer): split the virtual Resolve
5664         method in two methods: ResolveNoDefine and Resolve.
5665
5666         ResolveNoDefine will stop just after ResolveTopBlock has been
5667         called.   
5668
5669         Resolve will then continue by creating a method and issuing the
5670         call to method.Define ().
5671
5672         (AnonymousMethod): Split and implement the new Resolve and
5673         ResolveNoDefine as well.
5674
5675         * lambda.cs (LambdaExpression): Split the anonymous method
5676         resolution code into a separate routine (CoreCompatibilityTest)
5677         from DoCompatibleTest.
5678
5679         (LambdaExpression.TryBuild): New method, this method tries to
5680         build the LambdaExpression with the given set of types to be used
5681         as the types for the various parameters of the lambda expression. 
5682
5683         If the compilation succeed with the given types, the infered type
5684         of the Anonymous method is returned, otherwise null is returned.
5685
5686 2007-04-23  Marek Safar  <marek.safar@gmail.com>
5687
5688         A fix for bug #81414
5689         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
5690
5691 2007-04-22  Miguel de Icaza  <miguel@novell.com>
5692
5693         * cs-tokenizer.cs: Change various identifiers here from the
5694         camelCasing to the recommended Linux-like style for instance
5695         variables from the Coding Guidelines. 
5696
5697 2007-04-19  Martin Baulig  <martin@ximian.com>
5698
5699         * convert.cs
5700         (Convert.ImplicitReferenceConversionCore): Allow conversions from
5701         System.Enum to System.ValueType.
5702
5703 2007-04-13  Martin Baulig  <martin@ximian.com>
5704
5705         Rewrote implicit reference conversions.  We need to distinguish
5706         between implicit reference conversions (13.1.4) and implicit
5707         boxing conversions (13.1.5).
5708
5709         According to the spec, there's an an implicit conversion
5710         "From a one-dimensional array-type S[] to IList<T> and base
5711         interfaces of this interface, provided there is an implicit
5712         reference conversion from S to T."  Note that this does not
5713         include boxing conversions.
5714
5715         * convert.cs
5716         (Convert.ImplicitTypeParameterBoxingConversion): New method.
5717         (Convert.ImplicitReferenceConversion): Split into
5718         ImplicitReferenceConversionCore() and
5719         ImplicitBoxingConversionExist().
5720         (Convert.ImplicitReferenceConversionExists): Use the new
5721         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
5722
5723 2007-04-12  Martin Baulig  <martin@ximian.com>
5724
5725         * convert.cs (Convert.ImplicitReferenceConversion): Move the
5726         `TypeManager.null_type' checks up to the top of the method.
5727
5728 2007-04-11  Marek Safar  <marek.safar@gmail.com>
5729
5730         A fix for bug #81350
5731         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
5732         extension methods.
5733
5734 2007-04-11  Martin Baulig  <martin@ximian.com>
5735
5736         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
5737         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
5738         to make this work for generic classes; fixes #79561.
5739
5740 2007-04-11  Martin Baulig  <martin@ximian.com>
5741
5742         * expression.cs (As): Add support for nullable types; fixes #79371.
5743
5744 2007-04-11  Martin Baulig  <martin@ximian.com>
5745
5746         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
5747         `type.FullName' is null; fixes #80243.
5748
5749 2007-04-11  Martin Baulig  <martin@ximian.com>
5750
5751         * expression.cs (Invocation.IsApplicable): Don't modify the method
5752         if type inference succeeded, but the method was not applicable.
5753         Fixes #81250.
5754
5755 2007-04-10  Marek Safar  <marek.safar@gmail.com>
5756
5757         A fix for bug #81324
5758         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
5759         internal and external namespaces containers.
5760
5761 2007-04-10  Martin Baulig  <martin@ximian.com>
5762
5763         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
5764         TypeManager.DropGenericMethodArguments() so we also call
5765         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
5766
5767 2007-04-10  Martin Baulig  <martin@ximian.com>
5768
5769         * iterators.cs (Iterator.CreateIterator): Don't crash if
5770         `method.ReturnType' is null.  This happens if something went wrong
5771         while resolving that typ (we already reported an error in this case).
5772
5773 2007-04-10  Martin Baulig  <martin@ximian.com>
5774
5775         * expression.cs (New.DoResolve): Don't call CheckComImport() on
5776         generic interfaces; report the CS0144 directly.
5777
5778 2007-04-10  Martin Baulig  <martin@ximian.com>
5779
5780         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
5781         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
5782
5783 2007-04-10  Martin Baulig  <martin@ximian.com>
5784
5785         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
5786
5787 2007-04-09  Raja R Harinath  <rharinath@novell.com>
5788
5789         A better fix
5790         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
5791         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
5792
5793         Fix #81338
5794         * statement.cs (For.Resolve): If resolution fails, use
5795         KillFlowBranching.
5796
5797 2007-04-08  Marek Safar  <marek.safar@gmail.com>
5798
5799         * anonymous.cs (MakeName): Make faster and zero-based.
5800         (VerifyExplicitParameterCompatibility): Back to mode where generic
5801         parameter is ignored.
5802         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
5803
5804         * class.cs (EmitType): Method can emit another new method.
5805
5806         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
5807
5808         * driver.cs: Updated.
5809
5810         * lambda.cs: Reuse predefined empty parameters.
5811
5812         * parameter.cs: Updated
5813
5814         * support.cs: Implemented InflateTypes.
5815
5816         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
5817         (InitSystemCore): Introduced to isolate 3.0 dependencies.
5818
5819 2007-04-03  Martin Baulig  <martin@ximian.com>
5820
5821         Fix #80632.
5822
5823         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
5824         version of TypeManager.IsOverride() which also works with generic
5825         types.  
5826
5827 2007-04-03  Martin Baulig  <martin@ximian.com>
5828
5829         Fix #81044.
5830
5831         * convert.cs
5832         (Convert.ExplicitReferenceConversion): We need to cast when
5833         converting from IList<T> to S[].
5834
5835 2007-04-01  Marek Safar  <marek.safar@gmail.com>
5836
5837         * decl.cs (FindExtensionMethods): Consider all candidates with same name
5838         at this level.
5839         
5840         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
5841
5842 2007-03-31  Marek Safar  <marek.safar@gmail.com>
5843
5844         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
5845         argument and return type inferring.
5846
5847         * codegen.cs (InferReturnType): Flag whether return can be inferred.
5848         (ReturnType): Turned to property.
5849
5850         * statement.cs (Return): Implemented return type inferring.
5851
5852         * support.cs (ReflectionParameters): Use local types if possible.
5853
5854 2007-03-30  Raja R Harinath  <rharinath@novell.com>
5855
5856         * flowanalysis.cs (FlowBranching.Reachability): Remove.
5857         (FlowBranching.UsageVector): Update to changes.
5858
5859         Prepare to kill 'Reachability'
5860         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
5861         argument of constructor.
5862
5863 2007-03-29  Raja R Harinath  <rharinath@novell.com>
5864
5865         Prepare to kill 'Reachability'
5866         * flowanalysis.cs (UsageVector.is_unreachable): New.
5867         (UsageVector): Update to maintain 'is_unreachable' in parallel to
5868         'reachability', and verify they're consistent.
5869
5870         Fix #81121
5871         * expression.cs (New.EmitStatement): Handle type parameters here too.
5872
5873 2007-03-29  Martin Baulig  <martin@ximian.com>
5874
5875         Fix #79148.
5876
5877         * anonymous.cs
5878         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
5879         CompilerGeneratedClass.
5880         (ScopeInfo.EmitScopeInstance): Make this protected.
5881         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
5882         `ec.CurrentAnonymousMethod.Scope == Scope'.
5883
5884         * statement.cs (Block.ScopeInfo): Make this a property.
5885
5886 2007-03-27  Raja R Harinath  <harinath@gmail.com>
5887
5888         Prepare to kill 'Reachability'
5889         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
5890         (FlowBranching.UsageVector.Reachability): Remove property.
5891         (FlowBranching.UsageVector.IsUnreachable): New property.
5892         (FlowBranching.UsageVector.ResetBarrier): New.
5893         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
5894         * codegen.cs, statement.cs: Update to changes.
5895
5896 2007-03-27  Martin Baulig  <martin@ximian.com>
5897
5898         Fix #81209.
5899
5900         * decl.cs
5901         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
5902         generic types.
5903
5904 2007-03-26  Raja R Harinath  <rharinath@novell.com>
5905
5906         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
5907         instead of TriState.  Remove all mention of TriState.
5908
5909         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
5910         replaced by a boolean.  Add boolean 'is_unreachable' field, check
5911         and maintain invariants.
5912
5913 2007-03-25  Marek Safar  <marek.safar@gmail.com>
5914
5915         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
5916
5917 2007-03-25  Marek Safar  <marek.safar@gmail.com>
5918
5919         * expression.cs: Stop using obsolete 2.0 opcodes.
5920
5921 2007-03-25  Marek Safar  <marek.safar@gmail.com>
5922
5923         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
5924         one of the latests Martin's fixes.
5925
5926 2007-03-23  Miguel de Icaza  <miguel@novell.com>
5927
5928         * expression.cs: On BigEndian systems, swap the bytes, temporary
5929         solution until we get a new bitconverter class.
5930
5931 2007-03-23  Martin Baulig  <martin@ximian.com>
5932
5933         Fix #81158.
5934
5935         * decl.cs (MemberCache.AddMembers): Add generic methods both as
5936         "Method" and "Method`1".  Normally, a cache lookup is done on the
5937         "Method" form (ie. without the generic arity), but this one makes
5938         lookups on the full form work as well.
5939
5940 2007-03-22  Raja R Harinath  <rharinath@novell.com>
5941
5942         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
5943         unused properties.
5944
5945 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
5946         * class.cs: 
5947         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
5948         ordered_member_list, to TypeBuilder to store members to be defined
5949         in the order they were parsed in.
5950         - ordered_explicit_member_list contains all properties indexers
5951           and methods that are defined as explicit implementation of an
5952           interface or base class.
5953         - ordered_member_list contains all properties indexers and methods
5954           that are not defined as explicit implementation of an interface
5955           or base class.
5956
5957         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
5958         functionality in these removed classes has been replaced with 
5959         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
5960         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
5961
5962         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
5963         to CheckForDuplications inside GetMethod and SetMethod Define Method
5964         to handle method property and indexer name conflicts.
5965
5966         Fixes #79434
5967
5968         All code is contributed under the MIT/X11 license.
5969
5970 2007-03-20  Martin Baulig  <martin@ximian.com>
5971
5972         * class.cs (TypeContainer.Interfaces): Removed; they're now
5973         included in `TypeContainer.Types'.
5974
5975 2007-03-20  Martin Baulig  <martin@ximian.com>
5976
5977         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
5978
5979         * class.cs (TypeContainer.CreateType): New public method.  This is
5980         now called before DefineType() to create the TypeBuilders.
5981         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
5982         has already been created by CreateType().
5983         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
5984         don't resolve our base classes here; this has been moved into
5985         DefineBaseTypes().  We're now called from CreateType().
5986         (TypeContainer.DefineBaseTypes): New private method; resolve our
5987         base classes here.  We're now called from DefineType().
5988
5989         * rootcontext.cs
5990         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
5991         our types first to create all the TypeBuilders.  After that, call
5992         TypeContainer.DefineType() on all the types which'll resolve their
5993         base classes and setup the resolve order.
5994
5995 2007-03-20  Martin Baulig  <martin@ximian.com>
5996
5997         * class.cs (TypeContainer.Enums): Removed; they're now included in
5998         `TypeContainer.Types'.  
5999
6000 2007-03-20  Martin Baulig  <martin@ximian.com>
6001
6002         * class.cs
6003         (TypeContainer.DefineType): Don't call ResolveMembers() here.
6004         (TypeContainer.DoResolveMembers): Call DefineType() on our
6005         `compiler_generated' classes; moved here from DefineNestedTypes().
6006
6007         * rootcontext.cs
6008         (RootContext.ResolveTree): Call ResolveMembers() on all
6009         TypeContainer's in the `type_container_resolve_order'.
6010
6011 2007-03-19  Marek Safar  <marek.safar@gmail.com>
6012
6013         * class.cs: Use corlib to handle InternalMethodImplAttribute.
6014
6015 2007-03-17  Marek Safar  <marek.safar@gmail.com>
6016
6017         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
6018         implementation flags.
6019
6020 2007-03-17  Marek Safar  <marek.safar@gmail.com>
6021
6022         * class.cs: More optimizations for type parameters.
6023
6024 2007-03-15  Marek Safar  <marek.safar@gmail.com>
6025
6026         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
6027
6028         * ecore.cs, parameter.cs: More common code for both corlibs.
6029
6030         * typemanager.cs (IsGenericMethod): Simplified.
6031
6032 2007-03-15  Raja R Harinath  <rharinath@novell.com>
6033
6034         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6035         'returns'.
6036         * statement.cs, iterators.cs, lambda.cs: Update to changes.
6037
6038         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
6039         unconditionally.  Simplify explanation.
6040         (Try.Resolve, Using.Resolve): Likewise.
6041
6042 2007-03-15  Martin Baulig  <martin@ximian.com>
6043
6044         Fix #80731.
6045
6046         * decl.cs (DeclSpace): If we're a partial class, use our
6047         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
6048
6049 2007-03-15  Raja R Harinath  <rharinath@novell.com>
6050
6051         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6052         'throws'.
6053         (FlowBranching.UsageVector): Update to changes.
6054         (FlowBranching.MergeSiblings): Likewise.
6055         * statement.cs: Likewise.
6056
6057 2007-03-15  Martin Baulig  <martin@ximian.com>
6058
6059         Fix #79302.
6060
6061         * decl.cs
6062         (MemberCache): Added a special .ctor for type parameters.
6063
6064         * typemanager.cs
6065         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
6066         `MemberCache'.  
6067
6068 2007-03-09  Martin Baulig  <martin@ximian.com>
6069
6070         * enum.cs (Enum): Make this a TypeContainer.
6071         (EnumMember): Derive from `Const'.
6072
6073         * const.cs
6074         (Const.DoResolveValue): New protected virtual method; move most of
6075         the functionality of ResolveValue() here so we can override it in
6076         `EnumMember'.
6077         (Const.CreateConstantReference): Make this virtual.
6078
6079         * class.cs (Kind): Add `Kind.Enum'.
6080         (TypeContainer.Emit): Don't emit the enums here; they're already
6081         in the `RootContext.typecontainer_resolve_order'.
6082
6083         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
6084         here; they're already in the `typecontainer_resolve_order'.
6085
6086         * ecore.cs (EnumConstant.ConvertImplicitly): Add
6087         TypeManager.DropGenericTypeArguments().
6088
6089         * typemanager.cs
6090         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
6091         (TypeManager.IsEnumType): Likewise.
6092         (TypeManager.EnumToUnderlying): Likewise.
6093         (TypeManager.IsEqual): Add support for enums.
6094
6095 2007-03-12  Raja R Harinath  <rharinath@novell.com>
6096
6097         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
6098         DefaultParameterValueAttribute to be undefined, say if System.dll
6099         is not referenced.
6100
6101 2007-03-11  Marek Safar  <marek.safar@gmail.com>
6102
6103         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
6104         any mscorlib.
6105
6106 2007-03-10  Marek Safar  <marek.safar@gmail.com>
6107
6108         * class.cs, parameter.cs: Unified parameters verification.
6109
6110 2007-03-08  Martin Baulig  <martin@ximian.com>
6111
6112         * cs-parser.jay (constructor_header): Pass the location to the
6113         newly created TopLevelBlock.
6114
6115 2007-03-07  Martin Baulig  <martin@ximian.com>
6116
6117         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
6118
6119 2007-03-06  Miguel de Icaza  <miguel@novell.com>
6120
6121         * convert.cs (ExplicitReferenceConversionExists): Sync this method
6122         with the changes from David, fixes the build.
6123
6124 2007-03-05  David Mitchell  <dmitchell@logos.com>
6125
6126         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
6127         and its base interfaces to a one-dimensional array type S[],
6128         provided there is an implicit or explicit reference conversion
6129         from S to T.
6130
6131 2007-03-03  Marek Safar  <marek.safar@gmail.com>
6132
6133         * cs-tokenizer.cs: Implemented basic linq grammar.
6134
6135         * driver.cs: Set linq lang version on demand.
6136
6137 2007-02-26  Marek Safar  <marek.safar@gmail.com>
6138
6139         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
6140
6141 2007-02-25  Marek Safar  <marek.safar@gmail.com>
6142
6143         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
6144         (Fixes #80455)
6145
6146         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
6147         here.
6148         Check property and event extern attributes.
6149
6150         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
6151         charset.
6152
6153 2007-02-24  Marek Safar  <marek.safar@gmail.com>
6154
6155         A fix for bug #80407
6156         * ecore.cs: Don't report ambiguity error when methods have same parent.
6157
6158 2007-02-23  Marek Safar  <marek.safar@gmail.com>
6159
6160         A fix for bug #80878
6161         * class.cs, cs-parser.jay: Event property can host anonymous methods.
6162
6163 2007-02-22  Marek Safar  <marek.safar@gmail.com>
6164
6165         * attribute.cs: Enable ExtensionAttribute presence test.
6166
6167 2007-02-22  Marek Safar  <marek.safar@gmail.com>
6168
6169         * class.cs: Warn about missing GetHashCode only when Equals is override.
6170
6171         * decl.cs: Check accessibility of type arguments.
6172
6173         * typemanager.cs: Correctly report nullable array.
6174
6175 2007-02-20  Marek Safar  <marek.safar@gmail.com>
6176
6177         * class.cs, report.cs: Capture more details when things go wrong.
6178
6179 2007-02-20  Marek Safar  <marek.safar@gmail.com>
6180
6181         A fix for bug #80650
6182         * cs-parser.jay: Anonymous container starts at constructor declaration
6183         and not at block beginning because it has to be usable in constructor
6184         initializer.
6185
6186         * statement.cs: Use context location and not block one for error reporting.
6187
6188 2007-02-18  Marek Safar  <marek.safar@gmail.com>
6189
6190         A fix for bug #78712
6191         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
6192         too.
6193
6194 2007-02-18  Marek Safar  <marek.safar@gmail.com>
6195
6196         A fix for bug #80493 by Atsushi Enomoto
6197         * cs-parser.jay: Ignore invalid attribute target.
6198
6199 2007-02-18  Marek Safar  <marek.safar@gmail.com>
6200  
6201         * cs-tokenizer.cs: Ignore '\0' as white space character.
6202
6203 2007-02-17  Miguel de Icaza  <miguel@novell.com>
6204
6205         * cs-parser.jay: Add support for lambda expressions to the mcs
6206         compiler as well.
6207
6208         * lambda.cs: Only clone when we are probing, not on the final call
6209         (Compatible is the final call). 
6210
6211         * statement.cs (CloneContext): Introduce class to provide block
6212         remapping during clone.
6213
6214         All statements Clone themselves now.
6215
6216         (Clone): special handling for blocks, when we clone a block, we
6217         register the block inside this routine, as children of the block
6218         might trigger a lookup. 
6219         
6220         * expression.cs: Add support for CloneContext in all expressions. 
6221         
6222 2007-02-17  Marek Safar  <marek.safar@gmail.com>
6223  
6224         A fix for bug #80493
6225         * statement.cs: Report ambiguous warning when interfaces are not related.
6226
6227 2007-02-15  Marek Safar  <marek.safar@gmail.com>
6228
6229         C# 3.0 extension methods.
6230
6231         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
6232         cannot be used directly.
6233
6234         * class.cs (Class.Emit): Emit extension attribute if any class method
6235         is extension method.
6236         (Method.Define): Add basic extension method validation conditions.
6237         (Method.Emit): Emit extension attribute for method.
6238
6239         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
6240         extension method exists. Currently we follow same approach as Microsoft
6241         does, emit even if a method or a class are private but this can change
6242         later.
6243
6244         * cs-parser.jay: Add handling of `this' keyword in method parameters
6245         context.
6246
6247         * decl.cs (DeclSpace.IsStaticClass): New property.
6248         (MemberCache.FindExtensionMethods): Looks for extension methods with
6249         defined name and extension type.
6250
6251         * doc.cs: Updated after OverloadResolve changes.
6252
6253         * driver.cs: Add new soft reference to System.Core.dll.
6254
6255         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
6256         (ExtensionMethodGroupExpr): Represents group of extension methods.
6257
6258         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
6259         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
6260         to MethodGroupExpr and made non-static for easier customization.
6261         (Invocation.DoResolve): Add extension method lookup when no standard
6262         method was found.
6263         (MemberAccess.DoResolve): Try extension methods if no member exists.
6264
6265         * modifiers.cs: Add METHOD_EXTENSION modifier.
6266
6267         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
6268         as well as candidate extension type.
6269         (ComputeNamespaces): When assembly constains extension methods registers
6270         them.
6271         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
6272         extension method lookup.
6273         (Namespace.LookupExtensionMethod): Looks for extension method in this
6274         namespace.
6275         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
6276         find a method which matches name and extensionType.
6277
6278         * parameter.cs (Parameter): Add This modifer.
6279         (HasExtensionMethodModifier): New property.
6280         (Resolve): Add extension parameter check.
6281         (ModFlags): turned to property to exclude this modifier as it is not real
6282         parameter modifier.
6283         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
6284
6285         * support.cs (ParameterData): Add ExtensionMethodType.
6286         (ReflectionParameters): Implemented ExtensionMethodType interface property.
6287
6288         * typemanager.cs: Add type and ctor extension attribute type.
6289
6290 2007-02-15  Miguel de Icaza  <miguel@novell.com>
6291
6292         * report.cs (DisableErrors, EnableErrors): used to prevent error
6293         output when we are "trying" to compile various methods with
6294         different types. 
6295
6296         * ecore.cs (Expression): Add Clone method that calls the virtual
6297         CloneTo method.  The current CloneTo method in Expression throws
6298         an exception so we can track down all the places where this must
6299         be implemented (not using abstract, because that would be a lot of
6300         up-front-work before we can start testing the implementation
6301         idea). 
6302
6303         Important: we only need Clone capabilities for expressions created
6304         by the parser, as the expressions we will be cloning are
6305         expressions in the pre-resolved state.   This vastly simplifies
6306         the work required. 
6307         
6308         (SimpleName): Add CloneTo that does nothing.
6309         (EmptyCast): Add CloneTo.
6310         
6311         * expression.cs (Binary): Implement CloneTo.
6312         (Invocation.IsApplicable): Store the current ec in
6313         EmitContext.TempEc and restore it on return.  This is used so we
6314         do not have to sprinkle hundres of methods with an extra
6315         EmitContext, we know that the only user is the lambda expression
6316         ImplicitConversionExists code. 
6317         
6318         (Argument): Add Cloning capabilities.
6319         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
6320         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
6321         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
6322         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
6323         IndexerAccess): Add Clone capability.
6324
6325         (LocalVariableReference, This): TODO: needs cloned Block mapping.
6326
6327         (Argument): Add cloning capability.
6328
6329         * assign.cs (Assign): Implement CloneTo.
6330
6331         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
6332         
6333         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
6334         version by calling Convert with the EmitContext (that we are
6335         currently storing in ec, this is not great, but will do for now,
6336         to avoid passing EmitContext parameters to hundreds of functions
6337         that do not need them now).
6338
6339         (SetExpression): Remove, it is not needed.
6340         
6341         (ContextualReturn): Implement CloneTo.
6342
6343         * statement.cs (Statement): Implement cloning infrastructure,
6344         similar to expressions.
6345
6346         (Block): Partial implementation of Clone for statements.
6347
6348         (Return): Implement clone.
6349         
6350         * constant.cs (Constant.CloneTo): New method, does nothing.
6351
6352         * codegen.cs (TempEc): Add a static EmitContext as a temporary
6353         solution, until we decide how to exactly do this.  
6354         
6355 2007-02-14  Marek Safar  <marek.safar@gmail.com>
6356  
6357         A fix for bug #80493
6358         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
6359         a property is override we need to use second accessor.
6360
6361 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6362  
6363         A fix for bug #80418
6364         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
6365         methods.
6366
6367 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6368
6369         Another fix for bug #80749
6370         * pending.cs: Abstract class has priority over interfaces.
6371
6372 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6373
6374         Another fix for bug #80749
6375         * pending.cs: Abstract class has priority over interfaces.
6376
6377 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6378
6379         Another fix for bug #80749
6380         * pending.cs: Abstract class has priority over interfaces.
6381
6382 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6383
6384         Another fix for bug #80749
6385         * pending.cs: Abstract class has priority over interfaces.
6386
6387 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6388
6389         * class.cs Better error message.
6390
6391         * driver.cs: Add shorter versions of -optimize option.
6392
6393 2007-02-13  Martin Baulig  <martin@ximian.com>
6394
6395         * class.cs (Constructor.Emit): Check the return value of
6396         ec.ResolveTopBlock() and return on error.
6397
6398 2007-02-13  Raja R Harinath  <rharinath@novell.com>
6399
6400         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
6401         message to fix error message regression.
6402
6403 2007-02-12  Marek Safar  <marek.safar@gmail.com>
6404
6405         * delegate.cs: Delegate creation expression cannot be of Nullable type.
6406
6407 2007-02-12  Marek Safar  <marek.safar@gmail.com>
6408
6409         A fix for bug #80749
6410         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
6411         its parent container.
6412
6413         * class.cs (DefineFieldInitializers): Each initializer can has different
6414         resolve context.
6415
6416         * const.cs: Updated.
6417
6418 2007-02-11  Miguel de Icaza  <miguel@novell.com>
6419
6420         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
6421         now all the heavy lifting to check that embedded statements or
6422         expressions have the right form is done in the ContextualReturn.
6423
6424         (ContextualReturn): New class.  
6425
6426         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
6427         method that can be invoked to report 201, so we do not replicate
6428         this everywhere.
6429
6430         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
6431         
6432         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
6433         treating tabs as spaces. 
6434
6435 2007-02-09  Marek Safar  <marek.safar@gmail.com>
6436
6437         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
6438         * assign.cs: Use full implicit conversion for right side check.
6439
6440 2007-02-09  Marek Safar  <marek.safar@gmail.com>
6441
6442         * statement.cs (Switch): Switch over boolean type is not standardized.
6443
6444 2007-02-08  Marek Safar  <marek.safar@gmail.com>
6445
6446         A fix for bug #80755
6447         * decl.cs (FindBaseEvent): Don't use method cache for events.
6448
6449 2007-02-07  Marek Safar  <marek.safar@gmail.com>
6450
6451         * cs-parser.jay: Better syntax error handling.
6452
6453         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
6454         instead of underlying type value.
6455
6456 2007-02-06  Marek Safar  <marek.safar@gmail.com>
6457
6458         * driver.cs: Check define identifier before is registered.
6459
6460         * namespace.cs: Use existing error message.
6461
6462         * report.cs: New warning.
6463
6464 2007-02-06  Marek Safar  <marek.safar@gmail.com>
6465
6466         A fix for bug #80742
6467         * expression.cs: Delegate Invoke method can be called directly.
6468
6469 2007-02-06  Marek Safar  <marek.safar@gmail.com>
6470
6471         A fix for bug #80676
6472         * class.cs (IsEntryPoint): The Main method can have params modifier.
6473
6474 2007-02-04  Miguel de Icaza  <miguel@novell.com>
6475
6476         * parameter.cs (Parameter, Parameters): Add Clone method.
6477
6478         * anonymous.cs (Compatible): Turn method into virtual method, so
6479         LambdaExpression can implement a different behavior.
6480
6481         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
6482         out the basic checking here, so it can be used by
6483         LambdaExpressions.
6484         
6485         * lambda.cs: Introduce "Compatible" function that will do the
6486         heavy lifting.
6487
6488 2007-02-02  Marek Safar  <marek.safar@gmail.com>
6489
6490         * attribute.cs: Unified one error message.
6491
6492         * class.cs (Class): Use type attributes and not properties to test static
6493         class.
6494         (IsEntryPoint): Don's pass local variable.
6495
6496         * convert.cs: Removed duplicate check.
6497
6498         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
6499
6500         * driver.cs: Don't crash when soft reference does not exist.
6501
6502         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
6503         (UsingEntry): Removed redundant allocation.
6504
6505         * parameter.cs: Add fast path for type parameters.
6506
6507         * support.cs: Don't allocate attribute when it's not used.
6508
6509 2007-01-30  Miguel de Icaza  <miguel@novell.com>
6510
6511         * anonymous.cs
6512         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
6513         this into a virtual method, so we can override it in LambdaExpression.
6514
6515         * driver.cs: Improve diagnostics in case of failure. 
6516
6517         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
6518         write a function that is slightly more complex and that parses:
6519
6520         type identifier [, type identifier]* )
6521
6522         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
6523         this expression:
6524
6525                 (canEmpty ? i >= 0 : i > 0)
6526
6527 2007-01-30  Raja R Harinath  <rharinath@novell.com>
6528
6529         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
6530         exception on possibly valid code.
6531
6532 2007-01-29  Raja R Harinath  <rharinath@novell.com>
6533
6534         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
6535         Push/PopPosition.
6536         (parse_opt_type_arguments): Remove.  It's almost the same as
6537         parse_less_than.
6538         (parse_namespace_or_typename): Use parse_less_than.
6539
6540 2007-01-28  Miguel de Icaza  <miguel@novell.com>
6541
6542         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
6543         this bug took a few hours to find, because the state saved and
6544         restored by PushPosition and PopPosition was ignoring the state of
6545         parse_generic_less_than.
6546
6547         I can also now remove the handling of OP_LT and OP_GT, this solves
6548         the big mistery.
6549         
6550         * cs-tokenizer.cs: store the location for the ARROW token, we use
6551         that in the parser.
6552
6553         (PushPosition, PopPosition): save/restore also `current_token',
6554         restore `parse_generic_less_than' (was missing).
6555
6556         (parse_opt_type_arguments): use parse_type, not
6557         parse_namespace_or_typename to parse types.
6558
6559         * lambda.cs: Empty new file, will eventually have the lambda
6560         expression implementation.
6561
6562         * lambda.test: used to test the internal tokenizer. 
6563
6564         * report.cs (FeatureIsNotISO1): Rename from
6565         FeatureIsNotStandardized, because it was about the language level
6566         (1 vs 2) it was not about standarization.
6567
6568         (FeatureRequiresLINQ): New.
6569
6570         * support.cs (SeekableStreamReader): Only require that the reader
6571         is a TextReader, not a StreamReader, so we can plug StringReader. 
6572
6573         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
6574         given position in the input stream the following tokens can be
6575         parsed as a type followed by an identifier.
6576
6577         (is_punct): after a '(' if parse_type_and_parameter returns true,
6578         then return a special token OPEN_PARENS_LAMBDA which is used to
6579         avoid reduce/reduce errors in the grammar for the
6580         lambda_expression rules.
6581
6582         (parse_type): implement a type parser inside the
6583         tokenizer, the parser only returns true or false depending on
6584         whether the input at a given position can be parsed as a type.
6585
6586         (peek_token): new method used during type parsing.
6587
6588 2007-01-28  Raja R Harinath  <rharinath@novell.com>
6589
6590         Fix #80531
6591         * anonymous.cs (ScopeInfo.InflateParameters): New.
6592         (AnonymousContainer.Resolve): Use it to redirect types of
6593         delegate parameters.
6594
6595 2007-01-27  Raja R Harinath  <rharinath@novell.com>
6596
6597         Fix #80530
6598         * expression.cs (Error_InvalidArguments): Don't use two different
6599         messages for CS1503.  Use ExtraInformation and
6600         SymbolRelatedToPreviousError instead.
6601
6602         Fix #80358
6603         * decl.cs (DeclSpace.initialize_type_params): Don't access
6604         'type_params' of a partial class directly.
6605
6606 2007-01-26  Miguel de Icaza  <miguel@novell.com>
6607
6608         * constant.cs: Removed a handful of out-of-range checks that were
6609         not necessary. 
6610
6611 2007-01-25  Marek Safar  <marek.safar@gmail.com>
6612
6613         * expression.cs (CheckUselessComparison): Add additional check for char
6614         constants.
6615
6616         * namespace.cs: Fixed typo.
6617
6618 2007-01-23  Miguel de Icaza  <miguel@novell.com>
6619
6620         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
6621         gone, instead we inline the test, preventing the needless casts to
6622         longs, ulongs and doubles for the parameters, avoiding calls to
6623         methods that overchecked stuff, and instead inlined things
6624         nicely. 
6625
6626 2007-01-20  Marek Safar  <marek.safar@gmail.com>
6627
6628         * cs-parser.jay: Better parameter error handling.
6629
6630 2007-01-17  Marek Safar  <marek.safar@gmail.com>
6631
6632         A fix for bug #80368, #80522
6633         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
6634         whether array initializer contains constants only.
6635         (ArrayCreation.Emit): Use better formula to decide when
6636         are array initializers for static initialization.
6637         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
6638         have to emit even constants otherwise they are pre-initialized.
6639
6640 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
6641             Raja R Harinath  <rharinath@novell.com>
6642
6643         Fix emit order of 'get' vs. 'set'.
6644         * support.cs (Accessors): New.
6645         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
6646         Note the order in which accessors are declared in the source.
6647         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
6648         Refactored from Property.Define and Indexer.Define.
6649         (PropertyBase.DefineAccessors): New helper that calls the above in
6650         appropriate order as noted by the parser.
6651         (Property.Define, Indexer.Define): Update to changes.
6652         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
6653
6654 2007-01-17  Raja R Harinath  <rharinath@novell.com>
6655
6656         Fix cs0029-6.cs and gcs0029-2.cs (regression)
6657         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
6658         there's an implicit conversion from the current type to the target
6659         type before converting the underlying constant.
6660
6661 2007-01-16  Marek Safar  <marek.safar@gmail.com>
6662
6663         * const.cs (ResolveValue): Updated after constant conversion was made more
6664         generic.
6665
6666         * constant.cs (GetAttributableValue): constant to object conversion is
6667         used for attributes only.
6668         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
6669         constant conversions.
6670         (LongConstant.ConvertImplicitly): Ditto.
6671
6672         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
6673         (ImplicitConversionStandard): Handle constant conversion as extra step.
6674         It solves the issue when constant conversion was called indirectly like
6675         inside array initializer and constant folding was skipped.
6676
6677         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
6678         this change.
6679
6680         * statement.cs(ImplicitConversionStandard): Updated after constant
6681         conversion was made more generic.
6682
6683 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
6684
6685         * expression.cs (As.DoResolve): Use GenericConstraints instead of
6686         Constraints, solves the problem where the compiler incorrectly
6687         reported that a type parameter was not constrained to a class (Bug
6688         80518)
6689
6690 2007-01-14  Marek Habersack  <grendello@gmail.com>
6691
6692         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
6693
6694 2007-01-14  Marek Safar  <marek.safar@gmail.com>
6695
6696         A fix for bug #80368
6697         * assign.cs (FieldInitializer): New class implements field
6698         initializer statement.
6699
6700         * attribute.cs: Update after FieldMember rename.
6701
6702         * class.cs (PropertyBasedMember): New common class for property based
6703         types.
6704         (InterfaceMemberBase): New base class for all members which can be used as
6705         an interface members.
6706         (MethodCore): Moved really common code to InterfaceMemberBase.
6707         (Method.Define): Equal and GetHasCode detection is relevant for methods
6708         only.
6709         (MethodData.Define): Don't assume that public event implements an
6710         interface automatically.
6711         (MethodData.DefineMethodBuilder): Issue an error even if only extern
6712         modifier is used.
6713         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
6714         (FieldMember): Merged with FieldBase.
6715         (EventProperty.AEventPropertyAccessor): New specialization to check whether
6716         event extern modifier can be used.
6717         (EventField.EventFieldAccessor): Moved event field specific code here.
6718         (Event.AllowedModifiers): Even event can be extern.
6719         (Event.FindOutBaseMethod): New override specific to events.
6720         (Indexer.parameters): Reintroduce parameters because base class holds
6721         only properties common data.
6722         (Indexer.CheckForDuplications): Indexers are threated as methods so we
6723         need do extra parameters check.
6724
6725         * const.cs: Update after FieldMember rename.
6726
6727         * decl.cs (MemberCache.FindBaseEvent): New method.
6728
6729         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
6730         to reflect that indexer is now derived from PropertyBased.
6731
6732         * ecore.cs (GetMemberType): Made public.
6733         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
6734         obsolete event.
6735
6736         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
6737         
6738         * typemanager.cs (CSharpSignature): Correctly print event accessors.
6739         (RegisterEvent): Removed.
6740         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
6741         (GetPrivateFieldOfEvent): Renamed to GetEventField.
6742
6743 2007-01-11  Raja R Harinath  <rharinath@novell.com>
6744
6745         Fix #80249
6746         * statement.cs (CollectionForeach.TryType): Prefer generic
6747         GetEnumerator over non-generic variant.  Fix code to follow comments.
6748
6749 2007-01-09  Raja R Harinath  <rharinath@novell.com>
6750
6751         Fix #80446
6752         * support.cs (ReflectionParameter): Don't use an invalid index on
6753         the generic parameter data.
6754
6755 2007-01-08  Miguel de Icaza  <miguel@novell.com>
6756
6757         * driver.cs: Just add a tiny bit of infrastructure.
6758
6759 2007-01-02  Marek Safar  <marek.safar@gmail.com>
6760
6761         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
6762         where field type is struct from current assembly.
6763         
6764         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
6765         it is possible.
6766
6767 2007-01-02  Marek Safar  <marek.safar@gmail.com>
6768
6769         A fix for bug #80381
6770         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
6771         the core types.
6772
6773         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
6774         messages.
6775         (Namespace.LookupType): Always use core types from corlib when speficied.
6776
6777         * report.cs: A new warning.
6778
6779         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
6780         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
6781         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
6782
6783         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
6784         (InitCoreTypes): Set expression type of object_type and value_type
6785         immediately after lookup.
6786
6787 2007-01-01  Miguel de Icaza  <miguel@novell.com>
6788
6789         * cs-tokenizer.cs: Accept Pc class characters (Connector
6790         Punctuation) as valid identifiers.  Fixes #78259
6791
6792         * expression.cs (Invocation.DoResolve): Moved the check for the
6793         use of `this' for doing method calls to the Invocation resolution
6794         step, after overload resolution has taken place instead of doing
6795         the check at the low-level `This.DoResolve' level.
6796
6797         The `This.DoResolve'(appens before overload resolution, so it has
6798         no way of knowing if the method that will be called will be
6799         instace or static, triggering an erroneous report for cs0188 (Bug
6800         78113).
6801
6802         We now do the check for instance method invocations after we know
6803         what method will be called.
6804
6805         (This.CheckThisUsage): Move the actual use of this structure
6806         checking into its own method and expose it. 
6807
6808         * Everywhere that called Error_ValueCannotBeConverted: pass a new
6809         EmitContext.
6810
6811         Exceptions: Null.ConvertImplicitly,
6812         Constant.ImplicitConversionRequired as there are too many call
6813         sites for passing the ec. 
6814
6815         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
6816         EmitContext, if the value is null, then we do not try to provide
6817         the extra information from the error (If a userdefined conversion
6818         exists, as UserDefinedConversion requires a non null-EmitContext).
6819
6820         Fixes: #80347
6821
6822 2006-12-30  Raja R Harinath  <rharinath@novell.com>
6823
6824         * flowanalysis.cs (MyBitVector): Document some invariants.
6825         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
6826         introduced below, and add a couple of others, 
6827
6828 2006-12-30  Marek Safar  <marek.safar@gmail.com>
6829
6830         * attribute.cs (GetMethodObsoleteAttribute): Uses new
6831         GetPropertyFromAccessor and GetEventFromAccessor.
6832         
6833         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
6834         overrides non-obsolete one.
6835         (Indexer.Define): Error message has been moved to the parser.
6836
6837         * cs-parser.jay: Better syntax errors handling.
6838
6839         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
6840         when an invocation has no arguments.
6841
6842         * ecore.cs: Removed not used caching.
6843
6844         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
6845         implementation.
6846
6847         * report.cs: Add a new warning.
6848
6849         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
6850
6851         * typemanager.cs (enumeration_type): Removed.
6852         (CSharpSignature): Reuses IsSpecialMethod.
6853         (IsEqual): Hack for MS BCL.
6854         (GetPropertyFromAccessor): New method.
6855         (GetEventFromAccessor): New method.
6856         (IsSpecialMethod): Fixed to handle more cases.
6857
6858 2006-12-30  Marek Safar  <marek.safar@gmail.com>
6859
6860         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
6861         Made white spaces array static.
6862
6863         * ecore.cs (RemoveGenericArity): Optimized.
6864
6865         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
6866         10 times faster).
6867         (MyBitVector.initialize_vector): Simplified.
6868
6869 2006-12-22  Miguel de Icaza  <miguel@novell.com>
6870
6871         * ecore.cs: Am not entirely happy with this hack, but it seems to
6872         address the issue in 80257 (a small test case for
6873         CreativeDocs.NET). 
6874
6875         I set the MethodGroupExpr.Type to an internal compiler type
6876         (itself in this case) to force the resolution to take place.   Why
6877         it does not take place with a null is beyond me.
6878
6879 2006-12-20  Marek Safar  <marek.safar@gmail.com>
6880
6881         A fix for bug #80288
6882         * expression.cs (ResolveOperator): Consider user defined conversion for
6883         logical and operator too.
6884         (EmitBranchable): Optimization for logical and when full constant folding
6885         could not be applied but one operand is constant.
6886
6887 2006-12-19  Marek Safar  <marek.safar@gmail.com>
6888
6889         * class.cs (GetClassBases): Write 5 times every day, will never use
6890         FullName for error reporting.
6891
6892         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
6893
6894 2006-12-19  Martin Baulig  <martin@ximian.com>
6895
6896         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
6897         the symbol file info here.
6898
6899 2006-12-18  Marek Safar  <marek.safar@gmail.com>
6900
6901         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
6902         of `elseif' is taking then following sections are not taking.
6903         Fixes an issue reported on mono mailing list.
6904
6905 2006-12-18  Marek Safar  <marek.safar@gmail.com>
6906
6907         A fix for bug #80300
6908         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
6909         a caller is not taking.
6910
6911 2006-12-18  Raja R Harinath  <rharinath@novell.com>
6912
6913         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
6914         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
6915         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
6916         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
6917         * class.cs: Update to changes.
6918
6919 2006-12-17  Marek Safar  <marek.safar@gmail.com>
6920
6921         A fix for bug #79934
6922         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
6923         partial container.
6924
6925         * class.cs (ResolveMembers): Register an iterator in current container and
6926         not in shared one.
6927
6928 2006-12-16  Raja R Harinath  <rharinath@novell.com>
6929
6930         Fix test-543.cs
6931         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
6932         satisfy a params annotated parameter.
6933
6934 2006-12-16  Marek Safar  <marek.safar@gmail.com>
6935
6936         A fix for bug #77014
6937         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
6938         paramters correctly and not rely on hacks in Parameters class.
6939         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
6940         at any possition.
6941         (Invocation.VerifyArgumentsCompat): Ditto.
6942         (Invocation.EmitArguments): Changed to correctly emit params arguments at
6943         any possition.
6944
6945         * parameter.cs (HasParams): Don't assume that params is the last one.
6946
6947         * support.cs (ReflectionParameters.ctor): Look for params attribute
6948         correctly.
6949         (ReflectionParameters.ParameterType): Removed hack when we returned last
6950         parameter for out of range parameters.
6951         (ParameterName, ParameterModifier): Ditto.
6952
6953 2006-12-14  Marek Safar  <marek.safar@gmail.com>
6954
6955         A fix for bug #79987
6956         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
6957         when assembly is not CLS compliant but type is. I have no idea why is this
6958         allowed.
6959
6960         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
6961
6962 2006-12-13  Miguel de Icaza  <miguel@novell.com>
6963
6964         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
6965         in struct constructors, they are basically no-ops.
6966
6967 2006-12-12  Marek Safar  <marek.safar@gmail.com>
6968
6969         * cs-tokenizer.cs (Position): Save preprocessor status too.
6970
6971 2006-12-12  Marek Safar  <marek.safar@gmail.com>
6972
6973         A fix for bug #77794
6974         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
6975
6976 2006-12-12  Marek Safar  <marek.safar@gmail.com>
6977
6978         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
6979         Fixes #69299.
6980         (pp_expr): Report error for an invalid expression.
6981         (handle_preprocessing_directive): Simplified; add more error checking.
6982
6983 2006-12-11  Marek Safar  <marek.safar@gmail.com>
6984
6985         A fix for bug #74939
6986         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
6987         directives handling.
6988
6989 2006-12-10  Marek Safar  <marek.safar@gmail.com>
6990
6991         A fix for bugs #80093, and #75984
6992         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
6993         logic, it seems to me as it worked before "by coincidence".
6994         (xtoken): Simplified to use reworked handle_preprocessing_directive.
6995         (cleanup): Enabled endif check.
6996
6997 2006-12-09  Marek Safar  <marek.safar@gmail.com>
6998
6999         A fix for bug #80162
7000         * statement.cs (CollectionForeach.TryType): Generics and non-generics
7001         enumerators are never ambiguous.
7002
7003 2006-12-08  Raja R Harinath  <rharinath@novell.com>
7004
7005         Fix #80060
7006         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
7007
7008 2006-12-06  Marek Safar  <marek.safar@gmail.com>
7009
7010         A fix for bug #80144
7011         * class.cs (EventProperty.Define): Explicit implementation means
7012         that an even is used.
7013
7014 2006-12-06  Marek Safar  <marek.safar@gmail.com>
7015
7016         Fixes the operators implementation (part II)
7017
7018         * cfold.cs (DoConstantNumericPromotions): Renamed to
7019         DoBinaryNumericPromotions and simplified.
7020         (BinaryFold): Couple of conversion fixes; simplified.
7021
7022         * constant.cs, ecore.cs, literal.cs
7023         (ToType): Renamed to ConvertImplicitly.
7024         (Reduce): Renamed to ConvertExplicitly.
7025
7026         * class.cs, convert.cs: Updated.
7027
7028         * expression.cs: TryReduce doesn't throw an exception.
7029
7030 2006-12-01  Marek Safar  <marek.safar@gmail.com>
7031
7032         A fix for bug #80108
7033         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
7034         compatible.
7035
7036 2006-11-30  Marek Safar  <marek.safar@gmail.com>
7037
7038         Fixes unary operators implementation (part I)
7039         Also fixes #80026
7040
7041         * cfold.cs (Error_CompileTimeOverflow): Made internal
7042
7043         * const.cs (IConstant): Changed to use reference to constant and
7044         not constant itself.
7045         Updated IConstant implementations.
7046
7047         * constant.cs (CreateConstant): New factory method.
7048         Updated IConstant implementation.
7049
7050         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
7051
7052         * ecore.cs: Updated to use CreateConstantReference.
7053
7054         * enum.cs: Reflects IConstant changes.
7055
7056         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
7057
7058         * literal.cs (NullConstant): Change to be independently usable.
7059
7060 2006-11-29  Martin Baulig  <martin@ximian.com>
7061
7062         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
7063         we need to emit the scope initializer before calling the base .ctor.
7064
7065         * anonymous.cs: Merged back from the new anonymous methods branch.
7066         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
7067
7068         * expression.cs (ParameterReference.DoResolveBase): Create a
7069         "normal" ScopeInfo when capturing parameters rather than using the
7070         root scope; this makes things work with anonymous methods having
7071         parameters.
7072
7073         * statement.cs
7074         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
7075
7076 2006-11-22  Marek Safar  <marek.safar@gmail.com>
7077
7078         A fix for bug #79987
7079         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
7080         check to a base class.
7081         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
7082         only when assembly has missing attribute.
7083         * report.cs: Update.
7084
7085 2006-11-21  Marek Safar  <marek.safar@gmail.com>
7086
7087         * cs-tokenizer.cs: Merged with gmcs version.
7088
7089 2006-11-20  Marek Safar  <marek.safar@gmail.com>
7090
7091         * cs-tokenizer.cs,
7092         * cs-parser.jay: Better error message when partial keyword is misplaced.
7093
7094 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
7095
7096         A fix for bug #79810
7097         report.cs: CS1058 only applies to 2.0 profile (gmcs).
7098         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
7099         a RuntimeWrappedException by default.
7100
7101 2006-11-18  Marek Safar  <marek.safar@gmail.com>
7102
7103         A fix for bug #79843
7104         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
7105         implementation.
7106         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
7107
7108 2006-11-18  Marek Safar  <marek.safar@gmail.com>
7109
7110         * driver.cs, namespace.cs: Uses faster IndexOf version.
7111
7112 2006-11-17  Marek Safar  <marek.safar@gmail.com>
7113
7114         A fix for bug #79941
7115         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
7116         operators.
7117         (Operator.Define): Implicit/Explicit operator of same type is duplicate
7118         even if internal name is different.
7119         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
7120         (UserDefinedConversion): Simplified as the operators cannot be internal.
7121         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
7122         conversions.
7123         (MethodLookup): Replaced EmitContext with parentType.
7124         * expression.cs: Updated.
7125
7126 2006-11-09  Raja R Harinath  <rharinath@novell.com>
7127
7128         * driver.cs (BadAssembly): Handle all the ugliness of
7129         DefineDynamicAssembly.
7130
7131 2006-11-08  Raja R Harinath  <rharinath@novell.com>
7132
7133         Address parts of #58244 -- most of what's left is in the runtime
7134         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
7135         CS1509 error checks, and handle them for all assembly loads, not
7136         just the first invocation.
7137         (LoadModule): Likewise.  Move handling of 'adder_method' ...
7138         * codegen.cs (AssemblyClass.AddModule): ... here.
7139
7140 2006-11-02  Marek Safar  <marek.safar@gmail.com>
7141
7142         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
7143         IEnumerable<T> is ambiguous.
7144
7145 2006-10-31  Marek Safar  <marek.safar@gmail.com>
7146
7147         A fix for bug #67689
7148         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
7149         GetEnumerator is ambiguous.
7150
7151         * report.cs: Add new warning.
7152
7153 2006-10-29  Marek Safar  <marek.safar@gmail.com>
7154
7155         A fix for bug #78602
7156         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7157         to protected member can be nested type.
7158
7159 2006-10-28  Marek Safar  <marek.safar@gmail.com>
7160
7161         A fix for bug #78965
7162         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7163         to protected member must derive from current type.
7164
7165 2006-10-27  Marek Safar  <marek.safar@gmail.com>
7166
7167         assign.cs: Reuses error method.
7168
7169         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
7170         instead of type for constants.
7171         (Expression.Error_ValueAssignment): Common error method.
7172
7173         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
7174         for any assignment.
7175
7176 2006-10-27  Marek Safar  <marek.safar@gmail.com>
7177
7178         A fix for bug #79081
7179         * expression.cs (MemberAccess.DoResolve): Check nested type
7180         accessibility.
7181
7182 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
7183
7184         * doc.cs : nested delegates were not handled. Fixed bug #79754.
7185
7186 2006-10-26  Marek Safar  <marek.safar@gmail.com>
7187
7188         A fix for bug #76591
7189         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
7190
7191 2006-10-26  Marek Safar  <marek.safar@gmail.com>
7192
7193         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
7194         type forwarder of the same type multiple times.
7195
7196 2006-10-26  Raja R Harinath  <rharinath@novell.com>
7197
7198         Fix #78820
7199         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
7200         instance as an rvalue, even when we later resolve as an lvalue.
7201
7202 2006-10-25  Martin Baulig  <martin@ximian.com>
7203
7204         * anonymous.cs: Fix #79673.
7205
7206 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
7207
7208         A fix for bug #79666
7209         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
7210         ignored when is optimized (= default value) as its value is already set.
7211
7212 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
7213
7214         A fix for bug #79724
7215         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
7216         TypeContainer for type lookup.
7217
7218 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
7219
7220         A fix for bug #79231
7221         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
7222         * expression.cs (OverloadResolve): Always convert type name for
7223         an error message.
7224         (ResolveNamespaceOrType): Don't confuse a nested type with any 
7225         other member.
7226
7227 2006-10-18  Martin Baulig <martin@ximian.com>
7228
7229         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
7230
7231 2006-10-17  Miguel de Icaza  <miguel@novell.com>
7232
7233         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
7234         an int32, but requesting an int64 from the conversion
7235
7236 2006-10-12  Martin Baulig  <martin@ximian.com>
7237
7238         * anonymous.cs
7239         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
7240         
7241 2006-10-12  Martin Baulig  <martin@ximian.com>
7242
7243         * statement.cs
7244         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
7245
7246 2006-10-11  Miguel de Icaza  <miguel@novell.com>
7247
7248         * convert.cs: Remove broken code: I was doing the "Existance"
7249         tests for Implicit conversions.
7250
7251 2006-10-10  Miguel de Icaza  <miguel@novell.com>
7252
7253         * convert.cs: Added one missing case in
7254         ImplicitStandardConversionExists uint64 to intptr.
7255
7256         Fixes #59800
7257         
7258         * typemanager.cs (uintptr_type): another core known type.   
7259
7260         * ecore.cs (OperatorCast): routine used to do cast operations that
7261         depend on op_Explicit.  We could change some of the Decimal
7262         conversions to use this.
7263
7264         This one has a probe mechanism that checks both types for an op_
7265         which it coudl be used to eliminate two classes: CastToDecimal
7266         and CastFromDecimal.
7267
7268         * convert.cs: Implement the conversions documented in #59800
7269         
7270 2006-10-10  Martin Baulig  <martin@ximian.com>
7271
7272         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
7273         before RootScope.ResolveMembers().
7274
7275         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
7276         `CurrentType' if appropriate.
7277
7278 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
7279
7280         A fix for bug #78568
7281         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
7282         when contains binary operators.
7283         * cs-parser.jay: Updated.
7284
7285 2006-10-09  Martin Baulig  <martin@ximian.com>
7286
7287         * delegate.cs
7288         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
7289         moved that into Define() and also do the other type parameter
7290         checks there.  Fixes #79094.  Added gtest-292.cs.
7291
7292         * expression.cs
7293         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
7294         since that doesn't include type parameters; don't use `Ldelema'
7295         for type parameters.  Fixes #78980.  Added gtest-293.cs.
7296
7297 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
7298
7299         A fix for #77796
7300         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
7301         conversion is allowed.
7302
7303 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
7304
7305         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
7306         error reporting when no error occurs.
7307
7308 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
7309
7310         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
7311         does not exist.
7312
7313 2006-10-06  Raja R Harinath  <rharinath@novell.com>
7314
7315         Fix #79584
7316         * class.cs (DefineTypeBuilder): Check circular dependencies before
7317         setting the parent of the TypeBuilder.
7318         (CheckRecursiveDefinition): Don't use 'BaseType', since
7319         it may not be valid until after DefineTypeBuilder.  Use
7320         'base_type' instead.
7321
7322 2006-10-04  Martin Baulig  <martin@ximian.com>
7323
7324         Merged the Anonymous Methods patch.
7325
7326         * anonymous.cs, iterators.cs: The new anonymous methods code.
7327
7328         * statement.cs (Variable): New public abstract class.
7329         (LocalInfo.Variable): New public property.
7330         (LocalInfo.ResolveVariable): New public method.
7331         (Block.Flags): Add `IsIterator'.
7332         (Block.AddVariable): Improved the CS0136 check.
7333         (Block.AnonymousChildren): New public property.
7334         (Block.AddAnonymousChild): New public method.
7335         (ToplevelBlock): Update to use the new anonymous method framework.
7336         (ToplevelBlock.ctor): `container' is now a `Block' and not a
7337         `ToplevelBlock'; this is required to correctly implement the
7338         CS0136 check.
7339         (Fixed, Using): Use `TemporaryVariable' instead of directly
7340         creating the `LocalBuilder'.
7341
7342         * parameter.cs (Parameter.ResolveVariable): New public method.
7343         (Parameters.ResolveVariable): Likewise.
7344
7345         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
7346
7347         * class.cs (TypeContainer): Replaced the `iterators' list and
7348         corresponding methods with a list of `CompilerGeneratedClass'es.
7349         (TypeContainer.ResolveMembers): New public method.
7350         (Method): `IIteratorContainer' has been replaced by
7351         `IAnonymousHost'.
7352
7353         * expression.cs (VariableReference): New public abstract base
7354         class for `LocalVariableReference', `ParameterReference' and
7355         `This'.
7356
7357         * codegen.cs (EmitContext): Removed `capture_context',
7358         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
7359         (EmitContext.EmitThis): Removed.
7360
7361         * cs-parser.jay: Replace `iterator_container' with
7362         `anonymous_host'.       
7363
7364 2006-10-04  Martin Baulig  <martin@ximian.com>
7365
7366         * generic.cs (GenericMethod): Don't make this abstract.
7367         (Constraints.Clone): Added dummy implementation.
7368
7369 2006-10-04  Raja R Harinath  <harinath@gmail.com>
7370
7371         Fix #79577
7372         * namespace.cs (LookForAnyGenericType): Avoid nullref on
7373         'declspaces'.  Avoid allocating arrays willy-nilly.
7374
7375         Fix #79553
7376         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
7377         cases out of the switch.
7378
7379 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
7380
7381         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
7382         message when non-generic type is used with the type arguments.
7383         * expression.cs: Updated.
7384
7385 2006-09-28  Raja R Harinath  <rharinath@novell.com>
7386
7387         Fix #79013
7388         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
7389         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
7390         Change semantics slightly.  Don't insist on having only one
7391         temporary EmptyExpression -- just throttle the creation of new ones.
7392
7393         Fix #79451
7394         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
7395         non-interfaces too.  If no methods are found, don't try to create
7396         a MethodGroupExpr.
7397
7398 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
7399
7400         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
7401         generic type.
7402
7403         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
7404         us produce better error message.
7405
7406 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
7407
7408         * expression.cs (Binary.ResolveOperator): Warn about a side effect
7409         of the `|' operator.
7410
7411         * report.cs: A new warning added.
7412
7413 2006-09-27  Martin Baulig  <martin@ximian.com>
7414
7415         * generic.cs (GenericMethod): Don't make this abstract.
7416
7417 2006-09-27  Martin Baulig  <martin@ximian.com>
7418
7419         * report.cs
7420         (InternalErrorException): Added overloaded ctor taking a params array.
7421
7422 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
7423
7424         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
7425         Fixed the cases when same error was reported twice.
7426
7427         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
7428         now report symbol information.
7429
7430 2006-09-25  Martin Baulig  <martin@ximian.com>
7431
7432         * class.cs: Completely unified with the gmcs version.
7433
7434 2006-09-25  Martin Baulig  <martin@ximian.com>
7435
7436         * typemanager.cs (TypeManager.IsNullableType): New public function.
7437         (TypeManager.IsNullableTypeOf): Likewise.
7438         (TypeManager.IsNullableValueType): Likewise.
7439
7440         * class.cs (MethodCore): Added the `GenericMethod' argument from
7441         gmcs and also unified all classes derived from `MethodCore' with gmcs.
7442
7443 2006-09-24  Raja R Harinath  <harinath@gmail.com>
7444
7445         * convert.cs: Unify with gmcs version.
7446
7447 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
7448
7449         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
7450         verify them as well.
7451
7452         * report.cs: New warning.
7453
7454 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
7455
7456         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
7457         for anonymous block with out argument.
7458
7459 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
7460
7461         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
7462         not used private events only.
7463
7464 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
7465
7466         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
7467
7468         * const.cs (Const.Define): Check for constant type.
7469         (Const.IsConstantTypeValid): Looks for valid constant types.
7470
7471         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
7472
7473         * ecore.cs (EmptyConstantCast): New common class for all constant based
7474         EmptyCast(s).
7475
7476         * expression.cs (Is.DoResolve): Handle null constant especially.
7477         (New.DoResolve): Check for new void().
7478         (MemberAccess.DoResolve): Cope with all kind of nulls.
7479
7480         * literal.cs (NullConstant): Uses EmptyConstantCast.
7481         (NullDefault): Based on EmptyConstantCast.
7482         (NullLiteral): Uses EmptyConstantCast.
7483
7484         * statement.cs (Block.ResolveMeta): Check for constant type.
7485
7486 2006-09-22  Martin Baulig  <martin@ximian.com>
7487
7488         * delegate.cs, attribute.cs: Merged with the gmcs versions.
7489
7490 2006-09-22  Raja R Harinath  <rharinath@novell.com>
7491
7492         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
7493         not the null type.
7494
7495         Fix part of #79451
7496         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
7497         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
7498         code slightly.
7499
7500 2006-09-22  Martin Baulig  <martin@ximian.com>
7501
7502         * ecore.cs: Merged with the gmcs version.
7503
7504         * generic.cs (ConstructedType): New dummy class.
7505         (TypeArguments): Don't make this abstract.
7506
7507         * typemanager.cs
7508         (TypeManager.IsGenericTypeDefinition): New method.
7509         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
7510
7511 2006-09-22  Raja R Harinath  <rharinath@novell.com>
7512
7513         * expression.cs (ComposedCast): Check for arrays of TypedReference
7514         before creating the type, not after.
7515
7516 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
7517
7518         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
7519         after ToType change.
7520
7521         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
7522         when constant must be implicitly convertible.
7523
7524         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
7525
7526         * ecore.cs (NullCast): Derives from NullConstant.
7527
7528         * expression.cs (Is.DoResolve): Removed useless variables.
7529         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
7530         (New.Constantify): Add enum support.
7531         (MemberAccess.DoResolve): Add warning when accessing null constant or
7532         variable.
7533
7534         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
7535         property.
7536
7537         * literal.cs (NullConstant): New abstract class with common
7538         functionality for all null specializations.
7539         (NullDefault): Represents default(X) when result can be
7540         reduced to null.
7541         (NullLiteral): Updated.
7542
7543         * report.cs: Add new warning.
7544
7545 2006-09-21  Martin Baulig  <martin@ximian.com>
7546
7547         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
7548
7549 2006-09-21  Martin Baulig  <martin@ximian.com>
7550
7551         * generic.cs (GenericConstraints): New dummy class.
7552         (Constraints): Likewise.
7553         (TypeParameter): Likewise.
7554         (TypeParameterName): Likewise.
7555         (GenericMethod): Likewise.
7556
7557         * typemanager.cs (TypeManager.GetGenericArguments): New method.
7558
7559         * decl.cs: Merged with the gmcs version.
7560
7561 2006-09-21  Raja R Harinath  <rharinath@novell.com>
7562
7563         * generic.cs (TypeParameter): Implement IMemberContainer.
7564         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
7565
7566         * rootcontext.cs: Unify with gmcs version.
7567
7568         * report.cs: Unify with gmcs version.
7569         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
7570         from gmcs/generics.cs.
7571         * generics.cs (TypeParameter): New dummy class.
7572
7573         * support.cs: Unify with gmcs version.
7574
7575 2006-09-20  Raja R Harinath  <rharinath@novell.com>
7576
7577         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
7578         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
7579
7580         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
7581         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
7582         * mcs.exe.sources: Add generic.cs.
7583
7584         * codegen.cs: Unify with gmcs version.
7585
7586         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
7587         (EmitContext): Add GenericDeclContainer implementation.
7588         * decl.cs (MemberCore, DeclSpace): Likewise.
7589         * namespace.cs: Remove #ifdef GMCS_SOURCE.
7590
7591         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
7592         MCS TypeManager has a corresponding dummy method.
7593
7594 2006-09-19  Martin Baulig  <martin@ximian.com>
7595
7596         * expression.cs: Completely merged with the gmcs version.
7597
7598 2006-09-19  Martin Baulig  <martin@ximian.com>
7599
7600         * expression.cs (Invocation): Merged with the gmcs version.
7601         (ArrayAccess.GetStoreOpcode): Likewise.
7602
7603 2006-09-19  Martin Baulig  <martin@ximian.com>
7604
7605         * typemanager.cs
7606         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
7607         (TypeManager.IsGenericMethodDefinition): Likewise.
7608
7609 2006-09-19  Martin Baulig  <martin@ximian.com>
7610
7611         * typemanager.cs
7612         (TypeManager.IsEqual): Moved the gmcs implementation here.
7613         (TypeManager.DropGenericTypeArguments): Likewise.
7614         (TypeManager.DropGenericMethodArguments): Likewise.
7615         (TypeManager.GetTypeArguments): Moved here from gmcs.
7616         (TypeManager.HasGenericArguments): Likewise.
7617
7618 2006-09-19  Martin Baulig  <martin@ximian.com>
7619
7620         * expression.cs (Binary): Merged with the gmcs version.
7621
7622 2006-09-19  Martin Baulig  <martin@ximian.com>
7623
7624         * expression.cs (Probe, As, Is): Merged with the gmcs version.
7625
7626 2006-09-19  Martin Baulig  <martin@ximian.com>
7627
7628         * typemanager.cs: Merged with the gmcs version.
7629
7630 2006-09-16  Raja R Harinath  <rharinath@novell.com>
7631
7632         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
7633         * driver.cs: Likewise.
7634
7635 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
7636
7637         A fix for #79401
7638         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
7639         only if parent type is class.
7640         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
7641         update.
7642
7643 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
7644
7645         * cs-parser.jay,
7646         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
7647         keywords are used.
7648         * typemanager.cs(CSharpName): Converts NullType to null.
7649
7650 2006-09-15  Martin Baulig  <martin@ximian.com>
7651
7652         * typemanager.cs
7653         (TypeManager.GetMethodName): Added mcs implementation.
7654         (TypeManager.IsEqual): Likewise.
7655
7656         * ecore.cs
7657         (SimpleName.RemoveGenericArity): Added dummy implementation.
7658
7659         * pending.cs: Merged with the gmcs version.     
7660
7661 2006-09-15  Martin Baulig  <martin@ximian.com>
7662
7663         * statement.cs: Merge with the gmcs version.
7664
7665 2006-09-15  Martin Baulig  <martin@ximian.com>
7666
7667         * statement.cs (Switch): Merge with the gmcs implementation
7668         (without nullables), which is newer.
7669
7670 2006-09-15  Martin Baulig  <martin@ximian.com>
7671
7672         * statement.cs (Block.Variables): Make this public.
7673         (ToplevelBlock.Parameters): Make this a property.
7674         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
7675
7676 2006-09-15  Martin Baulig  <martin@ximian.com>
7677
7678         * namespace.cs: Merge with the gmcs version.
7679
7680 2006-09-15  Martin Baulig  <martin@ximian.com>
7681
7682         * decl.cs (MemberName): Minor code cleanups.
7683
7684 2006-09-15  Martin Baulig  <martin@ximian.com>
7685
7686         * parameter.cs: Merge with the gmcs version.
7687
7688 2006-09-15  Martin Baulig  <martin@ximian.com>
7689
7690         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
7691         and an error in mcs.
7692
7693 2006-09-15  Martin Baulig  <martin@ximian.com>
7694
7695         * flowanalysis.cs: Merged from GMCS; added the generics code into
7696         a `GMCS_SOURCE' conditional so we can share this file.
7697
7698 2006-09-08  Martin Baulig  <martin@ximian.com>
7699
7700         * typemanager.cs (TypeManager.interlocked_type): New public field.
7701         (TypeManager.int_interlocked_compare-exchange): New public field.
7702         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
7703         enumerator types here and call InitGenericCoreTypes().
7704         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
7705         after calling InitEnumUnderlyingTypes().
7706
7707         * rootcontext.cs
7708         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
7709         `classes_second_stage'. 
7710
7711 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
7712
7713         * assign.cs, ecore.cs, expression.cs: Share error message text.
7714         * class.cs (FieldMember.Define): Check for varible of static type.
7715         * driver.cs (LoadAssembly): Uses error output for errors.
7716         * statement.cs: Updated.
7717
7718 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
7719
7720         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
7721         type instance.
7722
7723 2006-09-07  Martin Baulig  <martin@ximian.com>
7724
7725         * driver.cs
7726         (MainDriver): Revert r62663 from Marek; see #70506 for details.
7727
7728 2006-08-29  Miguel de Icaza  <miguel@novell.com>
7729
7730         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
7731         
7732 2006-08-17  Miguel de Icaza  <miguel@novell.com>
7733
7734         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
7735         #52019 and #79064, the use of the \uXXXX sequence in source code
7736         to represent unicode characters.
7737
7738 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
7739
7740         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
7741         support.
7742         * class.cs, ecore.cs, statement.cs: Merged to one error message.
7743
7744 2006-08-13  Miguel de Icaza  <miguel@novell.com>
7745
7746         * assign.cs: Catch attempts to assign to a method groups in += and
7747         report as 1656
7748
7749 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
7750
7751         A fix for #79056
7752         * cs-parser.jay: Don't destroy current array type by typeof of array's.
7753
7754 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
7755
7756         * class.cs (Method.Define): Issue a warning when generic method looks like
7757         an entry point.
7758         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
7759         as well.
7760
7761 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
7762  
7763         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
7764         looking for ctor.
7765         * decl.cs (MemberCache.FindMembers): When container is interface we need to
7766         search all base interfaces as a member can be ambiguous.
7767         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
7768         Constructor member type filter. 
7769         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
7770         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
7771         reporting for returned memberinfos.
7772         * report.cs: Updated.
7773         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
7774         version to work on all runtimes.
7775         (TypeManager.RealMemberLookup): Removed members filtering.
7776
7777 2006-08-08  Raja R Harinath  <rharinath@novell.com>
7778
7779         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
7780         (PropertyExpr.EmitAssign): Likewise.
7781         * expression.cs (Indirection.EmitAssign): Likewise.
7782         (LocalVariableReference.EmitAssign): Likewise.
7783         (ParameterReference.EmitAssign): Likewise.
7784         (Invocation.EmitArguments): Likewise.
7785         (ArrayAccess.EmitAssign): Likewise.
7786         (IndexerAccess.EmitAssign): Likewise.
7787         (This.EmitAssign): Likewise.
7788         (ConditionalLogicalOperator.Emit): Likewise.
7789
7790         Fix #79026
7791         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
7792         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
7793         leave it in after returning it.
7794         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
7795
7796 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
7797
7798         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
7799         message.
7800
7801 2006-08-03  Raja R Harinath  <rharinath@novell.com>
7802
7803         Fix cs0146-3.cs and cs0146-4.cs.
7804         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
7805         enclosing types don't depend on the current type.
7806
7807 2006-08-02  Raja R Harinath  <rharinath@novell.com>
7808
7809         Fix #77963
7810         * class.cs (TypeContainer.DoDefineMembers): Use
7811         FindBaseMemberWithSameName on Parent, since we're interested in
7812         whether we hide inherited members or not.
7813         (FindBaseMemberWithSameName): Make slightly more robust.
7814
7815         Fix the non-generic testcase from #77396
7816         * decl.cs (DeclSpace.DeclContainer): Remove override.
7817
7818         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
7819         declspaces for doppelgangers too.
7820         (UsingEntry): Implement IResolveContext.
7821         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
7822         'this' as the resolve context.
7823         (LocalAliasEntry): Likewise.
7824
7825         Implement parts of #77403
7826         * roottypes.cs (RootDeclSpace): New.  Used to represent the
7827         toplevel declaration space.  Each namespace declaration introduces
7828         a "partial" root declaretion space.
7829         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
7830         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
7831         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
7832         from 'current_namespace.SlaveDeclSpace'.
7833         (namespace_declaration): Likewise.
7834         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
7835         check.  It can't happen now.
7836         * decl.cs (DeclSpace.LookupType): Likewise.
7837         * driver.cs (MainDriver): Sanity check.
7838
7839 2006-08-01  Raja R Harinath  <rharinath@novell.com>
7840
7841         * decl.cs (DeclSpace.FindNestedType): Remove.
7842         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
7843         LookupTypeContainer to get the container of the nested type.
7844         * class.cs (TypeContainer.FindNestedType): Make non-override.
7845
7846 2006-07-31  Raja R Harinath  <rharinath@novell.com>
7847
7848         * decl.cs (DeclSpace.PartialContainer): Move field from ...
7849         * class.cs (TypeContainer.PartialContainer): ... here.
7850         (TypeContainer.AddBasesForPart): New helper.
7851         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
7852         instead.
7853         * cs-parser.jay (current_class): Convert to DeclSpace.
7854         (struct_declaration, interface_declaration, class_declaration):
7855         Use AddBasesForPart instead of .Bases directly.
7856         * const.cs, iterators.cs: Update to changes.
7857
7858 2006-07-28  Raja R Harinath  <rharinath@novell.com>
7859
7860         * class.cs (TypeContainer.AddMemberType): Rename from
7861         AddToTypeContainer.
7862         (TypeContainer.AddMember): Rename from AddToMemberContainer.
7863         (AddTypeContainer): New.  Combine AddClassOrStruct and
7864         AddInterface.
7865         (AddPartial): Update.  Add 'is_partial' argument.
7866         * roottypes.cs: Update to changes.
7867         * cs-parser.jay (push_current_class): New helper for handling
7868         current_container and current_class.
7869         (struct_declaration, interface_declaration, class_declaration):
7870         Use it.
7871
7872 2006-07-26  Raja R Harinath  <rharinath@novell.com>
7873
7874         * roottypes.cs: Rename from tree.cs.
7875
7876         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
7877         * tree.cs (Tree, ITreeDump): Remove types.
7878         * rootcontext.cs (tree, Tree): Remove fields.
7879         (root, ToplevelTypes): New.
7880         * *.cs: Update to rename.
7881
7882         * tree.cs (Tree.RecordDecl): Remove.
7883         (RootTypes.AddToTypeContainer): Record the toplevel type in its
7884         namespace here.
7885         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
7886
7887 2006-07-23  Raja R Harinath  <harinath@gmail.com>
7888
7889         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
7890         DoFlowAnalysis and OmitStructFlowAnalysis here.
7891         (ec.With): Rename from WithUnsafe and generalize.
7892         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
7893         (ec.WithFlowAnalyis): New.
7894         * ecore.cs, expression.cs, statement.cs: Update.
7895
7896 2006-07-22  Raja R Harinath  <harinath@gmail.com>
7897
7898         * statement.cs (Block.ResolveMeta): Simplify slightly.
7899
7900         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
7901         multiple boolean fields.  Convert InUnsafe, constant_check_state,
7902         check_state to flags.
7903         (CheckState, ConstantCheckState): Update.
7904         (InUnsafe): New read-only property.
7905         (FlagsHandle): Rename from CheckStateHandle and convert to handle
7906         arbitrary flags.
7907         (WithUnsafe): New helper similar to WithCheckState.
7908         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
7909         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
7910
7911 2006-07-21  Raja R Harinath  <rharinath@novell.com>
7912
7913         Make comparisons use the same IL irrespective of whether they're
7914         in a 'checked' or 'unchecked' context: one of the issues in #78899
7915         * codegen.cs (EmitContext.CheckState): Make read-only property.
7916         (EmitContext.ConstantCheckState): Likewise.
7917         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
7918         helper that implement a save/restore stack for CheckState
7919         values.  This is the only way to change check-state.
7920         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
7921         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
7922         (CheckedExpr.EmitBranchable): New forwarding method.
7923         (UnCheckedExpr): Likewise.
7924         * statement.cs (Block.ResolveMeta): Use WithCheckState.
7925         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
7926         (Checked.Resolve, checked.DoEmit): Likewise.
7927
7928 2006-07-20  Miguel de Icaza  <miguel@novell.com>
7929
7930         * anonymous.cs: Cache the resolved anonymous delegate, and return
7931         this so that the ResolveTopBlock is only triggered once, not
7932         twice.
7933
7934         Currently we trigger ResolvetopBlock twice due to a first pass of
7935         argument check compatibility, and a second pass that does the
7936         actual resolution.   
7937         
7938 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
7939
7940         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
7941         modifiers.
7942         * rootcontext.cs (Reset): Add helper_classes.
7943
7944 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
7945
7946         A fix for #78860
7947         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
7948         correctly.
7949
7950 2006-07-13  Miguel de Icaza  <miguel@novell.com>
7951
7952         * statement.cs (Lock): Handle expressions of type
7953         TypeManager.null_type specially.  Fixes #78770
7954
7955 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
7956
7957         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
7958         to an event.
7959
7960 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
7961
7962         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
7963         for accessors as well.
7964         * ecore.cs (EventExpr): Add AccessorTable.
7965
7966 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
7967
7968         A fix for #78738
7969         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
7970         for CS0122 where appropriate.
7971         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
7972         level attributes.
7973         (Filter): Assembly can be null in the case of top level attributes.
7974
7975 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
7976
7977         A fix for #78690
7978
7979         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
7980         is done at global level.
7981
7982 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
7983
7984         A fix for #77002, Implemented TypeForwarder support.
7985
7986         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
7987         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
7988         * typemanager.cs (): Add type_forwarder_attr_type.
7989
7990 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
7991
7992         * report.cs: Add CS0469 warning.
7993
7994 2006-06-21  Martin Baulig  <martin@ximian.com>
7995
7996         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
7997         the `try'-block, so we also report CS0016 etc. there.
7998
7999 2006-06-21  Martin Baulig  <martin@ximian.com>
8000
8001         * delegate.cs
8002         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
8003
8004 2006-06-21  Martin Baulig  <martin@ximian.com>
8005
8006         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
8007         also report CS1686 for parameters.
8008
8009 2006-06-21  Martin Baulig  <martin@ximian.com>
8010
8011         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
8012         instead of an error if the value is not implicitly convertible to
8013         the switch types; fixes #77964.
8014
8015 2006-06-21  Raja R Harinath  <rharinath@novell.com>
8016
8017         Fix #78673
8018         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
8019         FieldBuilder is null.
8020
8021         Fix #78662
8022         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
8023         'left' and 'right' before error-checking.
8024
8025 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
8026
8027         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
8028         Fixed bug #78601.
8029         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
8030         (FieldExpr.DoResolve): likewise.
8031         (PropertyExpr.InstanceResolve): likewise.
8032         (EventExpr.InstanceResolve): likewise. 
8033
8034 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
8035
8036         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
8037         attribute applicable tests for attribute argument.
8038
8039 2006-06-02  Raja R Harinath  <rharinath@novell.com>
8040
8041         Fix #78079
8042         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
8043         (Binary.OverloadResolve_PredefinedIntegral): New.
8044         (Binary.OverloadResolve_PredefinedFloating): New.
8045         (Binary.OverloadResolve_PredefinedString): New.
8046         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
8047         Follow the standard more closely, and treat numeric promotions in
8048         terms of overload resolution.
8049         (Binary.CheckShiftArguments): Simplify.
8050
8051 2006-06-01  Raja R Harinath  <rharinath@novell.com>
8052
8053         * flowanalysis.cs (MyBitVector): Simplify representation.
8054         (MyBitVector.Clone): Avoid allocating BitArray.
8055         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
8056         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
8057         (*): Update.  Change all references to MyBitVector.And and
8058         MyBitVector.Or to &= and |=.
8059
8060 2006-05-29  Raja R Harinath  <rharinath@novell.com>
8061
8062         Fix cs0231-[34].cs.
8063         * cs-parser.jay (formal_parameter_list): Extend the pattern below
8064         to param arguments too.
8065
8066 2006-05-26  Miguel de Icaza  <miguel@novell.com>
8067
8068         * cs-parser.jay: Catch another parsing form for arglist being
8069         followed by other arguments.  Fixes #78313.
8070
8071 2006-05-24  Raja R Harinath  <rharinath@novell.com>
8072
8073         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
8074         checking of out parameters to ...
8075         (FlowBranchingToplevel.Merge): ... here.
8076         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
8077         set, propagate the origin upward, and only complain if there was
8078         no other error.
8079         (FlowBranchingException.AddContinueOrigin): Likewise.
8080         (FlowBranchingException.AddReturnOrigin): Likewise.
8081         (FlowBranchingException.AddGotoOrigin): Likewise.       
8082
8083 2006-05-23  Raja R Harinath  <rharinath@novell.com>
8084
8085         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
8086         unreachable, skip it.
8087         (FlowBranchingException.Merge): Always propagate jumps, even if
8088         the finally block renders subsequent code unreachable.
8089
8090 2006-05-18  Raja R Harinath  <rharinath@novell.com>
8091
8092         Fix #77601
8093         * statement.cs (Goto.Resolve): Move responsibility for resolving
8094         'goto' to FlowBranching.AddGotoOrigin.
8095         (Goto.SetResolvedTarget): New.  Callback to set the
8096         LabeledStatement that's the target of the goto.
8097         (Goto.DoEmit): Use Leave instead of Br when crossing an
8098         unwind-protect boundary.
8099         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
8100         LookupLabel and adjust to new semantics.
8101         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
8102         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
8103         Goto.SetResolvedTarget to update target.
8104         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
8105         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
8106         AddBreakOrigin & co.  Delay propagation until ...
8107         (FlowBranchingException.Merge): ... this.
8108
8109         * statement.cs (Block.Resolve): Always depend on flow-branching to
8110         determine unreachability.  Kill workaround that originally emitted
8111         only one statement after an "unreachable" label (see infloop in
8112         test-515.cs).
8113
8114         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
8115         This is still "wrong", but anything better would probably need a
8116         multi-pass algorithm.
8117         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
8118         usage vector.  Force current usage vector to be reachable, to
8119         optimistically signify backward jumps.
8120         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
8121         detected.
8122         (FlowBranchingLabeled.Merge): New.  If no backward jump was
8123         detected, return the original salted-away usage vector instead,
8124         updated with appropriate changes.  Print unreachable warning if
8125         necessary.
8126         * statement.cs (Block.Resolve): Don't print unreachable warning on
8127         a labeled statement.
8128
8129 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
8130
8131         * driver.cs: Pass filename without path to AssemblyBuilder's 
8132         AddResourceFile. Fixes bug #78407.
8133
8134 2006-05-17  Raja R Harinath  <rharinath@novell.com>
8135
8136         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
8137         * flowanalysis.cs (FlowBranchingLabeled): ... here.
8138         (FlowBranching.MergeChild): Overwrite
8139         reachability information from Labeled branchings too.
8140
8141 2006-05-16  Raja R Harinath  <rharinath@novell.com>
8142
8143         * statement.cs (Goto.Resolve): Merge jump origins here ...
8144         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
8145
8146         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
8147         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
8148         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
8149         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
8150         here, ...
8151         * statement.cs (Goto.Resolve): ... not here.
8152         (Goto.Emit): Remove CS1632 check.
8153
8154 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
8155
8156         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
8157         error message.
8158
8159 2006-05-11  Raja R Harinath  <rharinath@novell.com>
8160
8161         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
8162         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
8163         (FlowBranchingException.Label): Likewise.
8164
8165         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
8166         given value.
8167         (MyBitVector.Or): Use it to avoid losing information (Count).
8168         (FlowBranching.MergeOrigins): Likewise.
8169
8170         * flowanalysis.cs (UsageVector.IsDirty): Remove.
8171         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
8172         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
8173         (UsageVector.ToString): Simplify.
8174         (UsageVector.MergeSiblings): Move here from ...
8175         (FlowBranching.Merge): ... here.
8176         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
8177         not a MyBitVector.
8178
8179 2006-05-10  Raja R Harinath  <rharinath@novell.com>
8180
8181         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
8182         null bitvector is treated as all-true.
8183
8184         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
8185         (MyBitVector): Rationalize invariants.  'vector != null' implies
8186         that we have our own copy of the bitvector.  Otherwise,
8187         'InheritsFrom == null' implies all inherited bits are true.
8188
8189 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
8190
8191         * statement.cs (LocalInfo): Add IsConstant.
8192         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
8193         local variable for constants.
8194
8195 2006-05-09  Raja R Harinath  <rharinath@novell.com>
8196
8197         * flowanalysis.cs (MyBitVector.Empty): New.
8198         (MyBitVector): Don't allow InheritedFrom to be null.
8199         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
8200         (UsageVector, FlowBranching): Update to changes.
8201
8202         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
8203         recursion.  The 'Parent == null' condition isn't sufficient for
8204         anonymous methods.
8205         (FlowBranching.AddBreakOrigin): Likewise.
8206         (FlowBranching.AddContinueOrigin): Likewise.
8207         (FlowBranching.AddReturnOrigin): Likewise.
8208         (FlowBranching.StealFinallyClauses): Likewise.
8209         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
8210         (FlowBranching.CheckOutParameters): Likewise.
8211         (FlowBranchingToplevel): Terminate all the above recursions here.
8212         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
8213         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
8214
8215         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
8216         toplevel block.
8217         (FlowBranchingToplevel): New.  Empty for now.
8218         (FlowBranching.MergeTopBlock): Update.
8219         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
8220         branching for the anonymous delegate.
8221         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
8222
8223         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
8224         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
8225         information at the start of the merge.  Reorganize.
8226
8227 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
8228
8229         * class.cs (MethodData.Define): Method cannot implement interface accessor.
8230
8231 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
8232
8233         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
8234         to newly introduced ctor.
8235
8236         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
8237         message to one place.
8238         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
8239         global namespace.
8240
8241 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
8242
8243         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
8244
8245         * ecore.cs (Expression.ResolveAsConstant): Updated.
8246
8247         * statement.cs (ResolveMeta): Updated.
8248
8249 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
8250
8251         * cs-parser.jay: __arglist cannot be used in initializer.
8252
8253 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
8254
8255         A fix for #77879
8256         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
8257         private types.
8258
8259 2006-05-05  Raja R Harinath  <rharinath@novell.com>
8260
8261         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
8262         (LabeledStatement): Add 'name' parameter.
8263         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
8264         (Block.AddLabel): Update to changes.
8265         * cs-parser.jay (labeled_statement): Likewise.
8266
8267         * flowanalysis.cs (BranchingType.Labeled): New.
8268         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
8269         (FlowBranchingLabeled): New.  Does nothing for now, but will
8270         eventually handle 'goto' flows.
8271         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
8272         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
8273         that's terminated ...
8274         (Block.Resolve): ... here.
8275
8276         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
8277         (UsageVector.MergeFinallyOrigins): Likewise.
8278         (FlowBranching.InTryOrCatch): Likewise.
8279         (FlowBranching.AddFinallyVector): Likewise.
8280         (FlowBranchingException): Update to changes.
8281
8282         Fix #78290
8283         * statement.cs (Return.Resolve): Move error checking to ...
8284         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
8285         (FlowBranchingException): Handle return origins like break and
8286         continue origins.
8287         (FlowBranching.UsageVector.CheckOutParameters): Remove.
8288
8289 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
8290
8291         A fix for #76122
8292         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
8293         filter.
8294
8295 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
8296
8297         A fix for #77543
8298         * class.cs (MethodData.Define): Do public accessor check only when method
8299         implements an interface.
8300
8301 2006-05-04  Raja R Harinath  <rharinath@novell.com>
8302
8303         Remove special handling of 'break'
8304         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
8305         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
8306         (UsageVector.Break): Remove.
8307         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
8308         reachability.
8309         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
8310
8311         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
8312         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
8313
8314 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
8315
8316         A fix for #75726
8317         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
8318         be the interface member.
8319
8320 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
8321
8322         A fix for #60069
8323         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
8324         for emitting small (int) values.
8325
8326 2006-05-03  Raja R Harinath  <rharinath@novell.com>
8327
8328         Fix #59427
8329         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
8330         control-flow passes through the 'finally' after merging-in all the
8331         control-flows from 'try' and the 'catch' clauses.
8332
8333         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
8334         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
8335         always true at the only non-recursive entry point.
8336         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
8337         FlowBranchingBreakable.
8338         (FlowBranchingLoop): Remove.
8339         * statement.cs (Return.DoResolve): Update to changes.
8340
8341         Fix #76471, #76665
8342         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
8343         (FlowBranching.CreateBranching): Handle it: create a
8344         FlowBranchingContinuable.
8345         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
8346         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
8347         except that it handles the 'continue' command.
8348         (FlowBranching.UsageVector.MergeOrigins): Rename from
8349         MergeBreakOrigins.
8350         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
8351         except that it overrides AddContinueOrigin.
8352         (FlowBranchingException): Override AddContinueOrigin, similar to
8353         AddBreakOrigin.
8354         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
8355         Create a new branching around the embedded statement.
8356         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
8357         control flow after the embedded statement.
8358         (Continue.Resolve): Move all error checking to AddContinueOrigin.
8359
8360         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
8361         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
8362         FlowBranchingBreakable.
8363         (FlowBranchingSwitch): Remove.
8364
8365         Fix test-503.cs
8366         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
8367         error reporting to ...
8368         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
8369         Rename from 'AddBreakVector'.  Add new location argument.  Return
8370         a bool indicating whether the 'break' crosses an unwind-protect.
8371         (FlowBranchingException.AddBreakOrigin): Add.
8372         (FlowBranchingException.Merge): Propagate 'break's to surrounding
8373         flowbranching after updating with the effects of the 'finally'
8374         clause.
8375         (FlowBranchingBreakable): New common base class for
8376         FlowBranchingLoop and FlowBranchingSwitch.
8377
8378         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
8379         embedded statement.
8380         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
8381
8382 2006-05-02  Raja R Harinath  <rharinath@novell.com>
8383
8384         * statement.cs (Do.Resolve): If the loop is infinite, set the
8385         barrier.
8386         (While.Resolve, For.Resolve): Set a barrier after the embedded
8387         statement.  There's no direct control flow that goes from the end
8388         of the embedded statement to the end of the loop.
8389         * flowanalysis.cs (FlowBranching.Infinite): Remove.
8390         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
8391         above ensure that the reachability is correctly computed.
8392
8393         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
8394         (UsageVector.MergeBreakOrigins): If the current path is
8395         unreachable, treat it as if all parameters/locals are initialized.
8396         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
8397         infinite loops before merging-in break origins.
8398
8399         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
8400         (Reachability.Reachable): Split part into ...
8401         (Reachability.Unreachable): ... this.  Simplify.
8402         (Reachability.IsUnreachable): Use 'Unreachable' instead.
8403
8404         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
8405         (Reachability.SetThrowsSometimes): Likewise.
8406         (FlowBranchingBlock.MergeTopBlock): Don't compare against
8407         TriState.Always, use corresponding property.
8408         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
8409         (Block.Resolve): Likewise.  Remove some redundant checks.
8410
8411 2006-05-02  Raja R Harinath  <harinath@gmail.com>
8412
8413         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
8414         (Reachability.Meet): Don't bother checking AlwaysThrows --
8415         barrier is always set.
8416         (FlowBranchingBlock.Merge): Likewise.
8417
8418 2006-05-01  Raja R Harinath  <harinath@gmail.com>
8419
8420         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
8421         checks for unreachable.
8422
8423 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
8424
8425         A fix for #77980
8426         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
8427
8428         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
8429         whether field is really assigned.
8430
8431 2006-04-30  Raja R Harinath  <harinath@gmail.com>
8432
8433         * flowanalysis.cs (Reachability): Make 4-argument constructor
8434         private.
8435         (Reachability.Meet): Rename from 'And'.  Remove static variant.
8436         (Reachability.Always): Rename from the highly misleading
8437         'Reachability.Never'.
8438         (FlowBranching.Merge): Update to changes.  Mark an impossible
8439         situation with a 'throw'.
8440         (*): Update to changes.
8441
8442 2006-04-29  Raja R Harinath  <harinath@gmail.com>
8443
8444         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
8445         Remove 'Undefined'.
8446         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
8447         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
8448         (*): Update to changes.
8449         * statement.cs: Update to changes.
8450
8451 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
8452
8453         A fix for #78049
8454         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
8455
8456 2006-04-28  Raja R Harinath  <harinath@gmail.com>
8457
8458         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
8459         dummy UsageVector.
8460
8461         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
8462         argument to two arguments: an usage-vector and a bool.  Move call
8463         to FlowBranching.Merge () ...
8464         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
8465
8466         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
8467         handling of loop and switch reachability to ...
8468         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
8469
8470 2006-04-27  Raja R Harinath  <harinath@gmail.com>
8471
8472         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
8473         handling to FlowBranchingLoop.InLoop.
8474         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
8475
8476 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
8477
8478         A fix for #78115
8479         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
8480         anonymous method is allowed from AnonymousContainer here.
8481
8482         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
8483
8484 2006-04-24  Raja R Harinath  <rharinath@novell.com>
8485
8486         Fix #78156
8487         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
8488
8489 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
8490
8491         A fix for #49011.
8492         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
8493         (DoubleConstant.Reduce): Ditto.
8494
8495 2006-04-23  Raja R Harinath  <rharinath@novell.com>
8496
8497         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
8498         Remove 'lvalue_right_side' argument.  Move parts to ...
8499         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
8500         (LocalVariable.DoResolveLValue): ... these.
8501
8502 2006-04-21  Raja R Harinath  <rharinath@novell.com>
8503
8504         Fix cs1655.cs
8505         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
8506         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
8507         (LocalVariableReference.DoResolveBase): Use it to implement new
8508         CS1655 check.
8509         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
8510         (Argument.Resolve): Simplify.  Move CS1510 check ...
8511         * ecore.cs (Expression.ResolveLValue): ... here.
8512         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
8513         (PropertyExpr.DoResolveLValue): Likewise.
8514         (FieldExpr.Report_AssignToReadonly): Likewise.
8515         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
8516         LValueMemberAccess or LValueMemberOutAccess on instance depending
8517         on it.
8518         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
8519         DoResolve as appropriate.
8520
8521 2006-04-20  Raja R Harinath  <rharinath@novell.com>
8522
8523         Fix #75800
8524         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
8525         implicit conversions on 'out' and 'ref' arguments.
8526
8527         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
8528         improve clarity.  Remove dead code.
8529
8530         Fix #66031
8531         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
8532         (Catch.Resolve): Resolve VarBlock if it exists.
8533
8534 2006-04-19  Miguel de Icaza  <miguel@novell.com>
8535
8536         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
8537         twice, this was some residual code, the enumerator was emitted
8538         properly in the two branche of if later.
8539
8540 2006-04-19  Raja R Harinath  <rharinath@novell.com>
8541
8542         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
8543         cast is never an lvalue.
8544         (Cast.DoResolve, Cast.ResolveRest): Combine.
8545         (Argument.Emit): Simplify slightly.  Move 'Expr is
8546         IMemoryLocation' check ...
8547         (Argument.Resolve): ... here.
8548         (Argument.Error_LValueRequired): Remove.  Inline into only user.
8549
8550         Simplifications.  Fix cs0191-2.cs
8551         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
8552         CS1649 and CS1651 to ...
8553         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
8554         the actual selection of the error code and message to a lookup
8555         table.  Add a dummy return value to simplify callsites.
8556         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
8557         readonly fields of other instances of the same type.  Move CS0197
8558         warning from ...
8559         * expression.cs (Argument.Resolve): ... here.  Simplify code.
8560         Ensure that ec.InRefOutArgumentResolving is only set during LValue
8561         resolution of an out or ref argument.  The code simplification
8562         above uses this invariant.
8563
8564 2006-04-18  Raja R Harinath  <rharinath@novell.com>
8565
8566         Possibly fix #77752.  Fix cs1690-[4-7].cs.
8567         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
8568         CheckMarshallByRefAccess.  Drop parameter.
8569         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
8570         warning.
8571         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
8572         InstanceExpression.
8573         * report.cs (AllWarnings): Add CS1690.
8574         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
8575         for ref access too.
8576         (LocalVariableReference.DoResolveBase): Update.
8577
8578 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8579
8580         * class.cs (MethodOrOperator): Moved common parts from method class.
8581         detect obsolete attributes.
8582         (Method.Define): Simplified as it reuses code from base.
8583         (Constructor.ValidAttributeTargets): Fixed issue found during
8584         refactoring.
8585         (Destructor.ValidAttributeTargets): Fixed issue found during
8586         refactoring.
8587         (Operator): Finished refactoring set off by #78020. Operator class is now
8588         ordinary method class.
8589
8590         * anonymous.cs: Updated.
8591
8592         * decl.cs (DeclSpace): Add IsGeneric
8593
8594 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8595
8596         * class.cs (Constructor.Emit): Don't emit the attributes twice.
8597
8598 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8599
8600         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
8601         detect obsolete attributes.
8602         (Method.CreateEmitContext): Moved to MethodOrOperator.
8603
8604 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8605
8606         A fix for #78048.
8607         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
8608         customized exception to make crash detection easier.
8609         (MethodOrOperator): Started to work on new base class for methods and
8610         operators.
8611         (Method): Derives from MethodOrOperator.
8612         (Constructor.Emit): Emits its own attributes.
8613         (AbstractPropertyEventMethod.Emit): Ditto.
8614         (Operator): Derives from MethodOrOperator, will refactor fully in extra
8615         patch.
8616         (Operator.Emit): It's temporary more tricky than should be.
8617         
8618         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
8619
8620         * report.cs (InternalErrorException): Add ctor with inner exception.
8621
8622 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
8623
8624         A fix for #76744.
8625         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
8626         only not visible.
8627
8628 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
8629
8630         A fix for #77916.
8631         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
8632         array.
8633
8634 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
8635
8636         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
8637         attribute is present and Guid not.
8638         (Interface.ApplyAttributeBuilder): Ditto.
8639
8640         * attribute.cs: Add error message.
8641
8642 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
8643
8644         A fix for #78020.
8645
8646         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
8647         sources (it's composite) so hold them in extra array as they are used in
8648         Emit phase only. It worked in the previous versions by mistake.
8649         (Attribute.Emit): Emit attribute for more owners when exist.
8650
8651         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
8652         it has now different behaviour.
8653
8654 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
8655
8656         * constant.cs (Constant.IsDefaultInitializer): New method.
8657
8658         * class.cs: Updated.
8659
8660         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
8661         re-initialize default values. It saves KBs almost for every assembly.
8662         Thanks Zoltan for the idea.
8663         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
8664         (ArrayCreation.DoResolve): Resolve only once.
8665         (ArrayCreation.Emit): Emit static initializer only when it is faster.
8666         (ArrayCreation.GetAttributableValue): Cope with optimized values.
8667
8668 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
8669
8670         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
8671         From #77961.
8672
8673 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
8674
8675         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
8676         in an embedded statement too.
8677
8678 2006-04-01  Raja R Harinath  <rharinath@novell.com>
8679
8680         Fix #77958
8681         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
8682
8683 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
8684
8685         A fix for #77966.
8686
8687         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
8688         was not specified.
8689
8690         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
8691
8692 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
8693
8694         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
8695         phase.
8696
8697         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
8698         LocalTemporary change.
8699
8700         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
8701         TypeContainer.
8702         (ClassOrStruct.DefineFieldInitializers): Implemented static field
8703         initializers optimization.
8704         (ClassOrStruct.TypeAttr): Moved from modifiers.
8705         (Constructor.CheckBase): Don't crash when static ctor has parameters.
8706         (FieldBase.ResolveInitializer): Resolves initializer.
8707         (FieldBase.HasDefaultInitializer): New property.
8708
8709         * cs-parser.jay: Removed message.
8710
8711         * expression.cs (CompilerGeneratedThis): New specialization.
8712
8713         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
8714
8715 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
8716
8717         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
8718
8719 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
8720
8721         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
8722         be now EnumConstants only.
8723
8724 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
8725
8726         * attribute.cs, driver.cs: Reset more caches.
8727
8728 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8729
8730         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
8731
8732 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8733
8734         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
8735         for easier reuse. Updated all overrides.
8736         (IntegralConstant): New base class for all integral constants.
8737         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
8738         of the constant range, report custom error.
8739         (UIntConstant.Reduce): Fixed uint conversion.
8740
8741         * ecore.cs, literal.cs: Reduce updates.
8742
8743 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8744
8745         A fix for #75813.
8746
8747         * class.cs (Constructor.Define): Removed extra if for default ctors.
8748         A patch from Atsushi Enomoto.
8749
8750 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8751
8752         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
8753         GetAttributableValue.
8754
8755         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
8756         when required.
8757
8758         * convert.cs (ImplicitConversionRequired): Error message moved to
8759         DoubleLiteral.
8760
8761         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
8762         automatic implicit conversion of an output value.
8763         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
8764
8765         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
8766         conversion.
8767         (TypeOf.GetAttributableValue): Add extra handling for object type.
8768
8769         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
8770         special error message.
8771
8772 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
8773
8774         * class.cs (Constructor.Emit): Don't crash when struct ctor is
8775         InternalCall.
8776         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
8777         compatible with MS runtime.
8778
8779 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
8780
8781         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
8782         attribute arguments here.
8783
8784         * class.cs (Indexer.Define): The check was moved to attribute class.
8785
8786 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
8787
8788         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
8789         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
8790         easier.
8791
8792 2006-03-22  Raja R Harinath  <rharinath@novell.com>
8793
8794         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
8795         mcs to keep code differences small.
8796         * attribute.cs (Attribute.GetParameterDefaultValue): New.
8797         * typemanager.cs (parameter_default_value_attribute_type): New.
8798         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
8799         CS1908 check.
8800
8801 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
8802
8803         * expression.cs (StringConcat.Append): Reverted back to no warning state.
8804
8805 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
8806
8807         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
8808
8809         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
8810         the blocks too.
8811
8812 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
8813
8814         * doc-bootstrap.cs : fix build.
8815
8816 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
8817
8818         * expression.cs (StringConcat.Append): Issue a warning when empty string
8819         is going to append.
8820
8821 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
8822
8823         * assign.cs (CompoundAssign.ResolveSource): Removed.
8824
8825         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
8826         clean up.
8827
8828         * class.cs (TypeContainer.FindMethods): Removed.
8829         (TypeContainer.CheckMemberUsage): Made static.
8830
8831         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
8832
8833         * constant.cs (CheckRange): Removed unused type argument.
8834         (CheckUnsigned): Removed unused type argument.
8835
8836         * cs-parser.jay: Updated after MemberAccess clean up.
8837         Uses Length for empty string test.
8838
8839         * cs-tokenizer.cs: Uses Length for empty string test.
8840         (IsCastToken): Made static.
8841         (is_hex): Made static.
8842         (real_type_suffix): Made static.
8843
8844         * decl.cs (SetupCache): Made static.
8845         (OnGenerateDocComment): Removed unused ds argument.
8846
8847         * delegate.cs (VerifyDelegate): Removed unused argument.
8848
8849         * doc.cs: Uses Length for empty string test.
8850
8851         * driver.cs: Uses Length for empty string test.
8852
8853         * enum.cs (IsValidEnumType): Made static
8854
8855         * expression.cs (EnumLiftUp): Removed unused argument.
8856         (ResolveMethodGroup): Ditto.
8857         (BetterConversion): Ditto.
8858         (GetVarargsTypes): Ditto.
8859         (UpdateIndices): Ditto.
8860         (ValidateInitializers): Ditto.
8861         (MemberAccess.ctor): Ditto.
8862         (GetIndexersForType): Ditto.
8863
8864         * flowanalysis.cs: (MergeFinally): Removed unused argument.
8865
8866         * iterators.cs: Updated after MemberAccess clean up.
8867
8868         * location.cs: Uses Length for empty string test.
8869
8870         * namespace.cs: Uses Length for empty string test.
8871
8872          * report.cs (CheckWarningCode): Made static.
8873
8874         * statement.cs (LabeledStatement): Removed unused argument.
8875
8876         * typemanager.cs (FilterNone): Removed.
8877
8878 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8879
8880         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
8881         obsolete.
8882
8883         * class.cs: Updated.
8884
8885 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8886
8887         * cs-parser.jay.cs: __arglist is not allowed for delegates.
8888
8889 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8890
8891         A fix for #77822.
8892
8893         * expression.cs (VerifyArgumentsCompat): Reverted to double error
8894         reporting, it's more tricky than I thought.
8895
8896 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8897
8898         A fix for #77816.
8899
8900         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
8901         host container.
8902         (AnonymousMethod.ImplicitStandardConversionExists): New method.
8903         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
8904         Add more error reporting; Fixed issue with params.
8905
8906         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
8907
8908         * cs-parser.jay: AnonymousMethod requires host container.
8909
8910         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
8911
8912 2006-03-18  Raja R Harinath  <harinath@gmail.com>
8913
8914         * class.cs: Change 'TypeContainer ds' constructor argument to
8915         'DeclSpace parent'.  Some classes were missed below due to
8916         different naming convention.
8917
8918         * class.cs (MemberCore.Parent): Delete.  This makes the
8919         ParentContainer changes below enforceable by the compiler.
8920
8921         Treat pointers to enclosing declaration space as 'DeclSpace', not
8922         'TypeContainer'.
8923         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
8924         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
8925
8926         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
8927         of TypeContainer.
8928         (Block.AddThisVariable): Likewise.
8929         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
8930         (AbstractPropertyEventMethod.Emit): Likewise.
8931         (AbstractPropertyEventMethod.EmitMethod): Likewise.
8932         (GetMethod.Define, SetMethod.Define): Likewise.
8933         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
8934         (DelegateMethod.EmitMethod): Likewise.
8935
8936         Fix regression test-partial-13.cs.
8937         Rationalize use of PartialContainer.  Ensure that the partial
8938         class semantics can be tied to type-correctness, i.e., any
8939         violation will cause a compile error.
8940         * class.cs, const.cs: Access all fields that belong to class
8941         TypeContainer via ParentContainer.  Arguments of EmitContexts and
8942         Resolve()-like functions still use 'Parent'.
8943
8944         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
8945         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
8946         (PropertyMethod.CheckModifiers): Remove unused argument.
8947         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
8948         DeclSpace.
8949
8950 2006-03-17  Raja R Harinath  <harinath@gmail.com>
8951
8952         Make semantics of PartialContainer simpler.
8953         * decl.cs (DeclSpace.IsPartial): Remove.
8954         * class.cs (TypeContainer.IsPartial): Likewise.
8955         (TypeContainer..ctor): Set PartialContainer to point to self.
8956         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
8957         (TypeContainer.FindNestedType): Likewise.
8958         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
8959
8960 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
8961
8962         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
8963
8964 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
8965
8966         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
8967         classes.
8968
8969 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
8970
8971         * class.cs (Operator.Define): An error for base conversion was not
8972         reported correctly.
8973
8974 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
8975
8976         * iterator.cs : yield break is allowed in try statement which has
8977           catch clauses. Fixed bug #77767.
8978
8979 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
8980
8981         A fix for #77593, #77574.
8982
8983         * class.cs (MethodCore.CheckBase): Another if for operator.
8984
8985 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
8986
8987         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
8988         were not resolved
8989
8990         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
8991         (DelegateCreation.ImplicitStandardConversionExists): New method for just
8992         conversion test.
8993         
8994         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
8995         not needed.
8996
8997         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
8998         Updated after another emitcontext usage was clean up. It should help us to
8999         synchronize with gmcs easier.
9000
9001 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
9002
9003         A fix for #77353.
9004
9005         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
9006         (Event.Define): ditto
9007         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
9008
9009         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
9010         Removed redundant code and set NewSlot for Invoke method too.
9011
9012         * parameter.cs (Parameters.ctor): Add custom, type ctor.
9013         (Parameters.MergeGenerated): New method. Use this method when you merge
9014         compiler generated argument with user arguments.
9015
9016 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
9017
9018         * attribute.cs (ResolveAsTypeTerminal): Removed.
9019
9020         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
9021         specialization for predefined types; 30% speed up.
9022         Finally placed obsolete check to right place.
9023         (Expression.ResolveType): Removed.
9024
9025         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
9026         Updated after ResolveType was removed.
9027
9028         * expression.cs (Cast.ctor): Check void cast.
9029         (Binary.ResolveAsTypeTerminal): Is never type.
9030         (Conditional.ResolveAsTypeTerminal): Is never type.
9031
9032         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
9033
9034 2006-03-01  Raja R Harinath  <rharinath@novell.com>
9035
9036         Fix #77679.
9037         * expression.cs (ParameterReference.DoResolveBase): Change return
9038         type to bool.
9039         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
9040         Update.
9041
9042         Fix #77628.
9043         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
9044
9045         Fix #77642.
9046         * typemanager.cs (GetFullNameSignature): Don't nullref on
9047         protected accessors.
9048
9049 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
9050
9051         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
9052         these two separated members to simplify the code.
9053         (Attribute.Resolve): Refactored to use new fields and methods.
9054         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
9055         implemented obsolete attribute checking.
9056         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
9057         implemented obsolete checking again. It look line never ending quest ;-)
9058         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
9059
9060         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
9061
9062         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
9063
9064         *class.cs (Property.Define): Add RegisterProperty call.
9065
9066         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
9067         argument groups (only 2).
9068
9069         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
9070         encoding expression to arguments.
9071         (Expression.ExprClassToResolveFlags): Just turned to property.
9072
9073         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
9074         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
9075         optimized as well as implemented support for zero-length attributes.
9076
9077         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
9078         Add caching of PropertyInfo's.
9079
9080 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
9081
9082         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
9083         error multiple times.
9084
9085 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
9086
9087         New partial class implementation.
9088         A fix for #77027, #77029, #77403
9089
9090         * attribute.cs (Attributable): Made attributes protected.
9091
9092         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
9093         the replacements of ClassPart and PartialContainer.
9094         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
9095         (TypeContainer.AddInterface): Ditto.
9096         (TypeContainer.AddPartial): The main method for partial classes. It checks
9097         for errors and merges ModFlags and attributes. At the end class is added to
9098         partial_parts list.
9099         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
9100         required here.
9101         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
9102         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
9103         from the rest of partial classes.
9104         (TypeContainer.GetClassBases): Simplified.
9105         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
9106         DefineType.
9107         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
9108         (TypeContainer.HasExplicitLayout): Uses Flags now.
9109         (PartialContainer): Removed.
9110         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
9111         (StaticClass): Was merged with Class.
9112         (Class.GetClassBases): class and static class bases are verified here.
9113         (Class.TypeAttr): Added static attributes when class is static.
9114         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
9115         (MemberBase): In some cases we need to call parent container for partial
9116         class. It should be eliminated but it's not easy now.
9117
9118         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
9119
9120         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
9121         partial classed to accumulate class comments.
9122         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
9123
9124         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
9125
9126         * driver.cs (MainDriver): Tree.GetDecl was removed.
9127
9128         * modifiers.cs (Modifiers): Add partial modifier.
9129
9130         * tree.cs (Tree.decl): Removed.
9131         (RootTypes): Started to use this class more often for root types
9132         specializations.
9133
9134 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
9135
9136         A fix for #77615
9137
9138         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
9139         external interface does not have an attribute.
9140
9141 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
9142
9143         Another prerequisites for new partial classs implementation.
9144         
9145         * attribute.cs (Attribute.Equal): Implemented.
9146         (Attribute.Emit): Changed as attributes can be applied more than twice.
9147         (Attributes.Emit): Check for duplicate attributes here.
9148
9149         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
9150         as a parameter, clean-up.
9151
9152 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
9153
9154         A fix for #77485
9155
9156         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
9157         contains obsolete attribute check which can in some cases look for base
9158         type of current class which is not initialized yet.
9159         (TypeContainer.BaseType): Replacement of ptype.
9160
9161         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
9162
9163 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
9164
9165         First of prerequisites for new partial classs implemention.
9166         
9167         * attribute.cs (Attributable): Extended by ResolveContext;
9168         Attributes finally have correct context for resolving in all cases.
9169         (AttachTo): Attribute owner is assigned here.
9170
9171         * codegen.cs (IResolveContext): Introduce new interface to hold
9172         all information needed in resolving phase.
9173         (EmitContext): Implements IResolveContext; more clean-up needed here.
9174         
9175         * decl.cs (MemberCore): Implemented IResolveContext.
9176
9177         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
9178         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
9179         parameter.cs, statement.cs, tree.cs, typemanager.cs:
9180         Refactored to use new IResolveContext instead of EmitContext; cleanup
9181
9182 2006-02-06  Miguel de Icaza  <miguel@novell.com>
9183
9184         * codegen.cs (EmitScopeInitFromBlock): check here the
9185         capture_context, there is no need to make two calls to the
9186         EmitContext. 
9187
9188         * anonymous.cs: Add some debugging messages that might help me
9189         track other instances of this problem in the future (the
9190         regression of test 467).
9191
9192         * cs-parser.jay: track the variable block, as we need to initalize
9193         any captured variables declared in this block for the "catch"
9194         portion of the "Try" statement.
9195
9196         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
9197         scope initialization for captured variables. 
9198
9199         Also, move the emit for the variables after the block location has
9200         been marked.
9201
9202 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
9203
9204         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
9205
9206 2006-02-02  Miguel de Icaza  <miguel@novell.com>
9207
9208         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
9209         commit yesterday, the initialization for the roots is necessary.
9210         What is not necessary is the scope activation.
9211
9212 2006-02-02  Raja R Harinath  <rharinath@novell.com>
9213
9214         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
9215         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
9216         CS0206 checks.
9217         (Argument.Resolve): Remove CS0206 checks.
9218
9219 2006-02-01  Miguel de Icaza  <miguel@novell.com>
9220
9221         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
9222         scopes for all the roots, the scopes will now be emitted when the
9223         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
9224
9225         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
9226         code.  This reduces a lot of existing cruft.
9227         
9228         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
9229         that the ScopeInfo is generated as we enter the scope, not at the
9230         time of use, which is what we used to do before.
9231
9232         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
9233         every time a Block is about to be emitted if we have a
9234         CaptureContext. 
9235
9236 2006-02-01  Raja R Harinath  <rharinath@novell.com>
9237
9238         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
9239         (Reset): Update.
9240         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
9241
9242         * typemanager.cs (cons_param_array_attribute): Make private.
9243         (Reset): Set it to null.
9244         (InitCoreHelpers): Don't initialize it.
9245         (ConsParamArrayAttribute): New.  Initialize it as needed.
9246         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
9247
9248 2006-01-31  Miguel de Icaza  <miguel@novell.com>
9249
9250         * expression.cs: There might be errors reported during the
9251         selection of applicable methods.  If there are errors, do not
9252         continue execution as it will lead the compiler to crash.
9253
9254 2006-01-30  Miguel de Icaza  <miguel@novell.com>
9255
9256         * expression.cs: Member access is not allowed on anonymous
9257         methods.  Fixes #77402.
9258
9259 2006-01-30  Raja R Harinath  <rharinath@novell.com>
9260
9261         Fix #77401
9262         * cs-parser.jay (VariableDeclaration): Don't set
9263         current_array_type to null.
9264         (field_declaration, event_declaration, declaration_statement):
9265         Set it to null here.
9266
9267 2006-01-28  Raja R Harinath  <harinath@gmail.com>
9268
9269         * typemanager.cs (GenericParameterPosition): New.
9270         * doc.cs: Use it.
9271
9272 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
9273
9274         * doc.cs : To process "include" elements, first we should create
9275           another list than XmlNodeList, because it could result in node
9276           removal, which could result in that the XmlNodeList gives up
9277           yielding next node.
9278
9279           (Also made code identical to gmcs again.)
9280
9281 2006-01-25  Miguel de Icaza  <miguel@novell.com>
9282
9283         * ecore.cs: Introduce an error report that we were not catching
9284         before, if not silent, we must report the error.  Gonzalo ran into
9285         it.
9286
9287 2006-01-23  Miguel de Icaza  <miguel@novell.com>
9288
9289         A fix for bug: #76957
9290         
9291         * iterators.cs (MoveNextMethod.CreateMethodHost): call
9292         ComputeMethodHost before creating the method, this is a new
9293         requirement. 
9294
9295         * anonymous.cs (AnonymousContainer): Now we track all the scopes
9296         that this method references (RegisterScope).  The actual scope
9297         where the method is hosted is computed with the ComputeMethodHost
9298         before we create the method.
9299
9300         Moved the Deepest routine here.
9301
9302         (AnonymousContainer.ComputeMethodHost): New routine used to
9303         compute the proper ScopeInfo that will host the anonymous method.
9304
9305         (ScopeInfo): Deal with multiple roots.  The problem was that we
9306         did not have a unique root where all ScopeInfos could be hanged
9307         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
9308         of roots.  
9309
9310         Remove AdjustMethodScope which is now computed at the end.  Remove
9311         LinkScope which did a partial link, instead link all ScopeInfos
9312         before code generation from the new "LinkScopes" routine. 
9313
9314         Simplify all the Add* routines as they no longer need to maintain
9315         the tree, they just need to record that they are using variables
9316         from a ScopeInfo.
9317
9318         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
9319         routines to produce the forest of ScopeInfo trees.
9320
9321         * class.cs (TypeContainer.AppendMethod): This is just like
9322         AddMethod, but ensures that an interface implementation method
9323         (IEnumerable.XXX) is not inserted at the beginning of the queue of
9324         methods, but at the end.
9325
9326         We use this functionality to ensure that the generated MoveNext
9327         method in the iterator class is resolved/emitted before the
9328         enumerator methods created.   
9329
9330         This is required because the MoveNext method computes the right
9331         ScopeInfo for the method.  And the other methods will eventually
9332         need to resolve and fetch information computed from the anonymous
9333         method. 
9334
9335 2006-01-21  Raja R Harinath  <harinath@gmail.com>
9336             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
9337
9338         Fix rest of #76995.
9339         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
9340         the 'aliases' hash.
9341         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
9342         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
9343
9344 2006-01-18  Raja R Harinath  <rharinath@novell.com>
9345
9346         Fix #76656, cs0231-2.cs.
9347         * cs-parser.jay (formal_parameter_list): Make error case catch
9348         more issues.
9349         (parenthesized_expression_0): Add CS1026 check.
9350         (invocation_expression): Remove unused { $$ = lexer.Location }.
9351
9352 2006-01-17  Raja R Harinath  <rharinath@novell.com>
9353
9354         Fix #76824.
9355         * cs-parser.jay (statement_expression): Don't list out the
9356         individual statement-expressions.  Convert syntax error into
9357         CS0201 check.
9358
9359 2006-01-16  Raja R Harinath  <rharinath@novell.com>
9360
9361         Fix #76874.
9362         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
9363         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
9364         CheckIntermediateModification.
9365         (FieldExpr.DoResolve): Add new two-argument version that
9366         allows us to resolve the InstanceExpression as an lvalue.
9367         The one-argument variant is now just a wrapper.
9368         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
9369         Resolve the lhs as an lvalue if the it has a value type.
9370         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
9371         from Assign.DoResolve.
9372         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
9373         resolved as an lvalue.
9374         (PropertyExpr.DoResolve): Update.
9375         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
9376         has a value type.  Move CS1612 check here from
9377         CheckIntermediateModification.
9378         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
9379         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
9380         'right_side' of a ResolveLValue on an 'out' argument.
9381         (EmptyExpression.LValueMemberAccess): New.  Used as the
9382         'right_side' of a propagated ResolveLValue on a value type.
9383         (LocalVariableReference.DoResolveBase): Recognize
9384         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
9385         Add CS1654 check.
9386         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
9387         EmptyExpression.Null.
9388
9389 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
9390
9391         * typemanager.cs : added IsGenericParameter(). In mcs it always
9392           return false.
9393         * doc.cs : for generic parameters, use GenericParameterPosition,
9394           not FullName.
9395
9396 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
9397
9398         * expression.cs: Fix Console.WriteLine ((this = x).foo);
9399
9400 2006-01-12  Miguel de Icaza  <miguel@novell.com>
9401
9402         This fixes the problem where we used ldfld instead of ldflda to
9403         load the "THIS" pointer on captured parameters, when THIS is a
9404         value type.  See bug #77205.
9405         
9406         * iterators.cs (CapturedThisReference.Emit): Pass false to
9407         EmitThis (we do not need the address).
9408
9409         * codegen.cs (EmitThis): it needs to know whether we need the
9410         address of `this' or not.  This is used by value types.  
9411
9412         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
9413         every other call passes false.
9414
9415 2006-01-12  Raja R Harinath  <rharinath@novell.com>
9416
9417         Fix #77221.
9418         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
9419         GetOverride.
9420         * expression.cs (Invocation.OverloadResolve): Update.
9421         (Invocation.DoResolve): Avoid double resolution of invocation.
9422
9423 2006-01-11  Raja R Harinath  <rharinath@novell.com>
9424
9425         Fix #77180.
9426         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
9427         unary negation of floating point types as 0-expr; negation cannot
9428         overflow in floating point types.
9429
9430         Fix #77204.
9431         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
9432         on operands of 'void' type.
9433
9434         Fix #77200.
9435         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
9436         and ExclusiveOr for boolean constants too.
9437
9438 2006-01-09  Raja R Harinath  <rharinath@novell.com>
9439
9440         Fix #75636.
9441         * expression.cs (Invocation.OverloadResolve): Replace reflected
9442         override methods with their base virtual methods, rather than
9443         skipping over them.
9444         * typemanager.cs (TypeManager.GetOverride): New.
9445
9446 2006-01-05  Jb Evain  <jbevain@gmail.com>
9447
9448         * class.cs (Property.Define, Indexer.Define): do not tag the
9449         properties as SpecialName | RTSpecialName.
9450
9451 2006-01-04  Miguel de Icaza  <miguel@novell.com>
9452
9453         * class.cs (MethodCore.IsDuplicateImplementation): This method was
9454         doing a low-level comparission of parameter types.  It was lacking
9455         a check for __argslist. 
9456
9457 2005-12-30  Miguel de Icaza  <miguel@novell.com>
9458
9459         * expression.cs (ParameterReference.DoResolveBase): Allow
9460         reference parameters if they are local to this block. 
9461
9462         This allows the ref and out parameters of a delegate to be used in
9463         an anonymous method, for example:
9464
9465         delegate void set (out int x);
9466
9467         set s = delegate (out int x){
9468                 x = 0;
9469         };
9470
9471         This is used by functionality introduced late in the C# language.
9472         
9473         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
9474         method that take ref and out parameters. 
9475
9476         Fixes #77119 which was a late change in the spec.
9477
9478 2005-12-23  Miguel de Icaza  <miguel@novell.com>
9479
9480         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
9481         parent if its the same scope.  Fixes #77060.
9482
9483 2005-12-21  Miguel de Icaza  <miguel@novell.com>
9484
9485         * driver.cs: Report the case of no source files and no -out:
9486         argument provided.
9487
9488 2005-12-20  Raja R Harinath  <rharinath@novell.com>
9489
9490         Fix #77035.
9491         * expression.cs (ComposedCast.GetSignatureForError): Define.
9492
9493 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9494
9495         Fix #76995
9496
9497         * namespace.cs (NamespaceEntry): Add extern_aliases as a
9498         ListDictionary, to contain the ExternAliasEntry entries (in
9499         addition to the NamespaceEntry.aliases hashtable). This field is
9500         shared between the original entry and its doppelganger (bodyless 
9501         copy of it).
9502         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
9503         extern_aliases field.
9504         (NamespaceEntry.Lookup): Move the IsImplicit check after the
9505         lookup in extern_aliases.
9506
9507 2005-12-16  Raja R Harinath  <rharinath@novell.com>
9508
9509         Fix #77006.
9510         * class.cs (TypeContainer.Mark_HasEquals): New.
9511         (TypeContainer.Mark_HasGetHashCode): New.
9512         (ClassPart): Override them.
9513         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
9514
9515         Fix #77008.
9516         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
9517         'parent' argument to the base constructor.
9518
9519         Remove all mention of TypeContainer from decl.cs.
9520         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
9521         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
9522         (DeclSpace.DeclSpace): Likewise.
9523         (DeclSpace.DefineMembers): Remove unused argument.
9524         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
9525         debugging check -- we don't care if the debug code throws an
9526         InvalidCastException instead of an InternalErrorException.
9527         * class.cs (TypeContainer.DefineMembers): Update to changes.
9528         (TypeContainer.DoDefineMembers): Likewise.
9529         (TypeContainer.GetMethods): Likewise.
9530         (PropertyMember.Define): Likewise.
9531         (MemberBase.Parent): New property that forwards to
9532         MemberCore.Parent, but ensures that we get a TypeContainer.
9533         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
9534         (RootContext.PopulateTypes): Likewise.  Remove special case code
9535         for !RootContext.StdLib: DefineMembers is idempotent.
9536
9537 2005-12-14  Miguel de Icaza  <miguel@novell.com>
9538
9539         * convert.cs (ExplicitConversionCore): Check the return value from
9540         ExplicitConversionCore which can return null on failure.  Fixes #76914
9541
9542 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
9543
9544         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
9545
9546 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
9547
9548         * doc.cs : The search for referenced namespace was insufficient to
9549           get global one as it used to do. Fixed bug #76965.
9550
9551 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
9552
9553         * doc.cs : check name in cref in the last phase that whether it is
9554           namespace or not.
9555
9556 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
9557
9558         * cs-tokenizer.cs : reverted the latest change: it somehow broke
9559           Mono.C5.
9560
9561 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
9562
9563         * doc.cs : so it turned out that we cannot skip override check for 
9564           interface members. Fixed bug #76954.
9565
9566 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
9567
9568         * cs-tokenizer.cs : fixed bug #75984:
9569           - #warning and #error should not be handled when the source line
9570             is disabled.
9571           - #line is not checked strictly when the source line is disabled.
9572           - #define and #undef is on the other hand checked strictly at any
9573             state.
9574
9575 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
9576
9577         * cs-tokenizer.cs : missing Location (actually, filename) in one of
9578           CS1027 report.
9579
9580 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
9581
9582         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
9583
9584         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
9585         event initializers.
9586         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
9587         (FieldBase.Initializer): Initializer is now optional.
9588         (EventField.Define): Only event field can have initializer.
9589
9590         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
9591
9592         * const.cs (Const): Reuse initializer.
9593
9594         * cs-parser.jay: Updated after FieldBase changes.
9595         Added current_array_type to simplify array initializers.
9596
9597         * ecore.cs (NullCast.IsDefaultValue): Implemented.
9598
9599         * expression.cs, iterators.cs: Updated.
9600
9601         * namespace.cs (NamespaceEntry): Made UsingFound private.
9602
9603 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
9604
9605         * parameterCollection.cs: Obsolete, removed.
9606         * parser.cs: Obsolete, removed.
9607
9608 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
9609
9610         Fix #76849.
9611         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
9612
9613         * enum.cs (Enum.Define): Set obsolete context here.
9614
9615 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
9616
9617         * doc.cs :
9618           - FindDocumentedMember() now expects 1) paramList as null
9619             when "we don't have to check the number of parameters" and
9620             2) Type.EmptyTypes when "there is no arguments".
9621           - Introduced FoundMember struct to hold the exact type which was
9622             used to find the documented member (the above change broke
9623             test-xml-044; it might be better just to use DeclaringType than
9624             what MS does, like this change does, but it depends on usage.)
9625
9626 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
9627
9628         * doc.cs : documented member might be from DeclaringType for nested
9629           types. Fixed bug #76782.
9630
9631 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
9632
9633         * anonymous.cs: Have the param code handle leaving copies on the
9634         stack etc. Allows anonymous params to take part in the assignment
9635         code (++, +=, etc). Fixes bug #76550
9636
9637         * expression.cs: Handle the prepare_for_load/leave_copy by passing
9638         it down to the anon code.
9639
9640         * iterators.cs: Use dummy var here
9641
9642         * codegen.cs: Handle new vars
9643
9644 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
9645
9646         Fix #76849.
9647         * class.cs (MethodData.Define): Set proper Obsolete context.
9648
9649         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
9650         obsolete context.
9651         (FieldExpr.DoResolve): Ditto.
9652
9653 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
9654
9655         Fix #76849.
9656         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
9657         parent is not obsolete.
9658
9659 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
9660
9661         * doc.cs : (FindDocumentedMember) find parameterless members first
9662           and get CS0419 in the early stage. Fixed first case of bug #76727.
9663
9664 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
9665
9666         Fix #76859.
9667         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
9668         no error was reported.
9669
9670         *expression.cs (Binary.DoResolve): left can be null.
9671
9672 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
9673
9674         Fix #76783.
9675         * class.cs (MethodData.Emit): Parameters should be labeled first.
9676
9677 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
9678
9679         Fix #76761.
9680         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
9681
9682 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
9683
9684         * attribute.cs (AreParametersCompliant): Moved to Parameter.
9685
9686         * class.cs (MethodCore): Parameter clean up.
9687         (IMethodData): Added ParameterInfo.
9688         (MethodData): Parameter clean up.
9689         (Indexer.Define): Parameter clean up.
9690
9691         * anonymous.cs,
9692         * codegen.cs,
9693         * cs-parser.jay,
9694         * decl.cs,
9695         * doc.cs,
9696         * ecore.cs,
9697         * flowanalysis.cs,
9698         * iterators.cs,
9699         * pending.cs,
9700         * statement.cs,
9701         * typemanager.cs: Parameter clean up.
9702
9703         * delegate.cs (Define): Get rid of duplicated code.
9704
9705         * expression.cs (ParameterReference): Removed useless parameters
9706         and simplified.
9707         (Invocation): Ditto.
9708
9709         * parameter.cs (ParamsParameter): New class, params specialization.
9710         (ArglistParameter): Attemp to separate arglist.
9711         (Parameter): Refactored to be reusable and faster.
9712         (Parameter.Modifier): Made understandable.
9713         (Parameters): Changed to be used as a class for `this' assembly
9714         parameters. Refactored to use new specialized classes.
9715
9716         * support.cs (ParameterData): Added Types property.
9717         (InternalParameters): Deleted.
9718
9719 2005-08-20  Martin Baulig  <martin@ximian.com>
9720
9721         Merging this patch from GMCS to fix #75867.
9722
9723         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
9724         scope if we don't already have it.
9725
9726 2005-11-17  Martin Baulig  <martin@ximian.com>
9727
9728         * anonymous.cs
9729         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
9730         inherit the scope from our parent.  Fixes #76653.
9731
9732 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9733
9734         * doc.cs : the previous patch does not actually fix the bug.
9735           PropertyInfo override check is now implemented and really fixed it.
9736         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
9737
9738 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9739
9740         * doc.cs : apply "override filter" also to properties.
9741           Fixed bug #76730.
9742
9743 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9744
9745         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
9746           no need to check overrides. For classes, omit those results from 
9747           interfaces since they must exist in the class. Fixed bug #76726.
9748
9749 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9750
9751         * typemanager.cs : (GetFullNameSignature) differentiate indexers
9752           with different parameters. Fixed the second problem in #76685.
9753
9754 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9755
9756         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
9757           get expected 'protected' access in CheckValidFamilyAccess()).
9758           Fixed bug #76692.
9759
9760 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9761
9762         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
9763           Fixed bug #76705.  CS1569 was incorrectly commented out.
9764
9765 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
9766
9767         * doc.cs : use Invocation.IsOverride() to do real override check.
9768         * expression.cs : made Invocation.IsOverride() internal.
9769
9770 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
9771
9772         * doc.cs : use TypeManager.FindMembers() instead of (possible)
9773           TypeBuilder.FindMembers() and filter overriden base members out.
9774           Fixed bug #76990.
9775
9776 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9777
9778         * doc.cs : ref/out parameters are represented as '@' (instead of
9779           '&' in type FullName). Fixed bug #76630 (additionally crefs).
9780
9781 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9782
9783         * doc.cs : when there was no '.' in cref to methods in doc comment,
9784           then parameters were missing in the output. Fixed bug #76691.
9785
9786 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9787
9788         * driver.cs : don't output docs when there is an error.
9789           Fixed bug #76693.
9790
9791 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9792
9793         * doc.cs :
9794           Now it should detect indexers. Fixed primary concern in bug #76685.
9795           Fixed CS0419 message to not show the identical member signature in
9796           the message.
9797
9798 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9799
9800         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
9801           instead of Type.FindMembers() since it does not handle events.
9802           Fixed bug #71604.
9803
9804 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
9805
9806         * codegen.cs: Fixed typo (speficied -> specified).
9807
9808 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
9809
9810         Fix #76369.
9811         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
9812
9813 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
9814
9815         * attribute.cs: Changed error message.
9816
9817         * cs-tokenizer.cs: One more check.
9818
9819 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
9820
9821         * statement.cs (Block.Resolve): Ignore empty statement.
9822
9823 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
9824
9825         * report.cs: Made error/warning methods more strict to avoid
9826         their misuse.
9827
9828         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
9829         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
9830         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
9831         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
9832
9833 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
9834
9835         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
9836         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
9837
9838         * class.cs (TypeContainer.IsComImport): New property.
9839         (Constructor.Define): Create proper ctor for ComImport types.
9840
9841         * expression.cs (New.CheckComImport): Fixed.
9842
9843 2005-11-07  Miguel de Icaza  <miguel@novell.com>
9844
9845         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
9846         that a parameter has been captured does not mean that we do not
9847         have to do the rest of the processing.  This fixes the second part
9848         of #76592.  If there was another anonymous method capturing
9849         values in the past, the Scope would never be set for the second
9850         method that captured the same parameter.
9851
9852         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
9853         properly manipulate the stack.   Second part of fix for #76592.
9854
9855         * expression.cs (New): Add support for invoking "new" on
9856         interfaces that have been flagged with the ComImport attribute and
9857         the CoClass.  Fixes #76637 
9858
9859         * statement.cs (Try.DoEmit): When a variable is captured, do not
9860         try to emit the vi.LocalBuilder variable as it has been captured.
9861         Create a temporary variable and store the results on the
9862         FieldBuilder.  Fixes #76642
9863
9864 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
9865
9866         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
9867
9868         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
9869
9870         * expression.cs (Binary.DoResolve): Added && optimalization.
9871     
9872         * typemanager.cs (AddUserType): Removed useless argument.
9873
9874 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
9875
9876         * statement.cs (Block.variables): Uses ListDictionary.
9877
9878 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
9879
9880         Fix #75969.
9881         * class.cs (PartialContainer.EmitType): Customized to emit
9882         security attributes.
9883         (ClassPart.ApplyAttributeBuilder): Transform security attribute
9884         for partial classes.
9885
9886 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
9887
9888         Fix #76599.
9889         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
9890         access has to be fixed.
9891         
9892         * typemanager.cs (IsUnmanagedType): Wrong common field type.
9893
9894 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
9895
9896         Fix #76590.
9897         * ecore.cs (NullCast.Reduce): Implemented.
9898
9899         * expression.cs (ArrayCreation.CheckIndices): Correcly check
9900         constant type.
9901         
9902         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
9903         properly.
9904         (Foreach.Resolve): Catch null properly.
9905
9906 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
9907  
9908         * cs-tokenizer.cs: Warning text fix.
9909
9910         * driver.cs: AllWarningNumbers exposed on public interface.
9911
9912         * report.cs (): Reviewed warning numbers.
9913         (IsValidWarning): Use binary search.
9914
9915 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
9916  
9917         * driver.cs: Implemeted resource visibility.
9918         (Resources): New class for code sharing between /res: and
9919         /linkres:
9920  
9921 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
9922
9923         Fix #76568.
9924         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
9925         folding.
9926         
9927         * convert (Convert.ImplicitReferenceConversion): NullCast holds
9928         contants only.
9929         
9930         * ecore.cs (NullCast): Child is contant only.
9931         
9932         * literal.cs (NullLiteral.Reduce): null can be converted to any
9933         reference type.
9934
9935 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
9936
9937         * driver.cs: Use Encoding.Default as default code page instead
9938           of ISO-28591.
9939
9940 2005-10-27  Raja R Harinath  <rharinath@novell.com>
9941
9942         Fix #76085.
9943         * expression.cs (Invocation.Error_InvalidArguments): Handle
9944         __arglist parameters.
9945         (Invocation.VerifyArgumentsCompat): Likewise.
9946         * support.cs (ReflectionParameters.GetSignatureForError): Print
9947         __arglist parameters.
9948         (InternalParamters.GetSignatureForError): Likewise.
9949         * parameter.cs (Parameters.GetSignatureForError): Likewise.
9950
9951 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
9952
9953         * attribute.cs (GetPropertyValue): Made public.
9954
9955         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
9956         Resolve.
9957         Add new property WrapNonExceptionThrows to handle 2.0 assembly
9958         attribute.
9959         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
9960         is not defined.
9961         
9962         * driver.cs: Reflect method name change.
9963         
9964         * statement.cs (Try.Resolve): Warn when try has both general
9965         exception handlers.
9966         
9967         * typemanager.cs: runtime_compatibility_attr_type new predefined
9968         type.
9969
9970 2005-10-26  Raja R Harinath  <harinath@gmail.com>
9971
9972         Fix #76419.
9973         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
9974         treat it as an empty parameter list.
9975
9976 2005-10-26  Raja R Harinath  <rharinath@novell.com>
9977
9978         Fix #76271.     
9979         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
9980         ResolveAsTypeStep silent.
9981         * statement.cs (Block.AddConstant): Mark block as used.
9982         (Block.ResolveMeta): Avoid piling on error messages
9983         if a constant initializer resolution fails.
9984
9985 2005-10-25  Raja R Harinath  <rharinath@novell.com>
9986
9987         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
9988         Remove.
9989         (NamespaceEntry.VerifyAllUsing): New.
9990         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
9991         behaviour.  Delegates actual resolution of alias to ...
9992         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
9993         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
9994         Update.
9995         * driver.cs (Driver.MainDriver): Update.
9996         
9997         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
9998         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
9999         property.
10000         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
10001         Remove.
10002         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
10003         RootNamespace.DefineNamespacesForAll.
10004
10005 2005-10-24  Raja R Harinath  <harinath@gmail.com>
10006
10007         * typemanager.cs (assemblies, external_aliases, modules)
10008         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
10009         (ComputeNamespaces, GetRootNamespace): Remove extra staging
10010         overhead.  Move resposibility ...
10011         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
10012         * driver.cs, attribute.cs, codegen.cs: Update to changes.
10013
10014 2005-10-23  Raja R Harinath  <harinath@gmail.com>
10015
10016         * namespace.cs (RootNamespace.all_namespaces): Renamed from
10017         cached_namespaces.  Improve usage.
10018         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
10019         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
10020         Move from GlobalRootNamespace and simplify.
10021         (RootNamespace.Global): Make instance variable.
10022         (RootNamespace.RootNamespace): Add "alias name" parameter.
10023         (GlobalRootNamespace): Simplify drastically.
10024         (Namespace.Lookup): Don't use GetNamespace.
10025         * typemanager.cs (GetRootNamespace): Rename from
10026         ComputeNamespaceForAlias.
10027         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
10028
10029 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
10030
10031         * anonymous.cs (AnonymousContainer): Don't crash when container
10032         doesn't exist.
10033
10034 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
10035
10036         * expression.cs (Binary.DoResolve): Warn when comparing same
10037         values.
10038
10039 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
10040
10041         Fix #76486.
10042         * expression.cs (Binary.DoResolve): It looks like there are no
10043         convetsion rules in enum context.
10044
10045 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10046
10047         Add support for extern alias qualifiers.
10048         * typemanager.cs: Move some LookupTypeReflection code
10049         to namespace.cs, to have cleaner code. Added some methods
10050         to help us keep track of the extern aliased references.
10051         * driver.cs: Add suport for extern alias assemblies on command
10052         line and check for their warnings/errors. Also keep track of the
10053         extern aliased assemblies.
10054         * namespace.cs: Move the global functionality of Namespace
10055         to GlobalRootNamespace/RootNamespace. Now the global namespace
10056         is GlobalRootNamespace.Globa. Also the code moved from 
10057         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
10058         Finally added LocalAliasEntry (AliasEntry before) and
10059         ExternAliasEntry, to handle alias statements.
10060         * cs-parser.jay: Add support in the grammar for extern alias
10061         statement.
10062         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
10063         Update callings to Namespace (now in GlobalRootNamespace).
10064
10065 2005-10-18  Raja R Harinath  <rharinath@novell.com>
10066
10067         Fix #76371.
10068         * class.cs (TypeContainer.DefineType): Move updating of
10069         topological sort earlier in the code.
10070         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
10071
10072 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
10073
10074         Fix #76273.
10075         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
10076         
10077         * constant.cs (Constant.TryReduce): Moved from Cast class.
10078         (Reduce): Made little bit more OO and fixed missing conversions.
10079         
10080         * ecore.cs (Reduce): Implemented.
10081         (Binary.EnumLiftUp): New method to upgrade values to enum values.
10082         
10083         * literal.cs (Reduce): Implemented.
10084         
10085         * class.cs: Reverted Miguel's wrong commit.
10086
10087 2005-10-14  Miguel de Icaza  <miguel@novell.com>
10088
10089         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
10090
10091 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
10092
10093         * cs-parser.jay, expression.cs : CS0214 was missing error location
10094           for constants. Fixed bug #76404.
10095
10096 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
10097
10098         Fix #76370.
10099         * convert.cs (ExplicitConversionCore): Fixed object->enum
10100         conversion.
10101
10102 2005-10-10  Raja R Harinath  <rharinath@novell.com>
10103
10104         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
10105         InstanceExpression.
10106         (PropertyExpr.EmitCall): Likewise.
10107         * expression.cs (Invocation.EmitArguments): Handle case where
10108         arguments == null.
10109         (Invocation.EmitCall): Avoid allocating temporary variable if
10110         there are no arguments.
10111
10112 2005-10-07  Raja R Harinath  <rharinath@novell.com>
10113
10114         Fix #76323.
10115         * convert.cs (ImplicitConversionStandard): Move conversion of
10116         void* to arbitrary pointer types ...
10117         (ExplicitConversionStandard): .. here.
10118         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
10119         error to always print typenames.
10120
10121 2005-10-07  Raja R Harinath  <rharinath@novell.com>
10122
10123         * convert.cs (GetConversionOperator): Rename from
10124         GetConversionOperators.  Move operator selection code from ...
10125         (UserDefinedConversion): ... here.
10126
10127 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
10128
10129         * convert.cs (ExplicitConversionCore): Removed duplicate enum
10130         conversion.
10131
10132 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
10133
10134         * assign.cs (Assign.DoResolve): Error method changed.
10135
10136         * cfold.cs (DoConstantNumericPromotions): Error method changed.
10137         
10138         * const.cs (ResolveValue): Reset in_transit immediately.
10139         
10140         * constant.cs: Error method changed.
10141         
10142         * convert.cs: Removed useless location parameter.
10143         (ExplicitNumericConversion): Don't do double enum check.
10144         (ExplicitConversionCore): Renamed from ExplicitConversion.
10145         (ExplicitUnsafe): Extracted from ExplicitConversion.
10146         (ExplicitConversion): Uses for error reporting.
10147         
10148         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
10149         error messages.
10150         (ResolveBoolean): Uses common error method.
10151         (CastToDecimal): Get rid of ec.
10152         (CastFromDecimal): Optimized.
10153         (ConvCast): Get rid of ec.
10154         
10155         * enum.cs (ResolveValue): Reset in_transit immediately.
10156         (Emit): Return after first error.
10157         
10158         * expression.cs: Convert changes.
10159         
10160         * literal.cs: Error method changed.
10161         
10162         * statement.cs: Error method changed.
10163
10164 2005-10-03  Raja R Harinath  <rharinath@novell.com>
10165
10166         * support.cs (SeekableStreamReader.Position): Don't error out when
10167         the requested position is just beyond the end of the current
10168         buffered data.
10169
10170 2005-09-28  Raja R Harinath  <rharinath@novell.com>
10171
10172         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
10173         try to keep in sync with the byte count of the underlying Stream.
10174         However, this limits us to a window size of 2048 characters: i.e.,
10175         the maximum lookahead of our lexer/parser can be 2048 characters.
10176
10177 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
10178
10179         Fix #76255.
10180         * driver.cs: Fix compilation files with full root path.
10181
10182 2005-09-25  Miguel de Icaza  <miguel@novell.com>
10183
10184         * report.cs (SymbolRelatedToPreviousError): Format the output so
10185         it does not use an open parenthesis that is never closed. 
10186
10187         * driver.cs: Follow coding guidelines
10188
10189 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
10190
10191         Fix #72930.
10192         * const.cs (Const.ResolveValue): Check for assigning non-null
10193         value to reference type.
10194
10195 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
10196
10197         * anonymous.cs: Implemented ExprClassName.
10198         
10199         * assign.cs (Assign.DoResolve): Don't chrash when type is not
10200         delegate.
10201         
10202         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
10203         check.
10204         
10205         * class.cs (StaticClass.DefineContainerMembers): Report protected
10206         members as error.
10207         
10208         * codegen.cs: if(ed) PRODUCTION.
10209         
10210         * convert.cs (Error_CannotImplicitConversion): Better error
10211         distinction.
10212         
10213         * cs-parser.jay: More error checks.
10214         
10215         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
10216         
10217         * driver.cs (CSCParseOption): Enabled wrong option check.
10218         
10219         * ecore.cs (Expression.ExprClassName): Turned to property.
10220         (MemberExpr.CheckIntermediateModification): For checking boxed
10221         value types     modification.
10222         
10223         * statement.cs (Fixed.Resolve): Expression type must be
10224         convertible to fixed type.
10225         (CollectionForeach.GetEnumeratorFilter,TryType):
10226         Small refactoring for easier error checking.
10227
10228 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
10229
10230         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
10231         attributes.
10232         
10233         * class.cs (GeneratedBaseInitializer): New class for customization
10234         compiler generated initializers.
10235         (MemberBase.DoDefine): Check Obsolete attribute here.
10236         (FieldMember.DoDefine): Ditto.
10237         
10238         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
10239         constants.
10240         
10241         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
10242         (MemberCore.GetObsoleteAttribute): Removed argument.
10243         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
10244         (MemberCore.CheckObsoleteType): New helper.
10245         
10246         * delegate.cs,
10247         * enum.cs,
10248         * statement.cs: Updates after MemberCore changes.
10249         
10250         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
10251         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
10252         
10253         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
10254         obsolete attribute for compiler construct.
10255         (As.DoResolve): Cache result.
10256         
10257         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
10258
10259 2005-09-26  Raja R Harinath  <rharinath@novell.com>
10260
10261         Fix #76133.
10262         * expression.cs (This.VerifyFixed): In a value type T, the type of
10263         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
10264         value type R, 'this' is treated as a value parameter.
10265
10266 2005-09-22  Miguel de Icaza  <miguel@novell.com>
10267
10268         * statement.cs (Lock): Use the TemporaryVariable class instead of
10269         manually using local variables as those do not work when variables
10270         are captured.
10271
10272         * ecore.cs: Moved the TemporaryVariable class from being a nested
10273         class inside Foreach to be a public class that can be employed in
10274         other places. 
10275
10276 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
10277
10278         * cs-parser.jay: interface_accessors replaced by
10279         accessor_declarations.
10280
10281         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
10282         location.
10283         
10284         * statement.cs (GotoCase.Resolve): Convert null constant to
10285         null case.
10286         (SwitchLabel.ResolveAndReduce): Ditto.
10287         (SwitchLabel.NullStringCase): Custom null stamp.
10288         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
10289         
10290         typemanager.cs (CSharpSignature): Don't skip first argument
10291         for full names.
10292
10293 2005-09-18  Miguel de Icaza  <miguel@novell.com>
10294
10295         * driver.cs: Set InEmacs based on the environment variable EMACS. 
10296
10297         * location.cs (InEmacs): in this mode, do not report column
10298         location as it confuses Emacs.
10299
10300 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
10301
10302         * cfold.cs, constant.cs, convert.cs, ecore.cs,
10303         expression.cs, iterators.cs, literal.cs: Store constants and
10304         literals location.
10305         
10306         * class.cs (MemberBase.ShortName): Pass location.
10307         
10308         * cs-parser.jay: Some location fixes.
10309         
10310         * ecore.cs (Expression.Location): Made virtual.
10311
10312 2005-09-05  Miguel de Icaza  <miguel@novell.com>
10313
10314         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
10315         if the underlying types are the same, otherwise we need to produce
10316         code that will do the proper cast.
10317
10318         This was exposed by Marek's constant rewrite which produced
10319         invalid code for the call site:
10320
10321         enum X : long { a }
10322         void Method (X v) {}
10323
10324         Method ((X) 5)
10325
10326         This fixes test-49.cs
10327
10328 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
10329
10330         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
10331           Type/Object should be allowed as well. Fixed bug #75968.
10332
10333 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
10334
10335         * expression.cs : (Binary.DoResolve): when one is enum constant and
10336           another is constant 0, then return enum one *as enum type*.
10337           Fixed bug 74846.
10338
10339 2005-09-02  Raja R Harinath  <rharinath@novell.com>
10340
10341         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
10342         internal.
10343
10344         Fix #75941.
10345         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
10346         flow-branching for LocalVariableReferences in case we were invoked
10347         from a MemberAccess.
10348         * expression.cs (LocalVariableReference.VerifyAssigned): New.
10349         Carved out of ...
10350         (LocalVariableReference.DoResolveBase): ... this.
10351         (MemberAccess.Resolve): Do the check that was disabled during
10352         SimpleNameResolve.
10353
10354 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
10355
10356         * class.cs :
10357           (PartialContainer.Create): check abstract/sealed/static strictly
10358           but abstract/sealed can exist only at one side. Fixed bug #75883.
10359
10360 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
10361
10362         Fix #75945.
10363         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
10364         specified, don't default to UnmanagedType.I4.
10365
10366 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
10367
10368         * expression.cs : conditional operator should check possibly
10369           incorrect assign expression. Fixed bug #75946.
10370
10371 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
10372
10373         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
10374           Reverting the change. gmcs is much complex than mcs on this matter.
10375
10376 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
10377
10378         * cs-tokenizer.cs : To read another token ahead of the actual 
10379           consumption, use new SavedToken and cache token instead of moving
10380           back the stream with SeekableStreamReader (it seemed problematic).
10381         * cs-parser.jay,
10382           driver.cs : Thus use StreamReader directly.
10383         * support.cs : Thus removed SeekableStreamReader.
10384
10385 2005-08-30  Raja R Harinath  <rharinath@novell.com>
10386
10387         Fix #75934.
10388         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
10389         (ScopeInfo.EmitScopeType): Use it to construct field names from
10390         names of captured locals.
10391
10392         Fix #75929.
10393         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
10394         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
10395         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
10396         (ExplicitConversion): Remove enum cases already handled by
10397         implicit conversion.  Move implicit conversion check to the beginning.
10398         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
10399         * expression.cs (ArrayCreation.EmitDynamicInitializers):
10400         Don't treat System.Enum as a struct.
10401
10402 2005-08-30  Jb Evain  <jbevain@gmail.com>
10403
10404         * attribute.cs: handles as expression in parameters.
10405
10406 2005-08-30  Raja R Harinath  <rharinath@novell.com>
10407
10408         Fix #75802.
10409         * class.cs (TypeContainer.VerifyClsName): Don't use a
10410         PartialContainer when verifying CLS compliance.
10411         (AbstractPropertyEventMethod): Set Parent here, ...
10412         (PropertyMethod): ... not here.
10413
10414 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
10415
10416         * attribute.cs : escaped attribute name should not be allowed to be
10417           resolved (e.g. @class as classAttribute). Fixed bug #75930.
10418
10419 2005-08-29  Raja R Harinath  <rharinath@novell.com>
10420
10421         Fix #75927.
10422         * convert.cs (ImplicitStandardConversionExists): Allow zero also
10423         when converting a long constant to unsigned long.
10424         * expression.cs (Invocation.OverloadResolve): Add sanity check to
10425         detect where IsApplicable and VerifyArgumentsCompat disagree.
10426
10427 2005-08-29  Raja R Harinath  <rharinath@novell.com>
10428         and Carlos Alberto Cortez  <carlos@unixmexico.org>
10429
10430         Fix #75848.
10431         * class.cs (TypeContainer.CanElideInitializer): New helper.
10432         (TypeContainer.EmitFieldInitializers): Use it to determine if we
10433         can safely emitting the initializer of a field.
10434
10435 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10436
10437         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
10438           allowed inside a switch (without loop). Fixed bug #75433.
10439
10440 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
10441
10442         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
10443         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
10444
10445 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10446
10447         * driver.cs : kinda reverting the default encoding changes (not exact 
10448           revert since I noticed that "codepage:reset" might not work fine).
10449
10450 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10451
10452         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
10453           Location. Now getter and setter store location correctly.
10454           (errors/cs0111-12.cs now reports the expected location.)
10455
10456 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10457
10458         * driver.cs : Use default encoding on the environment.
10459           Removed (now that) extra parameter for SeekableStreamReader.
10460         * support.cs : (SeekableStreamReader) third .ctor() argument for
10461           StreamReader is not required (always true). preamble size could
10462           be acquired in simpler and safe way.
10463
10464 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
10465
10466         * cs-parser.jay: report CS0642 at warning level 3
10467           and report CS0642 for an if else statement also
10468           fixes bug #74745. Patch by John Luke (and a bit
10469           modified by me).
10470           Removed extra CS0642 warning check for "while",
10471           "for" and "fixed".
10472         * statement.cs: In Block.Resolve(), CS0642 check
10473           is reimplemented to check a sequence of an empty
10474           statement and a block.
10475
10476           Both fix bug #66777.
10477
10478 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
10479
10480         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
10481         detection until I fix it.
10482         
10483         * cs-tokenizer.cs: Changed error message.
10484         
10485         * cs-parser.jay: Fixed 2 error locations.
10486         
10487         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
10488         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
10489         properties.
10490         
10491         * enum.cs (GetSignatureForError): Fixed.
10492         
10493         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
10494         method detection.
10495         
10496         * class.cs,
10497         * typemanager.cs (RegisterProperty): Removed.
10498         
10499         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
10500
10501 2005-08-24  Raja R Harinath  <rharinath@novell.com>
10502
10503         Fix #75874.
10504         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
10505         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
10506
10507 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10508
10509         * expression.cs : tiny fix is required for not warning positive ulong.
10510           See test-441.cs.
10511
10512 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10513
10514         * expression.cs : add CS0652 check for constant and integral
10515           expression. Fixed bug #53974.
10516
10517 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10518
10519         * expression.cs : in DoNumericPromotions(), check if there is implicit
10520           conversion overload for string (to check CS0034). Fixed bug #52492.
10521
10522 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10523
10524         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
10525
10526 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10527
10528         * ecore.cs : report location when it is *not* Null.
10529
10530 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10531
10532         * codegen.cs,
10533           ecore.cs,
10534           flowanalysis.cs,
10535           expression.cs:
10536           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
10537           correctly. Fixed bug #75721.
10538
10539 2005-08-23  Raja R Harinath  <rharinath@novell.com>
10540
10541         * support.cs (SeekableStreamReader.Position): Avoid an expensive
10542         loop that performs 'min (pos, char_count)'.
10543
10544         Fix #75862.
10545         * expression.cs (Unary.ResolveOperator): Don't discard implicit
10546         converted value in Operator.OnesComplement.
10547
10548 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
10549
10550         * anonymous.cs: If the anon method is pulled into a helper class,
10551         it needs to be `internal' not `private'. Fixes runtime behavior on
10552         msft. bug #75704
10553
10554 2005-08-20  Martin Baulig  <martin@ximian.com>
10555
10556         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
10557         scope if we don't already have it.
10558
10559         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
10560         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
10561         fixes #75867.
10562
10563 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
10564
10565         Fix #75803
10566         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
10567         is a partial class.
10568
10569 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
10570
10571         The big constants rewrite
10572         Fix #75746, #75685 and more
10573         As a side effect saved 1MB for MWF ;-)
10574         
10575         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
10576         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
10577         enum based for corlib compilation.
10578         
10579         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
10580         subtractions.
10581         
10582         * class.cs (FixedField.Define): Use ResolveAsConstant.
10583         
10584         * const.cs (IConstant): Interface constants and enums.
10585         (Const.ResolveValue): New method for constant resolvning.
10586         (ExternalConstant): Constants from imported assemblies.
10587         
10588         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
10589         conversion; like enums.
10590         (Constant.ToType): Converts this constant to different type.
10591         (Constant.Increment): Adds 1.
10592         
10593         * convert.cs (ImplicitConversionRequired): Simplified.
10594         
10595         * cs-parser.jay: Create EnumMember directly.
10596         
10597         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
10598         
10599         * doc.cs (GenerateEnumDocComment): Removed.
10600         
10601         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
10602         (ConvertIntLiteral): Removed.
10603         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
10604         
10605         * enum.cs (EnumMember): Implement IConstant.
10606         (Enum.IsValidEnumConstant): Removed.
10607         (Enum.GetNextDefaultValue): Removed.
10608         (Enum.FindMembers): Updated.
10609         (Enum.GenerateDocComment): Iterate enum members.
10610         
10611         * expression.cs (Cast.TryReduce): Handle enums correctly.
10612         (New.Constantify): Made public.
10613         (MemberAccess.DoResolve): Removed contant specific if(s).
10614         
10615         * literal.cs (NullLiteral): Implement new abstract methods.
10616         
10617         * statement.cs (GotoCase.Resolve): Use new constant methods.
10618         (SwitchLabel.ResolveAndReduce): Use new constant methods.
10619         
10620         * typemanager.cs (LookupEnum): Removed.
10621         (IsEnumType): Fixed to work with corlib.
10622         (RegisterConstant): Removed.
10623         (LookupConstant): Removed.
10624         (GetConstant): Changed to work with IConstant.
10625
10626 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
10627
10628         * location.cs : Fixed overflown (>255) column number.
10629
10630 2005-08-03  Raja R Harinath  <rharinath@novell.com>
10631
10632         First cut of the qualified-alias-member feature.
10633         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
10634         token.
10635         * cs-parser.jay (DOUBLE_COLON): New token.
10636         (namespace_or_type_name): Add rule for recognizing
10637         qualified-alias-members.
10638         (primary_expression): Likewise.
10639         (element_access): Allow QualifiedAliasMember as a possible
10640         type-bearing expression.
10641         (local_variable_type, local_variable_pointer_type): Likewise.
10642         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
10643         aliases in the current and enclosing namespace declarations.
10644         (NamespaceEntry.UsingAlias): Add CS0440 warning.
10645         * decl.cs (MemberName.is_double_colon): New.
10646         (MemberName.MemberName): Add new constructor for alias-member.
10647         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
10648         * expression.cs (QualifiedAliasMember): New expression type.
10649
10650 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10651
10652         * location.cs : it borked when no argument was specified.
10653
10654 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10655
10656         * location.cs : tiny ToString() format fix.
10657
10658 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10659
10660         * statement.cs : oops, it was missing.
10661
10662 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10663
10664         A set of fixes for precise line/column location.
10665
10666         * location.cs :
10667           "token" field now holds a file/line "delta", a line number offset 
10668           from the segment, and a column number. See also:
10669           http://lists.ximian.com/pipermail/mono-devel-list/2004-
10670           December/009508.html
10671           Removed static IsNull. Use instance IsNull property instead.
10672         * cs-tokenizer.cs :
10673           For some tokens it stores Location. For Identifier it stores
10674           LocatedToken which is a pair of string name and location.
10675           Column numbers are adjusted only at getChar().
10676         * report.cs :
10677           Use Location.ToString() for reporting (it now contains column).
10678         * cs-parser.jay :
10679           Largely modified to use LocatedToken instead of
10680           string (IDENTIFIER), and to acquire Location from some tokens.
10681         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
10682           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
10683           codegen.cs :
10684           Now MemberName holds Location. DeclSpace.ctor() receives Location
10685           as a parameter. Removed extra parameters to all derived classes.
10686           Replaced Location.IsNull() with instance property.
10687         * assign.cs, expression.cs :
10688           Added .ctor() overload that omits Location.
10689         * attribute.cs :
10690           Added "nameEscaped" flag that indicates the identifier was escaped
10691           in the source file. This fixes bug #57047.
10692
10693 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
10694
10695         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
10696         New method, looking for lo-case imported cls type.
10697
10698         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
10699         here.
10700
10701         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
10702
10703         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
10704
10705         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
10706         all_imported_types.
10707         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
10708
10709         Optimized to save 3.5 MB for SWF compilation.
10710
10711 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
10712
10713         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
10714         (PartialContainer.Create): Moved logic AddToContainer.
10715         (PartialContainer.MarkForDuplicationCheck): Shares name.
10716         
10717         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
10718         place.
10719         
10720         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
10721         initialization.
10722         (Namespace.GetSignatureForError): New method.
10723         
10724         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
10725         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
10726
10727 2005-08-01  Raja R Harinath  <rharinath@novell.com>
10728
10729         Fix #75669.
10730         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
10731         member lookup rather than qualifier_type, since qualifier_type can
10732         be null.
10733
10734 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
10735
10736         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
10737         enum member.
10738
10739 2005-07-31  Miguel de Icaza  <miguel@novell.com>
10740
10741         * statement.cs: Copy the local exception into the exception
10742         captured local.  Fixes 75674
10743
10744 2005-07-31  Raja R Harinath  <harinath@gmail.com>
10745
10746         Fix #75658.
10747         * expression.cs (Invocation.OverloadResolve): Don't report error
10748         CS1501 if error CS1502 has been reported.
10749         (New.DoResolve): Delegate CS1501 reporting to
10750         Invocation.OverloadResolve.
10751
10752         Fix #75656.
10753         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
10754         invariant-meaning-in-block property in an enclosing block if
10755         necessary.
10756
10757 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
10758
10759         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
10760         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
10761         (Switch.CheckSwitch): Just save 50kb for SWF.
10762
10763 2005-07-27  Martin Baulig  <martin@ximian.com>
10764
10765         * anonymous.cs (CaptureContext.AddField): Added
10766         `AnonymousContainer am' argument; compute its toplevel scope if
10767         it's not already computed.  Fixes #75649.
10768
10769 2005-07-26  Raja R Harinath  <rharinath@novell.com>
10770
10771         Fix #75628.
10772         * class.cs (Constructor.Emit): Reset block to null if the block
10773         resolve fails.
10774
10775 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
10776
10777         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
10778
10779 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
10780
10781         * class.cs (MethodData.Define): Check whether accessor implementing
10782         interface is public.
10783
10784         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
10785
10786 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
10787
10788         Fix #57245
10789         * namespace.cs (LookupType): Moved same type check to...
10790         
10791         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
10792         with the same name.
10793
10794 2005-07-21  Raja R Harinath  <rharinath@novell.com>
10795
10796         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
10797         already found a typebuilder.
10798         * class.cs (MethodCore.IsDuplicateImplementation): Compare
10799         MemberNames, not strings.
10800
10801         * const.cs (Error_ExpressionMustBeConst): 
10802         Rename from Error_EpressionMustBeConst.
10803         * const.cs, class.cs, statement.cd: Update.
10804
10805 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
10806
10807         Fix #65573
10808
10809         * const.cs (Const.LookupConstantValue): Report missing contant expression
10810         everytime.
10811         (Error_EpressionMustBeConstant): Only one error method.
10812
10813         * class.cs, statement.c: Updated.
10814
10815 2005-07-20  Raja R Harinath  <rharinath@novell.com>
10816
10817         * statement.cs (Block.Flags): Add back HasVarargs.
10818         (Block.flags): Make protected.
10819         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
10820
10821         * typemanager.cs (types, typecontainers, user_types): Remove.
10822         (UserTypes, TypeContainers): Likewise.
10823         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
10824         (CleanUp, Reset): Update.
10825         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
10826         (GetNestedType): Use Type.GetNestedType.
10827         (CoreLookupType): Take two arguments, the namespace and the
10828         basename of the type.  Update to use the Namespace.Lookup
10829         mechanism.
10830         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
10831         (RealMemberLookup): Use IsNestedChildOf instead of playing with
10832         string concatenation and substring matches.
10833         * class.cs, enum.cs, delegate.cs: Update to changes.
10834
10835 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
10836
10837         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
10838         Expression and made virtual.
10839
10840         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
10841         (ImplicitStandardConversionExists): Fixed `byte' typo ?
10842
10843         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
10844
10845         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
10846         error message.
10847
10848         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
10849         change.
10850
10851 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
10852
10853         Fix #57707
10854         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
10855         AssemblyCultureAttribute is not used on executable.
10856
10857         * rootcontext.cs,
10858         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
10859
10860 2005-07-16  Raja R Harinath  <rharinath@novell.com>
10861
10862         Fix #60638.
10863         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
10864         New.  Reports CS0252/CS0253.
10865         Mostly taken from preliminary patch by Duncak Mak.
10866         (Binary.DoResolveOperator): Store results of operator lookup.
10867         Use them to detect if we need to warn about unintended reference
10868         comparisons.
10869
10870 2005-07-15  Raja R Harinath  <rharinath@novell.com>
10871
10872         Fix #72969.
10873         * namespace.cs (Namespace.Lookup): Add back location parameter.
10874         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
10875         * delegate.cs, ecore.cs, expression.cs: Update to changes.
10876
10877         * codegen.cs (EmitContext.DeclSpace): Make readonly.
10878         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
10879         (Namespace.LookupType): ... this.
10880         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
10881         of namespaces.
10882         * typemanager.cs (LookupTypeReflection): Remove buggy code that
10883         purported to handle pointers.
10884         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
10885         CoreLookupType.
10886
10887 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
10888
10889         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
10890         type as namespace.
10891
10892 2005-07-15  Raja R Harinath  <rharinath@novell.com>
10893
10894         * namespace.cs (Namespace.Lookup): Drop location parameter.
10895         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
10896         (NamespaceEntry.Lookup): ... this.
10897         (NamespaceEntry.Error_AmbiguousTypeReference):
10898         Move here from DeclSpace.
10899         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
10900         names ...
10901         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
10902         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
10903         Move to NamespaceEntry.
10904         * delegate.cs, expression.cs: Update to changes.
10905
10906 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
10907
10908         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
10909         CheckAttributeType and refactored.
10910         (Attribute.ResolvePossibleAttributeType): Changed to reuse
10911         ResolveAsTypeTerminal error handling.
10912         (ResolveAsTypeTerminal): Introduced because of global attributes extra
10913         handling.
10914         (GetSignatureForError): Print errors in same way.
10915
10916         * class.cs,
10917         * codegen.cs: Reflect attribute GetSignatureForError change.
10918
10919         * ecore.cs,
10920         * expression.cs: Add silent parameter to ResolveAsTypeStep.
10921
10922         * namespace.cs (UsingEntry): Refactored to make fields private.
10923
10924         * assign.cs,
10925         statement.cs: Error_UnexpectedKind has extra parameter.
10926
10927 2005-07-14  Raja R Harinath  <rharinath@novell.com>
10928
10929         * ecore.cs (IAlias): Remove.
10930         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
10931         that implement the interface.
10932         * namespace.cs (Namespace): Likewise.
10933         (Namespace.declspaces): Renamed from 'defined_names'.
10934         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
10935         DeclSpace instead of an IAlias.
10936         * tree.cs (Tree.AddDecl): Update.
10937
10938 2005-07-12  Raja R Harinath  <rharinath@novell.com>
10939
10940         * statement.cs (Block.Flags); Remove HasVarargs.
10941         (Block.HasVarargs): Move to ToplevelBlock.
10942         (Block.ThisVariable, Block.AddThisVariable): Likewise.
10943         (Block.Variables): Make protected.  Initialize variable hashtable
10944         if necessary.
10945         (Block.AddVariable): Update.
10946         (Block.Resolve): Update to changes.
10947         (ToplevelBlock.HasVarargs): New boolean.
10948         (ToplevelBlock.ThisVariable): Move here from Block.
10949         (ToplevelBlock.AddThisVariable): Likewise.
10950         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
10951         * expression.cs (This.ResolveBase): Update to changes.
10952         (ArglistAccess.DoResolve): Likewise.
10953
10954 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
10955
10956         Fix #75321
10957         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
10958
10959         * class.cs (TypeContainer.VerifyMembers): Distinguish between
10960         not used and not used & assigned.
10961         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
10962
10963 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
10964
10965         Fix #75053
10966         * expression.cs (Is.DoResolve): null is never provided type.
10967
10968 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
10969
10970         Fix #52496
10971         * cs-parser.jay: Less strict event error rule to catch more errors.
10972
10973 2005-07-08  Martin Baulig  <martin@ximian.com>
10974
10975         Fix test-iter-10.cs - distinguish whether we `yield' in a property
10976         gettter (allowed) or setter (not allowed).
10977
10978         * class.cs (Accessor): Implement IIteratorContainer.
10979         (Accessor.Yields): New public field.
10980         (PropertyBase.PropertyMethod.Define): Handle iterators on a
10981         per-accessor basis.
10982
10983         * cs-parser.jay
10984         (get_accessor_declaration, set_accessor_declaration): Set the
10985         `yields' flag on the accessor, not the property.
10986         (property_declaration): Do the iterators check on a per-accessor
10987         basis and not for the whole property.
10988
10989 2005-07-08  Martin Baulig  <martin@ximian.com>
10990
10991         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
10992         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
10993
10994 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
10995
10996         Fix #74975
10997         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
10998         (ExtractSecurityPermissionSet): Cope with self referencing security
10999         attributes properly.
11000
11001         * driver.cs (SetOutputFile): Made public property OutputFile.
11002
11003 2005-07-07  Raja R Harinath  <rharinath@novell.com>
11004
11005         Fix #75486.
11006         * class.cs (TypeContainer.first_nonstatic_field): Rename from
11007         has_nonstatic_fields.  Make into a FieldBase pointer.
11008         (TypeContainer.AddField): Add CS0282 check.
11009         (TypeContainer.EmitType): Update.
11010
11011 2005-07-06  Miguel de Icaza  <miguel@novell.com>
11012
11013         * cs-tokenizer.cs (consume_identifier): Do not create strings to
11014         compare if they start with __.
11015
11016 2005-07-06  Raja R Harinath  <rharinath@novell.com>
11017
11018         * statement.cs (Switch.SwitchGoverningType): Only look at
11019         UserCasts that don't need implicit standard conversions to one of
11020         the allowed switch types (Fixes test-322.cs).
11021         (LocalInfo.Resolve): Re-enable sanity-test.
11022
11023 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
11024
11025         * cs-tokenizer.cs (consume_identifier): Detect double undescores
11026         
11027         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
11028         
11029         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
11030
11031 2005-07-06  Raja R Harinath  <rharinath@novell.com>
11032
11033         Fix #75472.
11034         * ecore.cs (SimpleName.GetSignatureForError): Add.
11035         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
11036         (MemberAccess.GetSignatureForError): Add.
11037
11038 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
11039  
11040         The big error and warning messages review.
11041         
11042         * anonymous.cs,
11043         * assign.cs,
11044         * attribute.cs,
11045         * class.cs,
11046         * codegen.cs,
11047         * convert.cs,
11048         * cs-parser.jay,
11049         * cs-tokenizer.cs,
11050         * decl.cs,
11051         * delegate.cs,
11052         * doc.cs,
11053         * driver.cs,
11054         * ecore.cs,
11055         * enum.cs,
11056         * expression.cs,
11057         * flowanalysis.cs,
11058         * iterators.cs,
11059         * literal.cs,
11060         * location.cs,
11061         * modifiers.cs,
11062         * namespace.cs,
11063         * parameter.cs,
11064         * pending.cs,
11065         * report.cs,
11066         * rootcontext.cs,
11067         * statement.cs,
11068         * support.cs,
11069         * tree.cs,
11070         * typemanager.cs: Updated.
11071         
11072         * class.cs: (MethodCore.SetYields): Moved here to share.
11073         (PropertyMethod.Define): Moved iterator setup here.
11074         
11075         * iterators.cs: Add orig_method to have full access to parent
11076         container.
11077
11078 2005-07-05  Raja R Harinath  <rharinath@novell.com>
11079
11080         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
11081         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
11082         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
11083         variable of struct type.
11084         * expression.cs (Unary.ResolveOperator): Update to change.
11085         (Indirection.VerifyFixed): Likewise.
11086         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
11087         (ParameterReference.VerifyFixed): Value parameters are fixed.
11088         (This.VerifyFixed): Treat 'this' as a value parameter.
11089         * statement.cs (LocalInfo.IsFixed): Remove.
11090
11091 2005-07-01  Martin Baulig  <martin@ximian.com>
11092
11093         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
11094         `ec.EmitThis ()' to get the correct scope.
11095
11096 2005-07-01  Martin Baulig  <martin@ximian.com>
11097
11098         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
11099         instance is a ParameterReference; fixes #75299.
11100
11101 2005-07-01  Martin Baulig  <martin@ximian.com>
11102
11103         Reverted Marek's latest patch (r46725):
11104         - it contains structural changes which are neither mentioned in
11105           the ChangeLog nor explained anywhere; for example the additional
11106           argument of EmitContext's and Iterator's .ctor's and the
11107           TypeContainer.DefineMembers() change.
11108         - structural changes like this should go in in seperate patches
11109           and not be hidden in a huge patch which just seems to affect
11110           warnings and errors.
11111           a big and hard to understand patch.
11112         - it breaks iterators and causes regressions, for instance in
11113           test-iter-03.cs.      
11114
11115 2005-06-30  Raja R Harinath  <rharinath@novell.com>
11116
11117         Fix #75412.
11118         * expression.cs (Indexers.map): Remove.
11119         (Indexers.Append): Filter out inaccessible setters and getters.
11120         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
11121
11122         Fix #75283.
11123         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
11124         Refactored from ...
11125         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
11126         (FieldExpr.Emit, PropertyExpr.Emit): Update.
11127         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
11128         * expression.cs (Invocation.EmitCall): Add CS0120 check.
11129
11130 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
11131
11132         Fix #75322
11133         * class.cs (FieldBase.GetInitializerExpression): One more field
11134         for backup.
11135
11136 2005-06-28  Miguel de Icaza  <miguel@novell.com>
11137
11138         * pending.cs: Do not define a proxy if the base method is virtual,
11139         it will be picked up by the runtime (bug 75270).
11140
11141 2005-06-08  Martin Baulig  <martin@ximian.com>
11142
11143         The big Iterators rewrite :-)
11144
11145         * iterators.cs: Rewrite this to use the anonymous methods framework.
11146
11147         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
11148         before the TypeContainers; see 2test-21.cs.
11149
11150         * class.cs
11151         (TypeContainer.DefineType): Don't create a new EmitContext if we
11152         already have one (this only happens if we're an Iterator).
11153         (TypeContainer.Define): Also call Define() on all our iterators.
11154         (Method.CreateEmitContext): Added support for iterators.
11155
11156         * anonymous.cs
11157         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
11158         (AnonymousContainer.CreateMethodHost): Moved here from
11159         AnonymousMethod and made abstract.
11160         (AnonymousContainer.CreateScopeType): New abstract method.
11161         (AnonymousContainer.IsIterator): New public property.
11162         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
11163         get the ScopeTypeBuilder rather than manually defining it here. 
11164         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
11165         iterators here.
11166
11167         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
11168         before RootContext.DefineTypes().
11169
11170         * codegen.cs (EmitContext.RemapToProxy): Removed.
11171         (EmitContext.CurrentAnonymousMethod): Changed type from
11172         AnonymousMethod -> AnonymousContainer.
11173         (EmitContext.ResolveTopBlock): Protect from being called twice.
11174         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
11175         (EmitContext.EmitThis): Removed the iterators hacks; use the
11176         anonymous methods framework for that.
11177
11178         * statement.cs
11179         (ToplevelBlock.Container): Make this a property, not a field.
11180         (ToplevelBlock.ReParent): New public method; move the
11181         ToplevelBlock into a new container.
11182         (Foreach.TemporaryVariable): Simplify.
11183
11184 2005-06-05  Martin Baulig  <martin@ximian.com>
11185
11186         * statement.cs (LocalInfo.CompilerGenerated): New flag.
11187         (Block.AddTemporaryVariable): New public method; creates a new
11188         `LocalInfo' for a temporary variable.
11189         (Block.EmitMeta): Create the LocalBuilders for all the temporary
11190         variables here.
11191         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
11192         non-iterator variables.
11193
11194 2005-06-05  Martin Baulig  <martin@ximian.com>
11195
11196         * statement.cs (Foreach.TemporaryVariable): Create the
11197         LocalBuilder in the Emit phase and not in Resolve since in some
11198         situations, we don't have an ILGenerator during Resolve; see
11199         2test-19.cs for an example.
11200
11201 2005-06-04  Martin Baulig  <martin@ximian.com>
11202
11203         **** Merged r45395 from GCS ****
11204
11205         The big Foreach rewrite - Part II.
11206
11207         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
11208         with `PropertyInfo ienumerator_getcurrent'.
11209
11210         * codegen.cs (VariableStorage): Removed.
11211
11212         * statement.cs
11213         (Foreach): Derive from Statement, not ExceptionStatement.
11214         (Foreach.CollectionForeach): New nested class.  Moved all the code
11215         dealing with collection foreach here.
11216         (Foreach.ForeachHelperMethods): Removed.
11217         (Foreach.TemporaryVariable): Implement IMemoryLocation.
11218
11219 2005-05-23  Martin Baulig  <martin@ximian.com>
11220
11221         * statement.cs (Try.DoResolve): Don't create a `finally' if we
11222         don't need to.  Fix #75014.
11223
11224 2005-05-20  Martin Baulig  <martin@ximian.com>
11225
11226         Merged r44808 from GMCS.
11227
11228         * class.cs (TypeContainer.CircularDepException): Removed.
11229         (TypeContainer.DefineType): Removed the `InTransit' stuff.
11230         (TypeContainer.CheckRecursiveDefinition): Check for circular class
11231         (CS0146) and interface (CS0529) dependencies here.
11232
11233 2005-06-21  Raja R Harinath  <rharinath@novell.com>
11234
11235         * expression.cs (Invocation.EmitCall): Fix initialization
11236         'this_call' to reflect current behaviour.  Fix indentation.
11237
11238         * convert.cs (FindMostEncompassedType): Add two trivial special
11239         cases (number_of_types == 0 || number_of_types == 1).
11240         (FindMostEncompasingType): Likewise.
11241
11242 2005-06-17  Raja R Harinath  <rharinath@novell.com>
11243
11244         Some cleanups preparing for the fix of #75283.
11245         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
11246         error testing.
11247         (EventExpr.InstanceResolve): Likewise.
11248         (EventExpr.DoResolve): Remove redundant checks.
11249
11250 2005-06-10  Duncan Mak  <duncan@novell.com>
11251
11252         * cs-tokenizer.cs (process_directives): New flag for controlling
11253         the processing of preprocessor directives.
11254         (x_token): After seeing a '#', return Token.NONE instead of going
11255         to handle_preprocessing_directive() when not processing
11256         directives. This avoids unnecessary processing during the token peek in
11257         is_punct().
11258
11259         This fixes #74939.
11260
11261         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
11262         the existing error reporting methods instead of Report.Error.
11263
11264         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
11265         after Raja's rewrite.
11266
11267 2005-06-08  Miguel de Icaza  <miguel@novell.com>
11268
11269         * class.cs: Small fix.
11270
11271 2005-06-08  Raja R Harinath  <rharinath@novell.com>
11272
11273         Fix #75160.
11274         * class.cs (GetPartialBases): Fix return value check of
11275         part.GetClassBases.
11276
11277 2005-06-07  Raja R Harinath  <rharinath@novell.com>
11278
11279         Ensure that partial classes are registered in their enclosing
11280         namespace.  Initial part of fix of #75160.
11281         * tree.cs (Tree.RecordDecl): Add new namespace argument.
11282         Register declspace with namespace here, not in
11283         DeclSpace.RecordDecl.
11284         * cs-parser.jay: Pass namespace to RecordDecl.
11285         * class.cs (PartialContainer.Create): Likewise.
11286         (ClassPart.DefineType): New sanity-check.  Throws an exception if
11287         called.
11288         * decl.cs (Declspace.RecordDecl): Remove.
11289         * namespace.cs (NamespaceEntry.DefineName): Remove.
11290
11291 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
11292
11293         * rootcontext.cs: Reset TargetExt as well.
11294
11295 2005-06-03  Raja R Harinath  <rharinath@novell.com>
11296
11297         * ecore.cs (Expression.Resolve): Emit CS0654 error when
11298         -langversion:ISO-1.
11299
11300 2005-06-02  Raja R Harinath  <rharinath@novell.com>
11301
11302         Fix #75080, cs0119.cs.
11303         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
11304         of ...
11305         (Expression.Resolve): ... this.  Use it.  Remove bogus code
11306         allowing ExprClass.Type and ExprClass.Namespace for
11307         ResolveFlags.VariableOrValue.
11308         (Expression.Resolve) [1-argument variant]: Change default resolve
11309         flags based on language version.
11310         (Expression.Error_UnexpectedKind): Use a simple string array
11311         rather than an ArrayList.
11312         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
11313         not ExprClass.Type.
11314         (TypeOfVoid.DoResolve): Likewise.
11315         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
11316         flags argument -- it always has the same value.
11317
11318 2005-05-31  Raja R Harinath  <rharinath@novell.com>
11319
11320         Fix #75081.
11321         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
11322         Use it in the error message.
11323         * assign.cs, expression.cs, statement.cs: Update.
11324
11325 2005-05-30  Raja R Harinath  <rharinath@novell.com>
11326
11327         Fix #75088.
11328         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
11329         the "almostMatchedMember" case too.
11330         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
11331         that failed the accessibility checks to 'almost_match'.
11332
11333 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
11334
11335         * attribute.cs: Use internal MethodBuilder methods to set
11336         ExactSpelling and SetLastError on PInvoke methods, instead
11337         of passing them via charset.  Fixes #75060.
11338
11339 2005-05-27  Raja R Harinath  <rharinath@novell.com>
11340
11341         * parameter.cs (Parameter): Remove TODO comment.
11342         (Parameter.DefineParameter): Remove Location parameter.
11343         (Parameters.LabelParameters): Likewise.
11344         * class.cs (Constructor.Emit): Update to change.
11345         (MethodData.Emit): Likewise.
11346         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
11347         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
11348
11349 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
11350
11351         * parameter.cs,
11352           Removed Parameters.Location and added Parameter.Location instead.
11353           Removed Location parameter from Emit() and GetSignature().
11354         * anonymous.cs,
11355           class.cs,
11356           cs-parser.jay,
11357           delegate.cs,
11358           iterators.cs,
11359           statement.cs :
11360           Modified all related calls.
11361
11362 2005-05-26  Raja R Harinath  <rharinath@novell.com>
11363
11364         Improve user-defined conversion handling.
11365         * convert.cs (GetConversionOperators): Rewrite.  Return only the
11366         applicable operators.
11367         (AddConversionOperators): New.  Helper for GetConversionOperators.
11368         (FindMostEncompassedType, FindMostEncompassingType): Verify that
11369         there is only one most encompassed/encompassing type.
11370         (FindMostSpecificSource, FindMostSpecificTarget): Remove
11371         "applicable operator" handling.
11372         (UserConversion): Move cache here from GetConversionOperators.
11373         Directly cache the chosen operator, rather than the whole
11374         MethodGroup.
11375         (ExplicitNumericConversion): Fix buggy implementation of Decimal
11376         case.  Allow conversion of decimal to sbyte and byte too.
11377         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
11378         New static methods.  Used to avoid allocating EmptyExpressions in
11379         convert.cs.
11380
11381 2005-05-24  Duncan Mak  <duncan@novell.com>
11382
11383         * ecore.cs (CastFromDecimal): New class for casting a decimal to
11384         another class, used in Convert.ExplicitNumericConversion.
11385         (CastToDecimal): New class, similar to above, but casts to
11386         System.Decimal, used in Convert.ImplicitNumericConversion and also
11387         in explicit convesion from double/float to decimal.
11388
11389         * convert.cs (ImplicitNumericConversion): Handle implicit
11390         conversions to System.Decimal.
11391         (ExplicitNumericConversion): handle explicit conversions to
11392         System.Decimal.
11393
11394         This fixes #68711.
11395         
11396 2005-05-20  Miguel de Icaza  <miguel@novell.com>
11397
11398         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
11399         know the type at this stage, just break through.   Fixes #75008 
11400
11401 2005-05-19  Martin Baulig  <martin@ximian.com>
11402
11403         * delegate.cs
11404         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
11405         to disable error reporting.
11406
11407         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
11408         here since we don't want to report an error; see the new test-336.cs.
11409
11410 2005-05-19  Raja R Harinath  <rharinath@novell.com>
11411
11412         * statement.cs (ToplevelBlock.GetParameterReference)
11413         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
11414         Move here from class Block.
11415         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
11416         * expression.cs (ParameterReference.DoResolveBase): Likewise.
11417
11418 2005-05-18  Martin Baulig  <martin@ximian.com>
11419
11420         Fix #74978.
11421
11422         * flowanalysis.cs
11423         (FlowBranching.Reachability): Add non-static public And() and Or()
11424         methods.
11425         (FlowBranchingSwitch): New class; do the `break_origins' thing
11426         like in FlowBranchingLoop.
11427         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
11428         reachability, not just locals and parameters.
11429         (FlowBranching.MergeChild): Remove some of the hacks for loop and
11430         switch; MergeBreakOrigins() now takes care of that.
11431
11432 2005-05-18  Martin Baulig  <martin@ximian.com>
11433
11434         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11435         a loop and may leave it, reset the barrier; fixes #74974.
11436
11437 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
11438         
11439         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
11440         is back.
11441         
11442         * cs-parser.jay: Catch more lexical errors.
11443         
11444         * report.cs: Add one more Error method.
11445         
11446         * rootcontext.cs,
11447         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
11448
11449 2005-05-17  Martin Baulig  <martin@ximian.com>
11450
11451         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
11452         #70970. 
11453
11454 2005-05-16  Raja R Harinath  <rharinath@novell.com>
11455
11456         Fix test-382.cs.  Emit values of decimal constants.
11457         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
11458         Carved out of ...
11459         (TypeContainer.AddField): ... this.
11460         (TypeContainer.EmitFieldInitializers): Allow the list of fields
11461         with initializers to include 'Const's.
11462         (ClassPart.RegisterFieldForInitialization): Forward to
11463         PartialContainer.
11464         * const.cs (Const.Const): Pass initializer to base class.
11465         (Const.Define): In case of decimal constants, register them for
11466         initialization in a static constructor.
11467
11468 2005-05-14  Martin Baulig  <martin@ximian.com>
11469
11470         * statement.cs (Block.Resolve): Correctly handle unreachable code;
11471         do not call ResolveUnreachable() on unreachable statements in
11472         here, see the comment in the source code.
11473
11474 2005-05-13  Raja R Harinath  <rharinath@novell.com>
11475
11476         Fix #74934.
11477         * expression.cs (BinaryResolveOperator): If one of the operands of
11478         an equality comparison is 'null' and the other is a pointer type,
11479         convert the null to a NullPointer.
11480         * convert.cs (ImplicitReferenceConversion): If the expression is a
11481         NullLiteral and the target type is a pointer type, return a
11482         NullPointer instead.
11483         (ImplicitConversionStandard): Likewise.
11484
11485 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
11486         
11487         * cs-parser.jay: Set readonly context based on special constructs.
11488         
11489         * expression.cs (LocalVariableReference.DoResolveBase): Improved
11490         readonly variable error handling.
11491         
11492         * rootcontext.cs (EmitCode): Don't verify members when error
11493         occurred.
11494         
11495         * statement.cs (LocalInfo): Add reaodnly context information.
11496         (SetReadOnlyContext, GetReadOnlyContext): New methods.
11497
11498 2005-05-13  Raja R Harinath  <rharinath@novell.com>
11499
11500         * statement.cs (Block.Resolve): Revert change below.  Modify fix
11501         for #74041 to initialize 'resolved' to false only for explicit
11502         blocks.  Fixes #74873.
11503
11504 2005-05-12  Raja R Harinath  <harinath@gmail.com>
11505
11506         Fix #74920.
11507         * typemanager.cs (unmanaged_enclosing_types): New.
11508         (IsUnmanagedType): Avoid infloops by using
11509         'unmanaged_enclosing_types' to talk with recursive invocations.
11510
11511 2005-05-13  Martin Baulig  <martin@ximian.com>
11512
11513         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
11514         instance variable, not a local.  Fix #74873.
11515         (Block.ResolveUnreachable): Set it to true here.
11516
11517 2005-05-11  Duncan Mak  <duncan@novell.com>
11518
11519         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
11520         continuing to process for 'arg'.
11521         (handle_preprocessing_directive): Check the argument of the #endif
11522         directive and report error CS1025 if there are any trailing
11523         characters.
11524
11525         According to the C# spec, having even whitespace after the #endif
11526         directive is illegal; however, because we call arg.TrimEnd ()
11527         beforehand, we have the same behavior as csc, allowing whitespace
11528         after the directive.
11529
11530         Fixes #74892.
11531
11532 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
11533
11534         Fix #74863.
11535         
11536         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
11537         (Constructor.GetObsoleteAttribute): Implemented correctly.
11538
11539 2005-05-10  Martin Baulig  <martin@ximian.com>
11540
11541         * support.cs (ReflectionParameters.ParameterModifier): Use
11542         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
11543         and `ParameterAttributes.In'.  Fixes #74884.
11544
11545 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
11546
11547         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
11548         
11549         * expression.cs (Argument.GetParameterModifier): Turned to property.
11550         (Invocation.Error_InvalidArguments): Add more descriptive errors.
11551         
11552         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
11553         its C# equivalent.
11554         
11555 2005-05-09  Raja R Harinath  <rharinath@novell.com>
11556
11557         Fix #74852.
11558         * decl.cs (MemberCache.AddMethods): Register override methods,
11559         rather than non-override methods.
11560         * typemanager.cs (RegisterOverride): New.
11561         (IsOverride): Update.
11562
11563 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
11564
11565         Fix #73105.
11566         
11567         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
11568         recursive declaration.
11569         
11570         * statement.cs (Block.ResolveMeta): Report any error in resolving.
11571         
11572 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
11573
11574         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
11575         
11576         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
11577
11578 2005-05-05  Raja R Harinath  <rharinath@novell.com>
11579
11580         Fix #74797.
11581         * decl.cs (DeclSpace.FamilyAccessible): 
11582         Use TypeManager.IsNestedFamilyAccessible.
11583
11584         Fix reopened #64812.
11585         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
11586         internal'.
11587
11588 2005-05-04  Raja R Harinath  <rharinath@novell.com>
11589             Abin Thomas  <projectmonokochi@rediffmail.com>
11590             Anoob V E  <projectmonokochi@rediffmail.com>
11591             Harilal P R  <projectmonokochi@rediffmail.com>
11592
11593         Fix #64812.
11594         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
11595         allow access to all static members.
11596
11597 2005-05-04  Martin Baulig  <martin@ximian.com>
11598
11599         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
11600
11601 2005-05-04  Martin Baulig  <martin@ximian.com>
11602
11603         Fix #74655.
11604
11605         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
11606         section at the end; make things work if `default' is not the last
11607         section.        
11608
11609 2005-05-04  Martin Baulig  <martin@ximian.com>
11610
11611         Fix #70400.
11612
11613         * statement.cs (Switch): Replaced the `got_default' field with a
11614         `default_section' one.
11615         (Switch.CheckSwitch): Set `default_section' here.
11616         (Switch.Resolve): If we're a constant switch and the constant is
11617         not found, use the default section.
11618
11619 2005-05-03  Martin Baulig  <martin@ximian.com>
11620
11621         * expression.cs (ArrayAccess.EmitGetLength): New public method.
11622
11623         * statement.cs (Foreach.ArrayForeach): New nested class.
11624         (Foreach.TemporaryVariable): New nested class.
11625         (Foreach.EmitArrayForeach): Removed; this is now in the new
11626         ArrayForeach class.
11627
11628 2005-05-03  Raja R Harinath  <rharinath@novell.com>
11629
11630         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
11631         more conservative.
11632         (VerifyPendingMethods): Revert change below.
11633
11634         * typemanager.cs (IsOverride, RegisterNonOverride): New.
11635         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
11636         that used to trigger warning -28.  Remove warning -28.
11637         * expression.cs (Invocation.OverloadResolve): Use
11638         TypeManager.IsOverride to distinguish override methods.
11639
11640         Fix #74773.
11641         * pending.cs (VerifyPendingMethods): If a base type implements the
11642         requested interface, don't bother checking individual methods of
11643         the base type.  As a side-effect, this prevents the creation of
11644         unnecessary proxies.
11645
11646 2005-05-02  Martin Baulig  <martin@ximian.com>
11647
11648         Fix #70182.
11649
11650         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
11651         Also `And' the locals if the old vector is null.
11652         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
11653         null; in this case we basically reset all the variables.        
11654
11655 2005-05-02  Martin Baulig  <martin@ximian.com>
11656
11657         Fix #74529.
11658
11659         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
11660         Added `FlowBranching branching' argument; always `and' the
11661         variables instead of `or'ing them unless we're an infinite loop.
11662
11663         * statement.cs (While.Resolve): Create a new sibling unless we're
11664         infinite.       
11665
11666 2005-05-02  Martin Baulig  <martin@ximian.com>
11667
11668         Fix #70140.
11669
11670         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
11671         arguments; use it instead of creating a new TopLevelBlock.
11672         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
11673         our ConstructorInitializer.
11674
11675         * statement.cs
11676         (TopLevelBlock.TopLevelBranching): New public property.
11677         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
11678         and create our `TopLevelBranching'.
11679
11680         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
11681         anonymous method host, use `block.TopLevelBranching' rather than
11682         creating a new branching.
11683
11684 2005-04-20  Miguel de Icaza  <miguel@novell.com>
11685
11686         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
11687         a ScopeInfo, if any of the current children is a child of the new
11688         entry, move those children there.
11689
11690 2005-04-30  Martin Baulig  <martin@ximian.com>
11691
11692         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
11693         at the beginning of a SwitchSection.  Fix #73335.
11694
11695 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
11696
11697         Fix #74378
11698         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
11699         
11700         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
11701         (FieldExpr.DoResolve): Obsolete members are ignored for field
11702         initializers.
11703         
11704 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
11705
11706         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
11707         of arrays detection.
11708
11709         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
11710         verification.
11711         (Field.VerifyClsCompliance): Volatile fields are not compliant.
11712
11713         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
11714         arrays report.
11715
11716 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
11717
11718         * cs-parser.jay: Use the prefered version of -unsafe in error
11719         message.
11720
11721 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
11722
11723         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
11724         circumstances.
11725
11726 2005-04-20  John Luke  <john.luke@gmail.com>
11727
11728         * driver.cs: fix typo in error message, --outout to --output
11729
11730 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
11731
11732         * codegen.cs (InRefOutArgumentResolving): New field.
11733         
11734         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
11735         fields outside contructor.
11736         
11737         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
11738         
11739 2005-04-19  Miguel de Icaza  <miguel@novell.com>
11740
11741         * anonymous.cs (CaptureContext.EmitParameterInstance): The
11742         parameter code was not completed ever, so it was not as up-to-date
11743         as local variables.  Must finish it.
11744
11745         The bug fix was to compare the Toplevel of the block, not the
11746         current block.  Thanks for Ben for pointing this out. 
11747
11748 2005-04-19  Raja R Harinath  <rharinath@novell.com>
11749
11750         * decl.cs (AddMethods): Use the declaring type of the problem
11751         method to determine if we want to squash a warning.
11752
11753 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
11754
11755         * attribute.cs: Removed debug output.
11756
11757         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
11758         
11759         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
11760         Report.Stderr.
11761         
11762 2005-04-18  Raja R Harinath  <rharinath@novell.com>
11763
11764         Fix #74481.
11765         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
11766         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
11767         all null comparisons against reference types.
11768
11769 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
11770
11771         Fix# 74565
11772         * class.cs (TypeContainer.CircularDepException) New nested
11773         exception class.
11774         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
11775         (TypeContainer.DefineType): Removed error, reset InTransit before
11776         exit.
11777         (Class.DefineType): Throw exception when is in Transit.
11778         Catch exception and report error.
11779         (Struct.DefineType): Throw exception when is in Transit.
11780         Catch exception and report error.
11781         (Interface.DefineType): Throw exception when is in Transit.
11782         Catch exception and report error.
11783
11784         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
11785         handle nested exception handlers.
11786
11787         * flowanalysis.cs (InTryWithCatch): New method, search for try with
11788         a catch.
11789
11790         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
11791         InFinally and InCatch storage.
11792
11793         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
11794         (Catch.Resolve): Set and Restore ec.InCatch.
11795         (Try.Resolve): Set and Restore ec.InFinally.
11796         (Try.HasCatch): True when try has catch.
11797
11798 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
11799
11800         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
11801           for the same event member, so exclude such cases from warning 419.
11802           Fixed bug #74633.
11803
11804 2005-04-16  Miguel de Icaza  <miguel@novell.com>
11805
11806         * expression.cs (Binary.ResolveOperator): Apply patch from John
11807         Luke to fix bug 59864: operators &, | and ^ on enumerations
11808         require that the same enum type on both sides.
11809
11810         * driver.cs: Add warnings to old flag usage, this is to assist
11811         people who produce Makefiles and hope that the Makefiles will be
11812         used on Windows.
11813
11814         * class.cs (TypeContainer.EmitType): Moved the definition of the
11815         special $PRIVATE$ field from the resolve phase to the Emit phase.
11816         During resolve we do not know if we are a struct with
11817         HasExplicitLayout, we know this only after the attributes for the
11818         type are emitted.
11819
11820         Set the FieldOffset to zero on the dummy field that we create for
11821         the class.   Fixes 74590.
11822
11823 2005-04-16  Raja R Harinath  <rharinath@novell.com>
11824
11825         Fix #73834.
11826         * ecore.cs (PropertyExpr.resolved): New.
11827         (DoResolve): Use it to handle a case of double resolution here.
11828         Handle a case of identical-name-and-type-name.
11829         * expression.cs (ArrayCreation.CheckIndices): Avoid double
11830         resolution by storing the results of expression resolution back
11831         into the "probes" array.
11832
11833 2005-04-15  Raja R Harinath  <rharinath@novell.com>
11834
11835         Fix cs0208-7.cs and cs0208-8.cs.
11836         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
11837         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
11838         error reporting to point out the reason a struct is not unmanaged.
11839
11840 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
11841
11842         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
11843           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
11844
11845 2005-04-13  Raja R Harinath  <rharinath@novell.com>
11846
11847         Fix #74528.
11848         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
11849         IdenticalNameAndTypeName here.
11850         (EventExpr.InstanceResolve): Likewise.
11851
11852 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
11853
11854         C# 2.0 DefaultCharSetAttribute implementation
11855         
11856         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
11857         which allows us to set GlobalNamespace for every resolve.
11858         (Attribute.ResolveArguments): Cut from Resolve.
11859         (Attribute.GetCharSetValue): Returns CharSet named argument.
11860         (Attribute.DefinePInvokeMethod): Gets default charset from
11861         module settings.
11862         (GlobalAttribute.ResolveAsTypeStep): Override.
11863         (GlobalAttribute.ResolveArguments): Override.
11864         
11865         * class.cs (TypeAttr): Is protected.
11866         
11867         * codegen.cs (ModuleClass.DefaultCharSet): New member.
11868         (ModuleClass.DefaultCharSetType): New memeber.
11869         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
11870         
11871         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
11872         charset from module.
11873         
11874         * delegate.cs (TypeAttr): Override.
11875         (Delegate.DefineType): Use this TypeAttr.
11876         
11877         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
11878         at very early stage (before types are defined) to resolve model
11879         module attributes. It will probably not work with corlib but it
11880         should be ok.
11881         
11882         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
11883         charset from module.
11884         
11885         * typemanager.cs (default_charset_type): New type.
11886
11887 2005-04-13  Raja R Harinath  <rharinath@novell.com>
11888
11889         * decl.cs (MemberCache.AddMethods): Don't warn if
11890         System.Object.Finalize has buggy MethodAttributes.
11891
11892         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
11893         removed below.
11894
11895 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
11896
11897         * doc.cs : detect ambiguous reference to overloaded members.
11898           Fixed bug #71603. MS 1.1 csc does not detect it.
11899
11900 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
11901
11902         * doc.cs : delegates must not be referenced with parameters.
11903           Fixed bug #71605.
11904
11905 2005-04-12  Miguel de Icaza  <miguel@novell.com>
11906
11907         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
11908
11909 2005-04-10  Miguel de Icaza  <miguel@novell.com>
11910
11911         * driver.cs (MainDriver): Stop processing if the CLS stage found
11912         errors. 
11913
11914         (CompilerCallableEntryPoint.InvokeCompiler): Always
11915         reset after execution;   Take a TextWriter argument for the
11916         output.
11917
11918         * report.cs: Use the error stream instead of hardcoding stderr. 
11919
11920 2005-04-09  Miguel de Icaza  <miguel@novell.com>
11921
11922         * class.cs: Reduce code paths to test, too small of an
11923         optimization to make it worth the extra testing.  Always perform
11924         it. 
11925
11926 2005-04-08  Raja R Harinath  <rharinath@novell.com>
11927
11928         Fix #74510.
11929         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
11930         operators that had errors reported on them.
11931
11932 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
11933
11934         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
11935         argument types.
11936         (Attribute.Resolve): Add named argument type checking.
11937         
11938         * class.cs (FixedField.Define): Use IsPrimitiveType
11939         
11940         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
11941         
11942         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
11943         unsafe parameter types.
11944         
11945         * statement.cs (Using.ResolveExpression): Add better error description.
11946         
11947         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
11948         
11949 2005-04-08  Raja R Harinath  <rharinath@novell.com>
11950
11951         Fix #74484.
11952         * attribute.cs (Attribute.GetAttributeUsage): Resolve
11953         AttributeUsageAttribute in the emitcontext of the attribute class,
11954         not in the emitcontext of the attributable entity it was attached to.
11955         * cs-parser.jay: Use 'current_class', not 'current_container',
11956         when creating a GlobalAttribute.
11957
11958 2005-04-08  Alp Toker  <alp@atoker.com>
11959
11960         * pending.cs: The fix to #58413 failed to compile methods implementing
11961         interfaces with/without params modifiers and vice versa, even though
11962         params modifiers aren't part of the signature. Make the modifier check
11963         less strict as in csc.
11964
11965 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
11966             Anoob V E  <projectmonokochi@rediffmail.com>
11967             Harilal P R  <projectmonokochi@rediffmail.com>
11968
11969         Fix #58413.
11970         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
11971         modifiers of pending methods.
11972         (PendingImplementation.PendingImplementation): Initialize it.
11973         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
11974         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
11975         with ParameterData.  Add check for modifiers.
11976         * class.cs (MethodData.Define): Update to changes.
11977
11978 2005-04-07  Raja R Harinath  <rharinath@novell.com>
11979
11980         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
11981
11982 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
11983
11984         * class.cs (PropertyMethod.Define): Check private accessor in abstract
11985         property.
11986         
11987         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
11988         
11989         * rootcontext.cs,
11990         * typemanager.cs: Registered RequiredAttributeAttribute.
11991         
11992 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
11993
11994         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
11995         Warning CS0169 is back at level 3.
11996         (IMethodData.SetMemberIsUsed): New method.
11997         
11998         * decl.cs (IsUsed): New value; moved from FieldBase.Status
11999         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
12000         
12001         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
12002
12003         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
12004         contants.
12005         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
12006         is used.
12007         
12008         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
12009         is used.
12010         
12011         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
12012         to avoid the problems with nested types.
12013
12014 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
12015             Anoob V.E  <projectmonokochi@rediffmail.com>
12016             Harilal P.R  <projectmonokochi@rediffmail.com>
12017             Raja R Harinath  <rharinath@novell.com>
12018
12019         Fix #73820.
12020         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
12021         attribute.
12022         * typemanager (GetConstructor): Make public.
12023
12024 2005-04-05  John Luke  <john.luke@gmail.com>
12025             Raja R Harinath  <rharinath@novell.com>
12026
12027         Fix #62232.
12028         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
12029         struct too.  Return false quicker in a few cases.
12030         (VerifyUnManaged): Use it.
12031
12032 2005-04-05  Raja R Harinath  <rharinath@novell.com>
12033
12034         Fix #74041.
12035         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
12036         not 'unreachable_seen'.
12037
12038 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
12039
12040         * attribute.cs (Attribute.GetValue): Removed unused.
12041         
12042         * codegen.cs (CodeGen.TrimExt): Removed unused.
12043         
12044         * cs-parser.jay (output): Removed unused.
12045         
12046         * cs-tokenizer.cs (hex_digits): Removed unused.
12047         
12048         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
12049         
12050         * expression.cs (Indirection.LoadExprValue): Removed unused.
12051         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
12052         
12053         * iterators.cs (Iterator.param_types): Removed unused.
12054         
12055         * statement.cs (Goto.block): Removed unused.
12056         (ToplevelBlock.did): Removed unused.
12057         (Switch.ResolveConstantSwitch): Removed unused.
12058
12059 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
12060
12061         * rootcontext.cs: Allow mcs to bootstrap with the compilation
12062         resetting thingy.
12063
12064 2005-04-01  Raja R Harinath  <rharinath@novell.com>
12065
12066         Fix #74232 and cs0208-3.cs.
12067         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
12068         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
12069         unmanaged type.  Don't use FieldBuilders when 't' is a
12070         TypeBuilder.  Use ModFlags and MemberType fields.
12071         * class.cs (MemberBase.member_type): Rename from MemberType.
12072         (MemberBase.MemberType): New property.  Determines member_type on
12073         demand.
12074         (MemberBase.DoDefine): Don't initialize MemberType here.
12075         (FieldMember.Define): Likewise.
12076
12077 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
12078
12079         Fix #74241
12080         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
12081         Attributes are emitted there.
12082         
12083 2005-04-01  Raja R Harinath  <rharinath@novell.com>
12084
12085         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
12086         keyword in 'partial enum' too.
12087         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
12088         is not allowed).
12089         Report from Kamil Skalski <nazgul@omega.pl>.
12090
12091         Fix #74309.
12092         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
12093         have partial containers too.
12094
12095         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
12096         in block' checks to Block.CheckInvariantMeaningInBlock.
12097         * statement.cs (Block.GetKnownVariableInfo): Make private.
12098         (Block.IsVariableUsedInChildBlock): Remove.
12099         (Block.IsVariableUsedInBlock): Likewise.
12100         (Block.CheckInvariantMeaningInBlock): New.  Show location of
12101         conflicting declaration.
12102         (Block.AddVariable): Make error messages less long-winded and more
12103         specific.  Show location of conflicting declaration.
12104         * parameter.cs (Parameters.Location): New readonly property.
12105
12106 2005-03-31  Raja R Harinath  <rharinath@novell.com>
12107
12108         Clean up semantics of invoking ResolveMemberAccess.
12109         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
12110         can have an instance, ensure that we pass in a non-TypeExpression
12111         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
12112         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
12113         argument.  Update to changes and simplify.
12114         (FieldExpr.Emitinstance): Remove CS0120 check.
12115         (PropertyExpr.EmitInstance): Likewise.
12116         * expression.cs (Argument.Resolve): Likewise.
12117         (Invocation.DoResolve): Update to changes in semantics of
12118         InstanceExpression.
12119
12120 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
12121
12122         Fix #74241
12123         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
12124         customization.
12125         
12126         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
12127
12128 2005-03-31  Raja R Harinath  <rharinath@novell.com>
12129
12130         Fix difference in behaviour with commandline invocation.
12131         * driver.cs (Driver.Reset): New.
12132         (CompilerCallableEntryPoint): Call it.
12133
12134         * statement.cs (If.Resolve): Avoid spurious "uninitialized
12135         variable" warnings if the boolean expression failed to resolve.
12136
12137 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
12138
12139         * attribute.cs: Fix the union of several permissions when some of them
12140         are unrestricted (so the result isn't an unrestricted permission set).
12141         Fix #74036.
12142
12143 2005-03-30  Raja R Harinath  <rharinath@novell.com>
12144
12145         * ecore.cs (MemberExpr): New class.  Convert from interface
12146         IMemberExpr.
12147         (MemberExpr.ResolveMemberAccess): Refactor and move here from
12148         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
12149         error checks.
12150         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
12151         (MethodGroupExpr.IsExplicitImpl): Remove.
12152         (Expression.GetFieldFromEvent): Remove.
12153         (SimpleName.MemberStaticCheck): Remove.
12154         (SimpleName.DoSimpleNameResolve): Update to changes.
12155         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
12156         (MemberAccess.IdenticalNameAndTypeName): Remove.
12157         (MemberAccess.error176): Move to MemberExpr.
12158         (MemberAccess.DoResolve): Update to changes.
12159         (BaseAccess.DoResolve): Likewise.
12160
12161 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
12162
12163         C# 2.0 Conditional attribute class implementation
12164         
12165         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
12166         Analyzes class whether it has attribute which has ConditionalAttribute
12167         and its condition is not defined.
12168         
12169         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
12170         (Class.IsExcluded): New method. Search for at least one defined
12171         condition in ConditionalAttribute of attribute class.
12172
12173 2005-03-30  Raja R Harinath  <rharinath@novell.com>
12174
12175         * ecore.cs (PropertyExpr): Derive from Expression, not
12176         ExpressionStatement.
12177         (PropertyExpr.EmitStatement): Remove.
12178
12179 2005-03-29  Raja R Harinath  <rharinath@novell.com>
12180
12181         Fix #74060.
12182         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
12183         internal field "value__" of an enum be private.  The examples for
12184         "value__" that I found on MSDN all used FieldAttributes.Private.
12185
12186         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
12187         Don't mention IL method attribute names.
12188
12189         Fix #47991.  Remove a TODO.
12190         * statement.cs (Block.Toplevel): Make into a field.
12191         (Block.Parameters): Move into ToplevelBlock.
12192         (Block.known_variables): Rename from child_variable_names.
12193         (Block.Block): Remove variants that take Parameters.  Initialize
12194         'Toplevel' with the immediately surrounding toplevel block.
12195         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
12196         LocalInfo parameter.
12197         (Block.GetKnownVariableInfo): New.
12198         (Block.IsVariableNameUsedInChildBlock): Update.
12199         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
12200         the block, even though it may not be in scope.
12201         (Block.AddVariable): Remove Parameters parameter.  Use
12202         Toplevel.Parameters instead.
12203         (Block.AddConstant): Remove Parameters parameter.
12204         (Block.GetParameterReference): Update to use Toplevel.Parameters.
12205         (Block.IsParamaterReference): Likewise.
12206         (Block.IsLocalParameter): Likewise.  Simplify a lot.
12207         (ToplevelBlock.Parameters): New.  Moved from Block.
12208         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
12209         initialize Parameters to a non-null value.
12210         * cs-parser.jay: Update to changes.
12211         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
12212         simple names that mean different things in the same block.  Use
12213         Block.IsVariableNameUsedInBlock.
12214
12215 2005-03-28  Raja R Harinath  <rharinath@novell.com>
12216
12217         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
12218         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
12219         GetTypeHandle.  It is possible for a reflected type to derive from
12220         a TypeBuilder (e.g., int[] derives from the TypeBuilder
12221         System.Array during mscorlib compilation).
12222         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
12223         contain a method_hash, don't create one either.  Don't create a
12224         deep copy of the base cache's method_hash.
12225         (MemberCache.SetupCache): Rename back from DeepCopy.
12226         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
12227         already initialized.  If we see an override function, add its
12228         underlying base virtual function to the member_hash too.
12229
12230         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
12231
12232 2005-03-26  Raja R Harinath  <harinath@acm.org>
12233
12234         Fix #73038.
12235         * assign.cs (Assign.DoResolve): When the RHS of an assignment
12236         fails to resolve, ensure that the LHS is still resolved as an
12237         lvalue.
12238
12239 2005-03-25  Raja R Harinath  <harinath@acm.org>
12240
12241         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
12242         ec.ContainerType.
12243         (Enum.current_ec): Remove.
12244         (Enum.LookupEnumValue): Remove EmitContext argument.
12245         Just uses the one created during DefineType.
12246         (Enum.FindMembers): Update.
12247         * expression.cs (MemberAccess.DoResolve): Update.
12248
12249 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
12250
12251         * assign.cs (Assign.DoResolve): Check for CS1717 when
12252         source and target are same (uses Equals).
12253
12254         * expression.cs (LocalVariableReference, ParameterReference,
12255         This): Implemented Equals, GetHashCode.
12256
12257         * statement.cs (Block.GetParameterReference): Removed useless
12258         local variable.
12259
12260 2005-03-22  Raja R Harinath  <rharinath@novell.com>
12261
12262         Fix cs0128.cs
12263         * statement.cs (Block.AddVariable): Ensure that we skip implicit
12264         blocks before deciding whether the error is cs0136 or cs0128.
12265
12266         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
12267         (using_alias_directive, using_namespace_directive): Pass
12268         MemberName, not an expression to Namespace.UsingAlias and
12269         Namespace.Using.
12270         (MakeName): Use the MemberName of the namespace.
12271         * namespace.cs (Namespace.MemberName): New.
12272         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
12273         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
12274         Likewise.
12275         * decl.cs (MemberName.Name): Make readonly.
12276         (MemberName.FromDotted): New "constructor".
12277         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
12278         (MemberCore.Name): Compute from MemberName on demand.
12279         (MemberCore.SetMemberName): Provide a way to change the
12280         MemberName.
12281         (MemberCore.AddToContainer): Don't take a fullname parameter.
12282         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
12283         fully qualified name of the container to the member name.
12284         (TypeContainer.AddToTypeContainer): Use a fully qualified name
12285         only if the type is a member of the root container.
12286         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
12287         MemberName.Left rather than searching for an embedded ".".
12288         (PartialContainer.CreatePart): Update to changes in RootContext.
12289         (MemberBase.ShortName): Turn into a property.  Use
12290         MemberCore.SetMemberName.
12291         (MemberBase.ExplicitInterfaceName): Remove.
12292         (MemberBase.UpdateMemberName): Remove.
12293         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
12294         (PropertyBase.SetMemberName): New override.
12295         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
12296         (Tree.GetDecl): New.
12297         (Tree.AllDecls): Rename from Decls.
12298         * attribute.cs, enum.cs, report.cs: Update to changes.
12299         * driver.cs (MainDriver): Use MemberName.FromDotted on
12300         RootContext.MainClass.
12301
12302 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
12303
12304         * class.cs (FixedField.Define): Check for CS1664 and more sanity
12305         checks.
12306
12307         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
12308
12309 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
12310
12311         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
12312         property accessor modifiers.
12313
12314         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
12315         fixed buffer attribute (CS1716).
12316         (PropertyMethod.HasCustomAccessModifier): When property accessor
12317         has custom modifier.
12318
12319         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
12320         modifiers.
12321         (PropertyExpr.DoResolveLValue): Add CS0272.
12322
12323 2005-03-17  Miguel de Icaza  <miguel@novell.com>
12324
12325         * convert.cs: When converting to a pointer, use the proper Conv.U
12326         or Conv.I depending on the source data type.
12327
12328         * cs-tokenizer.cs: Make the size for large decimal constants,
12329         fixes #72957.
12330
12331 2005-03-17  Martin Baulig  <martin@ximian.com>
12332
12333         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
12334         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
12335
12336 2005-03-17  Martin Baulig  <martin@ximian.com>
12337
12338         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
12339         to bool so we can return an error condition.
12340         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
12341         returned an error.
12342
12343 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
12344
12345         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
12346         attributes.
12347
12348 2005-03-16  Raja R Harinath  <rharinath@novell.com>
12349
12350         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
12351         Refactor to avoid traversing the list of assemblies, and to avoid
12352         string concatenation.
12353         * typemanager.cs (guid_attr_type): Remove.
12354         (negative_hits, pointers, references): Remove hashes.
12355         (type_hash): New.
12356         (GetConstructedType): New.  Uses type_hash to handle constructed
12357         types (arrays, references, pointers).
12358         (GetReferenceType, GetPointerType): Use it.
12359         (GetNestedType): New.  Uses type_hash to handle nested types of
12360         reflected types.
12361         (LookupType, LookupTypeDirect): Remove.
12362         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
12363         'types' hash and LookupTypeReflection directly.
12364         (params_string, params_object): Use GetConstructedType.
12365         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
12366         top-level types.
12367         (Namespace.Lookup): Use cached_types.
12368         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
12369         provided by old TypeManager.LookupType.
12370         * rootcontext.cs (MakeFQN): Remove.
12371         * decl.cs (DeclSpace.MakeFQN): Likewise.
12372         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
12373         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12374         TypeManager.GetConstructedType.
12375         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
12376
12377 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
12378
12379         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
12380         indexers.
12381
12382         * cs-parser.jay: Reports CS1527 for any namespace element.
12383
12384         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
12385         Added CS0407.
12386
12387         * expression.cs (ParameterReference.IsAssigned): Changed error to
12388         CS0269.
12389         (Error_WrongNumArguments): Moved CS0245 detection here.
12390
12391         * statement.cs (Return.Resolve): Add CS1622 report.
12392
12393 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
12394
12395         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
12396
12397 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
12398
12399         * attribute.cs expression.cs: Get rid of some allocations.
12400
12401 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
12402
12403         * doc.cs : just eliminate the latest change.
12404
12405 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
12406
12407         * doc.cs : commented out the latest change. It breaks xml-030.cs
12408
12409 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
12410
12411         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
12412           fail. So invoke CreateType() in FindDocumentedType().
12413
12414 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
12415
12416         * cs-tokenizer.cs : added IsKeyword().
12417         * doc.cs : Detect keyword incorrectly used as identifier.
12418           Allow identifiers prefixed by @.
12419
12420 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
12421
12422         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
12423         It caused exception in namespace resolving (again!).
12424         
12425         * class.cs (Class.ctor): Removed exit.
12426         (PropertyMethod.ctor): ditto.
12427         
12428         * codegen.cs (Codegen.Reset): Reset static data.
12429         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
12430         
12431         * cs-tokenizer.cs (Cleanup): Removed.
12432         
12433         * driver.cs (GetSystemDir): Rewrote to one line command.
12434         It caused problem with unloaded dynamic modules.
12435         (UnixParseOption): Removed Exit.
12436         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
12437         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
12438         Now can be mcs used as library.
12439         
12440         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
12441         empty location.
12442         
12443         * location.cs (Reset): Reset static data.
12444         
12445         * namespace.cs (Reset): Reset static data.
12446         
12447         * report.cs (Report.Reset): Reset static data.
12448         
12449         * rootcontext.cs (RootContext.Reset): Reset static data.
12450         
12451         * tree.cs (RootTypes.ctor): Use Location.Null
12452         
12453         * typemanager.cs (TypeManager.Reset): Reset static data.
12454         (CoreLookupType): Removed Exit.
12455         (TypeHandle.Reset): Reset static data.
12456         
12457 2005-03-10  Raja R Harinath  <rharinath@novell.com>
12458
12459         Fix #73516.
12460         * typemanager.cs (ComputeNamespaces): Import namespaces from
12461         referenced modules too.
12462
12463 2005-03-09  Raja R Harinath  <rharinath@novell.com>
12464
12465         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
12466         than '.'.
12467
12468 2005-03-09  Raja R Harinath  <rharinath@novell.com>
12469
12470         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
12471         enclosing DeclSpace.  This ensures that a name-lookup populates
12472         more caches and there are fewer 'TypeExpression's.  Carve out
12473         nested type lookup into ...
12474         (LookupNestedTypeInHierarchy): ... this.
12475
12476 2005-03-09  Raja R Harinath  <rharinath@novell.com>
12477
12478         Clean up a few partial-class semantics.  
12479         Fixes test-357.cs and cs1618-2.cs.
12480         * cs-parser.jay (struct_declaration): Use 'current_class' as
12481         parent of newly-created struct.  Remove call to Register ().
12482         Use 'pop_current_class' to complete handing the current struct.
12483         (interface_declaration): Likewise.
12484         (class_declaration): Likewise.
12485         (enum_declaration): Use 'current_class' as parent of newly created
12486         enum.
12487         (delegate_declaration): Likewise.
12488         (pop_current_class): New function.  This is used to handle closing
12489         up the 'current_class' and 'current_container', and pointing them
12490         to the enclosing class/container.
12491         (CSharpParser): Initialize 'current_class' too.
12492         * decl.cs (MemberCore): Add check for invariant: a partial
12493         container is not a parsed entity, and thus does not enclose any
12494         parsed members.
12495         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
12496         (DeclSpace.BaseTypeExpr): Use it.
12497         (DeclSpace.LookupType): Add check for invariant.
12498         * class.cs (TypeContainer): Add check for invariant: a nested
12499         class should have the same NamespaceEntry as its enclosing class.
12500         (TypeContainer.EmitFieldInitializers): Make virtual.
12501         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
12502         MemberCore.
12503         (TypeContainer.Register): Remove.
12504         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
12505         null.  Use TypeResolveEmitContext for resolving base types and
12506         interfaces.  Move initialization of Parts.TypeBuilder here from
12507         ...
12508         (TypeContainer.DefineNestedTypes): ... here.
12509         (PartialContainer): Take a Namespace not a NamespaceEntry.
12510         (PartialContainer.Create): Don't use Register.  Call the
12511         appropriate Add... function directly.
12512         (ClassPart): Take both the PartialContainer and the enclosing
12513         class as constructor arguments.
12514         (ClassPart.EmitFieldInitializers): Override.
12515         (ClassPart.PartFindNestedTypes): Remove.
12516         (FieldBase.GetInitializerExpression): Resolve the initializer
12517         expression in the emit context of the enclosing class.
12518         * tree.cs (RootTypes): Remove Register ().
12519         
12520 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
12521
12522         * cs-parser.jay: Removed CS0134.
12523         
12524         * driver.cs: Removed CS1901.
12525         
12526         * expression.cs (SizeOf.DoResolve): Don't report CS0233
12527         for predefined types.
12528
12529 2005-03-07  Duncan Mak  <duncan@novell.com>
12530
12531         * codegen.cs (Save):  Catch UnauthorizedAccessException as
12532         well. Fixes bug #73454.
12533
12534 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
12535
12536         * cs-tokenizer.cs (xtoken): Add CS1035.
12537         
12538         * class.cs (MethodData.Define): Add CS0683.
12539         (FieldMember.ctor): Add CS0681.
12540
12541 2005-03-07  Raja R Harinath  <rharinath@novell.com>
12542
12543         * ecore.cs (SimpleName.DoResolve): Rename from
12544         SimpleName.DoResolveAllowStatic.
12545         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
12546         Pass 'intermediate' flag to MemberStaticCheck.
12547         (SimpleName.MemberStaticCheck): Skip "static check" only in case
12548         of "intermediate" lookups via MemberAccess.
12549         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
12550         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
12551
12552 2005-03-07  Raja R Harinath  <rharinath@novell.com>
12553
12554         Fix #73394.
12555         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
12556         slipped in because of variable names that are identical to a
12557         builtin type's BCL equivalent ('string String;', 'int Int32;').
12558         (PropertyExpr.EmitInstance): Likewise.
12559
12560 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
12561
12562         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
12563         
12564         * report.cs (warning_ignore_table): Made public.
12565
12566 2005-03-04  Raja R Harinath  <rharinath@novell.com>
12567
12568         Fix #73282.
12569         * class.cs (MethodData.Emit): Pass 'container' to
12570         container.GetObsoleteAttribute instead of 'container.Parent'.
12571
12572 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
12573
12574         * cs-parser.jay: Add 1534 error test.
12575
12576         * iterators.cs (Yield.CheckContext): Add error 1629.
12577         (Iterator.ctor): Save unsafe modifier.
12578         (MoveNextMethod.DoEmit): Restore unsafe context.
12579
12580         * namespace.cs (UsingAlias): Better error message.
12581
12582 2005-03-03  Dan Winship  <danw@novell.com>
12583
12584         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
12585         the warning message [#73219]
12586
12587 2005-03-03  Raja R Harinath  <rharinath@novell.com>
12588
12589         Fix compile with MCS 1.0.0.0.
12590         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
12591         w_restore to not depend on string constant folding.
12592
12593 2005-03-03  Raja R Harinath  <rharinath@novell.com>
12594
12595         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
12596         CS0246 check to users who passed 'silent = false'.
12597         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
12598         check.
12599         (SimpleName.SimpleNameResolve): Update.
12600         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
12601         (MemberAccess.IdenticalNameAndTypeName): Update.
12602         * doc.cs (FindDocumentedTypeNonArray): Update.
12603
12604 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
12605
12606         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
12607         * parameters.cs (ComputeAndDefineParameters): Remove.
12608         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
12609         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
12610         Use GetParameterInfo.
12611
12612 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
12613
12614         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
12615
12616 2005-03-02  Raja R Harinath  <rharinath@novell.com>
12617
12618         Unify DeclSpace.LookupType and DeclSpace.FindType.
12619         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
12620         is in charge of defining nested types on demand.
12621         (DeclSpace.LookupType): Use it when the current_type is a
12622         TypeBuilder.  Use LookupTypeDirect for reflected types.
12623         (DeclSpace.FindType): Remove.
12624         (DeclSpace.LookupInterfaceOrClass): Likewise.
12625         (DeclSpace.DefineTypeAndParents): Likewise.
12626         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
12627         DeclSpace.LookupType.
12628         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
12629         * typemanager.cs (LookupType): Simplify.
12630         (AddUserType): Remove type from negative_hits.
12631         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
12632         * class.cs (TypeContainer.FindMembers): Move handling of nested
12633         types ...
12634         (TypeContainer.FindMembers_NestedTypes): ... here.
12635         (TypeContainer.FindNestedType): Implement override.
12636         (ClassPart.FindNestedType): Delegate to PartialContainer.
12637         (ClassPart.PartFindNestedType): Looks up the nested types of the
12638         part alone.
12639
12640 2005-03-02  Martin Baulig  <martin@ximian.com>
12641
12642         * class.cs (TypeContainer.DoDefineMembers): We also need a default
12643         static constructor in static classes.
12644
12645 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
12646
12647         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
12648         sizeParamIndex is not specified.
12649
12650 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
12651
12652         Fix #73117
12653         * report.cs (WarningMessage.IsEnabled): Missing null check.
12654
12655 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
12656
12657         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
12658         in the fields and not in the properties.
12659
12660 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
12661
12662         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
12663         fields as well.
12664
12665 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
12666
12667         * attribute.cs: Small refactoring (improved robustness).
12668         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
12669         (ValidateGuid): Removed.
12670         (Resolve): Removed referenced to above mentioned.
12671         (GetAttributeUsage): Made private and changed to work without
12672         class assistance.
12673         (GetIndexerAttributeValue): Don't crash.
12674         (GetConditionalAttributeValue): Ditto.
12675         (GetClsCompliantAttributeValue): Ditto.
12676         (ExtractSecurityPermissionSet): All attributes exceptions are
12677         error 648.
12678         (GetPropertyValue): New helper.
12679         (GetMethodImplOptions): New method.
12680         (DefinePInvokeMethod): Reuse common code. Implemented handling of
12681         some missing properties.
12682         
12683         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
12684         (Method.ApplyAttributeBuilder): Updated.
12685         
12686         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
12687         exception.
12688
12689 2005-02-28  Raja R Harinath  <rharinath@novell.com>
12690
12691         Fix #73052.
12692         * report.cs (Report.SymbolRelatedToPreviousError): Handle
12693         non-simple types (array, pointer, reference).
12694
12695 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
12696
12697         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
12698
12699         * class.cs (MethodCore.IsDuplicateImplementation): Special error
12700         for operators.
12701         (Method.CheckBase): Catch wrong destructor here.
12702         (MethodData.Define): Add errors 550, 668.
12703
12704         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
12705
12706         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
12707
12708         * pending.cs (VerifyPendingMethods): Add error 551.
12709
12710         * typemanager.cs (CSharpName): Next error report helper.
12711
12712 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
12713
12714         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
12715         attributes. Removed useless attribute double check.
12716         It saves almost 2MBs for corlib.
12717
12718 2005-02-25  Raja R Harinath  <rharinath@novell.com>
12719
12720         Fix #72924.
12721         * statement.cs (ExpressionStatement.Resolve): Make robust to being
12722         called twice in case of error.
12723
12724 2005-02-23  Chris Toshok  <toshok@ximian.com>
12725
12726         Fix compiler portions of #72827.
12727         * statement.cs (Block.Emit): call Begin/EndScope on the
12728         EmitContext instead of the ILGenerator.
12729
12730         * codegen.cs (EmitContext.BeginScope): new method, call
12731         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
12732         we have one.)
12733         (EmitContext.BeginScope): same, but EndScope and CloseScope
12734
12735         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
12736         offset and call the superclass's OpenScope(int) with it.
12737         (SymbolWriter.CloseScope): get the current il
12738         offset and call superclass's CloseScope(int) with it.
12739
12740 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
12741
12742         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
12743         CS1677 for out and ref as well.
12744
12745         * class.cs (Method.Define): Add error CS1599 detection.
12746         
12747         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
12748         
12749         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
12750         
12751         * delegate.cs (Delegate.Define): Add error CS1599 detection.
12752         
12753         * support.cs.cs (ModifierDesc): New helper method.
12754
12755 2005-02-23  Raja R Harinath  <rharinath@novell.com>
12756             Abin Thomas  <projectmonokochi@rediffmail.com>
12757             Anoob V E  <projectmonokochi@rediffmail.com>
12758             Harilal P R  <projectmonokochi@rediffmail.com>
12759
12760         Fix #57851, #72718.
12761         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
12762         MemberLookup (used for error reporting) actually returns a result.
12763         Fix error report number (122, not 112).
12764
12765 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
12766             Anoob V E  <projectmonokochi@rediffmail.com>
12767             Harilal P R  <projectmonokochi@rediffmail.com>
12768
12769         Fix #71134.
12770         * pending.cs (PendingImplementation.GetAbstractMethods):
12771         Find NonPublic members too.
12772
12773 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
12774
12775         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
12776         Fixed error 217.
12777         
12778         * class.cs (MethodCore.CheckMethodAgainstBase):
12779         Add error 239 report.
12780
12781 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12782
12783         Fix #68955.
12784         * expression.cs (Invocation.IsApplicable): Make public.
12785         (Invocation.IsParamsMethodApplicable): Likewise.
12786         * delegate.cs (Delegate.VerifyApplicability): Don't use
12787         Invocation.VerifyArgumentCompat for parameter applicability
12788         testing.  Use Invocation.IsApplicable and
12789         Invocation.IsParamsMethodApplicable.
12790
12791 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
12792
12793         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
12794         
12795         * class.cs (Operator.Define): Add error 217 report.
12796         
12797 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12798
12799         * namespace.cs (UsingEntry.Resolve): Undo change below.
12800
12801 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12802
12803         Fix #72756.
12804         * ecore.cs (Expression.MemberLookupFailed): Add argument to
12805         disable the error message when the extended MemberLookup also
12806         fails.
12807         (Expression.MemberLookupFinal): Update.
12808         (SimpleName.DoSimpleNameResolve): Update.
12809         * expression.cs (MemberAccess.ResolveNamespaceOrType):
12810         Don't use MemberLookupFinal.
12811         (New.DoResolve): Update.
12812         (BaseAccess.CommonResolve): Update.
12813
12814 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12815
12816         Fix #72732.
12817         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
12818         occured previously, don't resolve again.
12819
12820 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
12821
12822         Fix #69949
12823         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
12824         argument. Call ResolveAttributeUsage for unresolved.
12825         when types doesn't match ctor arguments.
12826         
12827         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
12828         for nested attribute classes.
12829         (Class.attribute_usage): Removed.
12830         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
12831         for attribute class.
12832         
12833         * ecore.cs (IsAttribute): Removed.
12834         
12835         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
12836         
12837         * rootcontext.cs (RegisterAttribute): Removed, attributes are
12838         now normal types.
12839         (attribute_types): Removed.
12840         (EmitCode): Global attributes are emited as the latest.
12841
12842 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
12843
12844         * class.cs (EmitFieldInitializers): Don't emit field initializer
12845         for default values when optimilization is on.
12846         
12847         * constant.cs (Constant.IsDefaultValue): New property.
12848         
12849         * driver.cs: Add /optimize handling.
12850         
12851         * constant.cs,
12852         * ecore.cs,
12853         * literal.cs: Implement new IsDefaultValue property.
12854         
12855         * rootcontext.cs (Optimize): New field, holds /optimize option.
12856
12857 2005-02-18  Raja R Harinath  <rharinath@novell.com>
12858
12859         Fix crasher in re-opened #72347.
12860         * namespace.cs (Namespace.Lookup): Return null if
12861         DeclSpace.DefineType returns null.
12862
12863         Fix #72678.
12864         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
12865
12866 2005-02-18  Raja R Harinath  <rharinath@novell.com>
12867
12868         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
12869         now returns null if it cannot resolve to an lvalue.
12870         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
12871         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
12872         returned null.  Remove check for SimpleName.
12873         (EventExpr.DoResolveLValue): New.
12874         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
12875         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
12876         error from ...
12877         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
12878         avoid CS0131 error.
12879         (Unary.ResolveOperator): Move CS0211 check ...
12880         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
12881         CS0131 error.
12882         (Unary.DoResolveLValue): Simplify.
12883         (AddressOf.DoResolveLValue): New.
12884         (ArrayAccess.DoResolveLValue): New.
12885
12886 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
12887
12888         * attribute.cs (Attribute.Resolve): Add arguments casting for
12889         when types doesn't match ctor arguments.
12890
12891 2005-02-16  Raja R Harinath  <rharinath@novell.com>
12892
12893         Fix parts of #63202.
12894         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
12895         lookup of operator in base type.  Ensure that all checks happen
12896         when the operator resolves to an "op_..." method.
12897
12898 2005-02-15  Raja R Harinath  <rharinath@novell.com>
12899
12900         Fix #71992.
12901         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
12902         'ignore_cs0104' parameter.  Pass it to ...
12903         (NamespaceEntry.Lookup): ... this.
12904         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
12905         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
12906         (TypeLookupExpression.DoResolveAsTypeStep): Update.
12907         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
12908         Update.  Request that cs0104 errors be ignored.
12909         (ComposedCast.ResolveAsTypeStep): Update.
12910
12911 2005-02-14  Raja R Harinath  <rharinath@novell.com>
12912
12913         Fix #59209.
12914         * expression.cs (Invocation.BetterFunction): Remove support for
12915         comparing virtual functions and their overrides.
12916         (Invocation.IsOverride): New.
12917         (Invocation.OverloadResolve): Don't consider 'override' functions
12918         during candidate selection.  Store them in a lookaside list.
12919         If the selected method is a 'virtual' function, use the list to
12920         find any overrides that are closer to the LHS type.
12921
12922 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
12923
12924         * expression.cs (New.DoResolve): Add complex core type reduction.
12925         (New.Constantify): Converts complex core type syntax like 'new int ()'
12926         to simple constant.
12927         
12928 2005-02-14  Raja R Harinath  <rharinath@novell.com>
12929
12930         * decl.cs (EntryType.EntryType): New constructor to create an
12931         updated copy of a cache entry.
12932         (MemberCache.AddMethods): Use it.
12933         (MemberCache.ClearDeclaredOnly): Remove.
12934         (MemberCache.MemberCache): Update.
12935
12936 2005-02-11  Miguel de Icaza  <miguel@novell.com>
12937
12938         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
12939         variable.  This one is represents the actual low-level declaration
12940         of the method, as opposed to the semantic level `IsStatic'.   
12941
12942         An anonymous method which is hosted into a static method might be
12943         actually an instance method.  IsStatic would reflect the
12944         container, while MethodIsStatic represents the actual code
12945         generated.
12946
12947         * expression.cs (ParameterReference): Use the new MethodIsStatic
12948         instead of IsStatic.
12949
12950         * anonymous.cs (AnonymousMethod.Compatible): Pass the
12951         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
12952         set on the current EmitContext. 
12953
12954         * expression.cs (Cast): Overload DoResolveLValue so we can pass
12955         resolve our casted expression as an LValue.  This triggers the
12956         proper LValue processing that is later required by Assign.
12957
12958         This fixes 72347.
12959
12960         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
12961
12962 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
12963
12964         C# 2.0 Fixed buffer implementation
12965
12966         * anonymous.cs: Update after RegisterHelperClass renaming.
12967
12968         * attribute.cs (AttributeTester.fixed_buffer_cache):
12969         Cache of external fixed buffers.
12970         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
12971         implementation if field is fixed buffer else null.
12972
12973         * class.cs
12974         (TypeContainer.AddField): Accept FieldMember instead of Field.
12975         (FieldBase.IsFieldClsCompliant): Extracted code from
12976         VerifyClsCompliance descendant customization.
12977         (FixedField): New class handles fixed buffer fields.
12978         (FixedFieldExternal): Keeps information about imported fixed
12979         buffer.
12980         (IFixedField): Make access to internal or external fixed buffer
12981         same.
12982
12983         * cs-parser.jay: Add fixed buffer parsing.
12984
12985         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
12986         buffer.
12987
12988         * expression.cs (Indirection): Extended implementation to accept
12989         fixed buffer field.
12990         (PointerArithmetic.Emit): Get element from fixed buffer as well.
12991         (ElementAccess.MakePointerAccess): Get type as parameter.
12992         (DoResolve): Add fixed buffer field expression conversion.
12993         (DoResolveLValue): Ditto.
12994         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
12995         (ArrayPtr): Derives from FixedBufferPtr.
12996         (ArrayPtr.Emit): Add extra emit for array elements.
12997
12998         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
12999
13000         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
13001         for compiler generated types.
13002         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
13003
13004         * statement.cs (Fixed): Refactored to be easier add fixed buffer
13005         and consume less memory.
13006         (Fixed.Resolve): Add fixed buffer case.
13007
13008         * typemanager.cs (compiler_generated_attr_ctor,
13009         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
13010         (HasElementType): Add our own implementation to work on every
13011         runtime.
13012
13013 2005-02-11  Miguel de Icaza  <miguel@novell.com>
13014
13015         * anonymous.cs (CaptureContext): Track whether `this' has been
13016         referenced.   
13017
13018         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
13019         only captured `this' if it was implicitly done (instance
13020         methods/variables were used). 
13021
13022         * codegen.cs (EmitContext.CaptureThis): New method to flag that
13023         `this' must be captured.
13024
13025 2005-01-30  Miguel de Icaza  <miguel@novell.com>
13026  
13027         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
13028         is null it means that there has been no need to capture anything,
13029         so we just create a sibling.
13030
13031         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
13032
13033         Just a partial fix.  The other half is fairly elusive.
13034         
13035 2005-02-10  Raja R Harinath  <rharinath@novell.com>
13036
13037         Fix #52586, cs0121-4.cs.
13038         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
13039         and return a hashtable.
13040         (MemberCache.ClearDeclaredOnly): New.
13041         (MemberCache.MemberCache): Update to change.  Make a deep copy of
13042         the method_hash of a base type too.
13043         (MemberCache.AddMethods): Adapt to having a deep copy of the base
13044         type methods.  Overwrite entries with the same MethodHandle so
13045         that the ReflectedType is correct.  The process leaves in base
13046         virtual functions and their overrides as distinct entries.
13047         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
13048         matters since it was boxed in a ArrayList before.
13049         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
13050         modifier.
13051         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
13052         case of a virtual function and its override (choose the overload
13053         as better).
13054         (Invocation.OverloadResolve): Avoid 'override' members during
13055         'applicable_type' calculation.
13056
13057 2005-02-09  Raja R Harinath  <rharinath@novell.com>
13058
13059         Combine two near-redundant caches.
13060         * typemanager.cs (method_params): Rename from method_internal_params.
13061         (TypeManager.GetParameterData): New.  Replace
13062         Invocation.GetParameterData.
13063         (TypeManager.LookupParametersByBuilder): Remove.
13064         * expression.cs (Invocation.method_parameter_cache): Remove.
13065         (Invocation.GetParameterData): Remove.
13066         Update to changes.
13067         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
13068         Update to changes.
13069
13070 2005-02-08  Raja R Harinath  <rharinath@novell.com>
13071
13072         Fix #72015.
13073         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
13074         TypeManager.multicast_delegate_type is null, resolve it by looking
13075         up "System.MulticastDelegate".
13076         * rootcontext.cs (RootContext.ResolveCore): Simplify.
13077
13078 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
13079             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
13080             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
13081
13082         Fix cs0164.cs.
13083         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
13084         (LabeledStatement.AddReference): New.  Set 'referenced'.
13085         (Goto.Resolve): Use it.
13086
13087 2005-02-05  John Luke  <john.luke@gmail.com>
13088
13089         * driver.cs: remove duplicate -doc line in Usage ()
13090
13091 2005-02-04  Raja R Harinath  <rharinath@novell.com>
13092
13093         * location.cs (Location.AddFile): Fix CS2002 error report.
13094
13095 2005-02-02  Martin Baulig  <martin@ximian.com>
13096
13097         * delegate.cs (Delegate.DefineType): Report an internal error if
13098         TypeManager.multicast_delegate_type is null.  See bug #72015 for
13099         details.        
13100
13101 2005-02-02  Raja R Harinath  <rharinath@novell.com>
13102
13103         Fix a crasher in a variant of #31984.
13104         * const.cs (Constant.CheckBase): New override that defers the
13105         new-or-override check in case the base type hasn't been populated
13106         yet.
13107         (Constant.Define): Ensure the new-or-override check is performed.
13108
13109 2005-02-01  Duncan Mak  <duncan@ximian.com>
13110
13111         * const.cs (LookupConstantValue): Check that `ce' is not null
13112         before calling GetValue ().
13113
13114 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13115
13116         Fix test-334.cs (#69519).
13117         * cs-parser.jay (using_alias_directive): Pass in an expression to
13118         NamespaceEntry.UsingAlias.
13119         (using_namespace_directive): Pass in an expression to
13120         NamespaceEntry.Using.
13121         (namespace_name): Don't flatten to a string.
13122         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
13123         (NamespaceEntry.AliasEntry.Resolve): Lookup using
13124         ResolveAsTypeStep.
13125         (NamespaceEntry.UsingEntry): Likewise.
13126         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
13127         changes.
13128         (NamespaceEntry.LookupForUsing): Remove.
13129         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
13130         names.
13131         (NamespaceEntry.Lookup): Remove support for dotted names.
13132
13133 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13134
13135         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
13136         split into two.
13137         (NamespaceEntry.ImplicitParent): Compute on demand.
13138         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
13139         parallels the current.
13140         (NamespaceEntry.LookupForUsing): Use it.
13141         (NamespaceEntry.Lookup): If the current namespace-entry is
13142         implicit, don't search aliases and using tables.
13143
13144 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13145
13146         Fix #31984.
13147         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
13148         BaseCache here.
13149         (TypeContainer.BaseCache): Compute on demand.
13150         (TypeContainer.FindMembers): Define constants and types if they're
13151         not already created.
13152         (FieldMember.Define): Move resetting of ec.InUnsafe before error
13153         check.
13154         * const.cs (Constant.Define): Make idempotent.
13155
13156 2005-01-29  Miguel de Icaza  <miguel@novell.com>
13157
13158         * pending.cs: Produce better code (no nops produced by using Ldarg
13159         + value).
13160         
13161         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
13162         i - 1' it should be arg + 1.
13163
13164         Fixes bug #71819.
13165
13166 2005-01-28  Raja R Harinath  <rharinath@novell.com>
13167
13168         * attribute.cs (Attribute.CheckAttributeType): Make private
13169         non-virtual.
13170         (Attribute.ResolveType): Make virtual.
13171         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
13172         handling of RootContext.Tree.Types.
13173
13174 2005-01-27  Raja R Harinath  <rharinath@novell.com>
13175
13176         Update attribute-handling to use the SimpleName/MemberAccess
13177         mechanisms.
13178         * cs-parser.jay (attribute): Pass in an expression to the
13179         constructors of Attribute and GlobalAttribute.
13180         * attribute.cs (Attribute): Take an expression for the name.
13181         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
13182         passed in attribute name expression.
13183         (Attribute.CheckAttributeType): Use it.
13184         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
13185         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
13186         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
13187         argument to prevent error messages if the lookup fails.
13188
13189 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
13190
13191         * expression.cs (Indirection): Implemented IVariable interface
13192         to support indirection in AddressOf operator.
13193         (PointerArithmetic.Emit): Add optimalization for case where
13194         result can be precomputed.
13195
13196 2005-01-26  Martin Baulig  <martin@ximian.com>
13197
13198         * class.cs (TypeContainer.AttributeTargets): Return the correct
13199         AttributeTargets depending on our `Kind' instead of throwing an
13200         exception; fixes #71632.
13201
13202 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
13203
13204         Fix #71257
13205         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
13206         constant members.
13207
13208 2005-01-25  Raja R Harinath  <rharinath@novell.com>
13209
13210         Fix #71602.
13211         * expression.cs (MemberAccess.DoResolve): Don't complain with
13212         cs0572 when the LHS of a member access has identical name and type
13213         name.
13214
13215 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
13216
13217         Fix #71651, #71675
13218         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
13219         CreatePermission.
13220         Create custom PermissionSet only for PermissionSetAttribute.
13221
13222 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
13223
13224         Fix #71649
13225         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
13226         delegates in static class.
13227
13228 2005-01-24  Martin Baulig  <martin@ximian.com>
13229
13230         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13231         merging an implicit block, just use its reachability.
13232
13233         * statement.cs (Block.Resolve): Make the unreachable code check
13234         work wrt. implicit blocks; see test-337 from #63842.
13235
13236 2005-01-21  Alp Toker  <alp@atoker.com>
13237  
13238         * cs-parser.jay: destructor_declaration's container is PartialContainer
13239         not Class when partial types are used, so use Kind prop instead of
13240         'is'.
13241         
13242 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
13243
13244         * cs-parser.jay: Improve error reporting when an interface
13245         declares new types.
13246
13247 2005-01-20  Dick Porter  <dick@ximian.com>
13248
13249         * support.cs: SeekableStreamReader fix from Sandor Dobos
13250         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
13251         chars are read.  Fixes bug 70369.
13252
13253 2005-01-20  Raja R Harinath  <rharinath@novell.com>
13254
13255         * cs-parser.jay (catch_clause): Simplify current_block handling
13256         somewhat.
13257
13258 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
13259
13260         * convert.cs (ImplicitStandardConversionExists): Synchronize the
13261         code with ImplicitStandardConversion to handle the implicit
13262         conversion of method groups into valid delegate invocations. 
13263
13264         The problem is that in parameter handling we were using this code
13265         path.  Fixes bug #64698
13266
13267 2005-01-19  Raja R Harinath  <rharinath@novell.com>
13268
13269         * cs-parser.jay: Fix several infelicities.
13270         - Avoid assigning to the parser value stack.  Code like 
13271           '$3 = null' is unclean.  Synthesize a value for the code block
13272           instead. 
13273         - Avoid using oob_stack for storing location information.  Use ...
13274         (_mark_): ... this.  New (empty) rule.  Saves the current location
13275         in $$.
13276         (foreach_statement): Avoid using oob_stack for current_block
13277         handling.  Use technique used in for_statement and
13278         using_statement.  Synthesize a value for the code block to store
13279         additional intermediate information.
13280
13281 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
13282
13283         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
13284         of a different type is only allowed to private fields of a
13285         containing type, not on fields of a base class.
13286
13287         See test-174.cs and error cs0122-9.cs
13288
13289 2005-01-13  Raja R Harinath  <rharinath@novell.com>
13290
13291         Fix test-335.cs (bug #58126).
13292         * cs-parser.jay (argument): Split out non-expression parts of the
13293         rule into 'non_simple_argument'.
13294         (invocation_expression): Support parenthesized invocations with
13295         multiple arguments, and with single non-simple arguments.
13296
13297 2005-01-13  Raja R Harinath  <rharinath@novell.com>
13298
13299         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
13300         places.
13301
13302 2005-01-12  Raja R Harinath  <rharinath@novell.com>
13303
13304         Fix cs0038-1.cs, cs1640-6.cs.
13305         * ecore.cs (Expression.Resolve): Remove special-case for
13306         SimpleName in error-handling.
13307         (Expression.almostMatchedMembers): Relax access permission to
13308         protected.
13309         (Expression.MemberLookupFailed): Handle duplicates in
13310         almostMatchedMembers list.
13311         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
13312         * expression.cs (New.DoResolve): Report CS1540 for more cases.
13313         * typemanager.cs (GetFullNameSignature): Use the MethodBase
13314         overload if the passed in MemberInfo is a MethodBase.
13315
13316 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
13317
13318         Fix #70749
13319         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
13320         for non-CAS & merge permission sets properly.
13321
13322 2005-01-11  Raja R Harinath  <rharinath@novell.com>
13323
13324         Improve standard-compliance of simple name and member access 
13325         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
13326         * ecore.cs (FullNamedExpression): New abstract base class 
13327         for Namespaces and TypeExpressions.
13328         (ResolveFlags.SimpleName): Remove.
13329         (SimpleName): Remove support for dotted names.
13330         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
13331         DeclSpace.FindType and DeclSpace.LookupType.
13332         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
13333         (Expression.ExprClassName): Make member function.
13334         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
13335         a namespace.  Remove creation of dotted "SimpleName"s.
13336         (MemberAccess.DoResolve): Likewise.
13337         * decl.cs (DeclSpace.Cache): Make private.
13338         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
13339         (DeclSpace.FindType): Update.
13340         (DeclSpace.LookupType): Move here from RootContext.  Return a 
13341         FullNamedExpression.
13342         * namespace.cs (Namespace): Derive from FullNamedExpression
13343         so that it can be part of expression resolution.
13344         (Namespace.Lookup): Return an FullNamedExpression.
13345         (NamespaceEntry.LookupAlias): Lookup aliases only in current
13346         namespace.
13347         * rootcontext.cs (NamespaceLookup): Remove.
13348         (LookupType): Move to DeclSpace.
13349         * attribute.cs (CheckAttributeType): Update.
13350         * doc.cs (FindDocumentedType): Remove allowAlias argument.
13351         (FindDocumentedTypeNonArray): Likewise.
13352
13353 2005-01-11  Raja R Harinath  <rharinath@novell.com>
13354
13355         Fix cs0509.cs, cs1632.cs.
13356         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
13357         is the same as IsInterface.
13358         (TypeContainer.GetClassBases): Likewise.
13359         * statement.cs (LabeledStatement.ig): New field.
13360         (LabeledStatement.LabelTarget): Save ILGenerator which created the
13361         label.
13362         (LabeledStatement.DoEmit): Check that the label was created with
13363         the same ILGenerator.
13364
13365 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
13366
13367         Fix #71058
13368         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
13369         accessors to its properties.
13370
13371         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
13372         from accessors to property.
13373         
13374 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
13375
13376         Fix #70722
13377         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
13378         only for overrides.
13379         
13380 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
13381
13382         * attribute.cs: Check for null and empty strings.  
13383
13384         I have lost another battle to Paolo.
13385
13386 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
13387
13388         Fix #70942
13389         * class.cs (PropertyMethod): Set Parent field in ctors.
13390         (SetMethod.InternalParameters): Add unsafe switch hack.
13391         Override MarkForDuplicationCheck where it is appropriate.
13392
13393         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
13394         It says whether container allows members with the same name.
13395         Base default is no.
13396         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
13397         Removed is_method parameter.
13398
13399 2005-01-06  Duncan Mak  <duncan@ximian.com>
13400
13401         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
13402         because the previous change led to incorrect reporting of CS1032
13403         ("Cannot define/undefine preprocessor symbols after first token in
13404         file"). Instead of using `tokens_seen' as the only flag that
13405         triggers CS1040, introduce `comments_seen'. This new flag is used
13406         to signify having seen comments on the current line, so it is
13407         unset after a newline.
13408
13409 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
13410
13411         * doc.cs : When searching for a type, find nested type too.
13412           This fixes bug #71040.
13413
13414 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
13415
13416         * doc.cs :
13417           - Warn missing member comment on those classes which also does not
13418             have doc comments. Fixed bug #71041.
13419           - Don't warn missing doc comment on default constructor.
13420             Fixed bug #71042.
13421
13422 2005-01-06  Duncan Mak  <duncan@ximian.com>
13423
13424         * cs-tokenizer.cs (xtoken): After handling traditional C-style
13425         comments, set `tokens_seen' to true. This allows us to detect
13426         misplaced preprocessor directives (i.e. not at the beginning of
13427         the a line, nor after whitespaces). In that case, report error
13428         CS1040. This fixes bug #56460.
13429
13430         * cs-parser.jay (interface_member_declaration): Add checks for
13431         IsExplicitImpl, and report CS0541 error if an interface member is
13432         defined as an explicit interface declaration.
13433
13434 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
13435
13436         Fix #70817
13437         * class.cs (PropertyMethod): Set Parent field in ctors.
13438         (SetMethod.InternalParameters): Add unsafe switch hack.
13439         
13440         * decl.cs (MemberCore.Parent): Cannot be readonly.
13441
13442 2005-01-06  Raja R Harinath  <rharinath@novell.com>
13443
13444         * decl.cs (DeclSpace.ResolveType): Remove.
13445         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
13446         Merge in code from ...
13447         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
13448         * class.cs, enum.cs: Update to changes.
13449
13450 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
13451
13452         * anonymous.cs: Ensure that we init the scope of our parent if it
13453         has not been initialized yet.
13454
13455 2004-12-30  Duncan Mak  <duncan@ximian.com>
13456
13457         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
13458         if field.FieldBuilder is null. Fixes #70758.
13459
13460         * convert.cs: Fixed some typos and updated some of the comments.
13461         (ImplicitStandardConversionExists):
13462         (TryImplicitIntConversion): If `target_type' is an interface and
13463         the type of `ic' implements this interface, return true or a new
13464         BoxedCast instead of null. This fixes #70468.
13465
13466 2004-12-29  Duncan Mak  <duncan@ximian.com>
13467
13468         * expression.cs (Argument.Emit): Check that Expr is
13469         IMemoryLocation before casting to it, and report CS1510 otherwise.
13470
13471         This fixes #70402.
13472
13473 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
13474
13475         * statement.cs (Block.ThisVariable): remove the recursion here, to
13476         make the --profile more sane.
13477
13478 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
13479
13480         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
13481         assembly, by JB Evain.
13482
13483 2004-12-17  Raja R Harinath  <rharinath@novell.com>
13484
13485         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
13486           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
13487         "parent" refers to enclosing type/class.  "base" refers to superclass.
13488
13489 2004-12-17  Raja R Harinath  <rharinath@novell.com>
13490
13491         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13492         Ensure that we only have GlobalAttributes.
13493         * attribute.cs (Attribute.Emit): Make non-virtual.
13494         (GlobalAttribute.Emit): Remove.
13495         (Attribute.Resolve): Make virtual.
13496         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
13497         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
13498         the argument. Don't create one.
13499         (Attribute.GetObsoleteAttribute): Likewise.
13500         (Attribute.GetClsCompliantAttributeValue): Likewise.
13501         * class.cs, decl.cs: Update to changes.
13502
13503 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
13504
13505         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
13506         
13507         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
13508         
13509         * statement.cs (Foreach.Resolve): Add error 186 report.
13510
13511 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
13512
13513         * expression.cs (Conditional.DoResolve): Add warning 429.
13514         
13515         * statement.cs (If.Resolve): Add warning 665.
13516
13517 2004-12-16  Raja R Harinath  <rharinath@novell.com>
13518
13519         New invariant: RootContext.Tree.Types.NamespaceEntry == null
13520         except when in the parser, and in GlobalAttribute.
13521         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
13522         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
13523         RootContext.Tree.Types.NamespaceEntry once work is done.
13524         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
13525         and resets RootContext.Tree.Types.NamespaceEntry.
13526
13527 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
13528
13529         * cs-parser.jay: Don't create a block for every variable.
13530
13531 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
13532
13533         * location.cs: Provide extra information.
13534
13535         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
13536         variables from the captured environment, it is the ldarg_0.
13537
13538 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
13539
13540         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
13541         find a conclusion.
13542         
13543         * class.cs: Changed warning level for 169 to avoid developer
13544         displeasure from warning flooding. It will be changed back when they
13545         fix most of current BCL warnings.
13546         
13547         * RootContext.cs: Pushed default WarningLevel to 3.
13548         
13549         * statement.cs: Removed unused variable.
13550
13551 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
13552
13553         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
13554         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
13555         Add error 502 report.
13556         (StaticClass.DefineType): Add error 441 report.
13557         (Class.AllowedModifiersProp): New virtual property as temporary
13558         extension to AllowedModifiers.
13559         (Class.DefineType): Add error 418 report. Moved ModFlags check here
13560         to share implementation with StaticClass and don't call virtual
13561         methods from ctor.
13562         
13563         * driver.cs (MainDriver): Add error 1558 test.
13564
13565         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
13566         report. Moved error 36 test here.
13567
13568         * statement.cs (Throw.Resolve): Add error 724 report.
13569
13570         * typemanager.cs: Add out_attribute_type core type.
13571         
13572 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
13573
13574         * class.cs (TypeContainer.VerifyClsCompliance): Add error
13575         3018 report.
13576         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
13577
13578         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
13579         3017 report.
13580         
13581         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
13582
13583         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
13584         Add error 3023 report.
13585         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
13586
13587         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
13588         implementation.
13589
13590 2004-12-12  John Luke  <john.luke@gmail.com>
13591
13592         * driver.cs (AddArgs): take -- into account when
13593         adding arguments, fixes bug 65710 
13594
13595 2004-12-12  Martin Baulig  <martin@ximian.com>
13596
13597         * expression.cs (Unary.TryReduceNegative): Added support for
13598         SByteConstant and ByteConstant.
13599         (Unary.Reduce): Check error values from TryReduceNegative().
13600
13601 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
13602
13603         * attributes.cs (Attribute.Resolve): Avoid multiple error report
13604         and report exception as error 182.
13605
13606 2004-12-10  Raja R Harinath  <rharinath@novell.com>
13607
13608         * driver.cs (Main): Fix message when there are warnings.
13609
13610 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
13611
13612         * delegate.cs: Fixed my fix from yesterday, sorry about that.
13613
13614 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
13615
13616         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
13617         Reduced number of warnings.
13618         
13619         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
13620
13621 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
13622
13623         * driver.cs: Removed message.
13624
13625         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
13626
13627 2004-12-08    <vargaz@freemail.hu>
13628
13629         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
13630
13631 2004-12-08  Martin Baulig  <martin@ximian.com>
13632
13633         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
13634         instead of a CS3002 for properties and indexer.
13635
13636 2004-12-08  Martin Baulig  <martin@ximian.com>
13637
13638         * decl.cs (MemberName.ToString): Make this work again.
13639
13640 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
13641
13642         * attribute.cs (Resolve): Add error 591 detection.
13643
13644         * class.cs (FieldMember.Define): Add error 1547 detection.
13645         (Indexer.Define): Add error 620 detection.
13646         (Operator.Define): Add error 590 detection.
13647
13648         * ecore.cs: Missing argument for error 79.
13649
13650         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
13651         detection.
13652
13653 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
13654
13655         Fix #70106
13656         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
13657         only.
13658
13659 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
13660
13661         * cs-parser.jay : handle doc comments on implicit/explicit operators.
13662           Some operator comments were suppressed.
13663         * doc.cs : Implicit/explicit operator name in doc comments are like
13664           "op_Explicit(type)~returnType", so added suffix handling.
13665
13666 2004-12-07  Martin Baulig  <martin@ximian.com>
13667
13668         * decl.cs
13669         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
13670         (MemberCore.GetClsCompliantAttributeValue): Likewise.
13671         (DeclSpace.ec): New protected field; store the EmitContext here.
13672         (DeclSpace.EmitContext): New public property; moved here from
13673         `TypeContainer'.
13674         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
13675         EmitContext.
13676
13677         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
13678         (Enum.Emit): Don't create a new EmitContext.
13679
13680         * delegate.cs (Delegate.DefineType): Always create the
13681         EmitContext.
13682
13683         * iterators.cs (Iterators.DefineIterator): Create a new
13684         EmitContext and store it in `ec'.
13685
13686 2004-08-24  Martin Baulig  <martin@ximian.com>
13687
13688         * typemanager.cs
13689         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
13690         this for accessibility checks.
13691         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
13692         IsNestedFamilyAccessible.
13693         (TypeManager.IsSubclassOf): New method, do what the name actually
13694         says.   
13695
13696 2004-12-06  Raja R Harinath  <rharinath@novell.com>
13697
13698         Fix crash on cs0657-17.cs.
13699         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13700         Use RootContext.Tree.Types, not 'new RootTypes ()'.
13701         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
13702         the case where the NamespaceEntry gets overwritten.
13703
13704 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
13705
13706         Fixed #69195, #56821
13707         * ecore.cs (ResolveBoolean): Tiny refactoring.
13708
13709         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
13710         of right expression resolving when left is false constant and
13711         operator is LogicalAnd OR true constant and operator is LogicalOr.
13712
13713         * statement.cs (ResolveUnreachable): Always reports warning.
13714
13715 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
13716
13717         * class.cs: Distinguish between 1721 and 1722 (just a little help
13718         for the programmer).
13719
13720 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
13721
13722         * delegate.cs: Only allow this on new versions of the language. 
13723
13724 2004-12-02  Duncan Mak  <duncan@ximian.com>
13725
13726         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
13727         Expression class.
13728         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
13729         here as a static method. Take an additional bool out parameter
13730         `must_do_cs1540_check' for signaling to InstanceResolve.
13731         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
13732         member field from PropertyExpr class and made it an argument of
13733         the method instead.
13734         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
13735         check for MarshalByRefObject, and report CS0122 instead of CS1540.
13736         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
13737         and `remove_accessor' as well as InstanceResolve: report CS0122
13738         where applicable.
13739
13740         Fixes #70129.
13741
13742 2004-12-03  Raja R Harinath  <rharinath@novell.com>
13743
13744         Fix test-327.cs, test-328.cs, and put in early infrastructure
13745         for eventually fixing #52697.
13746         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
13747         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
13748         from other methods.
13749         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
13750         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
13751         (VerifyUsing, error246): Update.
13752         * rootcontext.cs (RootContext.NamespaceLookup): Just use
13753         'NamespaceEntry.LookupNamespaceOrType'.
13754
13755 2004-12-03  Martin Baulig  <martin@ximian.com>
13756
13757         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13758         method as our child, call AnonymousMethod.Compatible() on it.
13759
13760 2004-12-03  Raja R Harinath  <rharinath@novell.com>
13761
13762         Disable XML documentation support in 'basic' profile.
13763         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
13764         Redirect XmlElement to System.Object.
13765         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
13766         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
13767         * mcs.exe.sources: Add doc-bootstrap.cs.
13768         * doc-bootstrap.cs: New file.  Contains empty stub implementation
13769         of doc.cs.
13770
13771 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
13772
13773         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
13774           comments are allowed.
13775
13776 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13777
13778         * delegate.cs: Add checks for subtypes in paramaters and return values
13779         in VerifyMethod () to add support for Covariance/Contravariance
13780         in delegates.
13781         
13782 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
13783
13784         * report.cs: Remove extra closing parenthesis.
13785
13786         * convert.cs (Error_CannotImplicitConversion): If the name of the
13787         types are the same, provide some extra information.
13788
13789         * class.cs (FieldBase): Use an unused bit field from the field to
13790         encode the `has_offset' property from the FieldMember.  This saves
13791         a couple of Ks on bootstrap compilation.
13792
13793         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13794         method as our child, return the AnonymousMethod resolved
13795         expression.
13796
13797         * expression.cs (New.DoResolve): Allow return values from
13798         NewDelegate to also include AnonymousMethods.
13799
13800         Fixes #70150.
13801
13802 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
13803
13804         Fix bug #70102
13805         * attribute.cs (Resolve): Improved implementation of params
13806         attribute arguments.
13807
13808         * support.cs (ParameterData): Add HasParams to be faster.
13809
13810 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
13811
13812         all things are for /doc support:
13813
13814         * doc.cs: new file that supports XML documentation generation.
13815         * mcs.exe.sources: added doc.cs.
13816         * driver.cs:
13817           Handle /doc command line option.
13818           Report error 2006 instead of 5 for missing file name for /doc.
13819           Generate XML documentation when required, after type resolution.
13820         * cs-tokenizer.cs:
13821           Added support for picking up documentation (/// and /** ... */),
13822           including a new XmlCommentState enumeration.
13823         * cs-parser.jay:
13824           Added lines to fill Documentation element for field, constant,
13825           property, indexer, method, constructor, destructor, operator, event
13826           and class, struct, interface, delegate, enum.
13827           Added lines to warn incorrect comment.
13828         * rootcontext.cs :
13829           Added Documentation field (passed only when /doc was specified).
13830         * decl.cs:
13831           Added DocComment, DocCommentHeader, GenerateDocComment() and
13832           OnGenerateDocComment() and some supporting private members for
13833           /doc feature to MemberCore.
13834         * class.cs:
13835           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
13836         * delegate.cs:
13837           Added overriden DocCommentHeader.
13838         * enum.cs:
13839           Added overriden DocCommentHeader and GenerateDocComment().
13840
13841 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
13842
13843         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
13844         unwrapping the enumeration values, chain to
13845         DoConstantNumericPromotions again, so we can promote things to the
13846         fundamental types (takes care of enums that are bytes, sbytes).
13847
13848         Fixes bug #62054.
13849
13850 2004-12-01  Raja R Harinath  <rharinath@novell.com>
13851
13852         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
13853         Fix long-standing bug in type-lookup.  Use FindType instead of
13854         LookupType when ec.ResolvingTypeTree.
13855         (Attribute.ResolveType, Attribute.Resolve)
13856         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
13857         Update to changes.
13858         (Attributes.Search): Remove internal version.  Update.
13859         (Attributes.SearchMulti): Update.
13860         (Attributes.GetClsCompliantAttribute): Remove.
13861         (Attributes.GetIndexerNameAttribute): Remove.
13862         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
13863         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
13864         * class.cs (Indexer.Define): Likewise.
13865
13866 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
13867
13868         Fix bug #68790
13869         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
13870         MarshallByReference members access.
13871
13872         * expression.cs: Use CheckMarshallByRefAccess;
13873         Better error CS0197 message.
13874
13875         * report.cs: Print whole related error message.
13876
13877 2004-11-30  Raja R Harinath  <rharinath@novell.com>
13878
13879         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
13880         the current directory to help debugging.
13881
13882 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
13883
13884         * class (GetClassBases): Better error 60 report.
13885         (EventProperty): Disabled warning 67 detection.
13886
13887 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
13888
13889         Fix bug #60324
13890         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
13891
13892         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
13893         precise values.
13894
13895 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
13896
13897         Fix bug #49488
13898         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
13899
13900         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
13901
13902 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
13903
13904         * attribute.cs (Attribute.Resolve): Refine error reporting and
13905         report a cs0117 if the identifier does not exist, to distinguish
13906         from 0617 which is a miss-use of the actual identifier.
13907
13908         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
13909         between cs0070 and cs0079.
13910
13911         * class.cs (MemberBase.DoDefine): When reporting a wrong
13912         accessibility level, we use MethodCore to compare instead of
13913         Method (this was a regression in some refactoring effort).
13914
13915         So now we correctly report cs0056 again.
13916
13917         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
13918         testing the target_type (which was known to be object_type) and
13919         not the source type (which is anonymous_method).
13920
13921         Fixed reporting of error cs1660.
13922
13923         * expression.cs (UserCast.Source): Expose the underlying cast.
13924
13925         * statement.cs (Switch.SwitchGoverningType): Sort the list of
13926         allowed types to find a match to int32 first (most common).
13927
13928         In addition, it ignores any ImplicitUserConversions that did an
13929         internal implicit conversion (as the switch statement allows only
13930         one integral conversion to exist).
13931
13932         * class.cs (PartialContainer.Create): rename `name' to
13933         `member_name' for clarity.  Then replace the string calls with a
13934         call to MemberName.GetPartialName, as now using
13935         MemberName.ToString is an error (this is due to the side effects
13936         it had, that were fixed in the past).
13937
13938         This will restore the error reporting on a number of partial class
13939         errors that were missusing this (and getting an exception as a
13940         results, which is now just a plain textual warning, because
13941         yyparse debug output would crash otherwise).
13942
13943 2004-11-26  Raja R Harinath  <rharinath@novell.com>
13944
13945         * Makefile (PROGRAM_INSTALL_DIR): Remove.
13946
13947 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
13948
13949         * rootcontext.cs (LookupType): Make sure to cache lookups that
13950         don't give us a negative result. This saves about 5% of corlib
13951         compilation time.
13952
13953 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
13954
13955         * report.cs (AbstractMessage.Print): messages are sent to stderr
13956
13957         * class.cs (TypeContainer.GetClassBases): It is an error to have a
13958         non-interface in the list of interfaces (at this point, either
13959         parent was properly set, or a base class is being listed in the
13960         interfaces section).
13961
13962         This flags error 1722, and resolves the crash from bug 69259.
13963
13964 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
13965
13966         * statement.cs (Using.EmitExpressionFinally): make this work right
13967         for valuetypes. Fixes 69926.
13968
13969 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
13970
13971         * const.cs (Const.ChangeType): Cope with the "0 literal can be
13972         converted to an enum" here, before we try to change the underlying
13973         type.  This code exists, but it is a different code path than the
13974         one used while encoding constants.
13975
13976         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
13977         old bug: when converting from the null literal to a pointer,
13978         return an EmptyCast, not the NullLiteral.
13979
13980         This fixes #69921, the recent null_type changes probably made this
13981         bug more prominent.
13982
13983         (ImplicitReferenceConversionExists): In addition, resynchronized
13984         the code here, so it matches the same code in
13985         ImplicitReferenceConversionExists for the `from any class-type S
13986         to any interface-type T'.
13987         
13988
13989 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
13990
13991         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
13992
13993 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
13994
13995         * cs-parser.jay: Use verbosity accordingly. 
13996
13997 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
13998
13999         * expression.cs (Unary.ResolveOperator): Do not report warning;
14000         AddressOf reads from variable.
14001         
14002         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
14003
14004 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
14005
14006         Fix bug #69462
14007
14008         * attribute.cs (Attributable): Removed CheckTargets.
14009         (Attributes.Emit): Explicit attribute targets are tested here.
14010
14011         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
14012         not enabled for interfaces.
14013
14014         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
14015         (GetAssemblyName): Ouch next bug there.
14016
14017 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14018
14019         * expression.cs: Error 275 added.
14020         
14021 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
14022
14023         Fix bug #69177 (Implemented decimal constant support)
14024
14025         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
14026         (BinaryFold): Add DecimalConstant.
14027
14028         * const.cs (Define): Decimal constant 
14029         (is not constant.
14030         (ChangeType): Add decimal type handling.
14031         (LookupConstantValue): Don't set value for decimal type but
14032         emit DecimalConstantAttribute. Needed for constant optimization.
14033
14034         * constant.cs (ToDecimal): New method.
14035         (ConvertToDecimal): New method.
14036         (IntConstant): Implemented ConvertToDecimal.
14037         (DecimalConstant.Emit): Emit optimized version for decimals in
14038         int range.
14039
14040         * expression.cs (ResolveOperator): Changed order of constant
14041         reduction to work correctly with native types which have
14042         overloaded operators.
14043         (ResolveMemberAccess): Extract constant value from attribute
14044         for decimal type.
14045
14046         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
14047
14048         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
14049         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
14050         (ChangeType): Decimal is special.
14051         (TypeToCoreType): Add decimal type.
14052
14053 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
14054
14055         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
14056         decimal types.
14057
14058 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
14059
14060         * class.cs (EventField.ApplyAttributeBuilder): Fix error
14061         test cs1667-5.cs.
14062
14063 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
14064
14065         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
14066
14067         * pending.cs (PendingImplementation): Grab only interfaces.
14068
14069 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
14070
14071         * statement.cs (ForeachHelperMethods): Add location member and
14072         error 202 detection.
14073
14074 2004-11-19  Raja R Harinath  <rharinath@novell.com>
14075
14076         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
14077         automatically handled by executable.make.
14078         (PROGRAM): Make profile-specific.
14079
14080 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
14081
14082         * expression.cs (DoResolveBase): Fixed wrong warning for out
14083         variables.
14084
14085 2004-11-18  Martin Baulig  <martin@ximian.com>
14086
14087         Merged latest changes into gmcs.  Please keep this comment in
14088         here, it makes it easier for me to see what changed in MCS since
14089         the last time I merged.
14090
14091 2004-11-17  Raja R Harinath  <rharinath@novell.com>
14092
14093         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
14094         (TypeHandle.GetMemberCache): New.
14095         (TypeHandle.TypeHandle): Update.
14096         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
14097         (TypeManager.LookupParentInterfacesCache):
14098         Rename from LookupInterfaceCache.  Optimize slightly.
14099         (TypeManager.MemberLookup_FindMembers): Update.
14100         * decl.cs (MemberCache.MemberCache): Set Container to null in the
14101         multi-type variant.
14102         (AddCacheContents): Rename from AddHashtable.
14103         * class.cs (TypeContainer.parent_container): Remove.
14104         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
14105         (TypeContainer.DoDefineMembers): Don't initialize it.
14106         Update to name changes.
14107         
14108 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
14109
14110         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
14111         that factors the code to check access modifiers on override.  
14112
14113         (PropertyBase): Use the code here.
14114
14115         Patch from Lluis S'anchez, fixes bug #69361.
14116
14117 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
14118
14119         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
14120         routine that is used to report the use of a captured variable
14121         whose address has been taken.
14122
14123         There are two checks: one when variables are being captured and
14124         the other check is when the address of a variable is taken. 
14125         
14126         (because an anonymous methods might be resolved before *or* after
14127         the address has been taken) and 
14128
14129         * expression.cs (Conditional.DoResolve): Remove the special
14130         casing that Martin added to trueExpr and falseExpr being both
14131         NullLiteral.  We get the right behavior now just by introducing
14132         the null_type into the compiler. 
14133
14134         * convert.cs (ExplicitConversion): Change the code to use
14135         null_type instead of testing `expr is NullLiteral'.
14136         (ImplicitConversionStandard): use null_type too.
14137         (ImplicitReferenceConversionExists): use null_type too.
14138         (ImplicitReferenceConversion): use null_type too.
14139
14140         * literal.cs: The type of `NullLiteral' is now null_type instead
14141         of object_type. 
14142         (Resolve): Set the type here.
14143
14144         * typemanager.cs: Introduce null_type.
14145
14146 2004-11-17  Martin Baulig  <martin@ximian.com>
14147
14148         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
14149         direction, like FindMembers() does.  Fixes #69546, testcase is in
14150         test-315.cs.    
14151
14152 2004-11-16  Martin Baulig  <martin@ximian.com>
14153
14154         This is based on a patch from Marek Safar, see bug #69082.
14155         Fixes bugs #63705 and #67130.
14156
14157         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
14158         method; create a MemberCache for an interface type and cache the
14159         result.
14160
14161         * decl.cs (IMemberContainer.ParentContainer): Removed.
14162         (IMemberContainer.ParentCache): New property.
14163         (MemberCache.SetupCacheForInterface): Removed.
14164         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
14165         to create a cache for an interface's "parent".
14166
14167         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
14168         interfaces too.
14169
14170 2004-11-16  Martin Baulig  <martin@ximian.com>
14171
14172         Merged back from gmcs; these changes already went into gmcs a
14173         couple of weeks ago.
14174
14175         * typemanager.cs
14176         (TypeManager.AddUserType): Removed the `ifaces' argument.
14177         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
14178         `TypeExpr []'.
14179         (TypeManager.AddUserInterface): Removed.
14180         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
14181         `TypeExpr []'.
14182         (TypeManager.GetInterfaces): Likewise.
14183         (TypeManager.GetExplicitInterfaces): Likewise.
14184
14185         * ecore.cs (TypeExpr.GetInterfaces): Removed.
14186
14187         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
14188         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
14189
14190 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
14191
14192         * statement.cs: Avoid adding bools to a hashtable.
14193
14194 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
14195
14196         * expression.cs (Invocation.OverloadResolve): Flag error if we are
14197         calling an unsafe method from a safe location.
14198
14199 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
14200
14201         Fix #69167
14202         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
14203
14204 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
14205
14206         * namespace.cs (VerifyUsing): use GetPartialName instead of
14207         ToString. 
14208
14209 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
14210
14211         * statement.cs (Return.Resolve): Fix regression in typo: if
14212         `in_exc', we have to request a NeedReturnLabel, this was a typo
14213         introduced in the anonymous method check-in.  Fixes #69131.
14214
14215         * Indexers were using the ShortName when defining themselves,
14216         causing a regression in the compiler bootstrap when applying the
14217         patch from 2004-11-02 (first part), now they use their full name
14218         and the bug is gone.
14219
14220 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
14221
14222         * driver.cs: Strip the path from the names of embedded resources. Fixes
14223         #68519.
14224
14225 2004-11-04  Raja R Harinath  <rharinath@novell.com>
14226
14227         Fix error message regression: cs0104-2.cs.
14228         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
14229         (AliasEntry.Resolve): Update.
14230         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
14231         'silent' flag.
14232         (RootContext.LookupType): Update.
14233
14234 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
14235
14236         * cs-parser.jay: Add support for handling accessor modifiers
14237         * class: Add support port accessor modifiers and error checking,
14238         define PropertyMethod.Define as virtual (not abstract anymore)
14239         * ecore.cs: Add checking for proeprties access with access modifiers
14240         * iterators.cs: Modify Accessor constructor call based in the modified
14241         constructor
14242 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
14243
14244         * expression.cs (StringConcat): Handle being called twice,
14245         as when we have a concat in a field init with more than two
14246         ctors in the class
14247
14248 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
14249
14250         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
14251         special case explicit implementations, we should always produce
14252         the .property or .event declaration.
14253         
14254         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
14255         since it will not return correct data if people use this
14256         unresolved in the presence of using statements (see test-313).
14257
14258         * class.cs (MethodData.Define): If we are an explicit interface
14259         implementation, set the method name to the full name of the
14260         interface plus the name of the method.  
14261
14262         Notice that using the method.MethodName.GetFullName() does not
14263         work, as it will only contain the name as declared on the source
14264         file (it can be a shorthand in the presence of using statements)
14265         and not the fully qualifed type name, for example:
14266
14267         using System;
14268
14269         class D : ICloneable {
14270                 object ICloneable.Clone ()  {
14271                 }
14272         }
14273
14274         Would produce a method called `ICloneable.Clone' instead of
14275         `System.ICloneable.Clone'.
14276
14277         * namespace.cs (Alias.Resolve): Use GetPartialName.
14278         
14279 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
14280
14281         * cs-parser.jay: Add error 1055 report.
14282
14283 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
14284
14285         * assign.cs (Assign.DoResolve): Only do the transform of
14286         assignment into a New if the types are compatible, if not, fall
14287         through and let the implicit code deal with the errors and with
14288         the necessary conversions. 
14289
14290 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
14291
14292         * cs-parser.jay: Add error 1031 report.
14293
14294         * cs-tokenizer.cs: Add location for error 1038.
14295
14296 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14297
14298         * cs-parser.jay: Add error 1016 report.
14299
14300 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14301
14302         * cs-parser.jay: Add errors 1575,1611 report.
14303
14304 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14305
14306         * cs-parser.jay: Add error 1001 report.
14307
14308 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14309
14310         Fix #68850
14311         * attribute.cs (GetMarshal): Add method argument for
14312         caller identification.
14313
14314         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
14315         agument for GetMarshal and RuntimeMissingSupport.
14316
14317 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14318
14319         * attribute.cs (ExtractSecurityPermissionSet): Removed
14320         TypeManager.code_access_permission_type.
14321
14322         * typemanager.cs: Removed TypeManager.code_access_permission_type.
14323
14324 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
14325
14326         * expression.cs (LocalVariableReference.DoResolveLValue): Check
14327         for obsolete use of a variable here.   Fixes regression on errors
14328         cs0619-25 and cs0619-26.
14329
14330 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
14331
14332         Fix #62358, implemented security attribute encoding.
14333
14334         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
14335         Tests permitted SecurityAction for assembly or other types.
14336         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
14337         data from SecurityPermissionAttribute to PermisionSet class.
14338
14339         * class.cs (ApplyAttributeBuilder): Added special handling
14340         for System.Security.Permissions.SecurityAttribute based types.
14341
14342         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
14343         special handling for System.Security.Permissions.SecurityAttribute
14344         based types.
14345
14346         * enum.cs (ApplyAttributeBuilder): Added special handling
14347         for System.Security.Permissions.SecurityAttribute based types.
14348
14349         * parameter.cs (ApplyAttributeBuilder): Added special handling
14350         for System.Security.Permissions.SecurityAttribute based types.
14351
14352         * rootcontext.cs: Next 2 core types.
14353
14354         * typemanager.cs (TypeManager.security_permission_attr_type):
14355         Built in type for the SecurityPermission Attribute.
14356         (code_access_permission_type): Build in type.
14357
14358 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
14359
14360         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
14361         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
14362         all of this information into
14363         EmitContext.EmitCapturedVariableInstance.
14364         
14365         * codegen.cs (EmitCapturedVariableInstance): move here the
14366         funcionality of emitting an ldarg.0 in the presence of a
14367         remapping.   This centralizes the instance emit code.
14368
14369         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
14370         then emit a load of this: it means that we have reached the
14371         topmost ScopeInfo: the one that contains the pointer to the
14372         instance of the class hosting the anonymous method.
14373
14374         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
14375         captures to the topmost CaptureContext.
14376
14377 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
14378
14379         * expression.cs (LocalVariableReference): Move the knowledge about
14380         the iterators into codegen's EmitCapturedVariableInstance.
14381
14382 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
14383
14384         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
14385         all code paths return a value from an anonymous method (it is the
14386         same as the 161 error, but for anonymous methods).
14387
14388 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
14389
14390         The introduction of anonymous methods in the compiler changed
14391         various ways of doing things in the compiler.  The most
14392         significant one is the hard split between the resolution phase
14393         and the emission phases of the compiler.
14394
14395         For instance, routines that referenced local variables no
14396         longer can safely create temporary variables during the
14397         resolution phase: they must do so from the emission phase,
14398         since the variable might have been "captured", hence access to
14399         it can not be done with the local-variable operations from the runtime.
14400         
14401         * statement.cs 
14402
14403         (Block.Flags): New flag `IsTopLevel' to indicate that this block
14404         is a toplevel block.
14405
14406         (ToplevelBlock): A new kind of Block, these are the blocks that
14407         are created by the parser for all toplevel method bodies.  These
14408         include methods, accessors and anonymous methods.
14409
14410         These contain some extra information not found in regular blocks:
14411         A pointer to an optional CaptureContext (for tracking captured
14412         local variables and parameters).  A pointer to the parent
14413         ToplevelBlock.
14414         
14415         (Return.Resolve): Catch missmatches when returning a value from an
14416         anonymous method (error 1662).
14417         Invoke NeedReturnLabel from the Resolve phase instead of the emit
14418         phase.
14419
14420         (Break.Resolve): ditto.
14421
14422         (SwitchLabel): instead of defining the labels during the
14423         resolution phase, we now turned the public ILLabel and ILLabelCode
14424         labels into methods called GetILLabelCode() and GetILLabel() that
14425         only define the label during the Emit phase.
14426
14427         (GotoCase): Track the SwitchLabel instead of the computed label
14428         (its contained therein).  Emit the code by using
14429         SwitchLabel.GetILLabelCode ().
14430
14431         (LocalInfo.Flags.Captured): A new flag has been introduce to track
14432         whether the Local has been captured or not.
14433
14434         (LocalInfo.IsCaptured): New property, used to tell whether the
14435         local has been captured.
14436         
14437         * anonymous.cs: Vastly updated to contain the anonymous method
14438         support.
14439
14440         The main classes here are: CaptureContext which tracks any
14441         captured information for a toplevel block and ScopeInfo used to
14442         track the activation frames for various local variables.   
14443
14444         Each toplevel block has an optional capture context associated
14445         with it.  When a method contains an anonymous method both the
14446         toplevel method and the anonymous method will create a capture
14447         context.   When variables or parameters are captured, they are
14448         recorded on the CaptureContext that owns them, for example:
14449
14450         void Demo () {
14451              int a;
14452              MyDelegate d = delegate {
14453                  a = 1;
14454              }
14455         }
14456
14457         Here `a' will be recorded as captured on the toplevel
14458         CapturedContext, the inner captured context will not have anything
14459         (it will only have data if local variables or parameters from it
14460         are captured in a nested anonymous method.
14461
14462         The ScopeInfo is used to track the activation frames for local
14463         variables, for example:
14464
14465         for (int i = 0; i < 10; i++)
14466                 for (int j = 0; j < 10; j++){
14467                    MyDelegate d = delegate {
14468                         call (i, j);
14469                    }
14470                 }
14471
14472         At runtime this captures a single captured variable `i', but it
14473         captures 10 different versions of the variable `j'.  The variable
14474         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
14475         recorded on a child.  
14476
14477         The toplevel ScopeInfo will also track information like the `this'
14478         pointer if instance variables were referenced (this is necessary
14479         as the anonymous method lives inside a nested class in the host
14480         type of the method). 
14481
14482         (AnonymousMethod): Expanded to track the Toplevel, implement
14483         `AnonymousMethod.Compatible' to tell whether an anonymous method
14484         can be converted to a target delegate type. 
14485
14486         The routine now also produces the anonymous method content
14487
14488         (AnonymousDelegate): A helper class that derives from
14489         DelegateCreation, this is used to generate the code necessary to
14490         produce the delegate for the anonymous method that was created. 
14491
14492         * assign.cs: API adjustments for new changes in
14493         Convert.ImplicitStandardConversionExists.
14494
14495         * class.cs: Adjustments to cope with the fact that now toplevel
14496         blocks are of type `ToplevelBlock'. 
14497
14498         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
14499         insteda of standard blocks.
14500
14501         Flag errors if params arguments are passed to anonymous methods.
14502
14503         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
14504         `CurrentAnonymousMethod' which points to the current Anonymous
14505         Method.  The variable points to the AnonymousMethod class that
14506         holds the code being compiled.  It is set in the new EmitContext
14507         created for the anonymous method.
14508
14509         (EmitContext.Phase): Introduce a variable and an enumeration to
14510         assist in enforcing some rules about when and where we are allowed
14511         to invoke certain methods (EmitContext.NeedsReturnLabel is the
14512         only one that enfonces this right now).
14513
14514         (EmitContext.HaveCaptureInfo): new helper method that returns
14515         whether we have a CapturedContext initialized.
14516
14517         (EmitContext.CaptureVariable): New method used to register that a
14518         LocalInfo must be flagged for capturing. 
14519
14520         (EmitContext.CapturedParameter): New method used to register that a
14521         parameters must be flagged for capturing. 
14522         
14523         (EmitContext.CapturedField): New method used to register that a
14524         field must be flagged for capturing. 
14525
14526         (EmitContext.HaveCapturedVariables,
14527         EmitContext.HaveCapturedFields): Return whether there are captured
14528         variables or fields. 
14529
14530         (EmitContext.EmitMethodHostInstance): This is used to emit the
14531         instance for the anonymous method.  The instance might be null
14532         (static methods), this (for anonymous methods that capture nothing
14533         and happen to live side-by-side with the current method body) or a
14534         more complicated expression if the method has a CaptureContext.
14535
14536         (EmitContext.EmitTopBlock): Routine that drives the emission of
14537         code: it will first resolve the top block, then emit any metadata
14538         and then emit the code.  The split is done so that we can extract
14539         any anonymous methods and flag any captured variables/parameters.
14540         
14541         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
14542         during this phase, the ILGenerator should not be used as labels
14543         and local variables declared here might not be accessible to any
14544         code that is part of an anonymous method.  
14545
14546         Exceptions to this include the temporary variables that are
14547         created by some statements internally for holding temporary
14548         variables. 
14549         
14550         (EmitContext.EmitMeta): New routine, in charge of emitting all the
14551         metadata for a cb
14552
14553         (EmitContext.TemporaryReturn): This method is typically called
14554         from the Emit phase, and its the only place where we allow the
14555         ReturnLabel to be defined other than the EmitMeta.  The reason is
14556         that otherwise we would have to duplicate a lot of logic in the
14557         Resolve phases of various methods that today is on the Emit
14558         phase. 
14559
14560         (EmitContext.NeedReturnLabel): This no longer creates the label,
14561         as the ILGenerator is not valid during the resolve phase.
14562
14563         (EmitContext.EmitThis): Extended the knowledge in this class to
14564         work in anonymous methods in addition to iterators. 
14565
14566         (EmitContext.EmitCapturedVariableInstance): This emits whatever
14567         code is necessary on the stack to access the instance to a local
14568         variable (the variable will be accessed as a field).
14569
14570         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
14571         EmitContext.EmitAddressOfParameter): Routines to support
14572         parameters (not completed at this point). 
14573         
14574         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
14575         will also remove the parameters.
14576
14577         * convert.cs (Convert): Define a `ConstantEC' which points to a
14578         null.  This is just to prefity some code that uses
14579         ImplicitStandardConversion code and do not have an EmitContext
14580         handy.
14581
14582         The idea is to flag explicitly that at that point in time, it is
14583         known that the conversion will not trigger the delegate checking
14584         code in implicit conversions (which requires a valid
14585         EmitContext). 
14586
14587         Everywhere: pass new EmitContext parameter since
14588         ImplicitStandardConversionExists now requires it to check for
14589         anonymous method conversions. 
14590
14591         (Convert.ImplicitStandardConversionExists): If the type of an
14592         expression is the anonymous_method_type, and the type is a
14593         delegate, we invoke the AnonymousMethod.Compatible method to check
14594         whether an implicit conversion is possible. 
14595
14596         (Convert.ImplicitConversionStandard): Only do implicit method
14597         group conversions if the language level is not ISO_1.
14598
14599         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
14600         MethodInfo for the Invoke method.  used by Delegate and
14601         AnonymousDelegate.
14602
14603         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
14604         method conversions if the target type is a delegate.
14605
14606         Removed extra debugging nops.
14607
14608         (LocalVariableReference): Turn the `local_info' into a public
14609         field. 
14610
14611         Add `prepared' field, the same hack used for FieldExprs to cope
14612         with composed assignments, as Local variables do not necessarily
14613         operate purely on the stack as they used to: they can be captured
14614         fields. 
14615
14616         Add `temp' for a temporary result, like fields.
14617
14618         Refactor DoResolve and DoResolveLValue into DoResolveBase.
14619
14620         It now copes with Local variables that are captured and emits the
14621         proper instance variable to load it from a field in the captured
14622         case. 
14623
14624         (ParameterReference.DoResolveBase): During the resolve phase,
14625         capture parameters if we are in an anonymous method.
14626
14627         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
14628         anonymous method, use the EmitContext helper routines to emit the
14629         parameter reference.
14630
14631         * iterators.cs: Set RemapToProxy to true/false during the
14632         EmitDispose class.
14633
14634         * parameters.cs (GetParameterByName): New helper method. 
14635
14636         * typemanager.cs (anonymous_method_type) a new type that
14637         represents an anonyous method.  This is always an internal type,
14638         used as a fencepost to test against the anonymous-methodness of an
14639         expression. 
14640         
14641 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
14642
14643         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
14644         561 report.
14645         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
14646
14647 2004-10-18  Martin Baulig  <martin@ximian.com>
14648
14649         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
14650         `Type' directly, but call ResolveType() on it.
14651         (Catch.Resolve): Likewise.
14652         (Foreach.Resolve): Likewise.
14653
14654 2004-10-18  Martin Baulig  <martin@ximian.com>
14655
14656         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
14657         `Type' directly, but call ResolveType() on it.
14658         (Probe.DoResolve): Likewise.
14659         (ArrayCreation.LookupType): Likewise.
14660         (TypeOf.DoResolve): Likewise.
14661         (SizeOf.DoResolve): Likewise.
14662
14663 2004-10-18  Martin Baulig  <martin@ximian.com>
14664
14665         * expression.cs (Invocation.BetterFunction): Put back
14666         TypeManager.TypeToCoreType().
14667
14668 2004-10-18  Raja R Harinath  <rharinath@novell.com>
14669
14670         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
14671         the ResolveType.
14672
14673 2004-10-18  Martin Baulig  <martin@ximian.com>
14674
14675         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
14676         `Type' directly, but call ResolveType() on it.
14677
14678 2004-10-18  Martin Baulig  <martin@ximian.com>
14679
14680         * class.cs (FieldMember.Define): Don't access the TypeExpr's
14681         `Type' directly, but call ResolveType() on it.
14682         (MemberBase.DoDefine): Likewise.
14683
14684         * expression.cs (New.DoResolve): Don't access the TypeExpr's
14685         `Type' directly, but call ResolveType() on it.
14686         (ComposedCast.DoResolveAsTypeStep): Likewise.
14687
14688         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
14689         `Type' directly, but call ResolveType() on it.
14690
14691 2004-10-17  John Luke  <john.luke@gmail.com>
14692
14693         * class.cs (Operator.GetSignatureForError): use CSharpName
14694
14695         * parameter.cs (Parameter.GetSignatureForError): Returns
14696         correct name even if was not defined.
14697
14698 2004-10-13  Raja R Harinath  <rharinath@novell.com>
14699
14700         Fix #65816.
14701         * class.cs (TypeContainer.EmitContext): New property.
14702         (DefineNestedTypes): Create an emitcontext for each part.
14703         (MethodCore.DoDefineParameters): Use container's emitcontext.
14704         Pass type array to InternalParameters.
14705         (MemberBase.DoDefine): Use container's emitcontext.
14706         (FieldMember.Define): Likewise.
14707         (Event.Define): Likewise.
14708         (SetMethod.GetParameterInfo): Change argument to EmitContext.
14709         Pass type array to InternalParameters.
14710         (SetIndexerMethod.GetParameterInfo): Likewise.
14711         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
14712         * delegate.cs (Define): Pass emitcontext to
14713         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
14714         array to InternalParameters.
14715         * expression.cs (ParameterReference.DoResolveBase): Pass
14716         emitcontext to GetParameterInfo.
14717         (ComposedCast.DoResolveAsTypeStep): Remove check on
14718         ec.ResolvingTypeTree.
14719         * parameter.cs (Parameter.Resolve): Change argument to
14720         EmitContext.  Use ResolveAsTypeTerminal.
14721         (Parameter.GetSignature): Change argument to EmitContext.
14722         (Parameters.ComputeSignature): Likewise.
14723         (Parameters.ComputeParameterTypes): Likewise.
14724         (Parameters.GetParameterInfo): Likewise.
14725         (Parameters.ComputeAndDefineParameterTypes): Likewise.
14726         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
14727         * support.cs (InternalParameters..ctor): Remove variant that takes
14728         a DeclSpace.
14729         * typemanager.cs (system_intptr_expr): New.
14730         (InitExpressionTypes): Initialize it.
14731
14732 2004-10-12  Chris Toshok  <toshok@ximian.com>
14733
14734         * cs-parser.jay: fix location for try_statement and catch_clause.
14735
14736 2004-10-11  Martin Baulig  <martin@ximian.com>
14737
14738         * report.cs: Don't make --fatal abort on warnings, we have
14739         -warnaserror for that.
14740
14741 2004-10-07  Raja R Harinath  <rharinath@novell.com>
14742
14743         More DeclSpace.ResolveType avoidance.
14744         * decl.cs (MemberCore.InUnsafe): New property.
14745         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
14746         with newly created EmitContext.
14747         (FieldMember.Define): Likewise.
14748         * delegate.cs (Delegate.Define): Likewise.
14749         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
14750         only if normal name-lookup fails.
14751         (TypeExpr.DoResolve): Enable error-checking.
14752         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
14753         (SizeOf.DoResolve): Likewise.
14754         (ComposedCast.DoResolveAsTypeStep): Likewise.
14755         (StackAlloc.DoResolve): Likewise.
14756         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
14757         (Block.Unsafe): New property.
14758         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
14759         (Unsafe): Set 'unsafe' flag of contained block.
14760         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
14761         (Fixed.Resolve): Likewise.
14762         (Catch.Resolve): Likewise.
14763         (Using.ResolveLocalVariableDecls): Likewise.
14764         (Foreach.Resolve): Likewise.
14765
14766 2004-10-05  John Luke <john.luke@gmail.com>
14767
14768         * cs-parser.jay: add location to error CS0175
14769
14770 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
14771
14772         * ecore.cs (Expression.Constantity): Add support for turning null
14773         into a constant.
14774
14775         * const.cs (Const.Define): Allow constants to be reference types
14776         as long as the value is Null.
14777
14778 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
14779
14780         * namespace.cs (NamespaceEntry.Using): No matter which warning
14781         level is set, check if this namespace name has already been added.
14782
14783 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
14784
14785         * expression.cs: reftype [!=]= null should always use br[true,false].
14786         # 67410
14787
14788 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
14789
14790         Fix #67108
14791         * attribute.cs: Enum conversion moved to 
14792         GetAttributeArgumentExpression to be applied to the all
14793         expressions.
14794
14795 2004-10-01  Raja R Harinath  <rharinath@novell.com>
14796
14797         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
14798         * class.c (TypeContainer.DefineType): Flag error if
14799         base types aren't accessible due to access permissions.
14800         * decl.cs (DeclSpace.ResolveType): Move logic to
14801         Expression.ResolveAsTypeTerminal.
14802         (DeclSpace.ResolveTypeExpr): Thin layer over
14803         Expression.ResolveAsTypeTerminal.
14804         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
14805         Refactor code into NestedAccess.  Use it.
14806         (DeclSpace.NestedAccess): New.
14807         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
14808         argument to silence errors.  Check access permissions.
14809         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
14810         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
14811         (Cast.DoResolve): Likewise.
14812         (New.DoResolve): Likewise.
14813         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
14814         (TypeOf.DoResolve): Likewise.
14815
14816         * expression.cs (Invocation.BetterConversion): Return the Type of
14817         the better conversion.  Implement section 14.4.2.3 more faithfully.
14818         (Invocation.BetterFunction): Make boolean.  Make correspondence to
14819         section 14.4.2.2 explicit.
14820         (Invocation.OverloadResolve): Update.
14821         (Invocation): Remove is_base field.
14822         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
14823         (Invocation.Emit): Likewise.
14824
14825 2004-09-27  Raja R Harinath  <rharinath@novell.com>
14826
14827         * README: Update to changes.
14828
14829 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
14830
14831         * cs-parser.jay: Reverted 642 warning fix.
14832
14833 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14834
14835         Fix bug #66615
14836         * decl.cs (FindMemberWithSameName): Indexer can have more than
14837         1 argument.
14838
14839 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14840
14841         * expression.cs (LocalVariableReference.DoResolveLValue):
14842         Do not report warning 219 for out values.
14843         (EmptyExpression.Null): New member to avoid extra allocations.
14844
14845 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14846
14847         * cs-parser.jay: Fix wrong warning 642 report.
14848
14849         * cs-tokenizer.cs (CheckNextToken): New helper;
14850         Inspect next character if is same as expected.
14851
14852 2004-09-23  Martin Baulig  <martin@ximian.com>
14853
14854         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
14855         (Convert.ImplicitReferenceConversionExists): Likewise.
14856
14857 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14858
14859         * class.cs (Operator.Define): Add error 448 and 559 report.
14860
14861 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
14862
14863         * class.cs (MemberBase.IsTypePermitted): New protected
14864         method for checking error CS0610.
14865
14866 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
14867
14868         * class.cs (TypeContainer.HasExplicitLayout): New property
14869         Returns whether container has StructLayout attribute set Explicit.
14870         (FieldMember): New abstract class for consts and fields.
14871         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
14872         (Field): Reuse FieldMember.
14873
14874         * const.cs (Const): Reuse FieldMember.
14875
14876         * rootcontext.cs: EmitConstants call moved to class.
14877
14878 2004-09-22  Martin Baulig  <martin@ximian.com>
14879
14880         Thanks to Peter Sestoft for this bug report.
14881
14882         * expression.cs (Conditional): If both the `trueExpr' and the
14883         `falseExpr' is a NullLiteral, return a NullLiteral.
14884
14885 2004-09-22  Martin Baulig  <martin@ximian.com>
14886
14887         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
14888         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
14889         for the "get_Current" call.
14890
14891 2004-09-22  Martin Baulig  <martin@ximian.com>
14892
14893         Marek and me just fixed one of our oldest bugs: #28562 :-)
14894
14895         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
14896
14897         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
14898         we're an EnumConstant, just return that.
14899         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
14900         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
14901         to get the value which'll actually be written into the attribute.
14902         However, we have to use GetValue() to access the attribute's value
14903         in the compiler.        
14904
14905 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
14906
14907         * constant.cs (Constant.IsNegative): New abstract property
14908         IsNegative.
14909
14910         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
14911         (StackAlloc.DoResolve): Reused IsNegative.
14912
14913 2004-09-21  Martin Baulig  <martin@ximian.com>
14914
14915         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
14916         if we're used in an iterator, we may be called from different
14917         methods.
14918
14919         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
14920         we actually have an exception block.
14921
14922 2004-09-20  John Luke <jluke@cfl.rr.com>
14923
14924         * class.cs, cs-parser.jay: Improve the error report for 1520:
14925         report the actual line where the error happens, not where the
14926         class was declared.
14927
14928         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
14929         Pass location information that was available elsewhere.
14930
14931 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
14932
14933         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
14934         runtime to delay sign assemblies.
14935
14936 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
14937
14938         * cs-parser.jay: Do not report the stack trace, this is barely
14939         used nowadays.
14940
14941 2004-08-22  John Luke  <john.luke@gmail.com>
14942  
14943         * driver.cs : check that a resource id is not already used
14944         before adding it, report CS1508 if it is, bug #63637
14945
14946 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
14947
14948         * ecore.cs: Removed dead code.
14949
14950 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
14951
14952         * class.cs: Do not report warning CS0067 on the interfaces.
14953
14954 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
14955
14956         * cs-parser.jay: Add error 504 report.
14957
14958 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
14959
14960         * rootcontext.cs: WarningLevel is 4 by default now.
14961
14962         * statement.cs (Fixed.Resolve): Do not null
14963         VariableInfo.
14964
14965 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
14966
14967         Fixed bug #55780
14968         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
14969         deep search when property is not virtual.
14970         (PropertyExpr.ResolveAccessors): Make one call for both
14971         accessors.
14972
14973 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14974
14975         Fixed bug #65766
14976         * statement.cs: Error 152 report constains also location.
14977
14978 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14979
14980         Fixed bug #65766
14981         * const.cs: Explicitly set constant as static.
14982
14983 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14984
14985         Fixed bug #64226
14986         * cs-parser.jay: Add error 1017 report.
14987
14988 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14989
14990         Fixed bug #59980, #64224
14991         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
14992
14993         * typemanager.cs (IsSpecialMethod): Simplified
14994
14995 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
14996
14997         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
14998         condition with better params.
14999
15000 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
15001
15002         Fixed bug #65238
15003         * attribute.cs (Resolve): Property has to have both
15004         accessors.
15005
15006 2004-09-14  Martin Baulig  <martin@ximian.com>
15007
15008         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
15009
15010 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
15011
15012         Fixed bug #61902
15013         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
15014         called and is obsolete then this member suppress message
15015         when call is inside next [Obsolete] method or type.
15016
15017         * expression.cs: Use TestObsoleteMethodUsage member.
15018
15019 2004-09-14  Martin Baulig  <martin@ximian.com>
15020
15021         * cs-parser.jay: Sync a bit with the GMCS version.
15022
15023 2004-09-14  Martin Baulig  <martin@ximian.com>
15024
15025         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
15026         (CSharpParser.yacc_verbose_flag): New public field.
15027
15028         * genericparser.cs: Removed.
15029
15030 2004-09-14  Raja R Harinath  <rharinath@novell.com>
15031
15032         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
15033
15034 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
15035
15036         * class.cs (MethodCore.CheckBase): Fix bug #65757.
15037
15038 2004-09-10  Martin Baulig  <martin@ximian.com>
15039
15040         Backported my MemberName changes from GMCS into MCS.
15041
15042         - we are now using a special `MemberName' class instead of using
15043         strings; in GMCS, the `MemberName' also contains the type
15044         arguments.
15045
15046         - changed the grammar rules a bit:
15047           * the old `member_name' is now a `namespace_or_type_name':
15048             The rule is that we use `namespace_or_type_name' everywhere
15049             where we expect either a "member name" (GetEnumerator) or a
15050             "member name" with an explicit interface name
15051             (IEnumerable.GetEnumerator).
15052             In GMCS, the explicit interface name may include type arguments
15053             (IEnumerable<T>.GetEnumerator).
15054           * we use `member_name' instead of just `IDENTIFIER' for
15055             "member names":
15056             The rule is that we use `member_name' wherever a member may
15057             have type parameters in GMCS.       
15058
15059         * decl.cs (MemberName): New public class.
15060         (MemberCore.MemberName): New public readonly field.
15061         (MemberCore.ctor): Take a `MemberName' argument, not a string.
15062         (DeclSpace): Likewise.
15063
15064         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
15065         * enum.cs (Enum.ctor): Likewise.
15066
15067         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
15068         MemberName.     
15069         (AliasEntry.ctor): Take a MemberName, not an Expression.
15070         (AliasEntry.UsingAlias): Likewise.
15071
15072         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
15073         (IMethodData.MemberName): Changed type from string to MemberName.
15074         (MemberBase.ExplicitInterfaceName): Likewise.
15075         (AbstractPropertyEventMethod.SetupName): Make this private.
15076         (AbstractPropertyEventMethod.ctor): Added `string prefix'
15077         argument; compute the member name here.
15078         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
15079         on the `member.MemberName' and the `prefix'.
15080
15081         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
15082         not `type_name'.
15083         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
15084         thus, we get a `MemberName' instead of a `string'.  These
15085         declarations may have type parameters in GMCS.
15086         (interface_method_declaration, delegate_declaration): Likewise.
15087         (class_declaration, interface_declaration): Likewise.
15088         (method_header): Use `namespace_or_type_name' instead of
15089         `member_name'.  We may be an explicit interface implementation.
15090         (property_declaration, event_declaration): Likewise.
15091         (member_name): This is now just an `IDENTIFIER', not a
15092         `namespace_or_type_name'.
15093         (type_name, interface_type): Removed.
15094         (namespace_or_type_name): Return a MemberName, not an Expression.
15095         (primary_expression): Use `member_name' instead of `IDENTIFIER';
15096         call GetTypeExpression() on the MemberName to get an expression.
15097         (IndexerDeclaration.interface_type): Changed type from string to
15098         MemberName.
15099         (MakeName): Operate on MemberName's instead of string's.
15100
15101 2004-09-13  Raja R Harinath  <rharinath@novell.com>
15102
15103         Fix bug #55770.
15104         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
15105         (NamespaceEntry.Lookup): Add new argument to flag if we want the
15106         lookup to avoid symbols introduced by 'using'.
15107         * rootcontext.cs (NamespaceLookup): Update.
15108
15109 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
15110
15111         * class.cs (TypeContainer.DoDefineMembers): Do not call
15112         DefineDefaultConstructor for static classes.
15113
15114 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
15115
15116         * attribute.cs (Attribute.Resolve): Add error 653 report.
15117
15118         * class.cs (Class.ApplyAttributeBuilder): Add error 641
15119         report.
15120         (Method.ApplyAttributeBuilder): Add error 685 report.
15121         (Operator.Define): Add error 564 report.
15122
15123         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
15124
15125         * expression.cs (Invocation.DoResolve): Add error
15126         245 and 250 report.
15127
15128         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
15129         error 674 report.
15130
15131 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15132
15133         * class.cs (ConstructorInitializer.Resolve):
15134         Wrong error number (515->516).
15135
15136 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15137
15138         * class.cs (Indexer.Define): Add error 631 report.
15139
15140 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15141
15142         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
15143
15144 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15145
15146         * expression.cs (Probe.DoResolve): Add error CS0241 report.
15147
15148 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
15149
15150         * cs-parser.jay: Added error CS0241 report.
15151
15152 2004-09-10  Raja R Harinath  <rharinath@novell.com>
15153
15154         * cs-parser.jay (fixed_statement): Introduce a scope for the
15155         declaration in the 'fixed' statement.
15156
15157 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15158
15159         * cs-parser.jay: Added CS0230 error report.
15160
15161 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15162
15163         * cs-parser.jay: Added errors CS0231 and CS0257 report.
15164
15165 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15166
15167         * expression.cs (Argument.Resolve): Added error CS0192 and
15168         CS0199 report.
15169
15170 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15171
15172         C# 2.0 #pragma warning feature
15173
15174         * cs-tokenizer.cs (PreProcessPragma): New method; 
15175         Handles #pragma directive.
15176
15177         * report.cs (WarningRegions): New class; Support
15178         class for #pragma warning directive. It tests whether
15179         warning is enabled for a given line.
15180
15181 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
15182
15183         * const.cs: Add more descriptive error report, tahnks to
15184         Sebastien. 
15185
15186 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
15187
15188         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
15189
15190 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
15191
15192         * expression.cs: Apply patch from Ben: Remove dead code from
15193         ArrayCreation, and remove the TurnintoConstant call in const.cs,
15194         as that code just threw an exception anwyays.
15195
15196         * const.cs: Remove the call to the turnintoconstant, for details
15197         see bug: #63144
15198         
15199         * literal.cs: The type of the null-literal is the null type;  So
15200         we use a placeholder type (literal.cs:System.Null, defined here)
15201         for it.
15202
15203         * expression.cs (Conditional.DoResolve): Remove some old code that
15204         is no longer needed, conversions have been fixed.
15205
15206         (ArrayCreationExpression.DoResolve): Return false if we fail to
15207         resolve the inner expression.
15208
15209 2004-09-07  Raja R Harinath  <rharinath@novell.com>
15210
15211         Fix test-290.cs.
15212         * cs-parser.jay (delegate_declaration): Record a delegate
15213         declaration as a type declaration.
15214         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
15215
15216 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
15217
15218         * parameter.cs: Do not crash if the type can not be resolved. 
15219
15220         * expression.cs: Report errors with unsafe pointers, fixes #64896
15221
15222 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
15223
15224         * expression.cs: Pointer arith always needs to do a conv.i
15225         if the operand is a long. fix 65320
15226
15227 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
15228
15229         Fixed cs0619-37.cs, cs0619-38.cs
15230
15231         * enum.cs (GetObsoleteAttribute): Removed.
15232
15233         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
15234         on Enum member is double staged. The first is tested member
15235         and then enum.
15236
15237 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
15238
15239         Fixed #56986, #63631, #65231
15240
15241         * class.cs: (TypeContainer.AddToMemberContainer): New method,
15242         adds member to name container.
15243         (TypeContainer.AddToTypeContainer): New method, adds type to
15244         name container.
15245         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
15246         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
15247         AddOperator): Simplified by reusing AddToMemberContainer.
15248         (TypeContainer.UserDefinedStaticConstructor): Changed to property
15249         instead of field.
15250         (Method.CheckForDuplications): Fixed implementation to test all
15251         possibilities.
15252         (MemberBase): Detection whether member is explicit interface
15253         implementation is now in constructor.
15254         (MemberBase.UpdateMemberName): Handles IndexerName.
15255         (Accessor): Changed to keep also location information.
15256         (AbstractPropertyEventMethod): Is derived from MemberCore.
15257         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
15258         will be emited or not.
15259         (PropertyBase.AreAccessorsDuplicateImplementation):
15260         Tests whether accessors are not in collision with some method.
15261         (Operator): Is derived from MethodCore to simplify common
15262         operations.
15263
15264         * decl.cs (Flags.TestMethodDuplication): Test for duplication
15265         must be performed.
15266         (DeclSpace.AddToContainer): Adds the member to defined_names
15267         table. It tests for duplications and enclosing name conflicts.
15268
15269         * enum.cs (EnumMember): Clean up to reuse the base structures
15270
15271 2004-09-03  Martin Baulig  <martin@ximian.com>
15272
15273         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
15274         into TypeContainer, to make partial classes work again.
15275
15276 2004-09-03  Martin Baulig  <martin@ximian.com>
15277
15278         * rootcontext.cs (RootContext.V2): Removed.
15279
15280 2004-03-23  Martin Baulig  <martin@ximian.com>
15281
15282         * expression.cs (Invocation.OverloadResolve): Added `bool
15283         may_fail' argument and use it instead of the Location.IsNull() hack.
15284
15285 2004-09-03  Martin Baulig  <martin@ximian.com>
15286
15287         Merged latest changes into gmcs.  Please keep this comment in
15288         here, it makes it easier for me to see what changed in MCS since
15289         the last time I merged.
15290
15291 2004-09-03  Raja R Harinath  <rharinath@novell.com>
15292
15293         Fix #61128.
15294         * expression.cs (BetterConversion): Don't allow either conversion 
15295         to be null.  Remove redundant implicit conversion test when 'q ==
15296         null' -- when this function is invoked, we already know that the
15297         implicit conversion exists.
15298         (BetterFunction): Assume that 'best' is non-null.  Remove
15299         redundant reimplementation of IsApplicable when 'best' is null.
15300         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
15301         number of arguments.
15302         (IsAncestralType): Extract from OverloadResolve.
15303         (OverloadResolve): Make robust to the MethodGroupExpr being
15304         unsorted.  Implement all the logic of Section 14.5.5.1, and
15305         support overloading of methods from multiple applicable types.
15306         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
15307
15308         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
15309         (RealError, Warning): Append type of report to related symbol.
15310
15311 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
15312
15313         * enum.cs: Fixed CLS-Compliance checks for enum members.
15314         Error tests cs3008-8.cs, cs3014-8.cs
15315
15316 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
15317
15318         Fixed bug #62342, #63102
15319         * class.cs: ImplementIndexer uses member.IsExplicitImpl
15320         like ImplementMethod.
15321
15322 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
15323
15324         * attribute.cs (Attribute.GetAttributeArgumentExpression):
15325         Fixed bug #65170.
15326
15327 2004-09-02  Martin Baulig  <martin@ximian.com>
15328
15329         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
15330         TypeManager.GetArgumentTypes() rather than calling GetParameters()
15331         on the MethodBase.
15332
15333 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
15334
15335         C# 2.0 Static classes implemented
15336
15337         * class.cs (TypeContainer): instance_constructors,
15338         initialized_fields, initialized_static_fields,
15339         default_constructor, base_inteface_types are protected to be
15340         accessible from StaticClass.
15341         (TypeContainer.DefineDefaultConstructor): New virtual method
15342         for custom default constructor generating
15343         (StaticClass): New class to handle "Static classes" feature.
15344
15345         * cs-parser.jay: Handle static keyword on class like instance
15346         of StaticClass.
15347
15348         * driver.cs: Added "/langversion" command line switch with two
15349         options (iso-1, default).
15350
15351 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
15352
15353         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
15354
15355 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
15356
15357         * delegate.cs: Style.
15358
15359 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
15360
15361         * delegate.cs: Add seperate instance expr field for miguel.
15362
15363 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15364
15365         * PointerArithmetic (Resolve): make sure we are not doing
15366         pointer arith on void*. Also, make sure we are resolved
15367         by not setting eclass until resolve.
15368
15369         All callers: Make sure that PointerArithmetic gets resolved.
15370
15371 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15372
15373         * ArrayCreation (LookupType): If the type does not resolve 
15374         to an array, give an error.
15375
15376 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
15377
15378         * statement.cs (Try.Resolve): Fixed bug #64222
15379
15380 2004-08-27  Martin Baulig  <martin@ximian.com>
15381
15382         * class.cs
15383         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
15384         crash here.     
15385
15386 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
15387
15388         * ecore.cs (Constantify): Get underlying type via
15389         System.Enum.GetUnderlyingType to avoid StackOverflow on the
15390         Windows in special cases.
15391
15392 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
15393
15394         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
15395         for obtaining also private methods.
15396         (GetRemoveMethod): Used GetRemoveMethod (true)
15397         for obtaining also private methods.
15398
15399 2004-08-24  Martin Baulig  <martin@ximian.com>
15400
15401         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
15402         MethodAttributes.HideBySig for operators.
15403
15404 2004-08-23  Martin Baulig  <martin@ximian.com>
15405
15406         Back to the old error reporting system :-)
15407
15408         * report.cs (Message): Removed.
15409         (Report.MessageData, ErrorData, WarningData): Removed.
15410         (Report.Error, Warning): Back to the old system.
15411
15412 2004-08-23  Martin Baulig  <martin@ximian.com>
15413
15414         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
15415
15416         * class.cs (TypeContainer.ParentContainer): New public virtual
15417         method; replaces the explicit interface implementation.
15418         (ClassPart.ParentContainer): Override.
15419
15420 2004-08-23  Martin Baulig  <martin@ximian.com>
15421
15422         * statement.cs (Switch): Added support for constant switches; see
15423         #59428 or test-285.cs.
15424
15425 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
15426
15427         Fixed bug #62740.
15428         * statement.cs (GetEnumeratorFilter): Removed useless
15429         logic because C# specs is strict. GetEnumerator must be
15430         public.
15431
15432 2004-08-22  Martin Baulig  <martin@ximian.com>
15433
15434         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15435         a switch and may break, reset the barrier.  Fixes #59867.
15436
15437 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
15438
15439         CLS-Compliance speed up (~5% for corlib)
15440
15441         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
15442         New method. Tests container for CLS-Compliant names
15443
15444         * class.cs (TypeContainer.VerifyClsName): New method.
15445         Checks whether container name is CLS Compliant.
15446         (Constructor): Implements IMethodData.
15447
15448         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
15449         low-case table for CLS Compliance test.
15450         (MemberCache.VerifyClsParameterConflict): New method.
15451         Checks method parameters for CS3006 error.
15452
15453         * enum.cs (EnumMember): Is derived from MemberCore.
15454         (Enum.VerifyClsName): Optimized for better performance.
15455
15456 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
15457
15458         * report.cs: Renamed Error_T to Error and changed all
15459         references.
15460
15461 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
15462
15463         * class.cs (TypeContainer.IndexerArrayList): New inner class
15464         container for indexers.
15465         (TypeContainer.DefaultIndexerName): New constant for default
15466         indexer name. Replaced all "Item" with this constant.
15467         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
15468
15469         * typemanager.cs (TypeManager.default_member_ctor): Cache here
15470         DefaultMemberAttribute constructor.
15471
15472 2004-08-05  Martin Baulig  <martin@ximian.com>
15473
15474         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
15475         Fix bug #59429.
15476
15477 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
15478
15479         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
15480         multi platforms problem.
15481
15482         * compiler.csproj: Included shared files.
15483
15484 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
15485
15486         Fix bug 60333, 55971 in the more general way
15487         * attribute.cs (Attribute.GetAttributeArgumentExpression):
15488         Added arg_type argument for constant conversion.
15489         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
15490
15491 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
15492
15493         Fix bug #59760
15494         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
15495         OperatorArrayList, MethodCoreArrayList for typecontainer
15496         containers. Changed class member types to these new types.
15497         (MethodArrayList.DefineMembers): Added test for CS0659.
15498
15499 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
15500
15501         * cfold.cs: Synchronize the folding with the code in expression.cs
15502         Binary.DoNumericPromotions for uint operands.
15503
15504         * attribute.cs: Revert patch from Raja, it introduced a regression
15505         while building Blam-1.2.1 (hard to isolate a test case).
15506
15507 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
15508
15509         Fix for #55382
15510         * class.cs:
15511         (TypeContainer.Define): Renamed to DefineContainerMembers because of
15512         name collision.
15513         (MethodCore.parent_method): New member. The method we're overriding
15514         if this is an override method.
15515         (MethodCore.CheckBase): Moved from Method class and made common.
15516         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
15517         private.
15518         (MethodCore.CheckForDuplications): New abstract method. For custom
15519         member duplication search in a container
15520         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
15521         method and its return type.
15522         (Event.conflict_symbol): New member. Symbol with same name in the
15523         parent class.
15524
15525         * decl.cs:
15526         (MemberCache.FindMemberWithSameName): New method. The method
15527         is looking for conflict with inherited symbols.
15528
15529 2004-08-04  Martin Baulig  <martin@ximian.com>
15530
15531         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
15532
15533         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
15534
15535 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
15536
15537         * report.cs (Message): New enum for better error, warning reference in
15538         the code.
15539         (MessageData): New inner abstract class. It generally handles printing of
15540         error and warning messages.
15541         Removed unused Error, Warning, Message methods.
15542
15543 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
15544
15545         Fix for cs0592-8.cs test
15546         * attribute.cs
15547         (Attributable.ValidAttributeTargets): Made public.
15548         (Attribute.ExplicitTarget): New member for explicit target value.
15549         (Attribute.CheckTargets): Now we translate explicit attribute
15550         target to Target here.
15551
15552 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
15553
15554         * ecore.cs (MethodGroupExpr): new IsBase property.
15555
15556         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
15557
15558         * delegate.cs (DelegateCreation): store a MethodGroupExpr
15559         rather than an instance expr.
15560
15561         (DelegateCreation.Emit): Use the method group rather than
15562         the instance expression. Also, if you have base.Foo as the
15563         method for a delegate, make sure to emit ldftn, not ldftnvirt.
15564
15565         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
15566
15567         (NewDelegate.DoResolve): Only check for the existance of Invoke
15568         if the method is going to be needed. Use MethodGroupExpr.
15569
15570         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
15571
15572         * expression.cs: For pointer arith., make sure to use
15573         the size of the type, not the size of the pointer to
15574         the type.
15575
15576 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
15577
15578         Fix for #60722
15579         * class.cs (Class): Added error CS0502 test.
15580
15581 2004-08-03  John Luke  <jluke@cfl.rr.com>
15582             Raja R Harinath  <rharinath@novell.com>
15583
15584         Fix for #60997.
15585         * attribute.cs (Attribute.complained_before): New flag.
15586         (Attribute.ResolveType, Attribute.Resolve),
15587         (Attribute.DefinePInvokeMethod): Set it.
15588         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
15589         
15590 2004-08-03  Martin Baulig  <martin@ximian.com>
15591
15592         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
15593         use a user-defined operator; we still need to do numeric
15594         promotions in case one argument is a builtin type and the other
15595         one has an implicit conversion to that type.  Fixes #62322.
15596
15597 2004-08-02  Martin Baulig  <martin@ximian.com>
15598
15599         * statement.cs (LocalInfo.Flags): Added `IsThis'.
15600         (LocalInfo.IsThis): New public property.
15601         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
15602
15603 2004-08-01  Martin Baulig  <martin@ximian.com>
15604
15605         * class.cs (TypeContainer.GetClassBases): Don't set the default
15606         here since we may get called from GetPartialBases().
15607         (TypeContainer.DefineType): If GetClassBases() didn't return a
15608         parent, use the default one.
15609
15610 2004-07-30  Duncan Mak  <duncan@ximian.com>
15611
15612         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
15613
15614 2004-07-30  Martin Baulig  <martin@ximian.com>
15615
15616         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
15617
15618         * class.cs (SourceMethod): New public class, derive from the
15619         symbol writer's ISourceMethod.
15620         (Method): Use the new symbol writer API.
15621
15622         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
15623         as argument and use the new symbol writer.
15624
15625         * location.cs
15626         (SourceFile): Implement the symbol writer's ISourceFile.
15627         (Location.SymbolDocument): Removed.
15628         (Location.SourceFile): New public property.
15629
15630         * symbolwriter.cs: Use the new symbol writer API.
15631
15632 2004-07-30  Raja R Harinath  <rharinath@novell.com>
15633
15634         * Makefile (install-local): Remove.  Functionality moved to
15635         executable.make.
15636
15637 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
15638
15639         * Makefile: Install mcs.exe.config file together with mcs.exe.
15640         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
15641         correct runtime version.
15642         
15643 2004-07-25  Martin Baulig  <martin@ximian.com>
15644
15645         * class.cs
15646         (TypeContainer.RegisterOrder): Removed, this was unused.
15647         (TypeContainer, interface_order): Removed.
15648         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
15649         TypeContainer as argument since we can also be called with a
15650         `PartialContainer' for a partial class/struct/interface.
15651         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
15652         of checking whether we're an `Interface' - we could be a
15653         `PartialContainer'.
15654         (PartialContainer.Register): Override; call
15655         AddClass()/AddStruct()/AddInterface() on our parent.
15656
15657         * cs-parser.jay (interface_member_declaration): Add things to the
15658         `current_container', not the `current_class'.
15659
15660         * rootcontext.cs (RegisterOrder): The overloaded version which
15661         takes an `Interface' was unused, removed.
15662
15663         * typemanager.cs (TypeManager.LookupInterface): Return a
15664         `TypeContainer', not an `Interface'.
15665         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
15666         contain a `PartialContainer' for an interface, so check it's
15667         `Kind' to figure out what it is.
15668
15669 2004-07-25  Martin Baulig  <martin@ximian.com>
15670
15671         * class.cs (Class.DefaultTypeAttributes): New public constant.
15672         (Struct.DefaultTypeAttributes): Likewise.
15673         (Interface.DefaultTypeAttributes): Likewise.
15674         (PartialContainer.TypeAttr): Override this and add the
15675         DefaultTypeAttributes.
15676
15677 2004-07-25  Martin Baulig  <martin@ximian.com>
15678
15679         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
15680         we can just use the `Parent' field instead.
15681
15682 2004-07-25  Martin Baulig  <martin@ximian.com>
15683
15684         * class.cs (TypeContainer.Emit): Renamed to EmitType().
15685
15686 2004-07-25  Martin Baulig  <martin@ximian.com>
15687
15688         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
15689         our parts before defining any methods.
15690         (TypeContainer.VerifyImplements): Make this virtual.
15691         (ClassPart.VerifyImplements): Override and call VerifyImplements()
15692         on our PartialContainer.
15693
15694 2004-07-25  Martin Baulig  <martin@ximian.com>
15695
15696         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
15697
15698         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
15699         argument, we can just use the `Parent' field instead.
15700
15701         * class.cs
15702         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
15703         (MemberBase.DoDefine): Likewise.
15704
15705 2004-07-24  Martin Baulig  <martin@ximian.com>
15706
15707         * decl.cs (MemberCore.Parent): New public field.
15708         (DeclSpace.Parent): Moved to MemberCore.
15709
15710         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
15711         (MemberBase.ctor): Added TypeContainer argument, pass it to our
15712         parent's .ctor.
15713         (FieldBase, Field, Operator): Likewise.
15714         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
15715         (EventField, Event): Likewise.
15716
15717 2004-07-23  Martin Baulig  <martin@ximian.com>
15718
15719         * class.cs (PartialContainer): New public class.
15720         (ClassPart): New public class.
15721         (TypeContainer): Added support for partial classes.
15722         (TypeContainer.GetClassBases): Splitted some of the functionality
15723         out into GetNormalBases() and GetPartialBases().
15724
15725         * cs-tokenizer.cs (Token.PARTIAL): New token.
15726         (Tokenizer.consume_identifier): Added some hacks to recognize
15727         `partial', but only if it's immediately followed by `class',
15728         `struct' or `interface'.
15729
15730         * cs-parser.jay: Added support for partial clases.
15731
15732 2004-07-23  Martin Baulig  <martin@ximian.com>
15733
15734         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
15735         a `DeclSpace' and also made it readonly.
15736         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
15737         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
15738         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
15739
15740         * cs-parser.jay: Pass the `current_class', not the
15741         `current_container' (at the moment, this is still the same thing)
15742         to a new Method, Property, Event, Indexer or Constructor.
15743
15744 2004-07-23  Martin Baulig  <martin@ximian.com>
15745
15746         * cs-parser.jay (CSharpParser): Added a new `current_class' field
15747         and removed the `current_interface' one.
15748         (struct_declaration, class_declaration, interface_declaration):
15749         Set `current_class' to the newly created class/struct/interface;
15750         set their `Bases' and call Register() before parsing their body.
15751
15752 2004-07-23  Martin Baulig  <martin@ximian.com>
15753
15754         * class.cs (Kind): New public enum.
15755         (TypeContainer): Made this class abstract.
15756         (TypeContainer.Kind): New public readonly field.
15757         (TypeContainer.CheckDef): New public method; moved here from
15758         cs-parser.jay.
15759         (TypeContainer.Register): New public abstract method.
15760         (TypeContainer.GetPendingImplementations): New public abstract
15761         method.
15762         (TypeContainer.GetClassBases): Removed the `is_class' and
15763         `is_iface' parameters.
15764         (TypeContainer.DefineNestedTypes): Formerly known as
15765         DoDefineType().
15766         (ClassOrStruct): Made this class abstract.
15767
15768         * tree.cs (RootTypes): New public type. 
15769
15770 2004-07-20  Martin Baulig  <martin@ximian.com>
15771
15772         * tree.cs (Tree.RecordNamespace): Removed.
15773         (Tree.Namespaces): Removed.
15774
15775         * rootcontext.cs (RootContext.IsNamespace): Removed.
15776
15777         * cs-parser.jay (namespace_declaration): Just create a new
15778         NamespaceEntry here.
15779
15780 2004-07-20  Martin Baulig  <martin@ximian.com>
15781
15782         * statement.cs (ExceptionStatement): New abstract class.  This is
15783         now used as a base class for everyone who's using `finally'.
15784         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
15785         our local variables before using them.
15786
15787         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
15788         virtual method.  This is used by Yield.Resolve() to "steal" an
15789         outer block's `finally' clauses.
15790         (FlowBranchingException): The .ctor now takes an ExceptionStatement
15791         argument.
15792
15793         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
15794         version which takes an ExceptionStatement.  This version must be
15795         used to create exception branchings.
15796
15797         * iterator.cs
15798         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
15799         (Iterator.EmitMoveNext): Added exception support; protect the
15800         block with a `fault' clause, properly handle 'finally' clauses.
15801         (Iterator.EmitDispose): Run all the `finally' clauses here.
15802
15803 2004-07-20  Martin Baulig  <martin@ximian.com>
15804
15805         * iterator.cs: This is the first of a set of changes in the
15806         iterator code.  Match the spec more closely: if we're an
15807         IEnumerable, then GetEnumerator() must be called.  The first time
15808         GetEnumerator() is called, it returns the current instance; all
15809         subsequent invocations (if any) must create a copy.
15810
15811 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
15812
15813         * expression.cs: Resolve the constant expression before returning
15814         it. 
15815
15816 2004-07-19  Martin Baulig  <martin@ximian.com>
15817
15818         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
15819         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
15820         the return type of the new EmitContext.
15821
15822 2004-07-18  Martin Baulig  <martin@ximian.com>
15823
15824         * class.cs (Property.Define): Fix iterators.
15825
15826         * iterators.cs (Iterator.Define): Moved the
15827         `container.AddInterator (this)' call here from the .ctor; only do
15828         it if we resolved successfully.
15829
15830 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
15831
15832         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
15833         `true' for preprocessing directives that we parse.  The return
15834         value indicates whether we should return to regular tokenizing or
15835         not, not whether it was parsed successfully.
15836
15837         In the past if we were in: #if false ... #line #endif, we would
15838         resume parsing after `#line'.  See bug 61604.
15839
15840         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
15841         building: IsEnumType should return true only for enums, not for
15842         enums or System.Enum itself.  This fixes #61593.
15843
15844         Likely what happened is that corlib was wrong: mcs depended on
15845         this bug in some places.  The bug got fixed, we had to add the
15846         hack, which caused bug 61593.
15847
15848         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
15849         that was a workaround for the older conditions.
15850
15851 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
15852
15853         * assign.cs: IAssignMethod has a new interface, as documented
15854         inline. All assignment code now uses this new api.
15855
15856         * ecore.cs, expression.cs: All classes which implement
15857         IAssignMethod now use the new interface.
15858
15859         * expression.cs (Invocation): add a hack to EmitCall so that
15860         IndexerAccess can be the target of a compound assignment without
15861         evaluating its arguments twice.
15862
15863         * statement.cs: Handle changes in Invocation api.
15864
15865 2004-07-16  Martin Baulig  <martin@ximian.com>
15866
15867         * iterators.cs: Rewrote this.  We're now using one single Proxy
15868         class for both the IEnumerable and the IEnumerator interface and
15869         `Iterator' derives from Class so we can use the high-level API.
15870
15871         * class.cs (TypeContainer.AddIterator): New method.
15872         (TypeContainer.DoDefineType): New protected virtual method, which
15873         is called from DefineType().
15874         (TypeContainer.DoDefineMembers): Call DefineType() and
15875         DefineMembers() on all our iterators.
15876         (TypeContainer.Emit): Call Emit() on all our iterators.
15877         (TypeContainer.CloseType): Call CloseType() on all our iterators.
15878
15879         * codegen.cs (EmitContext.CurrentIterator): New public field.
15880
15881 2004-07-15  Martin Baulig  <martin@ximian.com>
15882
15883         * typemanager.cs
15884         (TypeManager.not_supported_exception_type): New type.   
15885
15886 2004-07-14  Martin Baulig  <martin@ximian.com>
15887
15888         * iterators.cs: Use real error numbers.
15889
15890 2004-07-14  Martin Baulig  <martin@ximian.com>
15891
15892         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
15893         requires this to be a System.Collection.IEnumerable and not a
15894         class implementing that interface.
15895         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
15896
15897 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
15898
15899         * class.cs: Fixed previous fix, it broke some error tests.
15900
15901 2004-07-12  Martin Baulig  <martin@ximian.com>
15902
15903         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
15904         Fixes #61293.
15905
15906 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
15907
15908         * assign.cs (LocalTemporary): Add new argument: is_address,If
15909         `is_address' is true, then the value that we store is the address
15910         to the real value, and not the value itself.
15911         
15912         * ecore.cs (PropertyExpr): use the new local temporary
15913         stuff to allow us to handle X.Y += z (where X is a struct)
15914
15915 2004-07-08  Martin Baulig  <martin@ximian.com>
15916
15917         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
15918         not always return, just like we're doing in Using.Resolve().
15919
15920 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
15921
15922         * cs-parser.jay (fixed_statement): flag this as Pinned.
15923
15924 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
15925
15926         * typemanager.cs (TypeManager): Removed MakePinned method, this
15927         mechanism is replaced with the .NET 2.x compatible mechanism of
15928         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
15929
15930         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
15931         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
15932         `IsFixed' property which has a different meaning.
15933
15934 2004-07-02  Raja R Harinath  <rharinath@novell.com>
15935
15936         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
15937         visible from inside a nested class, not just the names of the
15938         immediately enclosing class.
15939         Fix for bug #60730.
15940
15941 2004-06-24  Raja R Harinath  <rharinath@novell.com>
15942
15943         * expression.cs (BetterConversion): Remove buggy special-case
15944         handling of "implicit constant expression conversions".  At this
15945         point, we already know that the conversion is possible -- we're
15946         only checking to see which is better.
15947
15948 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15949
15950         * cs-parser.jay: Added error CS0210 test.
15951
15952 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15953
15954         * cs-parser.jay: Added error CS0134 test.
15955
15956 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15957
15958         Fix bug #52507
15959         * cs-parser.jay: Added error CS0145 test.
15960
15961 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15962
15963         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
15964
15965 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
15966         
15967         * expression.cs (StackAlloc.Resolve): The argument may not
15968         be a constant; deal with this case.
15969         
15970 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
15971
15972         * attribute.cs (IndexerName_GetIndexerName): Renamed to
15973         GetIndexerAttributeValue.
15974         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
15975
15976         * class.cs (Indexer.Define): Added error tests for CS0415,
15977         CS0609.
15978
15979 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
15980
15981         * attribute.cs (Attribute.Resolve): Keep field code in sync with
15982         property code.
15983
15984 2004-06-23  Martin Baulig  <martin@ximian.com>
15985
15986         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
15987         neither return nor throw, reset the barrier as well.  Fixes #60457.
15988
15989 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
15990
15991         * class.cs : EventAttributes is now set to None by default.
15992           This fixes bug #60459.
15993
15994 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
15995
15996         Fix bug #60219
15997         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
15998         Don't throw exception but return null (it's sufficient now).
15999
16000 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
16001
16002         * typemanager.cs (GetArgumentTypes): Faster implementation.
16003
16004 2004-06-18  Martin Baulig  <martin@ximian.com>
16005
16006         * attribute.cs (Attribute.Resolve): Check whether we're an
16007         EmptyCast which a Constant child.  Fixes #60333.
16008
16009 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
16010
16011         * statement.cs (EmitCollectionForeach): Account for the fact that
16012         not all valuetypes are in areas which we can take the address of.
16013         For these variables, we store to a temporary variable. Also, make
16014         sure that we dont emit a `callvirt' on a valuetype method.
16015
16016 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
16017
16018         * expression.cs (StackAlloc.DoReSolve): Added test for
16019         negative parameter (CS0247).
16020
16021 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
16022
16023         Fix bug #59792
16024         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
16025
16026 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
16027
16028         Fix bug #59781
16029         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
16030         ulong.
16031
16032 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
16033
16034         Fix bug #58254 & cs1555.cs, cs1556.cs
16035         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
16036
16037 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
16038
16039         * cs-parser.jay: Added error CS1669 test for indexers.
16040
16041 2004-06-11  Martin Baulig  <martin@ximian.com>
16042
16043         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
16044         call this twice: for params and varargs methods.
16045
16046 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16047
16048         * class.cs:
16049         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
16050
16051 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16052
16053         * attribute.cs (Attribute.GetValidTargets): Made public.
16054
16055         * class.cs: 
16056         (AbstractPropertyEventMethod): New class for better code sharing.
16057         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
16058         CS1667 report.
16059         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
16060
16061 2004-06-11  Raja R Harinath  <rharinath@novell.com>
16062
16063         Fix bug #59477.
16064         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
16065         that the call to Resolve is part of a MemberAccess.
16066         (Expression.Resolve): Use it for SimpleName resolution.
16067         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
16068         Add 'intermediate' boolean argument.
16069         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
16070         error message when the SimpleName can be resolved ambiguously
16071         between an expression and a type.
16072         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
16073         public.
16074         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
16075         call on the left-side.
16076
16077 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16078
16079         * class.cs:
16080         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
16081
16082 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16083
16084         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
16085
16086 2004-06-11  Martin Baulig  <martin@ximian.com>
16087
16088         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
16089         varargs methods if applicable.
16090
16091 2004-06-11  Martin Baulig  <martin@ximian.com>
16092
16093         * expression.cs (Invocation.EmitCall): Don't use
16094         `method.CallingConvention == CallingConventions.VarArgs' since the
16095         method could also have `CallingConventions.HasThis'.
16096
16097 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16098
16099         * class.cs (Event.GetSignatureForError): Implemented.
16100         Fixed crash in error test cs3010.cs
16101
16102 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
16103
16104         * cs-tokenizer.cs: Change the way we track __arglist to be
16105         consistent with the other keywords.
16106
16107 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
16108
16109         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
16110         tomorrow.
16111
16112 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
16113
16114         * codegen.cs: Check that all referenced assemblies have a strongname
16115         before strongnaming the compiled assembly. If not report error CS1577.
16116         Fix bug #56563. Patch by Jackson Harper.
16117         * typemanager.cs: Added a method to return all referenced assemblies.
16118         Fix bug #56563. Patch by Jackson Harper.
16119
16120 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
16121
16122         * class.cs:
16123         (Method.ApplyAttributeBuilder): Moved and added conditional
16124         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
16125
16126         * delegate.cs:
16127         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
16128
16129 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
16130
16131         Fixed #59640
16132         * class.cs: (EventField.attribute_targets): Changed default target.
16133
16134 2004-06-08  Martin Baulig  <martin@ximian.com>
16135
16136         * expression.cs (Invocation.EmitCall): Enable varargs methods.
16137
16138 2004-06-08  Martin Baulig  <martin@ximian.com>
16139
16140         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
16141
16142 2004-06-07  Martin Baulig  <martin@ximian.com>
16143
16144         Added support for varargs methods.
16145
16146         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
16147         keyword.
16148
16149         * cs-parser.jay: Added support for `__arglist'.
16150
16151         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
16152
16153         * expression.cs (Argument.AType): Added `ArgList'.
16154         (Invocation): Added support for varargs methods.
16155         (ArglistAccess): New public class.
16156         (Arglist): New public class.
16157
16158         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
16159
16160         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
16161         a method's top-level block if the method has varargs.
16162
16163         * support.cs (ReflectionParameters, InternalParameters): Added
16164         support for varargs methods.    
16165
16166 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
16167
16168         * class.cs: Provide location in indexer error report.
16169
16170         * driver.cs: Use standard names.
16171
16172         * namespace.cs: Catch the use of using after a namespace has been
16173         declared also on using aliases.
16174
16175 2004-06-03  Raja R Harinath  <rharinath@novell.com>
16176
16177         Bug #50820.
16178         * typemanager.cs (closure_private_ok, closure_invocation_type)
16179         (closure_qualifier_type, closure_invocation_assembly)
16180         (FilterWithClosure): Move to ...
16181         (Closure): New internal nested class.
16182         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
16183         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
16184         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
16185         (MemberLookup, MemberLookupFailed): Use it.
16186         * expression.cs (New.DoResolve): Treat the lookup for the
16187         constructor as being qualified by the 'new'ed type.
16188         (Indexers.GetIndexersForTypeOrInterface): Update.
16189
16190 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
16191
16192         * attribute.cs
16193         (GetConditionalAttributeValue): New method. Returns
16194         condition of ConditionalAttribute.
16195         (SearchMulti): New method.  Returns all attributes of type 't'.
16196         Use it when attribute is AllowMultiple = true.
16197         (IsConditionalMethodExcluded): New method.
16198
16199         * class.cs
16200         (Method.IsExcluded): Implemented. Returns true if method has conditional
16201         attribute and the conditions is not defined (method is excluded).
16202         (IMethodData): Extended interface for ConditionalAttribute support.
16203         (PropertyMethod.IsExcluded): Implemented.
16204
16205         * decl.cs
16206         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
16207
16208         * expression.cs
16209         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
16210         on the method.
16211
16212 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
16213
16214         * expression.cs (ArrayCreationExpression): Make this just an
16215         `expression'. It can't be a statement, so the code here was
16216         dead.
16217
16218 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
16219
16220         Fixed #59072
16221         * typemanager.cs (GetFullNameSignature): New method for
16222         MethodBase types.
16223
16224 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
16225
16226         Fixed #56452
16227         * class.cs (MemberBase.GetSignatureForError): New virtual method.
16228         Use this method when MethodBuilder is null.
16229         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
16230         Added test for error CS0626 (MONO reports error for this situation).
16231         (IMethodData.GetSignatureForError): Extended interface.
16232
16233 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
16234
16235         * attribute.cs
16236         (AttributeTester.GetObsoleteAttribute): Returns instance of
16237         ObsoleteAttribute when type is obsolete.
16238
16239         * class.cs
16240         (TypeContainer.VerifyObsoleteAttribute): Override.
16241         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
16242         (MethodCode.VerifyObsoleteAttribute): Override.
16243         (MemberBase.VerifyObsoleteAttribute): Override.
16244
16245         * decl.cs
16246         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
16247         and report proper error.
16248
16249         *delegate.cs
16250         Delegate.VerifyObsoleteAttribute): Override.
16251
16252         * ecore.cs
16253         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
16254         and report proper error.
16255         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
16256
16257         * enum.cs
16258         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
16259         and enum member.
16260
16261         * expression.cs
16262         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
16263         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
16264         Added test for ObsoleteAttribute.
16265
16266         * statement.cs
16267         (Catch): Derived from Statement.
16268
16269 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
16270  
16271         Fixed bug #59071 & cs0160.cs
16272  
16273         * statement.cs (Try.Resolve): Check here whether order of catch
16274         clauses matches their dependencies.
16275
16276 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
16277
16278         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
16279         caused a regression: #59343.  Referencing nested classes from an
16280         assembly stopped working.
16281
16282 2004-05-31  Martin Baulig  <martin@ximian.com>
16283
16284         MCS is now frozen for beta 2.
16285
16286 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16287
16288         * convert.cs: add a trivial cache for overload operator resolution.
16289
16290 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16291
16292         * decl.cs: If possible, use lookuptypedirect here. We can only do
16293         this if there is no `.' after the namespace. Avoids using
16294         LookupType, which does lots of slow processing.
16295         (FindNestedType) New method, does what it says :-).
16296         * namespace.cs: use LookupTypeDirect.
16297         * rootcontext.cs: use membercache, if possible.
16298         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
16299
16300 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16301
16302         * expression.cs:
16303         According to the spec, 
16304
16305         In a member access of the form E.I, if E is a single identifier,
16306         and if the meaning of E as a simple-name (§7.5.2) is a constant,
16307         field, property, localvariable, or parameter with the same type as
16308         the meaning of E as a type-name (§3.8), then both possible
16309         meanings of E are permitted.
16310
16311         We did not check that E as a simple-name had the same type as E as
16312         a type name.
16313
16314         This trivial check gives us 5-7% on bootstrap time.
16315
16316 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16317
16318         * expression.cs (Invocation.OverloadResolve): Avoid the
16319         use of hashtables and boxing here by allocating on demand.
16320
16321 2004-05-30  Martin Baulig  <martin@ximian.com>
16322
16323         * rootcontext.cs (RootContext.LookupType): Don't cache things if
16324         we're doing a silent lookup.  Don't try to lookup nested types in
16325         TypeManager.object_type (thanks to Ben Maurer).
16326
16327 2004-05-30  Martin Baulig  <martin@ximian.com>
16328
16329         Committing a patch from Ben Maurer.
16330
16331         * rootcontext.cs (RootContext.LookupType): Cache negative results.
16332
16333 2004-05-29  Martin Baulig  <martin@ximian.com>
16334
16335         * class.cs (IMethodData.ShouldIgnore): New method.
16336
16337         * typemanager.cs (TypeManager.MethodFlags): Don't take a
16338         `Location' argument, we don't need it anywhere.  Use
16339         `IMethodData.ShouldIgnore ()' instead of
16340         `MethodData.GetMethodFlags ()'.
16341         (TypeManager.AddMethod): Removed.
16342         (TypeManager.AddMethod2): Renamed to AddMethod.
16343
16344 2004-05-29  Martin Baulig  <martin@ximian.com>
16345
16346         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
16347
16348         * convert.cs (Convert.ImplicitReferenceConversion): If we're
16349         converting from a class type S to an interface type and we already
16350         have an object on the stack, don't box it again.  Fixes #52578.
16351
16352 2004-05-29  Martin Baulig  <martin@ximian.com>
16353
16354         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16355         Added support for `params' parameters.  Fixes #59267.
16356
16357 2004-05-29  Martin Baulig  <martin@ximian.com>
16358
16359         * literal.cs (NullPointer): Provide a private .ctor which sets
16360         `type' to TypeManager.object_type.  Fixes #59048.
16361
16362 2004-05-29  Martin Baulig  <martin@ximian.com>
16363
16364         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
16365         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
16366
16367         * ecore.cs (EventExpr.instance_expr): Make the field private.
16368
16369 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
16370
16371         Fixed bug #50080 & cs0214-2.cs
16372         * expression.cs (Cast.DoResolve): Check unsafe context here.
16373         
16374         * statement.cs (Resolve.DoResolve): Likewise.
16375
16376 2004-05-26  Martin Baulig  <martin@ximian.com>
16377
16378         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
16379
16380         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
16381         (RootContext.LookupType): Pass down the `silent' flag.
16382
16383 2004-05-25  Martin Baulig  <martin@ximian.com>
16384
16385         * expression.cs
16386         (MethodGroupExpr.IdenticalTypeName): New public property.
16387         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
16388         expression actually refers to a type.
16389
16390 2004-05-25  Martin Baulig  <martin@ximian.com>
16391
16392         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
16393         for #56176 and made it actually work.
16394
16395 2004-05-25  Martin Baulig  <martin@ximian.com>
16396
16397         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
16398         (FieldExpr, PropertyExpr): Override and implement
16399         CacheTemporaries.  Fixes #52279.
16400
16401 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
16402
16403         * location.cs: In the new compiler listing a file twice is a
16404         warning, not an error.
16405
16406 2004-05-24  Martin Baulig  <martin@ximian.com>
16407
16408         * enum.cs (Enum.DefineType): For the `BaseType' to be a
16409         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
16410
16411 2004-05-24  Martin Baulig  <martin@ximian.com>
16412
16413         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
16414         walking the `using' list.  Fixes #53921.
16415
16416 2004-05-24  Martin Baulig  <martin@ximian.com>
16417
16418         * const.cs (Const.LookupConstantValue): Added support for
16419         EmptyCast's; fixes #55251.
16420
16421 2004-05-24  Martin Baulig  <martin@ximian.com>
16422
16423         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
16424         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
16425         which does the CS0135 check.  The reason is that we first need to
16426         check whether the variable actually exists.
16427
16428 2004-05-24  Martin Baulig  <martin@ximian.com>
16429
16430         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
16431         than RootContext.LookupType() to find the explicit interface
16432         type.  Fixes #58584.
16433
16434 2004-05-24  Raja R Harinath  <rharinath@novell.com>
16435
16436         * Makefile: Simplify.  Use executable.make.
16437         * mcs.exe.sources: New file.  List of sources of mcs.exe.
16438
16439 2004-05-24  Anders Carlsson  <andersca@gnome.org>
16440
16441         * decl.cs:
16442         * enum.cs:
16443         Use the invariant culture when doing String.Compare for CLS case
16444         sensitivity.
16445         
16446 2004-05-23  Martin Baulig  <martin@ximian.com>
16447
16448         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
16449         don't have any dots.  Fixes #52622, added cs0246-8.cs.
16450
16451         * namespace.cs (NamespaceEntry.Lookup): Likewise.
16452         
16453 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
16454
16455         * class.cs (MemberBase.Define): Reuse MemberType member for 
16456         resolved type. Other methods can use it too.
16457
16458 2004-05-23  Martin Baulig  <martin@ximian.com>
16459
16460         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
16461         the variable also exists in the current block (otherwise, we need
16462         to report a CS0103).  Fixes #58670.
16463
16464 2004-05-23  Martin Baulig  <martin@ximian.com>
16465
16466         * flowanalysis.cs (Reachability.Reachable): Compute this
16467         on-the-fly rather than storing it as a field.
16468
16469 2004-05-23  Martin Baulig  <martin@ximian.com>
16470
16471         * flowanalysis.cs (Reachability.And): Manually compute the
16472         resulting `barrier' from the reachability.      
16473        
16474 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
16475
16476         Fix bug #57835
16477         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
16478         instance of ObsoleteAttribute when symbol is obsolete.
16479
16480         * class.cs
16481         (IMethodData): Extended interface for ObsoleteAttribute support.
16482
16483 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
16484
16485         * attribute.cs: Fix bug #55970
16486
16487 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
16488
16489         Fix bug #52705
16490         * attribute.cs
16491         (GetObsoleteAttribute): New method. Creates the instance of
16492         ObsoleteAttribute.
16493         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
16494         ObsoleteAttribute when member is obsolete.
16495         (AttributeTester.Report_ObsoleteMessage): Common method for
16496         Obsolete error/warning reporting.
16497
16498         * class.cs
16499         (TypeContainer.base_classs_type): New member for storing parent type.
16500
16501         * decl.cs
16502         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
16503         for this MemberCore.
16504
16505 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
16506
16507         * attribute.cs, const.cs: Fix bug #58590
16508
16509 2004-05-21  Martin Baulig  <martin@ximian.com>
16510
16511         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
16512         out parameters if the end of the method is unreachable.  Fixes
16513         #58098. 
16514
16515 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
16516
16517         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
16518         Hari was right, why extra method.
16519
16520 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
16521
16522         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
16523
16524 2004-05-20  Martin Baulig  <martin@ximian.com>
16525
16526         Merged this back from gmcs to keep the differences to a minumum.
16527
16528         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
16529         instead of a Declspace.
16530         (Attribute.ResolveType): Likewise.
16531         (Attributes.Search): Likewise.
16532         (Attributes.Contains): Likewise.
16533         (Attributes.GetClsCompliantAttribute): Likewise.
16534
16535         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
16536         argument.
16537         (MethodData.ApplyAttributes): Take an EmitContext instead of a
16538         DeclSpace.
16539
16540 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
16541
16542         Fix bug #58688 (MCS does not report error when the same attribute
16543         is assigned twice)
16544
16545         * attribute.cs (Attribute.Emit): Distinction between null and default.
16546
16547 2004-05-19  Raja R Harinath  <rharinath@novell.com>
16548
16549         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
16550         of a top-level attribute without an attribute target.
16551         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
16552         Make non-static.
16553         (Attribute.Conditional_GetConditionName), 
16554         (Attribute.Obsolete_GetObsoleteMessage): Update.
16555         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
16556         part of ScanForIndexerName.
16557         (Attribute.CanIgnoreInvalidAttribute): New function.
16558         (Attribute.ScanForIndexerName): Move to ...
16559         (Attributes.ScanForIndexerName): ... here.
16560         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
16561         (Attributes.Search): New internal variant that can choose not to
16562         complain if types aren't resolved.  The original signature now
16563         complains.
16564         (Attributes.GetClsCompliantAttribute): Use internal variant, with
16565         complaints suppressed.
16566         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
16567         only if it not useful.
16568         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
16569         top-level for attributes that are shared between the assembly
16570         and a top-level class.
16571         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
16572         * class.cs: Update to reflect changes.
16573         (DefineIndexers): Fuse loops.
16574         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
16575         a couple more variants of attribute names.
16576
16577 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
16578
16579         Fix bug #52585 (Implemented explicit attribute declaration)
16580
16581         * attribute.cs:
16582         (Attributable.ValidAttributeTargets): New abstract method. It gets
16583         list of valid attribute targets for explicit target declaration.
16584         (Attribute.Target): It holds target itself.
16585         (AttributeSection): Removed.
16586         (Attribute.CheckTargets): New method. It checks whether attribute
16587         target is valid for the current element.
16588
16589         * class.cs:
16590         (EventProperty): New class. For events that are declared like
16591         property (with add and remove accessors).
16592         (EventField): New class. For events that are declared like field.
16593         class.cs
16594
16595         * cs-parser.jay: Implemented explicit attribute target declaration.
16596
16597         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
16598         Override ValidAttributeTargets.
16599
16600         * parameter.cs:
16601         (ReturnParameter): Class for applying custom attributes on 
16602         the return type.
16603         (ParameterAtribute): New class. Class for applying custom
16604         attributes on the parameter type.
16605
16606 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
16607
16608         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
16609         definitions. 
16610
16611         (Method): Allow UNSAFE here.
16612
16613         * modifiers.cs: Support unsafe reporting.
16614
16615 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
16616
16617         * decl.cs: Fix bug #58478.
16618
16619 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16620
16621         * statement.cs: When checking for unreachable code on an EmptyStatement,
16622         set the location. Fixes bug #58488.
16623
16624 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
16625
16626         * driver.cs: Add -pkg handling.
16627
16628         From Gonzalo: UseShelLExecute=false
16629
16630 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
16631
16632         * attribute.cs:
16633         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
16634         for attribute.
16635         (Attribute.IsClsCompliaceRequired): Moved to base for better
16636         accesibility.
16637         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
16638         when attribute is AttributeUsageAttribute.
16639         (Attribute.GetValidTargets): Simplified.
16640         (Attribute.GetAttributeUsage): New method returns AttributeUsage
16641         attribute for this type.
16642         (Attribute.ApplyAttributes): Method renamed to Emit and make
16643         non-static.
16644         (GlobalAttributeSection): New class for special handling of global
16645         attributes (assembly, module).
16646         (AttributeSection.Emit): New method.
16647
16648         * class.cs: Implemented Attributable abstract methods.
16649         (MethodCore.LabelParameters): Moved to Parameter class.
16650         (Accessor): Is back simple class.
16651         (PropertyMethod): Implemented Attributable abstract class.
16652         (DelegateMethod): Implemented Attributable abstract class.
16653         (Event): New constructor for disctintion between normal Event
16654         and Event with accessors.
16655
16656         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
16657
16658         * codegen.cs, const.cs, decl.cs, delegate.cs:
16659         (CommonAssemblyModulClass): Implemented Attributable abstract class
16660         and simplified.
16661
16662         * enum.cs: Implement IAttributeSupport interface.
16663         (EnumMember): New class for emum members. Implemented Attributable
16664         abstract class
16665
16666         * parameter.cs:
16667         (ParameterBase): Is abstract.
16668         (ReturnParameter): New class for easier [return:] attribute handling.
16669
16670         * typemanager.cs: Removed builder_to_attr.
16671
16672 2004-05-11  Raja R Harinath  <rharinath@novell.com>
16673
16674         Fix bug #57151.
16675         * attribute.cs (Attribute.GetPositionalValue): New function.
16676         * class.cs (TypeContainer.VerifyMembers): New function.
16677         (TypeContainer.Emit): Use it.
16678         (ClassOrStruct): New base class for Class and Struct.
16679         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
16680         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
16681         class.
16682         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
16683         then each non-static field should have a FieldOffset attribute.
16684         Otherwise, none of the fields should have a FieldOffset attribute.
16685         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
16686         and FieldOffset attributes.
16687         * typemanager.cs (TypeManager.struct_layout_attribute_type)
16688         (TypeManager.field_offset_attribute_type): New core types.
16689         (TypeManager.InitCoreTypes): Initialize them.
16690
16691 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
16692
16693         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
16694         Return correct type.
16695         From bug #58270.
16696
16697 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
16698
16699         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
16700         be implicitly converted to ulong.
16701         
16702         * expression.cs: The logic for allowing operator &, | and ^ worked
16703         was wrong, it worked before because we did not report an error in
16704         an else branch.  Fixes 57895.
16705
16706         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
16707         allow volatile fields to be reference types.
16708
16709 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
16710
16711         * driver.cs: Add support for /debug-
16712
16713 2004-05-07  Raja R Harinath  <rharinath@novell.com>
16714
16715         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
16716         Add a 'complain' parameter to silence errors.
16717         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
16718         silently overlooked type-resolutions.
16719         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
16720         to reflect changes.
16721         (Attributes.Search): New function.
16722         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
16723         (Attributes.GetAttributeFullName): Remove hack.
16724         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
16725         Update to reflect changes.
16726         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
16727         Use Attributes.Search instead of nested loops.
16728
16729 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
16730
16731         * decl.cs:
16732         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
16733         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
16734         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
16735
16736         * report.cs: (Report.Warning): Renamed to Warning_T because of
16737         parameter collision.
16738
16739 2004-05-05  Raja R Harinath  <rharinath@novell.com>
16740
16741         * expression.cs (MemberAccess.ResolveMemberAccess):
16742         Exit with non-zero status after Report.Error.
16743         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
16744         Likewise.
16745         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
16746
16747 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
16748
16749         * support.cs: Don't hang when the file is empty.
16750
16751 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
16752
16753         * support.cs: In SeekableStreamReader, compute the preamble size of the
16754           underlying stream. Position changes should take into account that initial
16755           count of bytes.
16756
16757 2004-05-03  Todd Berman  <tberman@sevenl.net>
16758
16759         * driver.cs: remove unused GetSysVersion function.
16760
16761 2004-05-03  Todd Berman  <tberman@sevenl.net>
16762
16763         * driver.cs: Remove the hack from saturday, as well as the hack
16764         from jackson (LoadAssemblyFromGac), also adds the CWD to the
16765         link_paths to get that bit proper.
16766
16767 2004-05-01  Todd Berman  <tberman@sevenl.net>
16768
16769         * driver.cs: Try a LoadFrom before a Load, this checks the current
16770         path. This is currently a bug in mono that is be fixed, however, this
16771         provides a workaround for now. This will be removed when the bug
16772         is fixed.
16773
16774 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
16775
16776         * CryptoConvert.cs: Updated to latest version. Fix issue with 
16777         incomplete key pairs (#57941).
16778
16779 2004-05-01  Todd Berman  <tberman@sevenl.net>
16780
16781         * driver.cs: Remove '.' from path_chars, now System.* loads properly
16782         from the GAC
16783
16784 2004-04-30  Jackson Harper  <jackson@ximian.com>
16785
16786         * codegen.cs: Open keys readonly.
16787         
16788 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16789
16790         * typemanager.cs: don't report cyclic struct layout when a struct
16791         contains 2 or more fields of the same type. Failed for Pango.AttrShape
16792         which has 2 Pango.Rectangle fields.
16793
16794 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
16795
16796         * expression.cs: Handle IntPtr comparisons with IL code
16797         rather than a method call.
16798
16799 2004-04-29  Martin Baulig  <martin@ximian.com>
16800
16801         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
16802         the list of PropertyInfo's in class hierarchy and find the
16803         accessor.  Fixes #56013.
16804
16805 2004-04-29  Martin Baulig  <martin@ximian.com>
16806
16807         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
16808
16809 2004-04-29  Martin Baulig  <martin@ximian.com>
16810
16811         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16812
16813         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
16814
16815 2004-04-29  Martin Baulig  <martin@ximian.com>
16816
16817         * class.cs (ConstructorInitializer.Resolve): Check whether the
16818         parent .ctor is accessible.  Fixes #52146.
16819
16820 2004-04-29  Martin Baulig  <martin@ximian.com>
16821
16822         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16823
16824         * statement.cs (Using.EmitLocalVariableDecls): Use
16825         TypeManager.idisposable_type, not typeof (IDisposable).
16826         (Foreach.EmitCollectionForeach): Added support for valuetypes.
16827
16828 2004-04-29  Martin Baulig  <martin@ximian.com>
16829
16830         * class.cs (Event.Define): Don't emit the field and don't set
16831         RTSpecialName and SpecialName for events on interfaces.  Fixes
16832         #57703. 
16833
16834 2004-04-29  Raja R Harinath  <rharinath@novell.com>
16835
16836         Refactor Attribute.ApplyAttributes.
16837         * attribute.cs (Attributable): New base class for objects that can
16838         have Attributes applied on them.
16839         (Attribute): Make AttributeUsage fields public.
16840         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
16841         (Attribute.IsInternalCall): New property.
16842         (Attribute.UsageAttr): Convert to a public read-only property.
16843         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
16844         (Attribute.ResolveType, Attribute.Resolve)
16845         (Attribute.ScanForIndexerName): Update to reflect changes.
16846         (Attribute.CheckAttributeTarget): Re-format.
16847         (Attribute.ApplyAttributes): Refactor, to various
16848         Attributable.ApplyAttributeBuilder methods.
16849         * decl.cs (MemberCore): Make Attributable.
16850         * class.cs (Accessor): Make Attributable.
16851         (MethodData.ApplyAttributes): Use proper attribute types, not
16852         attribute names.
16853         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
16854         (TypeContainer.ApplyAttributeBuilder)
16855         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
16856         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
16857         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
16858         (Operator.ApplyAttributeBuilder): New factored-out methods.
16859         * const.cs (Const.ApplyAttributeBuilder): Likewise.
16860         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
16861         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
16862         * parameter.cs (ParameterBase): New Attributable base class
16863         that can also represent Return types.
16864         (Parameter): Update to the changes.
16865
16866 2004-04-29  Jackson Harper  <jackson@ximian.com>
16867
16868         * driver.cs: Prefer the corlib system version when looking for
16869         assemblies in the GAC. This is still a hack, but its a better hack
16870         now.
16871         
16872 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
16873
16874         * decl.cs, enum.cs: Improved error 3005 reporting.
16875   
16876         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
16877         (related_symbols): New private member for list of symbols
16878         related to reported error/warning.
16879         
16880         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
16881
16882 2004-04-29  Martin Baulig  <martin@ximian.com>
16883
16884         * ecore.cs (Expression.Constantify): If we're an enum and
16885         TypeManager.TypeToCoreType() doesn't give us another type, use
16886         t.UnderlyingSystemType.  Fixes #56178.  
16887
16888 2004-04-29  Martin Baulig  <martin@ximian.com>
16889
16890         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
16891         interfaces and for each interface, only add members directly
16892         declared in that interface.  Fixes #53255.
16893
16894 2004-04-28  Martin Baulig  <martin@ximian.com>
16895
16896         * expression.cs (ConditionalLogicalOperator): Use a temporary
16897         variable for `left' to avoid that we evaluate it more than once;
16898         bug #52588.
16899
16900 2004-04-28  Martin Baulig  <martin@ximian.com>
16901
16902         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
16903         `void[]' (CS1547).
16904
16905 2004-04-28  Martin Baulig  <martin@ximian.com>
16906
16907         * statement.cs (LocalInfo.Resolve): Check whether the type is not
16908         void (CS1547).
16909
16910         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
16911         whether the type is not void (CS1547).
16912
16913 2004-04-28  Martin Baulig  <martin@ximian.com>
16914
16915         * expression.cs (Unary.DoResolveLValue): Override this and report
16916         CS0131 for anything but Operator.Indirection.
16917
16918 2004-04-28  Martin Baulig  <martin@ximian.com>
16919
16920         Committing a patch from Ben Maurer; see bug #50820.
16921
16922         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16923         check for classes.
16924
16925         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16926         classes.        
16927
16928 2004-04-28  Martin Baulig  <martin@ximian.com>
16929
16930         Committing a patch from Ben Maurer; see bug #50820.
16931
16932         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16933         check for classes.
16934
16935         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16936         classes.        
16937
16938 2004-04-28  Martin Baulig  <martin@ximian.com>
16939
16940         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
16941         (Block.AddLabel): Call DoLookupLabel() to only search in the
16942         current block.
16943
16944 2004-04-28  Martin Baulig  <martin@ximian.com>
16945
16946         * cfold.cs (ConstantFold.BinaryFold): Added special support for
16947         comparing StringConstants and NullLiterals in Equality and Inequality.
16948
16949 2004-04-28  Jackson Harper  <jackson@ximian.com>
16950
16951         * driver.cs: Attempt to load referenced assemblies from the
16952         GAC. This is the quick and dirty version of this method that
16953         doesnt take into account versions and just takes the first
16954         canidate found. Will be good enough for now as we will not have more
16955         then one version installed into the GAC until I update this method.
16956
16957 2004-04-28  Martin Baulig  <martin@ximian.com>
16958
16959         * typemanager.cs (TypeManager.CheckStructCycles): New public
16960         static method to check for cycles in the struct layout.
16961
16962         * rootcontext.cs (RootContext.PopulateTypes): Call
16963         TypeManager.CheckStructCycles() for each TypeContainer.
16964         [Note: We only need to visit each type once.]
16965
16966 2004-04-28  Martin Baulig  <martin@ximian.com>
16967
16968         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
16969
16970         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
16971         success and added `out object value'.  Use a `bool resolved' field
16972         to check whether we've already been called rather than
16973         `ConstantValue != null' since this breaks for NullLiterals.
16974
16975 2004-04-28  Raja R Harinath  <rharinath@novell.com>
16976
16977         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
16978         setting of this flag, since the 'set' method may be non-public.
16979
16980 2004-04-28  Raja R Harinath  <rharinath@novell.com>
16981
16982         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
16983         check on current_vector.Block.
16984
16985 2004-04-27  Martin Baulig  <martin@ximian.com>
16986
16987         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
16988         a field initializer.  Fixes #56459.
16989
16990 2004-04-27  Martin Baulig  <martin@ximian.com>
16991
16992         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
16993         we're not attempting to use an indexer.  Fixes #52154.
16994
16995 2004-04-27  Martin Baulig  <martin@ximian.com>
16996
16997         * statement.cs (Return): Don't create a return label if we don't
16998         need it; reverts my change from January 20th.  Thanks to Ben
16999         Maurer for this.
17000
17001 2004-04-27  Martin Baulig  <martin@ximian.com>
17002
17003         According to the spec, `goto' can only leave a nested scope, but
17004         never enter it.
17005
17006         * statement.cs (Block.LookupLabel): Only lookup in the current
17007         block, don't recurse into parent or child blocks.
17008         (Block.AddLabel): Check in parent and child blocks, report
17009         CS0140/CS0158 if we find a duplicate.
17010         (Block): Removed this indexer for label lookups.
17011         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
17012         this already does the error reporting for us.
17013
17014         * flowanalysis.cs
17015         (FlowBranching.UsageVector.Block): New public variable; may be null.
17016         (FlowBranching.CreateSibling): Added `Block' argument.
17017         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
17018         label for the target of a `goto' and check whether we're not
17019         leaving a `finally'.
17020
17021 2004-04-27  Martin Baulig  <martin@ximian.com>
17022
17023         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
17024         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
17025         just for returns).
17026
17027 2004-04-27  Martin Baulig  <martin@ximian.com>
17028
17029         * statement.cs (Block.AddLabel): Also check for implicit blocks
17030         and added a CS0158 check.
17031
17032 2004-04-27  Martin Baulig  <martin@ximian.com>
17033
17034         * flowanalysis.cs (FlowBranchingLoop): New class.
17035         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
17036         UsageVector's instead of an ArrayList.
17037         (FlowBranching.Label): Likewise.
17038         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
17039         (FlowBranching.AddBreakVector): New method.
17040
17041 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
17042
17043         * attribute.cs: Small regression fix: only convert the type if we
17044         the type is different, fixes System.Drawing build.
17045
17046 2004-04-27  Martin Baulig  <martin@ximian.com>
17047
17048         * attribute.cs (Attribute.Resolve): If we have a constant value
17049         for a named field or property, implicity convert it to the correct
17050         type.
17051
17052 2004-04-27  Raja R Harinath  <rharinath@novell.com>
17053
17054         * statement.cs (Block.Block): Implicit blocks share
17055         'child_variable_names' fields with parent blocks.
17056         (Block.AddChildVariableNames): Remove.
17057         (Block.AddVariable): Mark variable as "used by a child block" in
17058         every surrounding block.
17059         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
17060         been used in a child block, complain about violation of "Invariant
17061         meaning in blocks" rule.
17062         * cs-parser.jay (declare_local_variables): Don't use
17063         AddChildVariableNames.
17064         (foreach_statement): Don't create an implicit block: 'foreach'
17065         introduces a scope.
17066
17067 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
17068
17069         * convert.cs (ImplicitNumericConversion): 0 is also positive when
17070         converting from 0L to ulong.  Fixes 57522.
17071
17072 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
17073
17074         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
17075         derived class hides via 'new' keyword field from base class (test-242.cs).
17076         TODO: Handle this in the more general way.
17077         
17078         * class.cs (CheckBase): Ditto.
17079
17080 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
17081
17082         * decl.cs (caching_flags): New member for storing cached values
17083         as bit flags.
17084         (MemberCore.Flags): New enum where bit flags for caching_flags
17085         are defined.
17086         (MemberCore.cls_compliance): Moved to caching_flags.
17087         (DeclSpace.Created): Moved to caching_flags.
17088
17089         * class.cs: Use caching_flags instead of DeclSpace.Created
17090         
17091 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
17092
17093         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
17094         if we are only a derived class, not a nested class.
17095
17096         * typemanager.cs: Same as above, but do this at the MemberLookup
17097         level (used by field and methods, properties are handled in
17098         PropertyExpr).   Allow for the qualified access if we are a nested
17099         method. 
17100
17101 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
17102
17103         * class.cs: Refactoring.
17104         (IMethodData): New inteface; Holds links to parent members
17105         to avoid member duplication (reduced memory allocation).
17106         (Method): Implemented IMethodData interface.
17107         (PropertyBase): New inner classes for get/set methods.
17108         (PropertyBase.PropertyMethod): Implemented IMethodData interface
17109         (Event): New inner classes for add/remove methods.
17110         (Event.DelegateMethod): Implemented IMethodData interface.
17111
17112         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
17113         EmitContext (related to class.cs refactoring).
17114
17115 2004-04-21  Raja R Harinath  <rharinath@novell.com>
17116
17117         * delegate.cs (Delegate.VerifyApplicability): If the number of
17118         arguments are the same as the number of parameters, first try to
17119         verify applicability ignoring  any 'params' modifier on the last
17120         parameter.
17121         Fixes #56442.
17122
17123 2004-04-16  Raja R Harinath  <rharinath@novell.com>
17124
17125         * class.cs (TypeContainer.AddIndexer): Use
17126         'ExplicitInterfaceName' to determine if interface name was
17127         explicitly specified.  'InterfaceType' is not initialized at this time.
17128         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
17129         Indexers array is already in the required order.  Initialize
17130         'IndexerName' only if there are normal indexers.
17131         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
17132         (TypeContainer.Emit): Emit DefaultMember attribute only if
17133         IndexerName is initialized.
17134         Fixes #56300.
17135
17136 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
17137
17138         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
17139         Fixes #57007
17140
17141 2004-04-15  Raja R Harinath  <rharinath@novell.com>
17142
17143         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
17144         attributes.
17145         Fix for #56456.
17146
17147         * attribute.cs (Attribute.Resolve): Check for duplicate named
17148         attributes.
17149         Fix for #56463.
17150
17151 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
17152
17153         * iterators.cs (MarkYield): track whether we are in an exception,
17154         and generate code accordingly.  Use a temporary value to store the
17155         result for our state.
17156
17157         I had ignored a bit the interaction of try/catch with iterators
17158         since their behavior was not entirely obvious, but now it is
17159         possible to verify that our behavior is the same as MS .NET 2.0
17160
17161         Fixes 54814
17162
17163 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
17164
17165         * iterators.cs: Avoid creating temporaries if there is no work to
17166         do. 
17167
17168         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
17169         Enumerations, use TypeManager.EnumToUnderlying and call
17170         recursively. 
17171
17172         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
17173         bug #57013
17174
17175         (This.Emit): Use EmitContext.EmitThis to emit our
17176         instance variable.
17177
17178         (This.EmitAssign): Ditto.
17179
17180         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
17181         codepaths, we will move all the functionality into
17182         Mono.CSharp.This 
17183
17184         (FieldExpr.EmitAssign): Ditto.
17185
17186         This fixes several hidden bugs that I uncovered while doing a code
17187         review of this today.
17188
17189         * codegen.cs (EmitThis): reworked so the semantics are more clear
17190         and also support value types "this" instances.
17191
17192         * iterators.cs: Changed so that for iterators in value types, we
17193         do not pass the value type as a parameter.  
17194
17195         Initialization of the enumerator helpers is now done in the caller
17196         instead of passing the parameters to the constructors and having
17197         the constructor set the fields.
17198
17199         The fields have now `assembly' visibility instead of private.
17200
17201 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
17202
17203         * expression.cs (Argument.Resolve): Check if fields passed as ref
17204         or out are contained in a MarshalByRefObject.
17205
17206         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
17207         another compiler type.
17208
17209 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
17210
17211         * class.cs (Indexer.Define): use the new name checking method.
17212         Also, return false on an error.
17213         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
17214         (is_identifier_[start/part]_character): make static.
17215
17216 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
17217
17218         * expression.cs (Binary.ResolveOperator): Do no append strings
17219         twice: since we can be invoked more than once (array evaluation)
17220         on the same concatenation, take care of this here.  Based on a fix
17221         from Ben (bug #56454)
17222
17223 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
17224
17225         * codegen.cs: Fix another case where CS1548 must be reported (when 
17226         delay-sign isn't specified and no private is available #56564). Fix
17227         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
17228         error when MCS is used on the MS runtime and we need to delay-sign 
17229         (which seems unsupported by AssemblyBuilder - see #56621).
17230
17231 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
17232
17233         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
17234         (TypeManager.ComputeNamespaces): Faster implementation for
17235         Microsoft runtime.
17236
17237         * compiler.csproj: Updated AssemblyName to mcs.
17238
17239 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
17240
17241         * rootcontext.cs: Add new types to the boot resolution.
17242
17243         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
17244         MulticastDelegate is not allowed.
17245
17246         * typemanager.cs: Add new types to lookup: System.TypedReference
17247         and ArgIterator.
17248
17249         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
17250         check for TypedReference or ArgIterator, they are not allowed. 
17251
17252         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
17253         makes us properly catch 1510 in some conditions (see bug 56016 for
17254         details). 
17255
17256 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
17257
17258         * CryptoConvert.cs: update from corlib version
17259         with endian fixes.
17260
17261 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
17262
17263         * class.cs (Indexer.Define): Check indexername declaration
17264
17265 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
17266
17267         * attribute.cs (IsClsCompliant): Fixed problem with handling
17268         all three states (compliant, not-compliant, undetected).
17269
17270 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
17271
17272         * attribute.cs (Attribute): Location is now public.
17273         (Resolve): Store resolved arguments (pos_values) in attribute class.
17274         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
17275         (GetClsCompliantAttributeValue): New method that gets
17276         CLSCompliantAttribute value.
17277         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
17278         if exists else null.
17279         (AttributeTester): New class for CLS-Compliant verification routines.
17280
17281         * class.cs (Emit): Add CLS-Compliant verification.
17282         (Method.GetSignatureForError): Implemented.
17283         (Constructor.GetSignatureForError): Implemented
17284         (Constructor.HasCompliantArgs): Returns if constructor has
17285         CLS-Compliant arguments.
17286         (Constructor.Emit): Override.
17287         (Construcor.IsIdentifierClsCompliant): New method; For constructors
17288         is needed to test only parameters.
17289         (FieldBase.GetSignatureForError): Implemented.
17290         (TypeContainer): New member for storing base interfaces.
17291         (TypeContainer.FindMembers): Search in base interfaces too.
17292
17293         * codegen.cs (GetClsComplianceAttribute): New method that gets
17294         assembly or module CLSCompliantAttribute value.
17295         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
17296         for assembly.
17297         (ModuleClass.Emit): Add error 3012 test.
17298
17299         * const.cs (Emit): Override and call base for CLS-Compliant tests.
17300
17301         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
17302         state for all decl types.
17303         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
17304         if CLS-Compliant tests are required.
17305         (IsClsCompliaceRequired): New method. Analyze whether code
17306         must be CLS-Compliant.
17307         (IsExposedFromAssembly): New method. Returns true when MemberCore
17308         is exposed from assembly.
17309         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
17310         value or gets cached value.
17311         (HasClsCompliantAttribute): New method. Returns true if MemberCore
17312         is explicitly marked with CLSCompliantAttribute.
17313         (IsIdentifierClsCompliant): New abstract method. This method is
17314         used to testing error 3005.
17315         (IsIdentifierAndParamClsCompliant): New method. Common helper method
17316         for identifier and parameters CLS-Compliant testing.
17317         (VerifyClsCompliance): New method. The main virtual method for
17318         CLS-Compliant verifications.
17319         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
17320         null. I don't know why is null (too many public members !).
17321         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
17322         and get value of first CLSCompliantAttribute that found.
17323
17324         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
17325         (VerifyClsCompliance): Override and add extra tests.
17326
17327         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
17328         clscheck- disable CLS-Compliant verification event if assembly is has
17329         CLSCompliantAttribute(true).
17330
17331         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
17332         ApllyAttribute is now called in emit section as in the other cases.
17333         Possible future Emit integration.
17334         (IsIdentifierClsCompliant): New override.
17335         (VerifyClsCompliance): New override.
17336         (GetEnumeratorName): Returns full enum name.
17337
17338         * parameter.cs (GetSignatureForError): Implemented.
17339
17340         * report.cs (WarningData): New struct for Warning message information.
17341         (LocationOfPreviousError): New method.
17342         (Warning): New method. Reports warning based on the warning table.
17343         (Error_T): New method. Reports error based on the error table.
17344
17345         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
17346         verifications are done here.
17347
17348         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
17349
17350         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
17351         CLSCompliantAttribute.
17352         (all_imported_types): New member holds all imported types from other
17353         assemblies.
17354         (LoadAllImportedTypes): New method fills static table with exported types
17355         from all referenced assemblies.
17356         (Modules): New property returns all assembly modules.
17357
17358 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
17359
17360         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
17361         throwing a parser error.
17362
17363         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
17364         which removes the hardcoded get_/set_ prefixes for properties, as
17365         IL allows for the properties to be named something else.  
17366
17367         Bug #56013
17368
17369         * expression.cs: Do not override operand before we know if it is
17370         non-null.  Fix 56207
17371
17372 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17373
17374         * typemanager.cs: support for pinned variables.
17375
17376 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17377
17378         * decl.cs, typemanager.cs: Avoid using an arraylist
17379         as a buffer if there is only one result set.
17380
17381 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17382
17383         * expression.cs: Make sure you cant call a static method
17384         with an instance expression, bug #56174.
17385
17386 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
17387
17388         * class.cs (IsDuplicateImplementation): Improve error reporting to
17389         flag 663 (method only differs in parameter modifier).
17390
17391         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
17392         in preprocessor directives.
17393
17394         * location.cs (LookupFile): Allow for the empty path.
17395
17396         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
17397         better approach for some of that patch, but its failing with the
17398         CharSet enumeration.  For now try/catch will do.
17399
17400         * typemanager.cs: Do not crash if a struct does not have fields.
17401         Fixes 56150.
17402
17403 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17404
17405         * expression.cs: cs0213, cant fix a fixed expression.
17406         fixes 50231.
17407
17408 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17409
17410         * cs-parser.jay: detect invalid embeded statements gracefully.
17411         bug #51113.
17412
17413 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17414
17415         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
17416         As a regex:
17417         s/
17418         the invocation type may not be a subclass of the tye of the item/
17419         The type of the item must be a subclass of the invocation item.
17420         /g
17421
17422         Fixes bug #50820.
17423
17424 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
17425
17426         * attribute.cs: Added methods to get a string and a bool from an
17427         attribute. Required to information from AssemblyKeyFileAttribute,
17428         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
17429         * codegen.cs: Modified AssemblyName creation to include support for
17430         strongnames. Catch additional exceptions to report them as CS1548.
17431         * compiler.csproj: Updated include CryptoConvert.cs.
17432         * compiler.csproj.user: Removed file - user specific configuration.
17433         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
17434         Mono.Security assembly. The original class is maintained and tested in
17435         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
17436         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
17437         like CSC 8.0 (C# v2) supports.
17438         * Makefile: Added CryptoConvert.cs to mcs sources.
17439         * rootcontext.cs: Added new options for strongnames.
17440
17441 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
17442
17443         * driver.cs: For --expect-error, report error code `2'
17444         if the program compiled with no errors, error code `1' if
17445         it compiled with an error other than the one expected.
17446
17447 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
17448
17449         * compiler.csproj: Updated for Visual Studio .NET 2003.
17450         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
17451         * compiler.sln: Updated for Visual Studio .NET 2003.
17452
17453 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
17454
17455         * expression.cs: Fix bug #47234. We basically need to apply the
17456         rule that we prefer the conversion of null to a reference type
17457         when faced with a conversion to 'object' (csc behaviour).
17458
17459 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17460
17461         * statement.cs: Shorter form for foreach, eliminates
17462         a local variable. r=Martin.
17463
17464 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17465
17466         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
17467         checks if we can use brtrue/brfalse to test for 0.
17468         * expression.cs: use the above in the test for using brtrue/brfalse.
17469         cleanup code a bit.
17470
17471 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17472
17473         * expression.cs: Rewrite string concat stuff. Benefits:
17474
17475         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
17476         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
17477         rather than a concat chain.
17478
17479         * typemanager.cs: Add lookups for more concat overloads.
17480
17481 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17482
17483         * expression.cs: Emit shorter il code for array init.
17484
17485         newarr
17486         dup
17487         // set 1
17488
17489         // set 2
17490
17491         newarr
17492         stloc.x
17493
17494         ldloc.x
17495         // set 1
17496
17497         ldloc.x
17498         // set 2
17499
17500 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
17501
17502         * statement.cs: Before, two switch blocks would be merged if the
17503         total size of the blocks (end_item - begin_item + 1) was less than
17504         two times the combined sizes of the blocks.
17505
17506         Now, it will only merge if after the merge at least half of the
17507         slots are filled.
17508
17509         fixes 55885.
17510
17511 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
17512
17513         * class.cs : csc build fix for GetMethods(). See bug #52503.
17514
17515 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
17516
17517         * expression.cs: Make sure fp comparisons work with NaN.
17518         This fixes bug #54303. Mig approved this patch a long
17519         time ago, but we were not able to test b/c the runtime
17520         had a related bug.
17521
17522 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
17523
17524         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
17525
17526 2004-03-19  Martin Baulig  <martin@ximian.com>
17527
17528         * class.cs (MemberCore.IsDuplicateImplementation): Report the
17529         error here and not in our caller.
17530
17531 2004-03-19  Martin Baulig  <martin@ximian.com>
17532
17533         * interface.cs: Completely killed this file.
17534         (Interface): We're now a TypeContainer and live in class.cs.
17535
17536         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
17537         argument; we're now also called for interfaces.
17538         (TypeContainer.DefineMembers): Allow this method being called
17539         multiple times.
17540         (TypeContainer.GetMethods): New public method; formerly known as
17541         Interface.GetMethod().  This is used by PendingImplementation.
17542         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
17543         it's now private and non-static.
17544         (Interface): Moved this here; it's now implemented similar to
17545         Class and Struct.
17546         (Method, Property, Event, Indexer): Added `bool is_interface'
17547         argument to their .ctor's.
17548         (MemberBase.IsInterface): New public field.
17549
17550         * cs-parser.jay: Create normal Method, Property, Event, Indexer
17551         instances instead of InterfaceMethod, InterfaceProperty, etc.
17552         (opt_interface_base): Removed; we now use `opt_class_base' instead.
17553         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
17554
17555 2004-03-19  Martin Baulig  <martin@ximian.com>
17556
17557         * class.cs (MethodCore.IsDuplicateImplementation): New private
17558         method which does the CS0111 checking.
17559         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
17560         Use IsDuplicateImplementation().
17561
17562 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
17563
17564         * decl.cs (FindMemberToOverride): New method to find the correct
17565         method or property to override in the base class.
17566         * class.cs
17567             - Make Method/Property use the above method to find the
17568               version in the base class.
17569             - Remove the InheritableMemberSignatureCompare as it is now
17570               dead code.
17571
17572         This patch makes large code bases much faster to compile, as it is
17573         O(n) rather than O(n^2) to do this validation.
17574
17575         Also, it fixes bug 52458 which is that nested classes are not
17576         taken into account when finding the base class member.
17577
17578         Reviewed/Approved by Martin.
17579
17580 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
17581
17582         * interface.cs: In all interface classes removed redundant
17583         member initialization.
17584
17585 2004-03-16  Martin Baulig  <martin@ximian.com>
17586
17587         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
17588
17589 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
17590
17591         * decl.cs (DefineTypeAndParents): New helper method to define a
17592         type's containers before the type itself is defined;  This is a
17593         bug exposed by the recent changes to Windows.Forms when an
17594         implemented interface was defined inside a class that had not been
17595         built yet.   
17596
17597         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
17598
17599         (Check): Loop correctly to report errors modifiers
17600         (UNSAFE was not in the loop, since it was the same as TOP).
17601
17602         * interface.cs: Every interface member now takes a ModFlags,
17603         instead of a "is_new" bool, which we set on the base MemberCore. 
17604
17605         Every place where we called "UnsafeOk" in the interface, now we
17606         call the proper member (InterfaceMethod.UnsafeOK) instead to get
17607         the unsafe settings from the member declaration instead of the
17608         container interface. 
17609
17610         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
17611
17612         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
17613         `set_indexer_name' to the pending bits (one per type).
17614
17615         We fixed a bug today that was picking the wrong method to
17616         override, since for properties the existing InterfaceMethod code
17617         basically ignored the method name.  Now we make sure that the
17618         method name is one of the valid indexer names.
17619
17620 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
17621  
17622         * support.cs (SeekableStreamReader): Keep track of stream byte
17623         positions and don't mix them with character offsets to the buffer.
17624
17625         Patch from Gustavo Giráldez
17626
17627 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
17628
17629         * interface.cs (InterfaceSetGetBase): Removed double member
17630         initialization, base class does it as well.
17631
17632 2004-03-13  Martin Baulig  <martin@ximian.com>
17633
17634         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
17635         when compiling corlib.
17636
17637 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
17638
17639         * convert.cs (ExplicitConversion): We were reporting an error on
17640         certain conversions (object_type source to a value type, when the
17641         expression was `null') before we had a chance to pass it through
17642         the user defined conversions.
17643
17644         * driver.cs: Replace / and \ in resource specifications to dots.
17645         Fixes 50752
17646
17647         * class.cs: Add check for duplicate operators.  Fixes 52477
17648
17649 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
17650
17651         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
17652         that are in the middle of the statements, not only at the end.
17653         Fixes #54987
17654
17655         * class.cs (TypeContainer.AddField): No longer set the
17656         `HaveStaticConstructor' flag, now we call it
17657         `UserDefineStaticConstructor' to diferentiate the slightly
17658         semantic difference.
17659
17660         The situation is that we were not adding BeforeFieldInit (from
17661         Modifiers.TypeAttr) to classes that could have it.
17662         BeforeFieldInit should be set to classes that have no static
17663         constructor. 
17664
17665         See:
17666
17667         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
17668
17669         And most importantly Zoltan's comment:
17670
17671         http://bugzilla.ximian.com/show_bug.cgi?id=44229
17672
17673         "I think beforefieldinit means 'it's ok to initialize the type sometime 
17674          before its static fields are used', i.e. initialization does not need
17675          to be triggered by the first access to the type. Setting this flag
17676          helps the JIT to compile better code, since it can run the static
17677          constructor at JIT time, and does not need to generate code to call it
17678          (possibly lots of times) at runtime. Unfortunately, mcs does not set
17679          this flag for lots of classes like String. 
17680          
17681          csc sets this flag if the type does not have an explicit static 
17682          constructor. The reasoning seems to be that if there are only static
17683          initalizers for a type, and no static constructor, then the programmer
17684          does not care when this initialization happens, so beforefieldinit
17685          can be used.
17686          
17687          This bug prevents the AOT compiler from being usable, since it 
17688          generates so many calls to mono_runtime_class_init that the AOT code
17689          is much slower than the JITted code. The JITted code is faster, 
17690          because it does not generate these calls if the vtable is type is
17691          already initialized, which is true in the majority of cases. But the
17692          AOT compiler can't do this."
17693
17694 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
17695
17696         * class.cs (MethodData.Emit): Refactor the code so symbolic
17697         information is generated for destructors;  For some reasons we
17698         were taking a code path that did not generate symbolic information
17699         before. 
17700
17701 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
17702
17703         * class.cs: Create a Constructor.CheckBase method that
17704         takes care of all validation type code. The method
17705         contains some code that was moved from Define.
17706
17707         It also includes new code that checks for duplicate ctors.
17708         This fixes bug #55148.
17709
17710 2004-03-09  Joshua Tauberer <tauberer@for.net>
17711
17712         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
17713         a { ... }-style array creation invokes EmitStaticInitializers
17714         which is not good for reference-type arrays.  String, decimal
17715         and now null constants (NullCast) are not counted toward
17716         static initializers.
17717
17718 2004-03-05  Martin Baulig  <martin@ximian.com>
17719
17720         * location.cs (SourceFile.HasLineDirective): New public field;
17721         specifies whether the file contains or is referenced by a "#line"
17722         directive.
17723         (Location.DefineSymbolDocuments): Ignore source files which
17724         either contain or are referenced by a "#line" directive.        
17725
17726 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
17727
17728         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
17729         direct access to our parent, so check the method inline there.
17730
17731 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
17732
17733         * expression.cs (Invocation.EmitCall): Miguel's last commit
17734         caused a regression. If you had:
17735
17736             T t = null;
17737             t.Foo ();
17738
17739         In Foo the implict this would be null.
17740
17741 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
17742
17743         * expression.cs (Invocation.EmitCall): If the method is not
17744         virtual, do not emit a CallVirt to it, use Call.
17745
17746         * typemanager.cs (GetFullNameSignature): Improve the method to
17747         cope with ".ctor" and replace it with the type name.
17748
17749         * class.cs (ConstructorInitializer.Resolve): Now the method takes
17750         as an argument the ConstructorBuilder where it is being defined,
17751         to catch the recursive constructor invocations.
17752
17753 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
17754
17755         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
17756         routines to check if a type is an enumerable/enumerator allow
17757         classes that implement the IEnumerable or IEnumerator interfaces.
17758
17759         * class.cs (Property, Operator): Implement IIteratorContainer, and
17760         implement SetYields.
17761
17762         (Property.Define): Do the block swapping for get_methods in the
17763         context of iterators.   We need to check if Properties also
17764         include indexers or not.
17765
17766         (Operator): Assign the Block before invoking the
17767         OperatorMethod.Define, so we can trigger the Iterator code
17768         replacement. 
17769
17770         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
17771         Property and Operator classes are not created when we parse the
17772         declarator but until we have the block completed, so we use a
17773         singleton SimpleIteratorContainer.Simple to flag whether the
17774         SetYields has been invoked.
17775
17776         We propagate this setting then to the Property or the Operator to
17777         allow the `yield' to function.
17778
17779 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
17780
17781         * codegen.cs: Implemented attribute support for modules.
17782         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
17783         Assembly/Module functionality.
17784
17785         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
17786         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
17787         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
17788
17789 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
17790
17791         * interface.cs (FindMembers): The operation is performed on all base
17792         interfaces and not only on the first. It is required for future CLS Compliance patch.
17793
17794 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
17795
17796         * statement.cs, codegen.cs:
17797         This patch deals with patterns such as:
17798
17799         public class List : IEnumerable {
17800
17801                 public MyEnumerator GetEnumerator () {
17802                         return new MyEnumerator(this);
17803                 }
17804
17805                 IEnumerator IEnumerable.GetEnumerator () {
17806                         ...
17807                 }
17808                 
17809                 public struct MyEnumerator : IEnumerator {
17810                         ...
17811                 }
17812         }
17813
17814         Before, there were a few things we did wrong:
17815         1) we would emit callvirt on a struct, which is illegal
17816         2) we emited ldarg when we needed to emit ldarga
17817         3) we would mistakenly call the interface methods on an enumerator
17818         type that derived from IEnumerator and was in another assembly. For example:
17819
17820         public class MyEnumerator : IEnumerator
17821
17822         Would have the interface methods called, even if there were public impls of the
17823         method. In a struct, this lead to invalid IL code.
17824
17825 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
17826
17827         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
17828           renamed to Emit.
17829
17830         * delegate.cs (Define): Fixed crash when delegate type is undefined.
17831
17832 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
17833
17834         * cs-parser.jay: Fix small regression: we were not testing V2
17835         compiler features correctly.
17836
17837         * interface.cs: If the emit context is null, then create one
17838
17839 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
17840
17841         * decl.cs (GetSignatureForError): New virtual method to get full name
17842           for error messages.
17843
17844         * attribute.cs (IAttributeSupport): New interface for attribute setting.
17845           Now it is possible to rewrite ApplyAttributes method to be less if/else.
17846
17847         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
17848           Duplicated members and code in these classes has been removed.
17849           Better encapsulation in these classes.
17850
17851 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
17852
17853         * assign.cs (Assign.DoResolve): When dealing with compound
17854         assignments, there is a new rule in ECMA C# 2.4 (might have been
17855         there before, but it is documented here) that states that in:
17856
17857         a op= b;
17858
17859         If b is of type int, and the `op' is a shift-operator, then the
17860         above is evaluated as:
17861
17862         a = (int) a op b 
17863
17864         * expression.cs (Binary.ResolveOperator): Instead of testing for
17865         int/uint/long/ulong, try to implicitly convert to any of those
17866         types and use that in pointer arithmetic.
17867
17868         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
17869         method to print information for from the type, not from the
17870         null-method we were given.
17871
17872 2004-02-01  Duncan Mak  <duncan@ximian.com>
17873
17874         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
17875         parsing for cmd, fixes bug #53694.
17876
17877 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
17878
17879         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
17880         in the member name duplication tests. Property and operator name duplication
17881         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
17882
17883 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
17884
17885         * interface.cs (PopulateMethod): Fixed crash when interface method
17886         returns not existing type (error test cs0246-3.cs).
17887
17888 2004-02-02  Ravi Pratap M <ravi@ximian.com>
17889
17890         * cs-parser.jay (interface_accessors): Re-write actions to also
17891         store attributes attached to get and set methods. Fix spelling
17892         while at it.
17893
17894         (inteface_property_declaration): Modify accordingly.
17895
17896         (InterfaceAccessorInfo): New helper class to store information to pass
17897         around between rules that use interface_accessors.
17898
17899         * interface.cs (Emit): Apply attributes on the get and set
17900         accessors of properties and indexers too.
17901
17902         * attribute.cs (ApplyAttributes): Modify accordingly to use the
17903         right MethodBuilder when applying attributes to the get and set accessors.
17904
17905 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
17906
17907         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
17908
17909 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
17910
17911         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
17912
17913 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
17914
17915         * cs-parser.jay: Remove YIELD token, instead use the new grammar
17916         changes that treat `yield' specially when present before `break'
17917         or `return' tokens.
17918
17919         * cs-tokenizer.cs: yield is no longer a keyword.
17920
17921 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
17922
17923         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
17924         setting for default constructors.
17925         For default constructors are almost every time set wrong Modifier. The
17926         generated IL code has been alright. But inside mcs this values was
17927         wrong and this was reason why several of my CLS Compliance tests
17928         failed.
17929
17930 2004-01-22  Martin Baulig  <martin@ximian.com>
17931
17932         * cs-parser.jay (namespace_or_type_name): Return an Expression,
17933         not a QualifiedIdentifier.  This is what `type_name_expression'
17934         was previously doing.
17935         (type_name_expression): Removed; the code is now in
17936         `namespace_or_type_name'.
17937         (qualified_identifier): Removed, use `namespace_or_type_name'
17938         instead.
17939         (QualifiedIdentifier): Removed this class.      
17940
17941 2004-01-22  Martin Baulig  <martin@ximian.com>
17942
17943         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
17944         not a string as alias name.
17945
17946 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
17947
17948         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
17949         #52730 bug, and instead compute correctly the need to use a
17950         temporary variable when requesting an address based on the
17951         static/instace modified of the field and the constructor.
17952  
17953 2004-01-21  Martin Baulig  <martin@ximian.com>
17954
17955         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
17956         class and namespace before looking up aliases.  Fixes #52517.
17957
17958 2004-01-21  Martin Baulig  <martin@ximian.com>
17959
17960         * flowanalysis.cs (UsageVector.Merge): Allow variables being
17961         assinged in a 'try'; fixes exception4.cs.
17962
17963 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17964         * class.cs : Implemented parameter-less constructor for TypeContainer
17965
17966         * decl.cs: Attributes are now stored here. New property OptAttributes
17967
17968         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
17969
17970         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
17971
17972 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17973
17974         * typemanager.cs (CSharpSignature): Now reports also inner class name.
17975           (CSharpSignature): New method for indexer and property signature.
17976
17977 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17978
17979         * pending.cs (IsVirtualFilter): Faster implementation.
17980
17981 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17982
17983         * typemanager.cs: Avoid inclusion of same assembly more than once.
17984
17985 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17986
17987         * cs-parser.jay: Fixed problem where the last assembly attribute
17988           has been applied also to following declaration (class, struct, etc.)
17989           
17990 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17991
17992         * class.cs: Added error CS0538, CS0539 reporting.
17993         Fixed crash on Microsoft runtime when field type is void.
17994
17995         * cs-parser.jay: Added error CS0537 reporting.
17996
17997         * pending.cs: Added error CS0535 reporting.
17998         Improved error report for errors CS0536, CS0534.
17999
18000 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
18001
18002         Merge a few bits from the Anonymous Method MCS tree.
18003
18004         * statement.cs (ToplevelBlock): New class for toplevel methods,
18005         will hold anonymous methods, lifted variables.
18006
18007         * cs-parser.jay: Create toplevel blocks for delegates and for
18008         regular blocks of code. 
18009
18010 2004-01-20  Martin Baulig  <martin@ximian.com>
18011
18012         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
18013         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
18014         and `NeedExplicitReturn'; added `IsLastStatement'.
18015         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
18016         have a `ReturnLabel' or we're not unreachable.
18017
18018         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
18019         child's reachability; don't just override ours with it.  Fixes
18020         #58058 (lluis's example).
18021         (FlowBranching): Added public InTryOrCatch(), InCatch(),
18022         InFinally(), InLoop(), InSwitch() and
18023         BreakCrossesTryCatchBoundary() methods.
18024
18025         * statement.cs (Return): Do all error checking in Resolve().
18026         Unless we are the last statement in a top-level block, always
18027         create a return label and jump to it.
18028         (Break, Continue): Do all error checking in Resolve(); also make
18029         sure we aren't leaving a `finally'.
18030         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
18031         statement in a top-level block.
18032         (Block.Flags): Added `IsDestructor'.
18033         (Block.IsDestructor): New public property.
18034
18035 2004-01-20  Martin Baulig  <martin@ximian.com>
18036
18037         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
18038
18039 2004-01-20  Martin Baulig  <martin@ximian.com>
18040
18041         * statement.cs (Statement.ResolveUnreachable): New public method.
18042         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
18043         (Block.Resolve): Resolve unreachable statements.
18044
18045 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
18046
18047         * expression.cs: We need to fix the case where we do
18048         not have a temp variable here.
18049
18050         * assign.cs: Only expression compound assignments need
18051         temporary variables.
18052
18053 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
18054
18055         * flowanalysis.cs: Reduce memory allocation in a few ways:
18056           - A block with no variables should not allocate a bit
18057             vector for itself.
18058           - A method with no out parameters does not need any tracking
18059             for assignment of the parameters, so we need not allocate
18060             any data for it.
18061           - The arrays:
18062                 public readonly Type[] VariableTypes;
18063                 public readonly string[] VariableNames;
18064             Are redundant. The data is already stored in the variable
18065             map, so we need not allocate another array for it.
18066           - We need to add alot of checks for if (params | locals) == null
18067             due to the first two changes.
18068
18069 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
18070
18071         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
18072         implement IMemoryLocation, we store a copy on a local variable and
18073         take the address of it.  Patch from Benjamin Jemlich
18074
18075         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
18076         to use a special "type_name_expression" rule which reduces the
18077         number of "QualifiedIdentifier" classes created, and instead
18078         directly creates MemberAccess expressions.
18079
18080 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
18081
18082         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
18083         that fixes #52853.  Null literal assignment to ValueType
18084
18085         * class.cs (MethodData.Emit): Instead of checking the name of the
18086         method to determine if its a destructor, create a new derived
18087         class from Method called Destructor, and test for that.  
18088
18089         * cs-parser.jay: Create a Destructor object instead of a Method.  
18090
18091         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
18092
18093         Fixes: 52933
18094
18095 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
18096
18097         * expression.cs (Binary.ResolveOperator): Perform an implicit
18098         conversion from MethodGroups to their delegate types on the
18099         Addition operation.
18100
18101         * delegate.cs: Introduce a new class DelegateCreation that is the
18102         base class for `NewDelegate' and `ImplicitDelegateCreation',
18103         factor some code in here.
18104
18105         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
18106         conversion from MethodGroups to compatible delegate types. 
18107
18108         * ecore.cs (Expression.Resolve): Do not flag error 654
18109         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
18110         we allow conversions from MethodGroups to delegate types now.
18111
18112         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
18113         assignments in v2 either.
18114
18115 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
18116
18117         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
18118         static read-only fields in ctors.
18119
18120         Applied patch from Benjamin Jemlich 
18121
18122         * expression.cs (UnaryMutator): Avoid leaking local variables. 
18123
18124 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
18125
18126         * cs-tokenizer.cs (IsCastToken): Allow the various native types
18127         here to return true, as they can be used like this:
18128
18129                 (XXX) int.MEMBER ()
18130
18131         Fixed 49836 and all the other dups
18132
18133 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
18134
18135         * driver.cs: Implement /win32res and /win32icon.
18136
18137 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
18138
18139         * cs-parser.jay: Add a rule to improve error handling for the
18140         common mistake of placing modifiers after the type.
18141
18142 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
18143
18144         * cs-parser.jay (interface_event_declaration): Catch
18145         initialization of events on interfaces, and report cs0068
18146
18147         * cs-parser.jay (interface_event_declaration): Catch
18148         initialization of events. 
18149
18150         * ecore.cs: Better report missing constructors.
18151
18152         * expression.cs (Binary.ResolveOperator): My previous bug fix had
18153         the error reporting done in the wrong place.  Fix.
18154
18155         * expression.cs (Binary.ResolveOperator): Catch the 
18156         operator + (E x, E y) error earlier, and later allow for implicit
18157         conversions in operator +/- (E e, U x) from U to the underlying
18158         type of E.
18159
18160         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
18161         52596, if the container class is abstract, the default constructor
18162         is protected otherwise its public (before, we were always public).
18163
18164         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
18165         fixed statement.
18166
18167         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
18168         Jemlich that fixes bug #52597, MCS was generating invalid code for
18169         idisposable structs.   Thanks to Ben for following up with this
18170         bug as well.
18171
18172 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
18173
18174         * driver.cs: Allow assemblies without code to be generated, fixes
18175         52230.
18176
18177 2004-01-07  Nick Drochak <ndrochak@gol.com>
18178
18179         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
18180
18181 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
18182
18183         * cs-parser.jay: Add rules to improve error reporting if fields or
18184         methods are declared at the namespace level (error 116)
18185
18186         * Add rules to catch event add/remove
18187
18188 2004-01-04  David Sheldon <dave-mono@earth.li>
18189
18190   * expression.cs: Added matching ")" to error message for 
18191   CS0077
18192
18193 2004-01-03 Todd Berman <tberman@gentoo.org>
18194
18195         * ecore.cs, attribute.cs:
18196         Applying fix from #52429.
18197
18198 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18199
18200         * ecore.cs, expression.cs, statement.cs:
18201         Total rewrite of how we handle branching. We
18202         now handle complex boolean expressions with fewer
18203         jumps. As well if (x == 0) no longer emits a ceq.
18204
18205         if (x is Foo) is much faster now, because we generate
18206         better code.
18207
18208         Overall, we get a pretty big improvement on our benchmark
18209         tests. The code we generate is smaller and more readable.
18210
18211         I did a full two-stage bootstrap. The patch was reviewed
18212         by Martin and Miguel.
18213
18214 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18215
18216         * cs-parser.jay: Make primary_expression not take a QI.
18217         we dont need this because the member_access rule covers
18218         us here. So we replace the rule with just IDENTIFIER.
18219
18220         This has two good effects. First, we remove a s/r conflict.
18221         Second, we allocate many fewer QualifiedIdentifier objects.
18222
18223 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18224
18225         * attribute.cs: Handle MarshalAs attributes as pseudo, and
18226         set the correct information via SRE. This prevents
18227         hanging on the MS runtime. Fixes #29374.
18228
18229 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18230
18231         * convert.cs: correctly handle conversions to value types
18232         from Enum and ValueType as unboxing conversions.
18233
18234         Fixes bug #52569. Patch by Benjamin Jemlich.
18235
18236 2004-01-02  Ravi Pratap  <ravi@ximian.com>
18237
18238         * expression.cs (BetterConversion): Prefer int -> uint
18239         over int -> ulong (csc's behaviour). This fixed bug #52046.
18240
18241 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
18242
18243         * decl.cs (MemberCache.FindMembers): now returns a
18244         MemberInfo [].
18245
18246         * typemanager.cs: In general, go with with ^^.
18247         (CopyNewMethods): take an IList.
18248         (RealMemberLookup): Only allocate an arraylist
18249         if we copy from two sets of methods.
18250
18251         This change basically does two things:
18252         1) Fewer array lists allocated due to CopyNewMethods.
18253         2) the explicit cast in MemberList costed ALOT.
18254
18255 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
18256
18257         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
18258         a hashtable to avoid needless string allocations when an identifier is
18259         used more than once (the common case).
18260
18261 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
18262
18263         * pending.cs: MS's TypeBuilder.GetInterfaces ()
18264         is broken, it will not return anything. So, we
18265         have to use the information we have in mcs to
18266         do the task.
18267
18268         * typemanager.cs: Add a cache for GetInterfaces,
18269         since this will now be used more often (due to ^^)
18270
18271         (GetExplicitInterfaces) New method that gets the
18272         declared, not effective, interfaces on a type
18273         builder (eg, if you have interface IFoo, interface
18274         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
18275         { IBar }.
18276
18277         This patch makes MCS able to bootstrap itself on
18278         Windows again.
18279
18280 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
18281
18282         * expression.cs: Remove the Nop's that Miguel put
18283         in by mistake.
18284
18285 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
18286
18287         * report.cs, codegen.cs: Give the real stack trace to
18288         the error when an exception is thrown.
18289
18290 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
18291
18292         * decl.cs: only allocate hashtables for ifaces if 
18293         it is an iface!
18294
18295 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
18296
18297         * expression.cs: fix the error from cs0121-2.cs
18298         (a parent interface has two child interfaces that
18299         have a function with the same name and 0 params
18300         and the function is called through the parent).
18301
18302 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
18303
18304         * class.cs, rootcontext.cs, typmanager.cs: do not
18305         leak pointers.
18306
18307 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
18308
18309         * codegen.cs: remove stack for the ec flow branching.
18310         It is already a linked list, so no need.
18311
18312 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
18313
18314         * Makefile: Allow custom profiler here.
18315
18316 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
18317
18318         * typemanager.cs (LookupType):
18319           - Use a static char [], because split takes
18320             a param array for args, so it was allocating
18321             every time.
18322           - Do not store true in a hashtable, it boxes.
18323
18324 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
18325
18326         * flowanalysis.cs: bytify common enums.
18327
18328 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
18329
18330         * modifiers.cs: Add a new set of flags for the
18331         flags allowed on explicit interface impls.
18332         * cs-parser.jay: catch the use of modifiers in
18333         interfaces correctly.
18334         * class.cs: catch private void IFoo.Blah ().
18335
18336         All related to bug #50572.
18337
18338 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
18339
18340         * decl.cs: Rewrite the consistant accessability checking.
18341         Accessability is not linear, it must be implemented in
18342         a tableish way. Fixes #49704.
18343
18344 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
18345
18346         * expression.cs: Handle negation in a checked context.
18347         We must use subtraction from zero. Fixes #38674.
18348
18349 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18350
18351         * class.cs: Ignore static void main in DLLs.
18352         * rootcontext.cs: Handle the target type here,
18353         since we are have to access it from class.cs
18354         * driver.cs: account for the above.
18355
18356 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18357
18358         * report.cs: Give line numbers and files if available.
18359
18360 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
18361
18362         * driver.cs: Implement /addmodule.
18363
18364         * typemanager.cs:  Change 'modules' field so it now contains Modules not
18365         ModuleBuilders.
18366
18367 2003-12-20  Martin Baulig  <martin@ximian.com>
18368
18369         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
18370         (FieldBase.IsAssigned): Removed this field.
18371         (FieldBase.SetAssigned): New public method.
18372         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
18373
18374 2003-12-20  Martin Baulig  <martin@ximian.com>
18375
18376         * expression.cs (LocalVariableReference.DoResolve): Don't set
18377         `vi.Used' if we're called from DoResolveLValue().
18378
18379         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
18380         returns the usage vector it just merged into the current one -
18381         pass this one to UsageWarning().
18382         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
18383         of the `EmitContext', don't call this recursively on our children.
18384
18385 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
18386
18387         * driver.cs: Implement /target:module.
18388
18389 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
18390
18391         * support.cs (CharArrayHashtable): New helper class.
18392
18393         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
18394         char arrays, not strings, so we can avoid creating a string in
18395         consume_identifier if the identifier is a keyword.
18396
18397 2003-12-16  Martin Baulig  <martin@ximian.com>
18398
18399         * statement.cs (LocalInfo.Assigned): Removed this property.
18400         (LocalInfo.Flags): Removed `Assigned'.
18401         (LocalInfo.IsAssigned): New public method; takes the EmitContext
18402         and uses flow analysis.
18403         (Block.UsageWarning): Made this method private.
18404         (Block.Resolve): Call UsageWarning() if appropriate.
18405
18406         * expression.cs (LocalVariableReference.DoResolve): Always set
18407         LocalInfo.Used here.
18408
18409 2003-12-13  Martin Baulig  <martin@ximian.com>
18410
18411         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
18412         any value here; we're now using flow analysis to figure out
18413         whether a statement/block returns a value.
18414
18415 2003-12-13  Martin Baulig  <martin@ximian.com>
18416
18417         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
18418         working again.
18419         (FlowBranching.MergeFinally): Don't call
18420         `branching.CheckOutParameters()' here, this is called in
18421         MergeTopBlock().
18422         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
18423         when adding the `finally' vector.       
18424
18425 2003-12-13  Martin Baulig  <martin@ximian.com>
18426
18427         * flowanalysis.cs
18428         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
18429         actually work and also fix #48962.
18430
18431 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
18432
18433         * decl.cs: Do not check System.Object for nested types,
18434         since we know it does not have any. Big bang for buck:
18435
18436         BEFORE:
18437            Run 1:   8.35 seconds
18438            Run 2:   8.32 seconds
18439            corlib:  17.99 seconds
18440         AFTER:
18441            Run 1:   8.17 seconds
18442            Run 2:   8.17 seconds
18443            corlib:  17.39 seconds
18444
18445 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
18446
18447         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
18448         time we are returning 0 members, so we save alot here.
18449
18450 2003-12-11  Martin Baulig  <martin@ximian.com>
18451
18452         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
18453         `MergeChild()', also just take the `FlowBranching' as argument;
18454         call Merge() on it and return the result.
18455         (FlowBranching.Merge): We don't need to do anything if we just
18456         have one sibling.
18457
18458 2003-12-11  Martin Baulig  <martin@ximian.com>
18459
18460         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
18461         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
18462         Maurer for this idea.
18463
18464 2003-12-11  Martin Baulig  <martin@ximian.com>
18465
18466         * flowanalysis.cs (MergeResult): This class is now gone; we now
18467         use the `UsageVector' for this.  The reason for this is that if a
18468         branching just has one sibling, we don't need to "merge" them at
18469         all - that's the next step to do.
18470         (FlowBranching.Merge): We now return a `UsageVector' instead of a
18471         `MergeResult'.
18472
18473 2003-12-11  Martin Baulig  <martin@ximian.com>
18474
18475         Reworked flow analyis and made it more precise and bug-free.  The
18476         most important change is that we're now using a special `Reachability'
18477         class instead of having "magic" meanings of `FlowReturns'.  I'll
18478         do some more cleanups and optimizations and also add some more
18479         documentation this week.
18480
18481         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
18482         largely reworked this class.
18483         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
18484         the new `Reachability' class instead of having "magic" values here.
18485         (FlowBranching): We're now using an instance of `Reachability'
18486         instead of having separate `Returns', `Breaks' etc. fields.
18487
18488         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
18489         based on flow analysis; ignore the return value of block.Emit ().
18490
18491 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
18492
18493         * driver.cs typemanager.cs: Find the mono extensions to corlib even
18494         if they are private.
18495
18496 2003-12-09  Martin Baulig  <martin@ximian.com>
18497
18498         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
18499         call them directly on the UsageVector.
18500
18501 2003-12-09  Martin Baulig  <martin@ximian.com>
18502
18503         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
18504         Changed return type from `FlowReturns' to `Reachability'.
18505
18506 2003-12-09  Martin Baulig  <martin@ximian.com>
18507
18508         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
18509         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
18510         `Reachable' fields with a single `Reachability' one.
18511
18512 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18513
18514         * class.cs (FindMembers): Remove foreach's.
18515
18516         Bootstrap times:
18517
18518         BEFORE
18519                 Run 1:   8.74 seconds
18520                 Run 2:   8.71 seconds
18521
18522         AFTER
18523                 Run 1:   8.64 seconds
18524                 Run 2:   8.58 seconds
18525
18526
18527 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18528
18529         * cs-parser.jay:
18530         * gen-treedump.cs:
18531         * statement.cs:
18532         This patch does a few things:
18533                 1. EmptyStatement is now a singleton, so it is never reallocated.
18534                 2. All blah is EmptyStatement constructs have been changed to
18535                    blah == EmptyStatement.Value, which is much faster and valid
18536                    now that EmptyStatement is a singleton.
18537                 3. When resolving a block, rather than allocating a new array for
18538                    the non-empty statements, empty statements are replaced with
18539                    EmptyStatement.Value
18540                 4. Some recursive functions have been made non-recursive.
18541         Mainly the performance impact is from (3), however (1) and (2) are needed for
18542         this to work. (4) does not make a big difference in normal situations, however
18543         it makes the profile look saner.
18544
18545         Bootstrap times:
18546
18547         BEFORE
18548         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
18549         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
18550         Total memory allocated: 56397 KB
18551
18552         AFTER
18553         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
18554         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
18555         Total memory allocated: 55666 KB
18556
18557 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18558
18559         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
18560         than the hashtable in a hashtable version
18561
18562         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
18563         we always end up concating a string. This results in a huge perf
18564         loss, because many strings have to be tracked by the GC. In this
18565         patch, we first use a hashtable that works with two keys, so that
18566         the strings do not need to be concat'ed.
18567
18568         Bootstrap times:
18569         BEFORE
18570                 Run 1:   8.74 seconds
18571                 Run 2:   8.71 seconds
18572
18573         AFTER
18574                 Run 1:   8.65 seconds
18575                 Run 2:   8.56 seconds
18576
18577 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18578
18579         * Makefile: Add a new target `do-time' that does a quick and simple
18580         profile, leaving easy to parse output.
18581
18582 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
18583
18584         * codegen.cs (Init): Create the dynamic assembly with 
18585         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
18586
18587 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
18588
18589         * support.cs: Make the PtrHashtable use only one
18590         instance of its comparer.
18591
18592 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
18593
18594         * typemanager.cs: Fix lookup of GetNamespaces.
18595
18596 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
18597
18598         * expression.cs: Removed redundant line.
18599
18600         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
18601         ArrayLists, use for loops with bounds.  
18602
18603         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
18604         arraylist.
18605
18606         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
18607         arraylists, use for loop with bounds.
18608
18609         The above three changes give us a 0.071 second performance
18610         improvement out of 3.294 seconds down to 3.223.  On my machine
18611         the above changes reduced the memory usage by 1,387 KB during
18612         compiler bootstrap.
18613
18614         * cs-parser.jay (QualifiedIdentifier): New class used to represent
18615         QualifiedIdentifiers.  Before we created a new string through
18616         concatenation, and mostly later on, the result would be
18617         manipulated by DecomposeQI through string manipulation.
18618
18619         This reduced the compiler memory usage for bootstrapping from
18620         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
18621         compile times in 0.05 seconds.
18622
18623 2003-11-28  Dick Porter  <dick@ximian.com>
18624
18625         * support.cs: Do string compares with the Invariant culture.
18626
18627         * rootcontext.cs: 
18628         * gen-treedump.cs: 
18629         * expression.cs: 
18630         * driver.cs: 
18631         * decl.cs: 
18632         * codegen.cs: 
18633         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
18634         the comparison is done with the Invariant culture.
18635
18636 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
18637
18638         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
18639         GetEnumerator method.
18640
18641         (ProbeCollectionType): Iterate starting at the most specific type
18642         upwards looking for a GetEnumerator
18643
18644         * expression.cs: Shift count can be up to 31 for int/uint and 63
18645         for long/ulong.
18646
18647 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
18648
18649         * statement.cs (Block.LookupLabel): Also look for the label on the
18650         children blocks.  Use a hash table to keep track of visited
18651         nodes. 
18652
18653         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
18654         we actually did transform the other operand, otherwise fall back
18655         to the common codepath that casts to long.
18656
18657         * cs-tokenizer.cs: Use the same code pattern as the int case.
18658         Maybe I should do the parsing myself, and avoid depending on the
18659         Parse routines to get this done.
18660
18661 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
18662
18663         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
18664         which fixes bug 51347.  This time test it.
18665
18666         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
18667         attributes for example can not tell the difference between these.
18668         The difference was only a syntax feature of the language. 
18669
18670         * attribute.cs: Apply attributes to delegates.
18671
18672         * delegate.cs: Call the apply attributes method.
18673
18674 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
18675
18676         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
18677         comparing 0 vs Byte.MinValue, not the value
18678
18679         (ImplicitConversionRequired): When reporting a conversion error,
18680         use error 31 to print out the constant error instead of the
18681         simpler 29.
18682
18683         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
18684         which fixes bug 51347.
18685
18686 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
18687
18688         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
18689         which fixes the -warnaserror command line option.
18690
18691 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
18692
18693         * cfold.cs (DoNumericPromotions): During constant folding of
18694         additions on UIntConstant, special case intconstants with
18695         IntConstants like we do on the expression binary operator. 
18696
18697 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
18698
18699         * convert.cs (ImplicitReferenceConversion): We were missing a case
18700         (System.Enum are not value types or class types, so we need to
18701         classify them separatedly).
18702
18703         * driver.cs: We do not support error 2007.
18704
18705 2003-11-12 Jackson Harper <jackson@ximian.com>
18706
18707         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
18708         system directory. Also use the full file name so users can
18709         libraries names mscorlib-o-tron.dll in a non system dir.
18710
18711 2003-11-10  Martin Baulig  <martin@ximian.com>
18712
18713         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
18714         (TypeManager.InitCoreTypes): Initialize them here, but instead of
18715         calling `ResolveType()' on them, directly assign their `Type'.
18716
18717 2003-11-08  Martin Baulig  <martin@ximian.com>
18718
18719         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
18720         return value and the `out parent' parameter.
18721         (TypeContainer.DefineType): Moved the CS0644 check into
18722         GetClassBases().  Don't pass the interface types to the
18723         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
18724         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
18725
18726         * ecore.cs (TypeExpr.IsAttribute): New property.
18727         (TypeExpr.GetInterfaces): New method.
18728
18729         * interface.cs (Interface.GetInterfaceTypeByName): Return a
18730         TypeExpr instead of a Type.
18731         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
18732         (Interface.DefineType): Don't pass the interface types to the
18733         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
18734         them later and then call `TypeBulider.AddInterfaceImplementation()'.
18735
18736         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
18737         instead of a `Type[]'.
18738         (TypeManager.RegisterBuilder): Likewise.
18739         (TypeManager.AddUserInterface): Likewise.
18740         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
18741         `Type[]' and also return a `TypeExpr[]'.
18742         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
18743
18744 2003-11-08  Martin Baulig  <martin@ximian.com>
18745
18746         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
18747         Expression.     
18748
18749 2003-11-08  Martin Baulig  <martin@ximian.com>
18750
18751         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
18752         TypeManager.ResolveExpressionTypes().
18753
18754         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
18755         instead of an Expression.
18756         (TypeExpr): This is now an abstract base class for `TypeExpression'.
18757         (TypeExpression): New public class; formerly known as `TypeExpr'.
18758
18759         * expression.cs (ComposedCast): Derive from TypeExpr.
18760
18761         * typemanager.cs (TypeManager.system_*_expr): These are now
18762         TypExpr's instead of Expression's.
18763         (TypeManager.ResolveExpressionTypes): New public static function;
18764         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
18765         of them.        
18766
18767 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
18768
18769         * expression.cs (New.DoResolve): Do not dereference value that
18770         might be a null return.
18771
18772         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
18773         sure that the constant value has the right type.  Fixes an
18774         unreported bug, similar to 50425.
18775
18776         * const.cs (Const.LookupConstantValue): Call
18777         ImplicitStandardConversionExists before doing a conversion to
18778         avoid havng the TypeManager.ChangeType do conversions.
18779
18780         Reduced the number of casts used
18781
18782         (Const.ChangeType): New routine to enable reuse of the constant
18783         type changing code from statement.
18784
18785         * typemanager.cs (ChangeType): Move common initialization to
18786         static global variables.
18787
18788         Fixes #50425.
18789
18790         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
18791         every value type to go through, even if it was void.  Fix that. 
18792
18793         * cs-tokenizer.cs: Use is_identifier_start_character on the start
18794         character of the define, and the is_identifier_part_character for
18795         the rest of the string.
18796
18797 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
18798
18799         * expression.cs (UnaryMutator.EmitCode): When I updated
18800         LocalVariableReference.DoResolve, I overdid it, and dropped an
18801         optimization done on local variable references.
18802
18803 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
18804
18805         * ecore.cs: Convert the return from Ldlen into an int.
18806
18807 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
18808
18809         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
18810         the accessibility, this is a special case for toplevel non-public
18811         classes (internal for instance).
18812
18813 2003-10-20  Nick Drochak <ndrochak@gol.com>
18814
18815         * ecore.cs: Fix typo and build.  Needed another right paren.
18816
18817 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
18818
18819         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
18820         `internal' case regular and protected, but not allowing protected
18821         to be evaluated later.  Bug 49840
18822
18823 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
18824
18825         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
18826         to kb.Nlast, and not the kb.nFirst to isolate the switch
18827         statement.
18828
18829         Extract the underlying type, so enumerations of long/ulong are
18830         treated like long/ulong.
18831
18832 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
18833
18834         * expression.cs (New): Overload the meaning of RequestedType to
18835         track the possible creation of the NewDelegate type, since
18836         DoResolve is invoked more than once for new constructors on field
18837         initialization.
18838
18839         See bugs: #48800 and #37014
18840
18841         * cs-parser.jay (declare_local_constants): Take an arraylist
18842         instead of a single constant.
18843
18844         (local_constant_declaration): It should take a
18845         constant_declarators, not a constant_declarator.  Fixes 49487
18846
18847         * convert.cs: Fix error report.
18848
18849 2003-10-13 Jackson Harper <jackson@ximian.com>
18850
18851         * typemanager.cs (TypeToCoreType): Add float and double this fixes
18852         bug #49611
18853
18854 2003-10-09  Martin Baulig  <martin@ximian.com>
18855
18856         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
18857         to the .ctor.
18858         (MethodCore.DoDefineParameters): Removed the TypeContainer
18859         argument; use the DeclSpace which was passed to the .ctor instead.
18860         (MethodCore.CheckParameter): Take a DeclSpace instead of a
18861         TypeContainer; we only need a DeclSpace here.
18862
18863 2003-10-09  Martin Baulig  <martin@ximian.com>
18864
18865         * class.cs (MethodData): Added additional `DeclSpace ds' argument
18866         to the .ctor.
18867         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
18868         EmitContext's .ctor.    
18869
18870 2003-10-09  Martin Baulig  <martin@ximian.com>
18871
18872         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
18873         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
18874         AsAccessible(), moved them as well.
18875
18876         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
18877
18878 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
18879
18880         * cs-parser.jay : Renamed yyName to yyNames related to jay.
18881
18882 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
18883
18884         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
18885         generation for >=, as spotted by Paolo, bug 48679.  
18886         Patch from David Waite.
18887
18888         * cs-tokenizer.cs: Add handling for #pragma.
18889
18890         * cs-parser.jay: Allow for both yield and yield return in the
18891         syntax.  The anti-cobolization of C# fight will go on!
18892
18893         * class.cs (TypeBuilder.DefineType): Catch error condition here
18894         (Parent.DefineType erroring out and returning null).
18895
18896         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
18897         coping with enumerations variables, we were mistakenly processing
18898         them as a regular value type instead of built-in types.  Fixes the
18899         bug #48063
18900
18901         * typemanager.cs (IsBuiltinOrEnum): New method.
18902
18903 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
18904
18905         * cs-parser.jay: Upgrade: yield now needs the return clause.
18906
18907 2003-09-19  Martin Baulig  <martin@ximian.com>
18908
18909         * decl.cs (MemberCache.SetupCacheForInterface): Take a
18910         `MemberCache parent' argument.  Normally, an interface doesn't
18911         have a parent type except System.Object, but we use this in gmcs
18912         for generic type parameters.
18913
18914 2003-09-18  Martin Baulig  <martin@ximian.com>
18915
18916         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
18917         on `type.IsInterface'; don't check whether the type has a parent
18918         to determine whether it's an interface.
18919
18920 2003-09-15  Martin Baulig  <martin@ximian.com>
18921
18922         * class.cs (TypeContainer.DefineType): Added an error flag to
18923         avoid reporting duplicate CS0146's ("class definition is
18924         circular.").
18925
18926         * driver.cs (Driver.MainDriver): Abort if
18927         RootContext.ResolveTree() reported any errors.
18928
18929 2003-09-07  Martin Baulig  <martin@ximian.com>
18930
18931         * report.cs (Error, Warning): Added overloaded versions which take
18932         a `params object[] args' and call String.Format().
18933
18934 2003-09-07  Martin Baulig  <martin@ximian.com>
18935
18936         * decl.cs (DeclSpace..ctor): Don't call
18937         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
18938         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
18939         (DeclSpace.RecordDecl): New method.
18940
18941         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
18942
18943 2003-09-02  Ravi Pratap  <ravi@ximian.com>
18944
18945         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
18946         value attributes to be applied to ParameterBuilders.
18947
18948         * class.cs (MethodCore.LabelParameters): Make static and more
18949         generic so that it can be used from other places - like interface
18950         methods, for instance.
18951
18952         * interface.cs (Interface.Emit): Call LabelParameters before
18953         emitting attributes on the InterfaceMethod.
18954
18955 2003-08-26  Martin Baulig  <martin@ximian.com>
18956
18957         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
18958         resolving aliases; fixes #47927.
18959
18960 2003-08-26  Martin Baulig  <martin@ximian.com>
18961
18962         * statement.cs (Using.DoResolve): This is internally emitting a
18963         try/finally clause, so we need to set ec.NeedExplicitReturn if we
18964         do not always return.  Fixes #47681.
18965
18966 2003-08-26  Martin Baulig  <martin@ximian.com>
18967
18968         * decl.cs (MemberCore): Moved WarningNotHiding(),
18969         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
18970         into MemberBase.
18971         (AdditionResult): Make this nested in DeclSpace.
18972         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
18973         argument; call NamespaceEntry.Define() unless we're nested in a
18974         class or struct.
18975
18976         * namespace.cs (Namespace.DefineName): New public function.  This
18977         is called from DeclSpace's .ctor to add 
18978         (Namespace.Lookup): Include DeclSpaces in the lookup.
18979
18980         * class.cs (Operator): Derive from MemberBase, not MemberCore.
18981
18982         * const.cs (Const): Derive from MemberBase, not MemberCore.     
18983
18984 2003-08-25  Martin Baulig  <martin@ximian.com>
18985
18986         * convert.cs (Convert.ExplicitReferenceConversion): When
18987         converting from an interface type to a class, unbox if the target
18988         type is a struct type.  Fixes #47822.
18989
18990 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18991
18992         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
18993         #47854.
18994
18995 2003-08-22  Martin Baulig  <martin@ximian.com>
18996
18997         * class.cs (TypeManager.DefineType): When defining a nested type,
18998         call DefineType() on our parent; fixes #47801.
18999
19000 2003-08-22  Martin Baulig  <martin@ximian.com>
19001
19002         * class.cs (MethodData.Define): While checking if a method is an
19003         interface implementation, improve the test a bit more to fix #47654.
19004
19005 2003-08-22  Martin Baulig  <martin@ximian.com>
19006
19007         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
19008         correctly; fixes #47722.
19009
19010 2003-08-22  Martin Baulig  <martin@ximian.com>
19011
19012         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
19013         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
19014
19015         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
19016
19017 2003-08-22  Martin Baulig  <martin@ximian.com>
19018
19019         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
19020         can only be assigned in static constructors.  Fixes #47161.
19021
19022 2003-08-22  Martin Baulig  <martin@ximian.com>
19023
19024         Rewrote and improved the flow analysis code.
19025
19026         * flowbranching.cs (FlowBranching): Make this class abstract.
19027         (FlowBranching.CreateBranching): New static function to create a
19028         new flow branching.
19029         (FlowBranchingBlock, FlowBranchingException): New classes.
19030         (FlowBranching.UsageVector.Type): New public readonly field.
19031         (FlowBranching.UsageVector.Breaks): Removed the setter.
19032         (FlowBranching.UsageVector.Returns): Removed the setter.
19033         (FlowBranching.UsageVector): Added Break(), Return(),
19034         NeverReachable() and Throw() methods to modify the reachability.
19035         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
19036         done by FlowBranching.Merge().
19037         (FlowBranching.UsageVector.MergeChild): New method; merges the
19038         merge result into the current vector.
19039         (FlowBranching.Merge): New abstract method to merge a branching.
19040
19041 2003-08-12  Martin Baulig  <martin@ximian.com>
19042
19043         * expression.cs (Indirection.CacheTemporaries): Create the
19044         LocalTemporary with the pointer type, not its element type.
19045
19046 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
19047
19048         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
19049         token was a keyword or not.
19050
19051         Add `error' options where an IDENTIFIER was expected;  Provide
19052         CheckToken and CheckIdentifierToken convenience error reporting
19053         functions. 
19054
19055         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
19056
19057         * decl.cs: Rename `NamespaceEntry Namespace' public field into
19058         NameSpaceEntry NameSpaceEntry.
19059
19060         (LookupInterfaceOrClass): Avoid creating a full qualified name
19061         from namespace and name: avoid doing lookups when we know the
19062         namespace is non-existant.   Use new Tree.LookupByNamespace which
19063         looks up DeclSpaces based on their namespace, name pair.
19064
19065         * driver.cs: Provide a new `parser verbose' to display the
19066         exception thrown during parsing.  This is turned off by default
19067         now, so the output of a failure from mcs is more graceful.
19068
19069         * namespace.cs: Track all the namespaces defined in a hashtable
19070         for quick lookup.
19071
19072         (IsNamespace): New method
19073
19074 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
19075
19076         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
19077         we know that we need to concatenate (full typename can never be
19078         null). 
19079
19080         * class.cs: ditto.
19081
19082         * statement.cs: Use a bitfield;  Do not initialize to null things
19083         which are done by the constructor by default.
19084
19085         * cs-parser.jay: bug fix, parameter was 4, not 3.
19086
19087         * expression.cs: Just use the property;
19088
19089         * statement.cs: No need for GetVariableInfo method.
19090
19091 2003-08-08  Martin Baulig  <martin@ximian.com>
19092
19093         * flowanalysis.cs (FlowReturns): This is now nested in the
19094         `FlowBranching' class.
19095         (MyBitVector): Moved this here from statement.cs.
19096         (FlowBranching.SiblingType): New enum type.
19097         (FlowBranching.CreateSibling): Added `SiblingType' argument.
19098
19099 2003-08-07  Martin Baulig  <martin@ximian.com>
19100
19101         * flowanalysis.cs (FlowBranchingType): This is now nested in the
19102         `FlowBranching' class and called `BranchingType'.
19103
19104 2003-08-07  Martin Baulig  <martin@ximian.com>
19105
19106         * flowanalysis.cs: Moved all the control flow analysis code into
19107         its own file.
19108
19109 2003-08-07  Martin Baulig  <martin@ximian.com>
19110
19111         * assign.cs (Assign.DoResolve): `target' must either be an
19112         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
19113         #37319.
19114
19115 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
19116
19117         * expression.cs (BinaryMethod): This kind of expression is created by the
19118         Binary class if it determines that the operator has to be handled
19119         by a method.
19120
19121         (BinaryDelegate): This kind of expression is created if we are
19122         dealing with a + or - operator on delegates.
19123
19124         (Binary): remove method, argumetns, and DelegateOperator: when
19125         dealing with methods, 
19126
19127         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
19128
19129         * statement.cs (Block): use bitfields for the three extra booleans
19130         we had in use.   Remove unused topblock parameter.
19131
19132         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
19133
19134         * assign.cs: Drop extra unneeded tests.
19135
19136 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
19137
19138         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
19139
19140         * statement.cs (Foreach): Use VariableStorage instead of
19141         LocalBuilders.   
19142
19143         * codegen.cs (VariableStorage): New class used by clients that
19144         require a variable stored: locals or fields for variables that
19145         need to live across yield.
19146
19147         Maybe provide a convenience api for EmitThis+EmitLoad?
19148
19149         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
19150         these bad boys.
19151
19152 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
19153
19154         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
19155         RemapParameterLValue): New methods that are used to turn a
19156         precomputed FieldInfo into an expression like this:
19157
19158                 instance.FieldInfo
19159
19160         The idea is to use this instead of making LocalVariableReference
19161         have more than one meaning.
19162
19163         * cs-parser.jay: Add error production to BASE.
19164
19165         * ecore.cs: Deal with TypeManager.GetField returning null, which
19166         is now a valid return value.
19167
19168         (FieldExprNoAddress): New expression for Fields whose address can
19169         not be taken.
19170
19171         * expression.cs (LocalVariableReference): During the resolve
19172         phases, create new expressions if we are in a remapping context.
19173         Remove code that dealt with remapping here.
19174
19175         (ParameterReference): same.
19176
19177         (ProxyInstance): New expression, like the `This' expression, but
19178         it is born fully resolved.  We know what we are doing, so remove
19179         the errors that are targeted to user-provided uses of `this'.
19180
19181         * statement.cs (Foreach): our variable is now stored as an
19182         Expression;  During resolution, follow the protocol, dont just
19183         assume it will return this.
19184
19185 2003-08-06  Martin Baulig  <martin@ximian.com>
19186
19187         * support.cs (SeekableStreamReader.cs): New public class.
19188
19189         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
19190         SeekableStreamReader instead of the normal StreamReader.
19191
19192 2003-08-04  Martin Baulig  <martin@ximian.com>
19193
19194         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
19195         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
19196         deambiguate casts and delegate invocations.
19197         (parenthesized_expression): Use the new tokens to ensure this is
19198         not a cast of method invocation.
19199
19200         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
19201         when reading a `)' and Deambiguate_CloseParens () was previously
19202         called.
19203
19204         * expression.cs (ParenthesizedExpression): New class.  This is
19205         just used for the CS0075 test.
19206         (Binary.DoResolve): Check for CS0075.   
19207
19208 2003-07-29  Ravi Pratap  <ravi@ximian.com>
19209
19210         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
19211         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
19212         reference comparison.
19213
19214         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
19215         examine the ReturnType for equality - this is necessary in the
19216         cases of implicit and explicit operators whose signature also
19217         includes the return type.
19218
19219 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
19220
19221         * namespace.cs: Cache the result of the namespace computation,
19222         instead of computing it every time.
19223
19224 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
19225
19226         * decl.cs: Use a global arraylist that we reuse over invocations
19227         to avoid excesive memory consumption.  Reduces memory usage on an
19228         mcs compile by one meg (45 average).
19229
19230         * typemanager.cs (LookupTypeReflection): In .NET pointers are
19231         private, work around that.
19232
19233 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
19234
19235         * literal.cs (IntLiteral): Define Zero and One static literals. 
19236
19237         * cs-parser.jay (integer_literal): use static literals to reduce
19238         memory usage for the most used literals (0, 1 and -1).  211kb
19239         reduced in memory usage.
19240
19241         Replace all calls to `new ArrayList' with `new
19242         ArrayList(4)' which is a good average number for most allocations,
19243         and also requires only 16 bytes of memory for its buffer by
19244         default. 
19245
19246         This reduced MCS memory usage in seven megabytes for the RSS after
19247         bootstrapping.
19248
19249 2003-07-28  Ravi Pratap  <ravi@ximian.com>
19250
19251         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
19252         handle params methods the correct way by forming only one
19253         applicable set with params and normal methods in them. Earlier we
19254         were looking at params methods only if we found no normal methods
19255         which was not the correct thing to do.
19256
19257         (Invocation.BetterFunction): Take separate arguments indicating
19258         when candidate and the best method are params methods in their
19259         expanded form.
19260
19261         This fixes bugs #43367 and #46199.
19262
19263         * attribute.cs: Documentation updates.
19264
19265         (CheckAttribute): Rename to CheckAttributeTarget.
19266         (GetValidPlaces): Rename to GetValidTargets.
19267
19268         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
19269         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
19270
19271         Fixes bug #44468.
19272
19273 2003-07-28  Martin Baulig  <martin@ximian.com>
19274
19275         * class.cs (TypeContainer.DefineMembers): Use the base type's full
19276         name when looking up the base class of a nested class.  Fixes #46977.
19277
19278 2003-07-26  Martin Baulig  <martin@ximian.com>
19279
19280         * expression.cs (Indexers.Indexer): New nested struct; contains
19281         getter, setter and the indexer's type.
19282         (Indexers.Properties): This is now an ArrayList of
19283         Indexers.Indexer's.
19284         (IndexerAccess.DoResolveLValue): Correctly set the type if the
19285         indexer doesn't have any getters.
19286
19287         * assign.cs (Assign.DoResolve): Also do the implicit conversions
19288         for embedded property and indexer assignments.
19289
19290 2003-07-26  Martin Baulig  <martin@ximian.com>
19291
19292         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
19293         preprocessor directive is not the first non-whitespace character
19294         on a line.
19295
19296 2003-07-26  Martin Baulig  <martin@ximian.com>
19297
19298         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
19299         namespace parsing, follow the spec more closely.
19300
19301         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
19302         NamespaceEntry.Lookup().
19303
19304 2003-07-25  Martin Baulig  <martin@ximian.com>
19305
19306         * MethodCore.cs (OverridesSomething): New public field; it's set
19307         from TypeContainer.DefineMembers if this method overrides
19308         something (which doesn't need to be a method).  Fix #39462.
19309
19310 2003-07-25  Ravi Pratap  <ravi@ximian.com>
19311
19312         * typemanager.cs (GetMembers): Ensure that the list of members is
19313         reversed. This keeps things in sync.
19314
19315         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
19316         find an AttributeUsage attribute.
19317
19318         * expression.cs (Invocation.OverloadResolve): Perform the check
19319         which disallows Invoke to be directly called on a Delegate.
19320
19321         (Error_InvokeOnDelegate): Report error cs1533.
19322
19323 2003-07-25  Martin Baulig  <martin@ximian.com>
19324
19325         * expression.cs (Indexers.GetIndexersForType): Only look in the
19326         interface hierarchy if the requested type is already an
19327         interface.  Fixes #46788 while keeping #46502 fixed.
19328
19329 2003-07-25  Martin Baulig  <martin@ximian.com>
19330
19331         * class.cs (TypeContainer.DefineMembers): Check whether all
19332         readonly fields have been assigned and report warning CS0649 if
19333         not.
19334
19335         * statement.cs (LocalInfo.IsFixed): Always return true if this is
19336         a valuetype.
19337
19338 2003-07-24  Ravi Pratap  <ravi@ximian.com>
19339
19340         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
19341         returned from GetMethods to make things consistent with the
19342         assumptions MCS makes about ordering of methods.
19343
19344         This should comprehensively fix bug #45127 and it does :-)
19345
19346         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
19347         ordering is actually reverse.
19348
19349         * Clean up some debug messages I left lying around.
19350
19351         * interface.cs (Populate*): Get rid of code which emits attributes
19352         since the stage in which we emit attributes is the 'Emit' stage,
19353         not the define stage.
19354
19355         (Emit): Move attribute emission for interface members here.
19356
19357 2003-07-22  Ravi Pratap  <ravi@ximian.com>
19358
19359         * expression.cs (Invocation.OverloadResolve): Follow the spec more
19360         closely: we eliminate methods in base types when we have an
19361         applicable method in a top-level type.
19362
19363         Please see section 14.5.5.1 for an exact description of what goes
19364         on. 
19365
19366         This fixes bug #45127 and a host of other related to corlib compilation.
19367
19368         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
19369         array is the method corresponding to the top-level type (this is
19370         because of the changes made to icall.c) so we change this
19371         accordingly.
19372
19373         (MethodGroupExpr.Name): This too.
19374
19375         * typemanager.cs (GetElementType): New method which does the right
19376         thing when compiling corlib. 
19377
19378         * everywhere: Make use of the above in the relevant places.
19379
19380 2003-07-22  Martin Baulig  <martin@ximian.com>
19381
19382         * cs-parser.jay (invocation_expression): Moved
19383         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
19384         `cast_expression', but create a InvocationOrCast which later
19385         resolves to either an Invocation or a Cast.
19386
19387         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
19388         method; call this before EmitStatement() to make sure that this
19389         expression can be used as a statement.
19390
19391         * expression.cs (InvocationOrCast): New class; resolves to either
19392         an Invocation or a Cast.
19393
19394         * statement.cs (StatementExpression): Call ResolveStatement() on
19395         the ExpressionStatement before emitting it.
19396
19397 2003-07-21  Martin Baulig  <martin@ximian.com>
19398
19399         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
19400         `ref' and `out' attributes match; fixes #46220.
19401         (MemberAccess.ResolveMemberAccess): You can't reference a type
19402         through an expression; fixes #33180.
19403         (Indexers.GetIndexersForType): Don't return the indexers from
19404         interfaces the class implements; fixes #46502.
19405
19406 2003-07-21  Martin Baulig  <martin@ximian.com>
19407
19408         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
19409         CS0661 checks; fixes bug #30442.
19410
19411 2003-07-21  Martin Baulig  <martin@ximian.com>
19412
19413         * decl.cs (AdditionResult): Added `Error'.
19414
19415         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
19416
19417         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
19418         makes cs0031.cs actually work.
19419
19420 2003-07-20  Martin Baulig  <martin@ximian.com>
19421
19422         * namespace.cs: Fixed that bug which caused a crash when compiling
19423         the debugger's GUI.
19424
19425 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
19426
19427         * typemanager.cs (LookupTypeReflection): Never expose types which
19428         are NotPublic, NestedPrivate, NestedAssembly, or
19429         NestedFamANDAssem.  We used to return these, and later do a check
19430         that would report a meaningful error, but the problem is that we
19431         would not get the real match, if there was a name override.
19432
19433 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
19434
19435         * namespace.cs (Namespace, Name): Do not compute the namespace
19436         name dynamically, compute it in the constructor.  This reduced
19437         memory usage by 1697 KB.
19438
19439         * driver.cs: Use --pause to pause at the end.
19440
19441 2003-07-17  Peter Williams  <peter@newton.cx>
19442
19443         * Makefile: Change the name of the test target so that it doesn't
19444         conflict with the recursive test target.
19445
19446 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
19447
19448         * expression.cs (LocalVariableReference.Emit, EmitAssign,
19449         AddressOf): Do not use EmitThis, that was wrong, use the actual
19450         this pointer.
19451
19452 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
19453
19454         * class.cs (MethodData.Define): While checking if a method is an
19455         interface implementation, improve the test: If we are not public
19456         (use new test here: use the computed MethodAttributes directly,
19457         instead of the parsed modifier flags) check if the `implementing'
19458         method comes from an interface or not.
19459
19460         * pending.cs (VerifyPendingMethods): Slightly better error
19461         message.
19462
19463         * makefile: add test target that does the mcs bootstrap.
19464
19465 2003-07-16  Ravi Pratap  <ravi@ximian.com>
19466
19467         * interface.cs (Define): Do nothing here since there are no
19468         members to populate etc. Move the attribute emission out of here
19469         since this was just totally the wrong place to put it. Attribute
19470         application happens during the 'Emit' phase, not in the 'Define'
19471         phase.
19472
19473         (Emit): Add this method and move the attribute emission here
19474
19475         * rootcontext.cs (EmitCode): Call the Emit method on interface
19476         types too.
19477
19478 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
19479
19480         * expression.cs (OverloadResolve): Report error only if Location
19481         is not 'Null' which means that there was a probe going on.
19482
19483 2003-07-14  Martin Baulig  <martin@ximian.com>
19484
19485         * expression.cs (ConditionalLogicalOperator): New public class to
19486         implement user defined conditional logical operators.
19487         This is section 14.11.2 in the spec and bug #40505.
19488
19489 2003-07-14  Martin Baulig  <martin@ximian.com>
19490
19491         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
19492
19493 2003-07-14  Martin Baulig  <martin@ximian.com>
19494
19495         * codegen.cs (EmitContext.InFixedInitializer): New public field.
19496
19497         * ecore.cs (IVariable.VerifyFixed): New interface method.
19498
19499         * expression.cs (Unary.ResolveOperator): When resolving the `&'
19500         operator, check whether the variable is actually fixed.  Fixes bug
19501         #36055.  Set a variable definitely assigned when taking its
19502         address as required by the spec.
19503
19504         * statement.cs (LocalInfo.IsFixed): New field.
19505         (LocalInfo.MakePinned): Set `IsFixed' to true.
19506
19507 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
19508
19509         * attribute.cs (Attribute.Resolve): While doing a Member lookup
19510         for .ctors, ensure that we only ask for members declared in the
19511         attribute type (BindingFlags.DeclaredOnly).
19512
19513         Fixes bug #43632.
19514
19515         * expression.cs (Error_WrongNumArguments): Report error 1501
19516         correctly the way CSC does.
19517
19518 2003-07-13  Martin Baulig  <martin@ximian.com>
19519
19520         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
19521         lookup on the fully qualified name, to make things like "X.X" work
19522         where "X.X" is a fully qualified type name, but we also have a
19523         namespace "X" in the using list.  Fixes #41975.
19524
19525 2003-07-13  Martin Baulig  <martin@ximian.com>
19526
19527         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
19528         function. If we're a CompoundAssign, we need to create an embedded
19529         CompoundAssign, not an embedded Assign.
19530         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
19531         Fixes #45854.
19532
19533 2003-07-13  Martin Baulig  <martin@ximian.com>
19534
19535         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
19536         work to fix bug #46088.
19537
19538 2003-07-13  Ravi Pratap <ravi@ximian.com>
19539
19540         * class.cs (Operator.Emit): Do not emit attributes here - it is
19541         taken care of by the Method class that we delegate too. This takes
19542         care of bug #45876.
19543
19544 2003-07-10  Martin Baulig  <martin@ximian.com>
19545
19546         * expression.cs (TypeOfVoid): New class.
19547         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
19548
19549 2003-07-10  Martin Baulig  <martin@ximian.com>
19550
19551         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
19552         bug #35957.
19553
19554 2003-07-10  Martin Baulig  <martin@ximian.com>
19555
19556         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
19557         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
19558
19559         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
19560
19561         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
19562
19563 2003-07-10  Martin Baulig  <martin@ximian.com>
19564
19565         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
19566         of decimal.  Fixes #42850.
19567
19568         NOTE: I also fixed the created byte blob, but this doesn't work on
19569         the MS runtime and csc never produces any byte blobs for decimal
19570         arrays.
19571
19572 2003-07-10  Martin Baulig  <martin@ximian.com>
19573
19574         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
19575         structs; fixes #32068.
19576         (Block.AddChildVariableNames): Fixed #44302.
19577
19578 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19579
19580         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
19581
19582 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
19583
19584         * attribute.cs: And this test is onger needed.
19585
19586 2003-07-08  Martin Baulig  <martin@ximian.com>
19587
19588         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
19589         inaccessible types.  Fixes #36313.
19590
19591         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
19592
19593         * namespace.cs (NamespaceEntry): Create implicit entries for all
19594         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
19595         implicit entries for N1.N2 and N1.
19596
19597 2003-07-08  Martin Baulig  <martin@ximian.com>
19598
19599         Rewrote the handling of namespaces to fix a lot of the issues
19600         wrt. `using' aliases etc.
19601
19602         * namespace.cs (Namespace): Splitted this class into a
19603         per-assembly `Namespace' and a per-file `NamespaceEntry'.
19604
19605         * typemanager.cs (TypeManager.IsNamespace): Removed.
19606         (TypeManager.ComputeNamespaces): Only compute namespaces from
19607         loaded assemblies here, not the namespaces from the assembly we're
19608         currently compiling.
19609
19610 2003-07-08  Martin Baulig  <martin@ximian.com>
19611
19612         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
19613
19614 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
19615
19616         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
19617         already fixed it.  
19618
19619         I thought about the memory savings here, but LookupTypeReflection
19620         is used under already very constrained scenarios.  Compiling
19621         corlib or mcs only exposes one hit, so it would not really reduce
19622         any memory consumption.
19623
19624 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19625
19626         * typemanager.cs: fixes bug #45889 by only adding public types from
19627         other assemblies to the list of known types.
19628
19629 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
19630
19631         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
19632         on the type we resolved.
19633
19634 2003-07-05  Martin Baulig  <martin@ximian.com>
19635
19636         * pending.cs (PendingImplementation.ParentImplements): Don't
19637         create the proxy if the parent is abstract.
19638
19639         * class.cs (TypeContainer.DefineIndexers): Process explicit
19640         interface implementations first.  Fixes #37714.
19641
19642 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
19643
19644         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
19645         defined recursively;  but since we modify the input parameters
19646         (left is set to `this' temporarily), we reset this value if the
19647         left_is_explicit is false, which gives the original semantics to
19648         the code.  
19649
19650         * literal.cs (NullPointer): new class used to represent a null
19651         literal in a pointer context.
19652
19653         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
19654         type is a pointer, use a NullPointer object instead of a
19655         NullLiteral.   Closes 43687
19656
19657         (ExplicitConversion): Convert pointer values using
19658         the conv opcode to the proper type.
19659
19660         * ecore.cs (New): change ValueTypeVariable property into a method,
19661         that returns whether the valuetype is suitable for being used.
19662
19663         * expression.cs (Binary.DoNumericPromotions): Only return if we
19664         the int constant was a valid uint, and we can return both left and
19665         right as uints.  If not, we continue processing, to trigger the
19666         type conversion.  This fixes 39018.
19667
19668         * statement.cs (Block.EmitMeta): During constant resolution, set
19669         the CurrentBlock property on the emitcontext, so that we resolve
19670         constants propertly.
19671
19672 2003-07-02  Martin Baulig  <martin@ximian.com>
19673
19674         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
19675         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
19676
19677         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
19678         than emitting it here.
19679
19680         * statement.cs: Fixed some more flow analysis bugs.
19681
19682 2003-07-02  Martin Baulig  <martin@ximian.com>
19683
19684         * class.cs (MethodData.Define): When implementing interface
19685         methods, set Final unless we're Virtual.
19686
19687         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
19688         check work for interface methods.
19689
19690 2003-07-01  Martin Baulig  <martin@ximian.com>
19691
19692         * ecore.cs (EmitContext.This): Replaced this property with a
19693         GetThis() method which takes a Location argument.  This ensures
19694         that we get the correct error location for a CS0188.
19695
19696 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
19697
19698         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
19699         ImplicitStandardConversion.
19700
19701         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
19702
19703 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
19704
19705         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
19706         optimization.
19707
19708 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
19709
19710         * class.cs (Constructor.Define): Turn off initlocals for unsafe
19711         constructors.
19712
19713         (MethodData.Define): Turn off initlocals for unsafe methods.
19714
19715 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
19716
19717         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
19718         complete;  Fixes #37521.
19719
19720         * delegate.cs: Use Modifiers.TypeAttr to compute the
19721         TypeAttributes, instead of rolling our own.  This makes the flags
19722         correct for the delegates.
19723
19724 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
19725
19726         * class.cs (Constructor.Define): Set the private flag for static
19727         constructors as well.
19728
19729         * cs-parser.jay (statement_expression): Set the return value to
19730         null, to avoid a crash when we catch an error.
19731
19732 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
19733
19734         * cs-parser.jay: Applied patch from Jackson that adds support for
19735         extern and unsafe modifiers to destructor declarations.
19736
19737         * expression.cs: Report error 21 if the user is trying to index a
19738         System.Array.
19739
19740         * driver.cs: Add an error message, suggested by the bug report.
19741
19742         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
19743         if we do not have a ": this ()" constructor initializer.  Fixes 45149
19744
19745 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
19746
19747         * namespace.cs: Add some information to reduce FAQs.
19748
19749 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
19750
19751         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
19752         underlying enumeration types.  Fixes #43915.
19753
19754         * expression.cs: Treat ushort/short as legal values to be used in
19755         bitwise operations.
19756
19757 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
19758
19759         * delegate.cs: transfer custom attributes for paramenters from
19760         the delegate declaration to Invoke and BeginInvoke.
19761
19762 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
19763
19764         * attribute.cs: handle custom marshalers and emit marshal info
19765         for fields, too.
19766
19767 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
19768
19769         * makefile.gnu: Added anonymous.cs to the compiler sources.
19770
19771 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
19772
19773         * iterators.cs: Change the name of the proxy class to include two
19774         underscores.
19775
19776         * cs-parser.jay: Update grammar to include anonymous methods.
19777
19778         * anonymous.cs: new file.
19779
19780 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
19781
19782         * class.cs (Field.Define): Add missing test for pointers and
19783         safety. 
19784
19785 2003-05-27  Ravi Pratap  <ravi@ximian.com>
19786
19787         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
19788         we use the stobj opcode.
19789
19790         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
19791         since it wasn't the correct fix. 
19792
19793         It still is puzzling that we are required to use stobj for IntPtr
19794         which seems to be a ValueType.
19795
19796 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
19797
19798         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
19799         during regular simple name resolution.   Now, the trick is that
19800         instead of returning for processing the simplename, we do a
19801         TypeManager.LookupType (ie, a rooted lookup as opposed to a
19802         contextual lookup type).   If a match is found, return that, if
19803         not, return for further composition.
19804
19805         This fixes long-standing 30485.
19806
19807         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19808         using the address to initialize an object, do an Stobj instead of
19809         using the regular Stelem.
19810
19811         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
19812         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
19813         Because if we are a BaseIndexerAccess that value will be true.
19814         Fixes 43643.
19815
19816         * statement.cs (GotoCase.Resolve): Return after reporting an
19817         error, do not attempt to continue. 
19818
19819         * expression.cs (PointerArithmetic.Emit): If our operand is a
19820         long, convert our constants to match the operand before
19821         multiplying.  Convert to I type before adding.   Fixes 43670.
19822
19823 2003-05-14  Ravi Pratap  <ravi@ximian.com>
19824
19825         * enum.cs (ImplicitConversionExists) : Rename to
19826         ImplicitEnumConversionExists to remove ambiguity. 
19827
19828         * ecore.cs (NullCast): New type of cast expression class which
19829         basically is very similar to EmptyCast with the difference being
19830         it still is a constant since it is used only to cast a null to
19831         something else
19832         (eg. (string) null)
19833
19834         * convert.cs (ImplicitReferenceConversion): When casting a null
19835         literal, we return a NullCast.
19836
19837         * literal.cs (NullLiteralTyped): Remove - I don't see why this
19838         should be around anymore.
19839
19840         The renaming (reported was slightly wrong). Corrections:
19841
19842         ConvertImplicitStandard -> ImplicitConversionStandard
19843         ConvertExplicitStandard -> ExplicitConversionStandard
19844
19845         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
19846         before passing them in !
19847
19848         * convert.cs (ImplicitConversionStandard): When comparing for
19849         equal expr and target types, ensure that expr is not a
19850         NullLiteral.
19851
19852         In general, we must not be checking (expr_type ==
19853         target_type) in the top level conversion methods
19854         (ImplicitConversion, ExplicitConversion etc). This checking is
19855         done in the methods that they delegate to.
19856
19857 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
19858
19859         * convert.cs: Move Error_CannotConvertType,
19860         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
19861         ImplicitNumericConversion, ImplicitConversionExists,
19862         ImplicitUserConversionExists, StandardConversionExists,
19863         FindMostEncompassedType, FindMostSpecificSource,
19864         FindMostSpecificTarget, ImplicitUserConversion,
19865         ExplicitUserConversion, GetConversionOperators,
19866         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
19867         TryImplicitIntConversion, Error_CannotConvertImplicit,
19868         ConvertImplicitRequired, ConvertNumericExplicit,
19869         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
19870         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
19871         its own file.
19872
19873         Perform the following renames:
19874
19875         StandardConversionExists -> ImplicitStandardConversionExists
19876         ConvertImplicit -> ImplicitConversion
19877         ConvertImplicitStandard -> ImplicitStandardConversion
19878         TryImplicitIntConversion -> ImplicitIntConversion
19879         ConvertImplicitRequired -> ImplicitConversionRequired
19880         ConvertNumericExplicit -> ExplicitNumericConversion
19881         ConvertReferenceExplicit -> ExplicitReferenceConversion
19882         ConvertExplicit -> ExplicitConversion
19883         ConvertExplicitStandard -> ExplicitStandardConversion
19884
19885 2003-05-19  Martin Baulig  <martin@ximian.com>
19886
19887         * statement.cs (TypeInfo.StructInfo): Made this type protected.
19888         (TypeInfo): Added support for structs having structs as fields.
19889
19890         * ecore.cs (FieldExpr): Implement IVariable.
19891         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
19892         VariableInfo for the field.
19893
19894 2003-05-18  Martin Baulig  <martin@ximian.com>
19895
19896         * expression.cs (This.DoResolve): Report a CS0027 if we're
19897         emitting a field initializer.
19898
19899 2003-05-18  Martin Baulig  <martin@ximian.com>
19900
19901         * expression.cs (This.ResolveBase): New public function.
19902         (This.DoResolve): Check for CS0188.
19903
19904         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
19905         This.Resolve().
19906
19907         * ecore.cs (MethodGroupExpr.DoResolve): Set the
19908         `instance_expression' to null if we don't have any non-static
19909         methods.
19910
19911 2003-05-18  Martin Baulig  <martin@ximian.com>
19912
19913         Reworked the way how local variables and parameters are handled by
19914         the flow analysis code.
19915
19916         * statement.cs (TypeInfo, VariableMap): New public classes.
19917         (VariableInfo): New public class.  This is now responsible for
19918         checking whether a variable has been assigned.  It is used for
19919         parameters and local variables.
19920         (Block.EmitMeta): Take the InternalParameters as argument; compute
19921         the layout of the flow vectors here.
19922         (Block.LocalMap, Block.ParameterMap): New public properties.
19923         (FlowBranching): The .ctor doesn't get the InternalParameters
19924         anymore since Block.EmitMeta() now computes the layout of the flow
19925         vector.
19926         (MyStructInfo): This class is now known as `StructInfo' and nested
19927         in `TypeInfo'; we don't access this directly anymore.
19928
19929         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
19930         property and removed IsAssigned(), IsFieldAssigned(),
19931         SetAssigned() and SetFieldAssigned(); we now call them on the
19932         VariableInfo so we don't need to duplicate this code everywhere.
19933
19934         * expression.cs (ParameterReference): Added `Block block' argument
19935         to the .ctor.
19936         (LocalVariableReference, ParameterReference, This): The new
19937         VariableInfo class is now responsible for all the definite
19938         assignment stuff.
19939
19940         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
19941         IsParameterAssigned, SetParameterAssigned): Removed.
19942
19943 2003-05-18  Martin Baulig  <martin@ximian.com>
19944
19945         * typemanager.cs (InitCoreTypes): Try calling
19946         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
19947         the 3-args-version.  Corlib now also needs our `void_type'.
19948         (GetMethod): Added overloaded version which takes an optional
19949         `bool report_errors' to allow lookups of optional methods.
19950
19951 2003-05-12  Martin Baulig  <martin@ximian.com>
19952
19953         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
19954         only used for locals and not for parameters.
19955
19956 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
19957
19958         * support.cs (InternalParameters.ParameterType): Return the
19959         ExternalType of the parameter.
19960
19961         * parameter.cs (Parameter.ExternalType): drop the two arguments,
19962         they were unused.
19963
19964 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
19965
19966         * class.cs (MethodData.Define): Do not set the `newslot' on
19967         interface members, if they are also flagged as "override".
19968
19969         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
19970         better code for ++i and i++.  This only works for static fields
19971         and local variables.
19972
19973         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
19974         want to pull the DeclSpace out of the builder_to_declspace instead
19975         of the TypeBuilder (like in TypeContainer.FindMembers).
19976
19977         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
19978         instead of LookupTypeContainer.  Fixes the crash on .NET for
19979         looking up interface members.
19980
19981         * const.cs: Create our own emit context during the Definition
19982         stage, so that constants are evaluated in the proper context, when
19983         a recursive definition happens.
19984
19985 2003-05-11  Martin Baulig  <martin@ximian.com>
19986
19987         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
19988         new block for a switch section.
19989         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
19990         the adding/lookup in the switch block.  Fixes #39828.
19991
19992 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
19993
19994         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
19995         functionality: I needed to convert the data after I had performed
19996         the add/sub operation into the operands type size.
19997
19998         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
19999         pass the type for the box operation, otherwise the resulting
20000         object would have been of type object.
20001
20002         (BoxedCast): Add constructor to specify the type to box as.
20003
20004 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
20005
20006         * iterators.cs: I was reusing the `count' variable inadvertently,
20007         take steps to not allow this to happen.
20008
20009 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
20010
20011         * attribute.cs (Attribute.Resolve): Params attributes are encoded
20012         by creating an array at the point where the params starts and
20013         putting all those arguments there, then adjusting the size of the
20014         array.
20015
20016 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
20017
20018         * expression.cs (New.AddressOf): Implement interface
20019         IMemoryLocation.  This is used when the `new' operator is used in
20020         the context of an invocation to a method on a value type.
20021
20022         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
20023         example. 
20024
20025         * namespace.cs: Also check the using aliases here.
20026
20027         * driver.cs: Move the test for using validity after the types have
20028         been entered, so we do a single pass that also includes the using
20029         aliases. 
20030
20031         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
20032         in the regular case.   CreateSiblingForFinally is doing extra
20033         error checking.
20034
20035         * attribute.cs (GetAttributeArgumentExpression): Store the result
20036         on an out value, and use the return value to indicate failure
20037         instead of using null (which is a valid return for Constant.GetValue).
20038
20039         * statement.cs: Perform the analysis flow for the increment
20040         portion after the statement, because this will be the real flow of
20041         execution.  Fixes #42385
20042
20043         * codegen.cs (EmitContext.EmitArgument,
20044         EmitContext.EmitStoreArgument): New helper functions when the
20045         RemapToProxy flag is set.
20046
20047         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
20048         function.
20049
20050         Add support for remapping parameters. 
20051
20052         * iterators.cs: Propagate parameter values;  Store parameter
20053         values in the proxy classes.
20054
20055 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
20056
20057         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
20058         need a proxy reference;  I do not know what I was thinking
20059
20060         * cs-parser.jay (constructor_initializer): catch another error,
20061         and display nice message.
20062
20063         (field_declaration): catch void field declaration
20064         to flag a better error. 
20065
20066         * class.cs (MemberBase.CheckBase): Report an error instead of a
20067         warning if a new protected member is declared in a struct. 
20068         (Field.Define): catch the error of readonly/volatile.
20069
20070         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
20071
20072         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
20073         volatile variable is taken
20074
20075 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
20076
20077         * statement.cs (Fixed.Resolve): Report an error if we are not in
20078         an unsafe context.
20079
20080 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
20081
20082         * typemanager.cs: reuse the code that handles type clashes for
20083         delegates and enumerations.
20084
20085         * class.cs (Report28): Always report.
20086
20087         * expression.cs (EncodeAsAttribute): Allow nulls here.
20088
20089 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
20090
20091         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
20092         the functionality for testing whether an expression is valid for
20093         an attribute here.  Also handle the case of arrays of elements
20094         being stored. 
20095
20096         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
20097         encoding a linear array into an array of objects that are suitable
20098         to be passed to an CustomAttributeBuilder.
20099
20100         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
20101
20102         * ecore.cs: (FieldExpr): Handle field remapping here.
20103
20104         * iteratators.cs: Pass the instance variable (if the method is an
20105         instance method) to the constructors, so we can access the field
20106         variables on the class.
20107
20108         TODO: Test this with structs.  I think the THIS variable on
20109         structs might have to be a pointer, and not a refenrece
20110
20111 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
20112
20113         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
20114         local variables to fields in a proxy class.
20115
20116         * iterators.cs (PopulateProxy): Rename our internal fields to
20117         <XXX>.  
20118         Create a <THIS> field if we are an instance method, so we can
20119         reference our parent container variables.
20120         (MapVariable): Called back from the EmitContext code to enter a
20121         new variable to field mapping into the proxy class (we just create
20122         a FieldBuilder).
20123
20124         * expression.cs
20125         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
20126         for using the remapped locals to fields.
20127
20128         I placed the code here, because that gives the same semantics to
20129         local variables, and only changes the Emit code.
20130
20131         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
20132         statements inside iterators.
20133         (VariableInfo): Add a FieldBuilder for the cases when we are
20134         remapping local variables to fields in a proxy class
20135
20136         * ecore.cs (SimpleNameResolve): Avoid testing two times for
20137         current_block != null.
20138
20139         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
20140         not cope with strings, as it has been moved to the
20141         TableSwitchEmit.  Fixed bug in switch generation.
20142
20143         * expression.cs (New.DoResolve): Provide more context for the user
20144         when reporting an error.
20145
20146         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
20147         pointers. 
20148
20149         * expression.cs (MemberAccess.DoResolve): When we get a type back,
20150         check the permissions for it.  Note than in a type-resolution
20151         context the check was already present in DeclSpace.ResolveType,
20152         but was missing from the MemberAccess.
20153
20154         (ArrayCreation.CheckIndices): warn if the user has
20155         more nested levels of expressions, but there are no more
20156         dimensions specified.  Avoids crash on bug 41906.
20157
20158 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
20159
20160         * statement.cs (Block): replace Implicit bool, for a generic
20161         flags.   
20162         New flag: `Unchecked'.  This is used during the EmitMeta phase
20163         (which is out-of-line with the regular Resolve/Emit process for a
20164         statement, as this is done ahead of time, but still gets a chance
20165         to call constant resolve).
20166
20167         (Block.Flags): new enum for adding a new flag.
20168
20169         (Block.EmitMeta): track the state of unchecked.
20170
20171         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
20172         to enable constant resolution to work there as well.
20173
20174 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
20175
20176         * typemanager.cs (ienumerable_type): Also look up
20177         System.Collections.IEnumerable. 
20178
20179 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
20180
20181         TODO: Test more than one conditional per method.
20182
20183         * class.cs (Indexer.Define): Report the location where the user is
20184         referencing the unsupported feature.
20185
20186         (MethodData): Overload the use of `conditionals' to
20187         minimize the creation of needless ArrayLists.   This saves roughly
20188         212kb on my machine.
20189
20190         (Method): Implement the new IIteratorContainer interface.
20191         (Method.SetYields): Implement the method by setting the ModFlags
20192         to contain METHOD_YIELDS.
20193
20194         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
20195         which just got set to null.
20196
20197         * iterators.cs: New file.
20198
20199         (Yield, YieldBreak): New statements.
20200
20201         * statement.cs (Return.Resolve): Flag an error if we are used in
20202         an iterator method.
20203
20204         * codegen.cs (InIterator): New flag set if the code is being
20205         compiled in an iterator method.
20206
20207         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
20208         internal modifier, and we just use it to avoid adding extra
20209         fields, as this is seldom used.  
20210
20211         * cs-parser.jay: Add yield_statement (yield and yield break).
20212
20213         * driver.cs: New flag -v2 to turn on version 2 features. 
20214
20215         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
20216         hashtable when v2 is enabled.
20217
20218 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
20219
20220         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
20221         there is already a namespace defined with this name.
20222
20223         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
20224         people upgraded their corlibs.
20225
20226         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
20227         always use fully qualified types, no need to use the compiler
20228         front end.
20229
20230         (TypeManager.IsNamespace): Use binarysearch.
20231
20232         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
20233         AddDelegate): I did not quite use the new IsValid API properly: I
20234         have to pass the short-name and the fullname.  I was passing only
20235         the basename instead of the fullname sometimes. 
20236
20237         (TypeContainer.DefineType): call NamespaceClash.
20238
20239         * interface.cs (Interface.DefineType): use NamespaceClash before
20240         defining the type.
20241
20242         * delegate.cs (Delegate.DefineType): use NamespaceClash before
20243         defining the type.
20244
20245         * enum.cs: (Enum.DefineType): use NamespaceClash before
20246         defining the type.
20247
20248         * typemanager.cs (: 3-line patch that gives us some tasty 11%
20249         speed increase.  First, use the negative_hits cache when we get a
20250         negative.  Second, add the type with its full original name
20251         instead of the new . and + encoded name (reflection uses + to
20252         separate type from a nested type).  Use LookupTypeReflection
20253         directly which bypasses the type->name hashtable (that we already
20254         know does not contain the type.
20255
20256         * decl.cs (DeclSpace.ResolveTypeExpr): track the
20257         location/container type. 
20258
20259         * driver.cs: When passing utf8, use directly the UTF8Encoding.
20260
20261 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
20262
20263         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
20264
20265         * delegate.cs (NewDelegate.Resolve): Test whether an instance
20266         method is being referenced in the method group from a static
20267         context, and report error 120 if so.
20268
20269         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
20270         Error118. 
20271
20272         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
20273         is created, we create the A namespace).
20274
20275         * cs-parser.jay: A namespace also introduces a DeclarationFound.
20276         Fixes #41591
20277
20278 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
20279
20280         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
20281         invocation to ModuleBuilder.GetType with the same values will
20282         return a new type instance, so we need to cache its return
20283         values. 
20284
20285         * expression.cs (Binary.ResolveOperator): Only allow the compare
20286         operators on enums if they are of the same type.
20287
20288         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
20289         types of ValueType on their own case.  Before we were giving them
20290         the same treatment as objects.
20291
20292         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
20293         fullname.  Short name is used to compare against container name.
20294         Fullname is used to check against defined namespace names.
20295
20296         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
20297         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
20298
20299         (Method.CheckBase): Call parent.
20300         (MemberBase.CheckBase): Check for protected members on sealed
20301         classes.
20302         (PropertyBase.CheckBase): Call parent.
20303         (Field.Define): Call parent.
20304
20305         * report.cs: Negative error codes are now mapped to 8000 - code,
20306         so that the display is render more nicely.
20307
20308         * typemanager.cs: Do not use try/catch, instead report a regular
20309         error. 
20310
20311         (GetPointerType, GetReferenceType): These methods provide
20312         mechanisms to obtain the T* and T& from a T.  We had the code
20313         previously scattered around the code base, and it also used
20314         TypeManager.LookupType that would go through plenty of caches.
20315         This one goes directly to the type source.
20316
20317         In some places we did the Type.GetType followed by
20318         ModuleBuilder.GetType, but not in others, so this unifies the
20319         processing as well.
20320
20321         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
20322         statements now that we have namespace information.
20323
20324         * typemanager.cs (IsNamespace): New method, returns whether the
20325         string presented is a namespace or not.
20326
20327         (ComputeNamespaces): New public entry point, computes the list of
20328         available namespaces, using the GetNamespaces API call in Mono, or
20329         the slower version in MS.NET.   
20330
20331         Now before we start the semantic analysis phase, we have a
20332         complete list of namespaces including everything that the user has
20333         provided.
20334
20335         Deleted old code to cache namespaces in .nsc files.
20336
20337 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
20338
20339         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
20340         class/struct location definition Location for the implicit
20341         constructor location.
20342
20343         (Operator.Define): Use the location of the operator for the
20344         implicit Method definition.
20345
20346         (Constructor.Emit): use the constructor location for the implicit
20347         base initializer constructor.
20348
20349         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
20350         and the Expression class now contains two new methods:
20351
20352         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
20353         isolate type lookup from the rest of the resolution process.
20354
20355         Since we use Expressions to hold type definitions due to the way
20356         we parse the input we have historically overloaded Resolve to
20357         perform the Type lookups if a special flag is passed.  Now this is
20358         eliminated and two methods take their place. 
20359
20360         The differences in the two methods between xStep and xTerminal is
20361         that xStep is involved in our current lookup system that uses
20362         SimpleNames to compose a name, while xTerminal is used just to
20363         catch the case where the simplename lookup failed.
20364
20365 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
20366
20367         * expression.cs (ResolveMemberAccess): Remove redundant code.
20368         TypeExpr expressions are always born fully resolved.
20369
20370         * interface.cs (PopulateMethod): Do not lookup the types twice.
20371         We were doing it once during SemanticAnalysis and once during
20372         PopulateMethod.
20373
20374         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
20375         in local variable type definitions, were being returned as a
20376         SimpleName (we decomposed everything into a string), that is
20377         because primary_expression was being used instead of a type in the
20378         grammar (reduce/reduce conflicts).
20379
20380         The part that was wrong is that we converted the expression into a
20381         string (an oversimplification in one hand, compounded with primary
20382         expressions doing string concatenation).
20383
20384         So things like:
20385
20386         A.B.C [] x;
20387
20388         Would return "A.B.C[]" as a SimpleName.  This stopped things like
20389         using clauses from working on this particular context.  And a type
20390         was being matched directly against "A.B.C[]".
20391
20392         We now use the correct approach, and allow for ComposedCast to be
20393         part of the unary expression.  So the "A.B.C []" become a composed
20394         cast of "A.B.C" (as a nested group of MemberAccess with a
20395         SimpleName at the end) plus the rank composition "[]". 
20396
20397         Also fixes 35567
20398
20399 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
20400
20401         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
20402         for the access level checking.
20403
20404         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
20405         `TypeContainer container', because I kept getting confused when I
20406         was debugging this code.
20407
20408         * expression.cs (Indexers): Instead of tracking getters/setters,
20409         we now track them in parallel.  We create one arraylist less, but
20410         most importantly it is possible now for the LValue code to find a
20411         matching get for a set.
20412
20413         (IndexerAccess.DoResolveLValue): Update the code.
20414         GetIndexersForType has been modified already to extract all the
20415         indexers from a type.  The code assumed it did not.
20416
20417         Also make the code set the correct return type for the indexer.
20418         This was fixed a long time ago for properties, but was missing for
20419         indexers.  It used to be void_type.
20420
20421         (Binary.Emit): Test first for doubles instead of
20422         floats, as they are more common.
20423
20424         (Binary.EmitBranchable): Use the .un version of the branch opcodes
20425         when dealing with floats and the <=, >= operators.  This fixes bug
20426         #39314 
20427
20428         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
20429         to load the array value by emitting a load on the foreach variable
20430         type.  This was incorrect.  
20431
20432         We now emit the code to load an element using the the array
20433         variable type, and then we emit the conversion operator.
20434
20435         Fixed #40176
20436
20437 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
20438
20439         * attribute.cs: Avoid allocation of ArrayLists in the common case.
20440
20441 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
20442
20443         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
20444         test for protection before we test for signatures. 
20445
20446         (MethodSignature.ToString): implement.
20447
20448         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
20449         to the case where we reduced into a LongConstant.
20450
20451         * decl.cs (CheckAccessLevel): If the type is an array, we can not
20452         depend on whether the information is acurrate, because the
20453         Microsoft runtime will always claim that the array type is public,
20454         regardless of the real state.
20455
20456         If the type is a pointer, another problem happens: the type is
20457         reported as non-public in Microsoft.  
20458
20459         In both cases we have to call CheckAccessLevel recursively with
20460         the underlying type as the argument to be tested.
20461
20462 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
20463
20464         * assign.cs (Assign.Emit): If we are dealing with a compound
20465         assignment expression, we should use the code path that stores the
20466         intermediate result in a temporary value.  This fixes #40903.
20467
20468         *expression.cs (Indirection.ToString): Provide ToString method for
20469         debugging. 
20470
20471 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
20472
20473         * class.cs: Null out fields holding references to Block objects so
20474         they can be garbage collected.
20475
20476         * expression.cs (OverloadResolve): Remove unused local.
20477
20478 2003-04-07  Martin Baulig  <martin@ximian.com>
20479
20480         * codegen.cs (EmitContext.CurrentFile): New public field.
20481         (EmitContext.Mark): Use the CurrentFile to check whether the
20482         location is in the correct file.
20483         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
20484
20485 2003-04-07  Martin Baulig  <martin@ximian.com>
20486
20487         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
20488
20489         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
20490         location.  [FIXME: The location argument which gets passed to this
20491         method is sometimes wrong!]
20492
20493 2003-04-07  Nick Drochak <ndrochak@gol.com>
20494
20495         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
20496
20497 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
20498
20499         * expression.cs (Indirection.EmitAssign): We were using the
20500         temporary, but returning immediately instead of continuing the
20501         EmitAssing flow.
20502
20503 2003-04-06  Martin Baulig  <martin@ximian.com>
20504
20505         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
20506         if it's a nested child, but also deriving from the outer class.
20507         See test 190.cs.
20508
20509         * typemanager.cs (IsNestedChildOf): Make this work if it's a
20510         nested child, but also deriving from the outer class.  See
20511         test-190.cs.
20512         (FilterWithClosure): We may access private members of the outer
20513         class if we're a nested child and deriving from the outer class.
20514         (RealMemberLookup): Only set `closure_private_ok' if the
20515         `original_bf' contained BindingFlags.NonPublic.
20516
20517 2003-04-05  Martin Baulig  <martin@ximian.com>
20518
20519         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
20520
20521 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
20522
20523         * class.cs (Event.Define): Do not allow abstract events to have
20524         initializers. 
20525
20526 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
20527
20528         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
20529         block in event declarations.
20530
20531         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
20532         value type, get its address.
20533
20534         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
20535         leaving a class on the stack instead of a boolean value (int
20536         0/1).  Change the code so we compare against null, and then the
20537         result against zero.
20538
20539         * class.cs (TypeContainer.GetClassBases): We were checking for the
20540         parent class being sealed too late.
20541
20542         * expression.cs (Binary.Emit): For <= and >= when dealing with
20543         floating point values, use cgt.un and clt.un instead of cgt and
20544         clt alone.
20545
20546 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
20547
20548         * statement.cs: Apply the same optimization as MS: skip the 
20549         GetEnumerator returning an IEnumerator, and use the one returning a 
20550         CharEnumerator instead. This allows us to avoid the try-finally block 
20551         and the boxing.
20552
20553 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
20554
20555         * cs-parser.jay: Attributes cannot be applied to
20556                          namespaces. Fixes #40473
20557
20558 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20559
20560         * class.cs:
20561         (Add*): check if the name is valid using the full name for constants,
20562         fields, properties and events.
20563
20564 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
20565
20566         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
20567         char constants to be part of the enumeration.
20568
20569         * expression.cs (Conditional.DoResolve): Add support for operator
20570         true. Implements the missing functionality from 14.12
20571
20572         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
20573         operator true/false as required by the spec.
20574
20575         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
20576         implicit conversion to boolean.
20577
20578         * statement.cs (Statement.ResolveBoolean): A boolean expression is
20579         also one where the type implements `operator true'. 
20580
20581         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
20582         get an expression that will invoke operator true based on an
20583         expression.  
20584
20585         (GetConversionOperators): Removed the hack that called op_True
20586         here.  
20587
20588         (Expression.ResolveBoolean): Move this from Statement.
20589
20590 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
20591
20592         * ecore.cs (FieldExpr): do not allow initialization of initonly
20593         fields on derived classes
20594
20595 2003-03-13  Martin Baulig  <martin@ximian.com>
20596
20597         * statement.cs (Block.Emit): Call ig.BeginScope() and
20598         ig.EndScope() when compiling with debugging info; call
20599         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
20600
20601 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
20602
20603         * expression.cs (Indexers): Do not construct immediately, allow
20604         for new members to be appended as we go.  Fixes 38143
20605
20606 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20607
20608         * expression.cs: save/restore context when resolving an unchecked
20609         expression.
20610
20611 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
20612
20613         * cfold.cs: Catch division by zero in modulus operator during
20614         constant folding.
20615
20616 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
20617
20618         * interface.cs (Interface.DefineMembers): Avoid defining members
20619         twice. 
20620
20621 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
20622
20623         * driver.cs: handle the +/- options for -noconfig
20624
20625         * statement.cs (Unckeched.Resolve): Also track the state of
20626         unchecked in the Resolve phase.
20627
20628 2003-02-27  Martin Baulig  <martin@ximian.com>
20629
20630         * ecore.cs (Expression.MemberLookup): Don't create a
20631         MethodGroupExpr for something which is not a method.  Fixes #38291.
20632
20633 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
20634
20635         * class.cs (MemberBase.CheckParameters): Also check that the type
20636         is unmanaged if it is a pointer.
20637
20638         * expression.cs (SizeOf.Resolve): Add location information.
20639
20640         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
20641         a managed type is declared.
20642
20643         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
20644         parameter modifiers as well.  Fixes bug 38606
20645
20646         * class.cs: Very sad.  Am backing out the speed up changes
20647         introduced by the ArrayList -> Array in the TypeContainer, as they
20648         were not actually that much faster, and introduced a bug (no error
20649         reports on duplicated methods).
20650
20651         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
20652         source first, this will guarantee that we have a valid expression
20653         before calling in lower levels functions that will require a
20654         resolved object.  Then use this original_source in the
20655         target.ResolveLValue instead of the original source that was
20656         passed to us.
20657
20658         Another change.  Use target.Resolve instead of LValueResolve.
20659         Although we are resolving for LValues, we will let the Assign code
20660         take care of that (it will be called again from Resolve).  This
20661         basically allows code like this:
20662
20663         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
20664         class Y { void A (X x) { x [0] += o; }
20665
20666         The problem was that the indexer was trying to resolve for
20667         set_Item (idx, object o) and never finding one.  The real set_Item
20668         was set_Item (idx, X).  By delaying the process we get the right
20669         semantics. 
20670
20671         Fixes bug 36505
20672
20673 2003-02-23  Martin Baulig  <martin@ximian.com>
20674
20675         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
20676         while calling DoEmit ().
20677
20678         * codegen.cs (EmitContext.Mark): Don't mark locations in other
20679         source files; if you use the #line directive inside a method, the
20680         compiler stops emitting line numbers for the debugger until it
20681         reaches the end of the method or another #line directive which
20682         restores the original file.
20683
20684 2003-02-23  Martin Baulig  <martin@ximian.com>
20685
20686         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
20687
20688 2003-02-23  Martin Baulig  <martin@ximian.com>
20689
20690         * statement.cs (Block.AddChildVariableNames): We need to call this
20691         recursively, not just for our immediate children.
20692
20693 2003-02-23  Martin Baulig  <martin@ximian.com>
20694
20695         * class.cs (Event.Define): Always make the field private, like csc does.
20696
20697         * typemanager.cs (TypeManager.RealMemberLookup): Make events
20698         actually work, fixes bug #37521.
20699
20700 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
20701
20702         * delegate.cs: When creating the various temporary "Parameters"
20703         classes, make sure that we call the ComputeAndDefineParameterTypes
20704         on those new parameters (just like we do with the formal ones), to
20705         allow them to be resolved in the context of the DeclSpace.
20706
20707         This fixes the bug that Dick observed in Bugzilla #38530.
20708
20709 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
20710
20711         * expression.cs (ResolveMemberAccess): When resolving a constant,
20712         do not attempt to pull a constant if the value was not able to
20713         generate a valid constant.
20714
20715         * const.cs (LookupConstantValue): Do not report more errors than required.
20716
20717 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20718
20719         * expression.cs: fixes bug #38328.
20720
20721 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
20722
20723         * class.cs: Changed all the various members that can be part of a
20724         class from being an ArrayList to be an Array of the right type.
20725         During the DefineType type_list, interface_list, delegate_list and
20726         enum_list are turned into types, interfaces, delegates and enums
20727         arrays.  
20728
20729         And during the member population, indexer_list, event_list,
20730         constant_list, field_list, instance_constructor_list, method_list,
20731         operator_list and property_list are turned into their real arrays.
20732
20733         Although we could probably perform this operation earlier, for
20734         good error reporting we need to keep the lists and remove the
20735         lists for longer than required.
20736
20737         This optimization was triggered by Paolo profiling the compiler
20738         speed on the output of `gen-sample-program.pl' perl script. 
20739
20740         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
20741         not crash in methods like MemberLookupFailed that use this field.  
20742
20743         This problem arises when the compiler fails to resolve a type
20744         during interface type definition for example.
20745
20746 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
20747
20748         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
20749         inherit from System.Object, so we have to stop at null, not only
20750         when reaching System.Object.
20751
20752 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
20753
20754         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
20755         DeclaredOnly because the parent indexer might have had a different
20756         name, but did not loop until the top of the hierarchy was reached.
20757
20758         The problem this one fixes is 35492: when a class implemented an
20759         indexer from an interface, we were getting the interface method
20760         (which was abstract) and we were flagging an error (can not invoke
20761         abstract method).
20762
20763         This also keeps bug 33089 functioning, and test-148 functioning.
20764
20765         * typemanager.cs (IsSpecialMethod): The correct way of figuring
20766         out if a method is special is to see if it is declared in a
20767         property or event, or whether it is one of the predefined operator
20768         names.   This should fix correctly #36804.
20769
20770 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
20771
20772         The goal here is to remove the dependency on EmptyCast.Peel ().
20773         Killing it completely.
20774
20775         The problem is that currently in a number of places where
20776         constants are expected, we have to "probe" for an EmptyCast, and
20777         Peel, which is not the correct thing to do, as this will be
20778         repetitive and will likely lead to errors. 
20779
20780         The idea is to remove any EmptyCasts that are used in casts that
20781         can be reduced to constants, so we only have to cope with
20782         constants. 
20783
20784         This bug hunt was triggered by Bug 37363 and the desire to remove
20785         the duplicate pattern where we were "peeling" emptycasts to check
20786         whether they were constants.  Now constants will always be
20787         constants.
20788
20789         * ecore.cs: Use an enumconstant here instead of wrapping with
20790         EmptyCast.  
20791
20792         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
20793         throwing me off.  By handling this we can get rid of a few hacks.
20794
20795         * statement.cs (Switch): Removed Peel() code.
20796
20797 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
20798
20799         * class.cs: Location information for error 508
20800
20801         * expression.cs (New.DoResolve): Add a guard against double
20802         resolution of an expression.  
20803
20804         The New DoResolve might be called twice when initializing field
20805         expressions (see EmitFieldInitializers, the call to
20806         GetInitializerExpression will perform a resolve on the expression,
20807         and later the assign will trigger another resolution
20808
20809         This leads to bugs (#37014)
20810
20811         * delegate.cs: The signature for EndInvoke should contain any ref
20812         or out parameters as well.  We were not doing this in the past. 
20813
20814         * class.cs (Field.Define): Do not overwrite the type definition
20815         inside the `volatile' group.  Turns out that volatile enumerations
20816         were changing the type here to perform a validity test, which
20817         broke conversions. 
20818
20819 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
20820
20821         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
20822         and structs, we do not want to load the instance variable
20823
20824         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
20825         enum_type has to be handled like an object reference (implicit
20826         conversions exists from this to object), but the regular IsClass
20827         and IsValueType tests will never return true for this one.
20828
20829         Also we use TypeManager.IsValueType instead of type.IsValueType,
20830         just for consistency with the rest of the code (this is only
20831         needed if we ever use the construct exposed by test-180.cs inside
20832         corlib, which we dont today).
20833
20834 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
20835
20836         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
20837         just InternalCall.
20838
20839 2003-02-09  Martin Baulig  <martin@ximian.com>
20840
20841         * namespace.cs (Namespace..ctor): Added SourceFile argument.
20842         (Namespace.DefineNamespaces): New static public method; this is
20843         called when we're compiling with debugging to add all namespaces
20844         to the symbol file.
20845
20846         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
20847         pass it to the Namespace's .ctor.
20848
20849         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
20850         and MethodBase arguments; pass the namespace ID to the symwriter;
20851         pass the MethodBase instead of the token to the symwriter.
20852         (SymbolWriter.DefineNamespace): New method to add a namespace to
20853         the symbol file.
20854
20855 2003-02-09  Martin Baulig  <martin@ximian.com>
20856
20857         * symbolwriter.cs: New file.  This is a wrapper around
20858         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
20859         methods here in near future.
20860
20861 2003-02-09  Martin Baulig  <martin@ximian.com>
20862
20863         * codegen.cs (EmitContext.Mark): Just pass the arguments to
20864         ILGenerator.MarkSequencePoint() which are actually used by the
20865         symbol writer.
20866
20867 2003-02-09  Martin Baulig  <martin@ximian.com>
20868
20869         * location.cs (SourceFile): New public sealed class.  This
20870         contains the name and an index which is used in the location's token.
20871         (Location): Reserve an appropriate number of bits in the token for
20872         the source file instead of walking over that list, this gives us a
20873         really huge performance improvement when compiling with debugging.
20874
20875         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
20876         `SourceFile' argument instead of a string.
20877         (Driver.ProcessFile): Add all the files via Location.AddFile(),
20878         but don't parse/tokenize here, we need to generate the list of all
20879         source files before we do that.
20880         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
20881         the files.
20882
20883         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
20884         instead of a string.
20885
20886         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
20887         of a string.
20888
20889 2003-02-09  Martin Baulig  <martin@ximian.com>
20890
20891         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
20892         filename on `#line default'.
20893
20894 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
20895
20896         * statement.cs: don't clear the pinned var when the fixed statement
20897         returns from the method (fixes bug#37752).
20898
20899 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
20900
20901         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
20902         to IsValueType.
20903
20904 2003-02-07  Martin Baulig  <martin@ximian.com>
20905
20906         * driver.cs: Removed the `--debug-args' command line argument.
20907
20908         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
20909         automatically by the AsssemblyBuilder.
20910         (CodeGen.InitializeSymbolWriter): We don't need to call any
20911         initialization function on the symbol writer anymore.  This method
20912         doesn't take any arguments.
20913
20914 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
20915
20916         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
20917         from referenced assemblies as well.
20918
20919 2003-02-02  Martin Baulig  <martin@ximian.com>
20920
20921         * class.cs (MethodData.Emit): Generate debugging info for external methods.
20922
20923 2003-02-02  Martin Baulig  <martin@ximian.com>
20924
20925         * class.cs (Constructor.Emit): Open the symbol writer before
20926         emitting the constructor initializer.
20927         (ConstructorInitializer.Emit): Call ec.Mark() to allow
20928         single-stepping through constructor initializers.
20929
20930 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
20931
20932         * class.cs: Handle error 549: do not allow virtual methods in
20933         sealed classes. 
20934
20935 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
20936
20937         * decl.cs: Check access levels when resolving types
20938
20939 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
20940
20941         * statement.cs: Add parameters and locals set in catch blocks that might 
20942         return to set vector
20943
20944 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
20945
20946         * class.cs (Operator): Set the SpecialName flags for operators.
20947
20948         * expression.cs (Invocation.DoResolve): Only block calls to
20949         accessors and operators on SpecialName methods.
20950
20951         (Cast.TryReduce): Handle conversions from char constants.
20952
20953
20954 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
20955
20956         * statement.cs: small memory and time optimization in FlowBranching.
20957
20958 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
20959
20960         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
20961         problem that the last fix but in the other sid (Set).
20962
20963         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
20964         access when there is no indexer in the hierarchy.
20965
20966 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
20967
20968         * class.cs: Combine some if statements.
20969
20970 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20971
20972         * driver.cs: fixed bug #37187.
20973
20974 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
20975
20976         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
20977         any indexer, it's needed to build a list with all the indexers in the
20978         hierarchy (AllGetters), else we have problems. Fixes #35653.
20979
20980 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
20981
20982         * class.cs (MethodData.Define): It is wrong for an interface
20983         implementation to be static in both cases: explicit and implicit.
20984         We were only handling this in one case.
20985
20986         Improve the if situation there to not have negations.
20987
20988         * class.cs (Field.Define): Turns out that we do not need to check
20989         the unsafe bit on field definition, only on usage.  Remove the test.
20990
20991 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20992
20993         * driver.cs: use assembly.Location instead of Codebase (the latest
20994         patch made mcs fail when using MS assemblies).
20995
20996 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
20997
20998         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
20999         get the path to *corlib.dll.
21000
21001 2003-01-21  Nick Drochak <ndrochak@gol.com>
21002
21003         * cs-tokenizer.cs:
21004         * pending.cs:
21005         * typemanager.cs: Remove compiler warnings
21006
21007 2003-01-20  Duncan Mak  <duncan@ximian.com>
21008
21009         * AssemblyInfo.cs: Bump the version number to 0.19.
21010
21011 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21012
21013         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
21014
21015 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
21016
21017         * class.cs (Constructor::Emit): Emit debugging info for constructors.
21018
21019 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
21020
21021         * cs-parser.jay: Small fix: we were not comparing the constructor
21022         name correctly.   Thanks to Zoltan for the initial pointer.
21023
21024 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
21025
21026         * cs-tokenizer.cs: Set file name when specified with #line
21027
21028 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
21029
21030         * cs-parser.jay: Only perform the constructor checks here if we
21031         are named like the class;  This will help provider a better
21032         error.  The constructor path is taken when a type definition is
21033         not found, but most likely the user forgot to add the type, so
21034         report that rather than the constructor error.
21035
21036 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
21037
21038         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
21039         allocations.
21040
21041 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21042
21043         * cs-parser.jay: Add cleanup call.
21044
21045 2003-01-13  Duncan Mak  <duncan@ximian.com>
21046
21047         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
21048         consistent with other methods.
21049
21050 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21051
21052         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
21053
21054 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
21055
21056         * attribute.cs: only set GuidAttr to true when we have a
21057         GuidAttribute.
21058
21059 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21060
21061         * ecore.cs:
21062         * expression.cs:
21063         * typemanager.cs: fixes to allow mcs compile corlib with the new
21064         Type.IsSubclassOf fix.
21065
21066 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
21067
21068         * expression.cs (LocalVariableReference.DoResolve): Classify a
21069         constant as a value, not as a variable.   Also, set the type for
21070         the variable.
21071
21072         * cs-parser.jay (fixed_statement): take a type instead of a
21073         pointer_type, so we can produce a better error message later.
21074
21075         * statement.cs (Fixed.Resolve): Flag types that are not pointers
21076         as an error.  
21077
21078         (For.DoEmit): Make inifinite loops have a
21079         non-conditional branch back.
21080
21081         (Fixed.DoEmit): First populate the pinned variables, then emit the
21082         statement, then clear the variables.  Before I was emitting the
21083         code once for each fixed piece.
21084
21085
21086 2003-01-08  Martin Baulig  <martin@ximian.com>
21087
21088         * statement.cs (FlowBranching.MergeChild): A break in a
21089         SWITCH_SECTION does not leave a loop.  Fixes #36155.
21090
21091 2003-01-08  Martin Baulig  <martin@ximian.com>
21092
21093         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
21094         lives in the same number space than `param_map'.  Fixes #36154.
21095
21096 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
21097
21098         * cs-parser.jay (constructor_declaration): Set the
21099         Constructor.ModFlags before probing for it.  This makes the
21100         compiler report 514, 515 and 132 (the code was there, but got
21101         broken). 
21102
21103         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
21104         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
21105         (GotoCase.Resolve): Set `Returns' to ALWAYS.
21106
21107 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
21108
21109         * enum.cs: create the enum static fields using the enum type.
21110
21111 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
21112
21113         * class.cs: don't try to create the ParamBuilder for the return
21114         type if it's not needed (and handle it breaking for the ms runtime
21115         anyway).
21116
21117 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
21118
21119         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
21120
21121 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
21122
21123         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
21124         the command.   This showed up while compiling the JANET source
21125         code, which used \r as its only newline separator.
21126
21127 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
21128
21129         * class.cs (Method.Define): If we are an operator (because it
21130         reuses our code), then set the SpecialName and HideBySig.  #36128
21131
21132 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
21133
21134         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
21135         exception, report error 120 `object reference required'.
21136
21137         * driver.cs: Add --pause option, used during to measure the size
21138         of the process as it goes with --timestamp.
21139
21140         * expression.cs (Invocation.DoResolve): Do not allow methods with
21141         SpecialName to be invoked.
21142
21143 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
21144
21145         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
21146         number before adding it.
21147
21148 2002-12-21  Ravi Pratap  <ravi@ximian.com>
21149
21150         * ecore.cs (StandardImplicitConversion): When in an unsafe
21151         context, we allow conversion between void * to any other pointer
21152         type. This fixes bug #35973.
21153
21154 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
21155
21156         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
21157         is not thrown when extensionless outputs are used 
21158
21159 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21160
21161         * rootcontext.cs: fixed compilation of corlib.
21162
21163 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
21164
21165         * attribute.cs (Attributes.Contains): Add new method.
21166
21167         * class.cs (MethodCore.LabelParameters): if the parameter is an
21168         `out' parameter, check that no attribute `[In]' has been passed.
21169
21170         * enum.cs: Handle the `value__' name in an enumeration.
21171
21172 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
21173
21174         * decl.cs: Added special case to allow overrides on "protected
21175         internal" methods
21176
21177 2002-12-18  Ravi Pratap  <ravi@ximian.com>
21178
21179         * attribute.cs (Attributes.AddAttributeSection): Rename to this
21180         since it makes much more sense.
21181
21182         (Attributes.ctor): Don't require a Location parameter.
21183
21184         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
21185
21186         * attribute.cs (ApplyAttributes): Remove extra Location parameters
21187         since we already have that information per attribute.
21188
21189         * everywhere : make appropriate changes.
21190
21191         * class.cs (LabelParameters): Write the code which actually
21192         applies attributes to the return type. We can't do this on the MS
21193         .NET runtime so we flag a warning in the case an exception is
21194         thrown.
21195
21196 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
21197
21198         * const.cs: Handle implicit null conversions here too.
21199
21200 2002-12-17  Ravi Pratap  <ravi@ximian.com>
21201
21202         * class.cs (MethodCore.LabelParameters): Remove the extra
21203         Type [] parameter since it is completely unnecessary. Instead
21204         pass in the method's attributes so that we can extract
21205         the "return" attribute.
21206
21207 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
21208
21209         * cs-parser.jay (parse): Use Report.Error to flag errors instead
21210         of ignoring it and letting the compile continue.
21211
21212         * typemanager.cs (ChangeType): use an extra argument to return an
21213         error condition instead of throwing an exception.
21214
21215 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
21216
21217         * expression.cs (Unary.TryReduce): mimic the code for the regular
21218         code path.  Perform an implicit cast in the cases where we can
21219         implicitly convert to one of the integral types, and then reduce
21220         based on that constant.   This fixes bug #35483.
21221
21222 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21223
21224         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
21225
21226 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21227
21228         * namespace.cs: fixed bug #35489.
21229
21230 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
21231
21232         * class.cs: Remove some dead code.
21233
21234         * cs-parser.jay: Estimate the number of methods needed
21235         (RootContext.MethodCount);
21236
21237         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
21238         numbers instead of StringBuilders.
21239
21240         * support.cs (PtrHashtable): Add constructor with initial size;
21241         We can now reduce reallocations of the method table.
21242
21243 2002-12-10  Ravi Pratap  <ravi@ximian.com>
21244
21245         * attribute.cs (ApplyAttributes): Keep track of the emitted
21246         attributes on a per-target basis. This fixes bug #35413.
21247
21248 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
21249
21250         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
21251         default to the Windows 1252 encoding.
21252
21253         (UnixParseOption): Support version, thanks to Alp for the missing
21254         pointer. 
21255
21256         * AssemblyInfo.cs: Add nice assembly information.
21257
21258         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
21259         (bug 35169).
21260
21261         * cs-parser.jay: Allow a trailing comma before the close bracked
21262         in the attribute_section production.
21263
21264         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
21265         address of the instance was being taken, I will take this out,
21266         because we take the address of the object immediately here.
21267
21268 2002-12-09  Ravi Pratap  <ravi@ximian.com>
21269
21270         * typemanager.cs (AreMultipleAllowed): Take care of the most
21271         obvious case where attribute type is not in the current assembly -
21272         stupid me ;-)
21273
21274 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
21275
21276         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
21277         definitions, instead of doing that afterwards.  
21278
21279         Also we use a nice little hack, depending on the constructor, we
21280         know if we are a "composed" name or a simple name.  Hence, we
21281         avoid the IndexOf test, and we avoid 
21282
21283         * codegen.cs: Add code to assist in a bug reporter to track down
21284         the source of a compiler crash. 
21285
21286 2002-12-07  Ravi Pratap  <ravi@ximian.com>
21287
21288         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
21289         types have been emitted for a given element and flag an error
21290         if something which does not have AllowMultiple set is used more
21291         than once.
21292
21293         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
21294         attribute types and their corresponding AllowMultiple properties
21295
21296         (AreMultipleAllowed): Check the property for a given type.
21297
21298         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
21299         property in the case we have a TypeContainer.
21300
21301         (Attributes.AddAttribute): Detect duplicates and just skip on
21302         adding them. This trivial fix catches a pretty gross error in our
21303         attribute emission - global attributes were being emitted twice!
21304
21305         Bugzilla bug #33187 is now fixed.
21306
21307 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
21308
21309         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
21310         instead of pp_and).
21311
21312         * expression.cs (Binary.ResolveOperator): I can only use the
21313         Concat (string, string, string) and Concat (string, string,
21314         string, string) if the child is actually a concatenation of
21315         strings. 
21316
21317 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
21318
21319         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
21320         context where we need a 2-character lookahead.
21321
21322         * pending.cs (PendingImplementation): Rework so we can keep track
21323         of interface types all the time, and flag those which were
21324         implemented by parents as optional.
21325
21326 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
21327
21328         * expression.cs (Binary.ResolveOperator): Use
21329         String.Concat(string,string,string) or
21330         String.Concat(string,string,string,string) when possible. 
21331
21332         * typemanager: More helper methods.
21333
21334
21335 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
21336
21337         * pending.cs: remove the bogus return from GetMissingInterfaces()
21338         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
21339
21340 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21341
21342         * namespace.cs: avoid duplicated 'using xxx' being added to
21343         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
21344         when we get more than one 'using' statement for the same namespace.
21345         Report a CS0105 warning for it.
21346
21347 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
21348
21349         * cs-tokenizer.cs (consume_identifier): use read directly, instead
21350         of calling getChar/putback, uses internal knowledge of it.    
21351
21352         (xtoken): Reorder tokenizer so most common patterns are checked
21353         first.  This reduces the compilation time in another 5% (from 8.11s
21354         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
21355
21356         The parsing time is 22% of the compilation in mcs, and from that
21357         64% is spent on the tokenization process.  
21358
21359         I tried using a binary search for keywords, but this is slower
21360         than the hashtable.  Another option would be to do a couple of
21361         things:
21362
21363                 * Not use a StringBuilder, instead use an array of chars,
21364                   with a set value.  Notice that this way we could catch
21365                   the 645 error without having to do it *afterwards*.
21366
21367                 * We could write a hand-parser to avoid the hashtable
21368                   compares altogether.
21369
21370         The identifier consumption process takes 37% of the tokenization
21371         time.  Another 15% is spent on is_number.  56% of the time spent
21372         on is_number is spent on Int64.Parse:
21373
21374                 * We could probably choose based on the string length to
21375                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
21376                   computations. 
21377
21378         Another 3% is spend on wrapping `xtoken' in the `token' function.
21379
21380         Handle 0xa0 as whitespace (#34752)
21381
21382 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
21383
21384         * typemanager.cs (IsCLRType): New routine to tell whether a type
21385         is one of the builtin types.  
21386
21387         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
21388         typecode in more places instead of doing pointer comparissions.
21389         We could leverage some knowledge about the way the typecodes are
21390         laid out.
21391
21392         New code to cache namespaces in assemblies, it is currently not
21393         invoked, to be used soon.
21394
21395         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
21396
21397         * expression.cs (Binary.ResolveOperator): specially handle
21398         strings, and do not perform user-defined operator overloading for
21399         built-in types.
21400
21401 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
21402
21403         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
21404         internalcall as it is a pretty simple operation;  Avoid whenever
21405         possible to call Char.IsLetter.
21406
21407         (consume_identifier): Cut by half the number of
21408         hashtable calls by merging the is_keyword and GetKeyword behavior.
21409
21410         Do not short-circuit, because if we do, we
21411         report errors (ie, #if false && true would produce an invalid
21412         directive error);
21413
21414
21415 2002-11-24  Martin Baulig  <martin@ximian.com>
21416
21417         * expression.cs (Cast.TryReduce): If we're in checked syntax,
21418         check constant ranges and report a CS0221.  Fixes #33186.
21419
21420 2002-11-24  Martin Baulig  <martin@ximian.com>
21421
21422         * cs-parser.jay: Make this work for uninitialized variable
21423         declarations in the `for' initializer.  Fixes #32416.
21424
21425 2002-11-24  Martin Baulig  <martin@ximian.com>
21426
21427         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
21428         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
21429
21430 2002-11-24  Martin Baulig  <martin@ximian.com>
21431
21432         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
21433         argument; if true, we also check for user-defined conversions.
21434         This is only needed if both arguments are of a user-defined type.
21435         Fixes #30443, added test-175.cs.
21436         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
21437
21438         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
21439
21440 2002-11-24  Martin Baulig  <martin@ximian.com>
21441
21442         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
21443         function to get the store opcode.
21444         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
21445         only emit the Ldelema if the store opcode is Stobj.  You must run
21446         both test-34 and test-167 to test this.  Fixes #34529.
21447
21448 2002-11-23  Martin Baulig  <martin@ximian.com>
21449
21450         * ecore.cs (Expression.MemberLookup): Added additional
21451         `qualifier_type' argument which is used when we're being called
21452         from MemberAccess.DoResolve() and null if we're called from a
21453         SimpleName lookup.
21454         (Expression.MemberLookupFailed): New method to report errors; this
21455         does the CS1540 check and reports the correct error message.
21456
21457         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
21458         argument for the CS1540 check and redone the way how we're dealing
21459         with private members.  See the comment in the source code for details.
21460         (FilterWithClosure): Reverted this back to revision 1.197; renamed
21461         `closure_start_type' to `closure_qualifier_type' and check whether
21462         it's not null.  It was not this filter being broken, it was just
21463         being called with the wrong arguments.
21464
21465         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
21466         and pass it the correct `qualifier_type'; this also does the error
21467         handling for us.
21468
21469 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
21470
21471         * expression.cs (Invocation.EmitParams): If the we are dealing
21472         with a non-built-in value type, load its address as well.
21473
21474         (ArrayCreation): Use a a pretty constant instead
21475         of the hardcoded value 2.   Use 6 instead of 2 for the number of
21476         static initializers.  
21477
21478         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
21479         because they are not really value types, just glorified integers. 
21480
21481         * driver.cs: Do not append .exe, the CSC compiler does not do it.
21482
21483         * ecore.cs: Remove redundant code for enumerations, make them use
21484         the same code path as everything else, fixes the casting issue
21485         with enumerations in Windows.Forms.
21486
21487         * attribute.cs: Do only cast to string if it is a string, the
21488         validation happens later.
21489
21490         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
21491         people upgrade their corlibs.
21492
21493         * ecore.cs: Oops, enumerations were not following the entire code path
21494
21495 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
21496
21497         * typemanager.cs (FilterWithClosure): Commented out the test for
21498         1540 in typemanager.cs, as it has problems when accessing
21499         protected methods from a parent class (see test-174.cs). 
21500
21501         * attribute.cs (Attribute.ValidateGuid): new method.
21502         (Attribute.Resolve): Use above.
21503
21504 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
21505
21506         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
21507
21508         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
21509         handling for enumerations, as we only needed the TypeContainer
21510         functionality to begin with (this is required for the fix below to
21511         work for enums that reference constants in a container class for
21512         example). 
21513
21514         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
21515
21516         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
21517         a valid TypeBuilder to perform lookups on.o
21518
21519         * class.cs (InheritableMemberSignatureCompare): Use true in the
21520         call to GetGetMethod and GetSetMethod, because we are comparing
21521         the signature, and we need to get the methods *even* if they are
21522         private. 
21523
21524         (PropertyBase.CheckBase): ditto.
21525
21526         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
21527         GotoCase.Resolve): Use Peel on EmpytCasts.
21528
21529         * ecore.cs (EmptyCast): drop child, add Peel method.
21530
21531 2002-11-17  Martin Baulig  <martin@ximian.com>
21532
21533         * ecore.cs (EmptyCast.Child): New public property.
21534
21535         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
21536         label resolved to an EmptyCast.  Fixes #34162.
21537         (GotoCase.Resolve): Likewise.
21538         (Block.EmitMeta): Likewise.
21539
21540 2002-11-17  Martin Baulig  <martin@ximian.com>
21541
21542         * expression.cs (Invocation.BetterConversion): Prefer int over
21543         uint; short over ushort; long over ulong for integer literals.
21544         Use ImplicitConversionExists instead of StandardConversionExists
21545         since we also need to check for user-defined implicit conversions.
21546         Fixes #34165.  Added test-173.cs.
21547
21548 2002-11-16  Martin Baulig  <martin@ximian.com>
21549
21550         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
21551         with the `true' and `false' literals.  Fixes #33151.
21552
21553 2002-11-16  Martin Baulig  <martin@ximian.com>
21554
21555         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
21556         October 22nd; don't do the cs1540 check for static members.
21557
21558         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
21559         now using our own filter here and doing the cs1540 check again.
21560
21561 2002-11-16  Martin Baulig  <martin@ximian.com>
21562
21563         * support.cs (InternalParameters): Don't crash if we don't have
21564         any fixed parameters.  Fixes #33532.
21565
21566 2002-11-16  Martin Baulig  <martin@ximian.com>
21567
21568         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
21569         when looking up static methods to make this work on Windows.
21570         Fixes #33773.
21571
21572 2002-11-16  Martin Baulig  <martin@ximian.com>
21573
21574         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
21575         a setter rather than using PropertyInfo.CanWrite.
21576
21577 2002-11-15  Nick Drochak  <ndrochak@gol.com>
21578
21579         * class.cs: Allow acces to block member by subclasses. Fixes build
21580         breaker.
21581
21582 2002-11-14  Martin Baulig  <martin@ximian.com>
21583
21584         * class.cs (Constructor.Emit): Added the extern/block check.
21585         Fixes bug #33678.
21586
21587 2002-11-14  Martin Baulig  <martin@ximian.com>
21588
21589         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
21590         iteration while looking for indexers, this is needed because the
21591         indexer may have a different name in our base classes.  Fixed the
21592         error reporting (no indexers at all, not get accessor, no
21593         overloaded match).  Fixes bug #33089.
21594         (IndexerAccess.DoResolveLValue): Likewise.
21595
21596 2002-11-14  Martin Baulig  <martin@ximian.com>
21597
21598         * class.cs (PropertyBase.CheckBase): Make this work for multiple
21599         indexers.  Fixes the first part of bug #33089.
21600         (MethodSignature.InheritableMemberSignatureCompare): Added support
21601         for properties.
21602
21603 2002-11-13  Ravi Pratap  <ravi@ximian.com>
21604
21605         * attribute.cs (Attribute.Resolve): Catch the
21606         NullReferenceException and report it since it isn't supposed to
21607         happen. 
21608
21609 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
21610
21611         * expression.cs (Binary.EmitBranchable): Also handle the cases for
21612         LogicalOr and LogicalAnd that can benefit from recursively
21613         handling EmitBranchable.  The code now should be nice for Paolo.
21614
21615 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
21616
21617         * typemanager.cs (LookupType): Added a negative-hit hashtable for
21618         the Type lookups, as we perform quite a number of lookups on
21619         non-Types.  This can be removed once we can deterministically tell
21620         whether we have a type or a namespace in advance.
21621
21622         But this might require special hacks from our corlib.
21623
21624         * TODO: updated.
21625
21626         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
21627         and double which avoids a conversion from an integer to a double.
21628
21629         * expression.cs: tiny optimization, avoid calling IsConstant,
21630         because it effectively performs the lookup twice.
21631
21632 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
21633
21634         But a bogus return here to keep the semantics of the old code
21635         until the Mono runtime is fixed.
21636
21637         * pending.cs (GetMissingInterfaces): New method used to remove all
21638         the interfaces that are already implemented by our parent
21639         classes from the list of pending methods. 
21640
21641         * interface.cs: Add checks for calls after ResolveTypeExpr.
21642
21643 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
21644
21645         * class.cs (Class.Emit): Report warning 67: event not used if the
21646         warning level is beyond 3.
21647
21648         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
21649         being a NullLiteral.
21650
21651         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
21652         specifiers. 
21653
21654         * class.cs (TypeContainer.GetClassBases): Cover a missing code
21655         path that might fail if a type can not be resolved.
21656
21657         * expression.cs (Binary.Emit): Emit unsigned versions of the
21658         operators. 
21659
21660         * driver.cs: use error 5.
21661
21662 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
21663
21664         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
21665
21666 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
21667
21668         * cs-parser.jay (switch_section): A beautiful patch from Martin
21669         Baulig that fixed 33094.
21670
21671 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
21672
21673         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
21674         Check whether the base is abstract and report an error if so.
21675
21676         * expression.cs (IndexerAccess.DoResolveLValue,
21677         IndexerAccess.DoResolve): ditto. 
21678
21679         (Invocation.DoResolve): ditto.
21680
21681         (Invocation.FullMethodDesc): Improve the report string.
21682
21683         * statement.cs (Block): Eliminate IsVariableDefined as it is
21684         basically just a wrapper for GetVariableInfo.
21685
21686         * ecore.cs (SimpleName): Use new 
21687
21688         * support.cs (ReflectionParamter.ParameterType): We unwrap the
21689         type, as we return the actual parameter ref/unref state on a
21690         different call.
21691
21692 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
21693
21694         * support.cs: Return proper flags REF/OUT fixing the previous
21695         commit.  
21696
21697         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
21698         not used to mean `ref' but `ref or out' in ParameterReference
21699
21700         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
21701         full type signature instead of calling TypeManger.CSharpName
21702         ourselves. 
21703
21704         * support.cs (InternalParameters.ParameterDesc): Do not compare
21705         directly to the modflags, because REF/OUT will actually be bitsets
21706         if set. 
21707
21708         * delegate.cs (VerifyMethod): Check also the modifiers.
21709
21710         * cs-tokenizer.cs: Fix bug where floating point values with an
21711         exponent where a sign was missing was ignored.
21712
21713         * driver.cs: Allow multiple assemblies to be specified in a single
21714         /r: argument
21715
21716 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
21717
21718         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
21719         because identifiers after a parenthesis would end up in this kind
21720         of production, and we needed to desamiguate it for having casts
21721         like:
21722
21723                 (UserDefinedType *) xxx
21724
21725 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
21726
21727         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
21728         we should set on the Bindingflags.NonPublic, but not turn on
21729         private_ok.  private_ok controls whether a Private member is
21730         returned (this is chekced on the filter routine), while the
21731         BindingFlags.NonPublic just controls whether private/protected
21732         will be allowed.   This fixes the problem part of the problem of
21733         private properties being allowed to be used in derived classes.
21734
21735         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
21736         so we can call the children DoResolveLValue method (this will
21737         properly signal errors on lvalue assignments to base properties)
21738
21739         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
21740         getter are null, and we have a property info, we know that this
21741         happened because the lookup failed, so we report an error 122 for
21742         protection level violation.
21743
21744         We also silently return if setter and getter are null in the
21745         resolve functions, this condition only happens if we have flagged
21746         the error before.  This is the other half of the problem. 
21747
21748         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
21749         not have accessibility information, that is why we were returning
21750         true in the filter function in typemanager.cs.
21751
21752         To properly report 122 (property is inaccessible because of its
21753         protection level) correctly, we report this error in ResolveAccess
21754         by failing if both the setter and the getter are lacking (ie, the
21755         lookup failed). 
21756
21757         DoResolve and DoLResolve have been modified to check for both
21758         setter/getter being null and returning silently, the reason being
21759         that I did not want to put the knowledge about this error in upper
21760         layers, like:
21761
21762         int old = Report.Errors;
21763         x = new PropertyExpr (...);
21764         if (old != Report.Errors)
21765                 return null;
21766         else
21767                 return x;
21768
21769         So the property expr is returned, but it is invalid, so the error
21770         will be flagged during the resolve process. 
21771
21772         * class.cs: Remove InheritablePropertySignatureCompare from the
21773         class, as we no longer depend on the property signature to compute
21774         whether it is possible to implement a method or not.
21775
21776         The reason is that calling PropertyInfo.GetGetMethod will return
21777         null (in .NET, in Mono it works, and we should change this), in
21778         cases where the Get Method does not exist in that particular
21779         class.
21780
21781         So this code:
21782
21783         class X { public virtual int A { get { return 1; } } }
21784         class Y : X { }
21785         class Z : Y { public override int A { get { return 2; } } }
21786
21787         Would fail in Z because the parent (Y) would not have the property
21788         defined.  So we avoid this completely now (because the alternative
21789         fix was ugly and slow), and we now depend exclusively on the
21790         method names.
21791
21792         (PropertyBase.CheckBase): Use a method-base mechanism to find our
21793         reference method, instead of using the property.
21794
21795         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
21796         routines are gone now.
21797
21798         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
21799         names, they were incorrectly named.
21800
21801         * cs-tokenizer.cs: Return are more gentle token on failure. 
21802
21803         * pending.cs (PendingImplementation.InterfaceMethod): This routine
21804         had an out-of-sync index variable, which caused it to remove from
21805         the list of pending methods the wrong method sometimes.
21806
21807 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
21808
21809         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
21810         CanWrite, because those refer to this particular instance of the
21811         property, and do not take into account the fact that we can
21812         override single members of a property.
21813
21814         Constructor requires an EmitContext.  The resolution process does
21815         not happen here, but we need to compute the accessors before,
21816         because the resolution does not always happen for properties.
21817
21818         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
21819         subclass, before we did not update this flag, but we did update
21820         bindingflags. 
21821
21822         (GetAccessors): Drop this routine, as it did not work in the
21823         presence of partially overwritten set/get methods. 
21824
21825         Notice that this broke the cs1540 detection, but that will require
21826         more thinking. 
21827
21828 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21829
21830         * class.cs:
21831         * codegen.cs:
21832         * driver.cs: issue a warning instead of an error if we don't support
21833         debugging for the platform. Also ignore a couple of errors that may
21834         arise when trying to write the symbols. Undo my previous patch.
21835
21836 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21837
21838         * driver.cs: ignore /debug switch except for Unix platforms.
21839
21840 2002-10-23  Nick Drochak  <ndrochak@gol.com>
21841
21842         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
21843
21844 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
21845
21846         * driver.cs: Do not make mcs-debug conditional, so we do not break
21847         builds that use it.
21848
21849         * statement.cs (UsageVector.MergeChildren): I would like Martin to
21850         review this patch.  But basically after all the children variables
21851         have been merged, the value of "Breaks" was not being set to
21852         new_breaks for Switch blocks.  I think that it should be set after
21853         it has executed.  Currently I set this to the value of new_breaks,
21854         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
21855         conservative, but I do not understand this code very well.
21856
21857         I did not break anything in the build, so that is good ;-)
21858
21859         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
21860
21861 2002-10-20  Mark Crichton  <crichton@gimp.org>
21862
21863         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
21864
21865 2002-10-20  Nick Drochak  <ndrochak@gol.com>
21866
21867         * cfold.cs: Fixed compile blocker.
21868
21869 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
21870
21871         * driver.cs: I was chekcing the key, not the file.
21872
21873 2002-10-19  Ravi Pratap  <ravi@ximian.com>
21874
21875         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
21876         message that we were generating - we just need to silently return
21877         a null.
21878
21879 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
21880
21881         * class.cs (Event.Define): Change my previous commit, as this
21882         breaks the debugger.  This is a temporary hack, as it seems like
21883         the compiler is generating events incorrectly to begin with.
21884
21885         * expression.cs (Binary.ResolveOperator): Added support for 
21886         "U operator - (E x, E y)"
21887
21888         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
21889         y)".
21890
21891         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
21892         init-only variables, but this path did not take into account that
21893         there might be also instance readonly variables.  Correct this
21894         problem. 
21895
21896         This fixes bug 32253
21897
21898         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
21899         delegates as well.
21900
21901         * driver.cs: Change the extension for modules to `netmodule'
21902
21903         * cs-parser.jay: Improved slightly the location tracking for
21904         the debugger symbols.
21905
21906         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
21907         modifiers that were specified instead of the hardcoded value
21908         (FamAndAssem).  This was basically ignoring the static modifier,
21909         and others.  Fixes 32429.
21910
21911         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
21912         fixed a bug in the process (32476)
21913
21914         * expression.cs (ArrayAccess.EmitAssign): Patch from
21915         hwang_rob@yahoo.ca that fixes bug 31834.3
21916
21917 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
21918
21919         * driver.cs: Make the module extension .netmodule.
21920
21921 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
21922
21923         * driver.cs: Report an error if the resource file is not found
21924         instead of crashing.
21925
21926         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
21927         false, like Emit does.
21928
21929 2002-10-16  Nick Drochak  <ndrochak@gol.com>
21930
21931         * typemanager.cs: Remove unused private member.  Also reported mcs
21932         bug to report this as a warning like csc.
21933
21934 2002-10-15  Martin Baulig  <martin@gnome.org>
21935
21936         * statement.cs (Statement.Emit): Made this a virtual method; emits
21937         the line number info and calls DoEmit().
21938         (Statement.DoEmit): New protected abstract method, formerly knows
21939         as Statement.Emit().
21940
21941         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
21942
21943 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
21944
21945         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
21946         have fixed a remaining problem: not every AddXXXX was adding a
21947         fully qualified name.  
21948
21949         Now everyone registers a fully qualified name in the DeclSpace as
21950         being defined instead of the partial name.  
21951
21952         Downsides: we are slower than we need to be due to the excess
21953         copies and the names being registered this way.  
21954
21955         The reason for this is that we currently depend (on the corlib
21956         bootstrap for instance) that types are fully qualified, because
21957         we dump all the types in the namespace, and we should really have
21958         types inserted into the proper namespace, so we can only store the
21959         basenames in the defined_names array.
21960
21961 2002-10-10  Martin Baulig  <martin@gnome.org>
21962
21963         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
21964         from bug #31834, see the bug report for a testcase which is
21965         miscompiled.
21966
21967 2002-10-10  Martin Baulig  <martin@gnome.org>
21968
21969         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
21970         flow analysis code for this.
21971
21972         * statement.cs (Do, While, For): Tell the flow analysis code about
21973         infinite loops.
21974         (FlowBranching.UsageVector): Added support for infinite loops.
21975         (Block.Resolve): Moved the dead code elimination here and use flow
21976         analysis to do it.
21977
21978 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
21979
21980         * class.cs (Field.Define): Catch cycles on struct type
21981         definitions. 
21982
21983         * typemanager.cs (IsUnmanagedtype): Do not recursively check
21984         fields if the fields are static.  We only need to check instance
21985         fields. 
21986
21987         * expression.cs (As.DoResolve): Test for reference type.
21988
21989         * statement.cs (Using.ResolveExpression): Use
21990         ConvertImplicitRequired, not ConvertImplicit which reports an
21991         error on failture
21992         (Using.ResolveLocalVariableDecls): ditto.
21993
21994         * expression.cs (Binary.ResolveOperator): Report errors in a few
21995         places where we had to.
21996
21997         * typemanager.cs (IsUnmanagedtype): Finish implementation.
21998
21999 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
22000
22001         * expression.cs: Use StoreFromPtr instead of extracting the type
22002         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
22003
22004         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
22005         an enumeration value to a System.Enum, but System.Enum is not a
22006         value type, but an class type, so we need to box.
22007
22008         (Expression.ConvertExplicit): One codepath could return
22009         errors but not flag them.  Fix this.  Fixes #31853
22010
22011         * parameter.cs (Resolve): Do not allow void as a parameter type.
22012
22013 2002-10-06  Martin Baulig  <martin@gnome.org>
22014
22015         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
22016         if it's a class type and not a struct.  Fixes #31815.
22017
22018 2002-10-06  Martin Baulig  <martin@gnome.org>
22019
22020         * statement.cs: Reworked the flow analysis code a bit to make it
22021         usable for dead code elimination.
22022
22023 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22024
22025         * cs-parser.jay: allow empty source files. Fixes bug #31781.
22026
22027 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
22028
22029         * expression.cs (ComposedCast.DoResolveType): A quick workaround
22030         to fix the test 165, will investigate deeper.
22031
22032 2002-10-04  Martin Baulig  <martin@gnome.org>
22033
22034         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
22035         finally blocks actually work.
22036         (Try.Resolve): We don't need to create a sibling for `finally' if
22037         there is no finally block.
22038
22039 2002-10-04  Martin Baulig  <martin@gnome.org>
22040
22041         * class.cs (Constructor.Define): The default accessibility for a
22042         non-default constructor is private, not public.
22043
22044 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
22045
22046         * class.cs (Constructor): Make AllowedModifiers public, add
22047         EXTERN.
22048
22049         * cs-parser.jay: Perform the modifiers test here, as the
22050         constructor for the Constructor class usually receives a zero
22051         because of the way we create it (first we create, later we
22052         customize, and we were never checking the modifiers).
22053
22054         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
22055         is a version of LookupTypeReflection that includes the type-name
22056         cache.  This can be used as a fast path for functions that know
22057         the fully qualified name and are only calling into *.GetType() to
22058         obtain a composed type.
22059
22060         This is also used by TypeManager.LookupType during its type
22061         composition.
22062
22063         (LookupType): We now also track the real type name, as sometimes
22064         we can get a quey for the real type name from things like
22065         ComposedCast.  This fixes bug 31422.
22066
22067         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
22068         complete type fullname, it does not have to go through the type
22069         resolution system to obtain the composed version of the type (for
22070         obtaining arrays or pointers).
22071
22072         (Conditional.Emit): Use the EmitBoolExpression to
22073         generate nicer code, as requested by Paolo.
22074
22075         (ArrayCreation.CheckIndices): Use the patch from
22076         hwang_rob@yahoo.ca to validate the array initializers. 
22077
22078 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
22079
22080         * class.cs (ConstructorInitializer.Emit): simplify code by using
22081         Invocation.EmitCall, and at the same time, fix the bugs in calling
22082         parent constructors that took variable arguments. 
22083
22084         * ecore.cs (Expression.ConvertNumericExplicit,
22085         Expression.ImplicitNumericConversion): Remove the code that
22086         manually wrapped decimal (InternalTypeConstructor call is now gone
22087         as well).
22088
22089         * expression.cs (Cast.TryReduce): Also handle decimal types when
22090         trying to perform a constant fold on the type.
22091
22092         * typemanager.cs (IsUnmanagedtype): Partially implemented.
22093
22094         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
22095         that only turned off an error report, and did nothing else. 
22096
22097 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
22098
22099         * driver.cs: Handle and ignore /fullpaths
22100
22101 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
22102
22103         * expression.cs (Binary.ResolveOperator): Catch the case where
22104         DoNumericPromotions returns true, 
22105
22106         (Binary.DoNumericPromotions): Simplify the code, and the tests.
22107
22108 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
22109
22110         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
22111         report error 70.
22112
22113 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
22114
22115         * ecore.cs (ConvertNumericExplicit): It is not enough that the
22116         conversion exists, but it is also required that the conversion be
22117         performed.  This manifested in "(Type64Enum) 2".  
22118
22119         * class.cs (TypeManager.AddMethod): The fix is not to change
22120         AddEnum, because that one was using a fully qualified name (every
22121         DeclSpace derivative does), but to change the AddMethod routine
22122         that was using an un-namespaced name.  This now correctly reports
22123         the duplicated name.
22124
22125         Revert patch until I can properly fix it.  The issue
22126         is that we have a shared Type space across all namespaces
22127         currently, which is wrong.
22128
22129         Options include making the Namespace a DeclSpace, and merge
22130         current_namespace/current_container in the parser.
22131
22132 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
22133
22134         * cs-parser.jay: Improve error reporting when we get a different
22135         kind of expression in local_variable_type and
22136         local_variable_pointer_type. 
22137
22138         Propagate this to avoid missleading errors being reported.
22139
22140         * ecore.cs (ImplicitReferenceConversion): treat
22141         TypeManager.value_type as a target just like object_type.   As
22142         code like this:
22143
22144         ValueType v = 1;
22145
22146         Is valid, and needs to result in the int 1 being boxed before it
22147         is assigned to the value type v.
22148
22149         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
22150         to validate the enumeration name.
22151
22152         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
22153         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
22154         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
22155
22156         * ecore.cs (TryImplicitIntConversion): When doing an
22157         implicit-enumeration-conversion, check if the type is 64-bits and
22158         perform a conversion before passing to EnumConstant.
22159
22160 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
22161
22162         * decl.cs (Error_AmbiguousTypeReference); New routine used to
22163         report ambiguous type references.  Unlike the MS version, we
22164         report what the ambiguity is.   Innovation at work ;-)
22165
22166         (DeclSpace.FindType): Require a location argument to
22167         display when we display an ambiguous error.
22168
22169         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
22170
22171         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
22172
22173         * expression.cs (EmitDynamicInitializers): Apply patch from
22174         hwang_rob@yahoo.ca that fixes the order in which we emit our
22175         initializers. 
22176
22177 2002-09-21  Martin Baulig  <martin@gnome.org>
22178
22179         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
22180         delegate takes no arguments.
22181
22182 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
22183
22184         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
22185         from integers.
22186
22187         * expression.cs: Extract the underlying type.
22188
22189         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
22190
22191         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
22192
22193 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
22194
22195         * class.cs (TypeContainer.DefineType): We can not use the nice
22196         PackingSize with the size set to 1 DefineType method, because it
22197         will not allow us to define the interfaces that the struct
22198         implements.
22199
22200         This completes the fixing of bug 27287
22201
22202         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
22203         means also structs.  This fixes part of the problem. 
22204         (Expresion.ImplicitReferenceConversionExists): ditto.
22205
22206         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
22207         error if there were no errors reported during the type lookup
22208         process, to avoid duplicates or redundant errors.  Without this
22209         you would get an ambiguous errors plus a type not found.  We have
22210         beaten the user enough with the first error.  
22211
22212         (DeclSparce.FindType): Emit a warning if we have an ambiguous
22213         reference. 
22214
22215         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
22216         during the resolution process, stop the lookup, this avoids
22217         repeated error reports (same error twice).
22218
22219         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
22220
22221         * typemanager.cs (LookupType): Redo the type lookup code to match
22222         the needs of System.Reflection.  
22223
22224         The issue is that System.Reflection requires references to nested
22225         types to begin with a "+" sign instead of a dot.  So toplevel
22226         types look like: "NameSpace.TopLevelClass", and nested ones look
22227         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
22228         levels. 
22229
22230 2002-09-19  Martin Baulig  <martin@gnome.org>
22231
22232         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
22233         says that a method always returns or always throws an exception,
22234         don't report the CS0161.
22235
22236         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
22237         set `Returns = new_returns'.
22238
22239 2002-09-19  Martin Baulig  <martin@gnome.org>
22240
22241         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
22242         to an enum constant, check for a CS0176.
22243
22244 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
22245
22246         * class.cs (TypeContainer.CheckPairedOperators): Now we check
22247         for operators that must be in pairs and report errors.
22248
22249         * ecore.cs (SimpleName.DoResolveType): During the initial type
22250         resolution process, when we define types recursively, we must
22251         check first for types in our current scope before we perform
22252         lookups in the enclosing scopes.
22253
22254         * expression.cs (MakeByteBlob): Handle Decimal blobs.
22255
22256         (Invocation.VerifyArgumentsCompat): Call
22257         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
22258         I thought we were supposed to always call this, but there are a
22259         few places in the code where we dont do it.
22260
22261 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
22262
22263         * driver.cs: Add support in -linkres and -resource to specify the
22264         name of the identifier.
22265
22266 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
22267
22268         * ecore.cs (StandardConversionExists): Sync with the conversion
22269         code: allow anything-* to void* conversions.
22270
22271         (FindMostSpecificSource): Use an Expression argument
22272         instead of a Type, because we might be handed over a Literal which
22273         gets a few more implicit conversions that plain types do not.  So
22274         this information was being lost.
22275
22276         Also, we drop the temporary type-holder expression when not
22277         required.
22278
22279 2002-09-17  Martin Baulig  <martin@gnome.org>
22280
22281         * class.cs (PropertyBase.CheckBase): Don't check the base class if
22282         this is an explicit interface implementation.
22283
22284 2002-09-17  Martin Baulig  <martin@gnome.org>
22285
22286         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
22287         different `IndexerName' attributes.
22288
22289         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
22290         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
22291         virtual CommonResolve().
22292
22293 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
22294
22295         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
22296         and convert that to the UnderlyingType.
22297
22298         * statement.cs (Foreach.Resolve): Indexers are just like variables
22299         or PropertyAccesses.
22300
22301         * cs-tokenizer.cs (consume_string): Track line numbers and columns
22302         inside quoted strings, we were not doing this before.
22303
22304 2002-09-16  Martin Baulig  <martin@gnome.org>
22305
22306         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
22307         resolve it.  This is needed for the definite assignment check of the
22308         instance expression, fixes bug #29846.
22309         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
22310
22311 2002-09-16  Nick Drochak  <ndrochak@gol.com>
22312
22313         * parameter.cs: Fix compile error.  Cannot reference static member
22314         from an instance object.  Is this an mcs bug?
22315
22316 2002-09-14  Martin Baulig  <martin@gnome.org>
22317
22318         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
22319         multiple times.  Fixes bug #30295, added test-166.cs.
22320
22321 2002-09-14  Martin Baulig  <martin@gnome.org>
22322
22323         * statement.cs (Block.Emit): Don't emit unreachable code.
22324         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
22325         `break' statements.
22326         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
22327
22328 2002-09-14  Martin Baulig  <martin@gnome.org>
22329
22330         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
22331         is set.
22332
22333 2002-09-14  Martin Baulig  <martin@gnome.org>
22334
22335         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
22336         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
22337         be false on the ms runtime.
22338
22339 2002-09-13  Martin Baulig  <martin@gnome.org>
22340
22341         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
22342         the CS0038 error message.
22343
22344 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
22345
22346         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
22347         constant inside, return it.
22348
22349 2002-09-12  Martin Baulig  <martin@gnome.org>
22350
22351         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
22352         implicit conversion can be done between enum types.
22353
22354         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
22355         check whether an implicit conversion to the current enum's UnderlyingType
22356         exists and report an error if not.
22357
22358         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
22359         without debugging support.
22360
22361         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
22362         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
22363
22364 2002-09-12  Martin Baulig  <martin@gnome.org>
22365
22366         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
22367
22368         * ecore.cs (IMemberExpr.DeclaringType): New property.
22369         (SimpleName.SimpleNameResolve): Check whether we're accessing a
22370         nonstatic member of an outer type (CS0038).
22371
22372 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
22373
22374         * driver.cs: Activate the using-error detector at warning level
22375         4 (at least for MS-compatible APIs).
22376
22377         * namespace.cs (VerifyUsing): Small buglett fix.
22378
22379         * pending.cs (PendingImplementation): pass the container pointer. 
22380
22381         * interface.cs (GetMethods): Allow for recursive definition.  Long
22382         term, I would like to move every type to support recursive
22383         definitions, not the current ordering mechanism that we have right
22384         now.
22385
22386         The situation is this: Attributes are handled before interfaces,
22387         so we can apply attributes to interfaces.  But some attributes
22388         implement interfaces, we will now handle the simple cases
22389         (recursive definitions will just get an error).  
22390
22391         * parameter.cs: Only invalidate types at the end if we fail to
22392         lookup all types.  
22393
22394 2002-09-09  Martin Baulig  <martin@gnome.org>
22395
22396         * ecore.cs (PropertyExpr.Emit): Also check for
22397         TypeManager.system_int_array_get_length so this'll also work when
22398         compiling corlib.  Fixes #30003.
22399
22400 2002-09-09  Martin Baulig  <martin@gnome.org>
22401
22402         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
22403         and throw an exception if we can't get the type's size.  Fixed #30040,
22404         added test-165.cs.
22405
22406 2002-09-09  Martin Baulig  <martin@gnome.org>
22407
22408         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
22409
22410         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
22411         context.  Fixes bug #30027.
22412
22413         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
22414         virtual functions.  Fixes bug #30043, added test-164.cs.
22415
22416 2002-09-08  Ravi Pratap  <ravi@ximian.com>
22417
22418         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
22419
22420 2002-09-08  Nick Drochak  <ndrochak@gol.com>
22421
22422         * driver.cs: Use an object to get the windows codepage since it's not a
22423         static property.
22424
22425 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
22426
22427         * statement.cs (For.Emit): for infinite loops (test == null)
22428         return whether there is a break inside, not always "true".
22429
22430         * namespace.cs (UsingEntry): New struct to hold the name of the
22431         using definition, the location where it is defined, and whether it
22432         has been used in a successful type lookup.
22433
22434         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
22435         strings.
22436
22437         * decl.cs: ditto.
22438
22439 2002-09-06  Ravi Pratap  <ravi@ximian.com>
22440
22441         * attribute.cs : Fix incorrect code which relied on catching
22442         a NullReferenceException to detect a null being passed in
22443         where an object was expected.
22444
22445 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
22446
22447         * statement.cs (Try): flag the catch variable as assigned
22448
22449         * expression.cs (Cast): Simplified by using ResolveType instead of
22450         manually resolving.
22451
22452         * statement.cs (Catch): Fix bug by using ResolveType.
22453
22454 2002-09-06  Ravi Pratap  <ravi@ximian.com>
22455
22456         * expression.cs (BetterConversion): Special case for when we have
22457         a NullLiteral as the argument and we have to choose between string
22458         and object types - we choose string the way csc does.
22459
22460         * attribute.cs (Attribute.Resolve): Catch the
22461         NullReferenceException and report error #182 since the Mono
22462         runtime no more has the bug and having this exception raised means
22463         we tried to select a constructor which takes an object and is
22464         passed a null.
22465
22466 2002-09-05  Ravi Pratap  <ravi@ximian.com>
22467
22468         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
22469         message (1502, 1503) when we can't locate a method after overload
22470         resolution. This is much more informative and closes the bug
22471         Miguel reported.
22472
22473         * interface.cs (PopulateMethod): Return if there are no argument
22474         types. Fixes a NullReferenceException bug.
22475
22476         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
22477         expressions too. Previously we were checking only in one place for
22478         positional arguments leaving out named arguments.
22479
22480         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
22481         type to the enum type is not allowed. Remove code corresponding to
22482         that.
22483
22484         (ConvertNumericExplicit): Allow explicit conversions from
22485         the underlying type to enum type. This precisely follows the spec
22486         and closes a bug filed by Gonzalo.
22487
22488 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22489
22490         * compiler.csproj:
22491         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
22492
22493 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
22494
22495         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
22496         it was important that we stored the right value after the
22497         reduction in `converted'.
22498
22499 2002-09-04  Martin Baulig  <martin@gnome.org>
22500
22501         * location.cs (Location.SymbolDocument): Use full pathnames for the
22502         source files.
22503
22504 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
22505
22506         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
22507         of the expression resolve mechanism, because that will catch the
22508         SimpleName error failures.
22509
22510         (Conditional): If we can not resolve the
22511         expression, return, do not crash.
22512
22513 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22514
22515         * cs-tokenizer.cs:
22516         (location): display token name instead of its number.
22517
22518 2002-08-28  Martin Baulig  <martin@gnome.org>
22519
22520         * expression.cs (Binary.ResolveOperator): Don't silently return
22521         but return an error if an operator cannot be applied between two
22522         enum types.
22523
22524 2002-08-28  Martin Baulig  <martin@gnome.org>
22525
22526         * class.cs (Constructor.Define): Set the permission attributes
22527         correctly instead of making all constructors public.
22528
22529 2002-08-28  Martin Baulig  <martin@gnome.org>
22530
22531         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
22532         for private members before reporting a CS0103; if we find anything,
22533         it's a CS0122.
22534
22535 2002-08-28  Martin Baulig  <martin@gnome.org>
22536
22537         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
22538         to check whether `closure_start_type == closure_invocation_type',
22539         we also need to check whether `m.DeclaringType == closure_invocation_type'
22540         before bypassing the permission checks.  We might be accessing
22541         protected/private members from the base class.
22542         (TypeManager.RealMemberLookup): Only set private_ok if private
22543         members were requested via BindingFlags.NonPublic.
22544
22545         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
22546
22547         * expression.cs (MemberAccess.ResolveMemberAccess): Set
22548         MethodGroupExpr.IsExplicitImpl if appropriate.
22549         (Invocation.DoResolve): Don't report the CS0120 for explicit
22550         interface implementations.
22551
22552 2002-08-27  Martin Baulig  <martin@gnome.org>
22553
22554         * expression.cs (Invocation.DoResolve): If this is a static
22555         method and we don't have an InstanceExpression, we must report
22556         a CS0120.
22557
22558 2002-08-25  Martin Baulig  <martin@gnome.org>
22559
22560         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
22561         `==' between a valuetype and an object.
22562
22563 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
22564
22565         * ecore.cs (TypeExpr): Provide a ToString method.
22566
22567 2002-08-24  Martin Baulig  <martin@gnome.org>
22568
22569         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
22570         now called proggie.dbg and it's a binary file.
22571
22572 2002-08-23  Martin Baulig  <martin@gnome.org>
22573
22574         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
22575
22576 2002-08-23  Martin Baulig  <martin@gnome.org>
22577
22578         * struct.cs (MyStructInfo.ctor): Make this work with empty
22579         structs; it's not allowed to use foreach() on null.
22580
22581 2002-08-23  Martin Baulig  <martin@gnome.org>
22582
22583         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
22584         writer the full pathname of the generated assembly.
22585
22586 2002-08-23  Martin Baulig  <martin@gnome.org>
22587
22588         * statements.cs (FlowBranching.UsageVector.MergeChildren):
22589         A `finally' block never returns or breaks; improved handling of
22590         unreachable code.
22591
22592 2002-08-23  Martin Baulig  <martin@gnome.org>
22593
22594         * statement.cs (Throw.Resolve): Allow `throw null'.
22595
22596 2002-08-23  Martin Baulig  <martin@gnome.org>
22597
22598         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
22599         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
22600         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
22601         MemberLookup would return a wrong event if this is an explicit
22602         interface implementation and the class has an event with the same
22603         name.
22604
22605 2002-08-23  Martin Baulig  <martin@gnome.org>
22606
22607         * statement.cs (Block.AddChildVariableNames): New public method.
22608         (Block.AddChildVariableName): Likewise.
22609         (Block.IsVariableNameUsedInChildBlock): Likewise.
22610         (Block.AddVariable): Check whether a variable name has already
22611         been used in a child block.
22612
22613         * cs-parser.jay (declare_local_variables): Mark all variable names
22614         from the current block as being used in a child block in the
22615         implicit block.
22616
22617 2002-08-23  Martin Baulig  <martin@gnome.org>
22618
22619         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
22620         find the symbol writer.
22621
22622         * driver.cs: csc also allows the arguments to /define being
22623         separated by commas, not only by semicolons.
22624
22625 2002-08-23  Martin Baulig  <martin@gnome.org>
22626
22627         * interface.cs (Interface.GetMembers): Added static check for events.
22628
22629 2002-08-15  Martin Baulig  <martin@gnome.org>
22630
22631         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
22632         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
22633
22634         * ecore.cs (Expression.MemberLookup): Added documentation and explained
22635         why the MethodData.EmitDestructor() change was necessary.
22636
22637 2002-08-20  Martin Baulig  <martin@gnome.org>
22638
22639         * class.cs (TypeContainer.FindMembers): Added static check for events.
22640
22641         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
22642
22643         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
22644         use Type.GetEvents(), not Type.FindMembers().
22645
22646 2002-08-20  Martin Baulig  <martin@gnome.org>
22647
22648         * decl.cs (MemberCache): Added a special method cache which will
22649         be used for method-only searched.  This ensures that a method
22650         search will return a MethodInfo with the correct ReflectedType for
22651         inherited methods.      
22652
22653 2002-08-20  Martin Baulig  <martin@gnome.org>
22654
22655         * decl.cs (DeclSpace.FindMembers): Made this public.
22656
22657 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22658
22659         * delegate.cs: fixed build on windows.
22660         [FIXME:  Filed as bug #29150: MCS must report these errors.]
22661
22662 2002-08-19  Ravi Pratap  <ravi@ximian.com>
22663
22664         * ecore.cs (StandardConversionExists): Return a false
22665         if we are trying to convert the void type to anything else
22666         since that is not allowed.
22667
22668         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
22669         we flag error 70 in the event an event is trying to be accessed
22670         directly from outside the declaring type.
22671
22672 2002-08-20  Martin Baulig  <martin@gnome.org>
22673
22674         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
22675         MemberCache from typemanager.cs to decl.cs.
22676
22677 2002-08-19  Martin Baulig  <martin@gnome.org>
22678
22679         * class.cs (TypeContainer): Implement IMemberContainer.
22680         (TypeContainer.DefineMembers): Create the MemberCache.
22681         (TypeContainer.FindMembers): Do better BindingFlags checking; only
22682         return public members if BindingFlags.Public was given, check
22683         whether members are static.
22684
22685 2002-08-16  Martin Baulig  <martin@gnome.org>
22686
22687         * decl.cs (DeclSpace.Define): Splitted this in Define and
22688         DefineMembers.  DefineMembers is called first and initializes the
22689         MemberCache.
22690
22691         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
22692         DefineMembers() on all our DeclSpaces.
22693
22694         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
22695         but call DefineMembers() on all nested interfaces.  We call their
22696         Define() in our new Define() function.
22697
22698         * interface.cs (Interface): Implement IMemberContainer.
22699         (Interface.Define): Moved all code except the attribute stuf to
22700         DefineMembers().
22701         (Interface.DefineMembers): Initialize the member cache.
22702
22703         * typemanager.cs (IMemberFinder): Removed this interface, we don't
22704         need this anymore since we can use MemberCache.FindMembers directly.
22705
22706 2002-08-19  Martin Baulig  <martin@gnome.org>
22707
22708         * typemanager.cs (MemberCache): When creating the cache for an
22709         interface type, add all inherited members.
22710         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
22711         to `out bool used_cache' and documented it.
22712         (TypeManager.MemberLookup): If we already used the cache in the first
22713         iteration, we don't need to do the interfaces check.
22714
22715 2002-08-19  Martin Baulig  <martin@gnome.org>
22716
22717         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
22718         here from IMemberFinder and don't implement this interface anymore.
22719         (DeclSpace.MemberCache): Moved here from IMemberFinder.
22720
22721         * typemanager.cs (IMemberFinder): This interface is now only used by
22722         classes which actually support the member cache.
22723         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
22724         since we only put DeclSpaces into this Hashtable.
22725         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
22726         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
22727
22728 2002-08-16  Martin Baulig  <martin@gnome.org>
22729
22730         * typemanager.cs (ICachingMemberFinder): Removed.
22731         (IMemberFinder.MemberCache): New property.
22732         (TypeManager.FindMembers): Merged this with RealFindMembers().
22733         This function will never be called from TypeManager.MemberLookup()
22734         so we can't use the cache here, just the IMemberFinder.
22735         (TypeManager.MemberLookup_FindMembers): Check whether the
22736         IMemberFinder has a MemberCache and call the cache's FindMembers
22737         function.
22738         (MemberCache): Rewrote larger parts of this yet another time and
22739         cleaned it up a bit.
22740
22741 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
22742
22743         * driver.cs (LoadArgs): Support quoting.
22744
22745         (Usage): Show the CSC-like command line arguments.
22746
22747         Improved a few error messages.
22748
22749 2002-08-15  Martin Baulig  <martin@gnome.org>
22750
22751         * typemanager.cs (IMemberContainer.Type): New property.
22752         (IMemberContainer.IsInterface): New property.
22753
22754         The following changes are conditional to BROKEN_RUNTIME, which is
22755         defined at the top of the file.
22756
22757         * typemanager.cs (MemberCache.MemberCache): Don't add the base
22758         class'es members, but add all members from TypeHandle.ObjectType
22759         if we're an interface.
22760         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
22761         is the current type.
22762         (MemberCache.CacheEntry.Container): Removed this field.
22763         (TypeHandle.GetMembers): Include inherited members.
22764
22765 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22766
22767         * typemanager.cs: fixed compilation and added a comment on a field that
22768         is never used.
22769
22770 2002-08-15  Martin Baulig  <martin@gnome.org>
22771
22772         * class.cs (ConstructorInitializer.Resolve): In the
22773         Expression.MemberLookup call, use the queried_type as
22774         invocation_type.
22775
22776         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
22777         declared' attribute, it's always true.
22778         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
22779         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
22780         temporary wrapper for FindMembers which tells MemberLookup whether
22781         members from the base classes are included in the return value.
22782         This will go away soon.
22783         (TypeManager.MemberLookup): Use this temporary hack here; once the
22784         new MemberCache is completed, we don't need to do the DeclaredOnly
22785         looping here anymore since the MemberCache will take care of this.
22786         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
22787         (MemberCache): When creating the MemberCache for a class, get
22788         members from the current class and all its base classes.
22789         (MemberCache.CacheEntry.Container): New field.  This is a
22790         temporary hack until the Mono runtime is fixed to distinguish
22791         between ReflectedType and DeclaringType.  It allows us to use MCS
22792         with both the MS runtime and the unfixed Mono runtime without
22793         problems and without accecting performance.
22794         (MemberCache.SearchMembers): The DeclaredOnly looping from
22795         TypeManager.MemberLookup is now done here.      
22796
22797 2002-08-14  Martin Baulig  <martin@gnome.org>
22798
22799         * statement.cs (MyStructInfo.MyStructInfo): Don't call
22800         Type.GetFields on dynamic types but get the fields from the
22801         corresponding TypeContainer.
22802         (MyStructInfo.GetStructInfo): Added check for enum types.
22803
22804         * typemanager.cs (MemberList.IsSynchronized): Implemented.
22805         (MemberList.SyncRoot): Implemented.
22806         (TypeManager.FilterWithClosure): No need to check permissions if
22807         closure_start_type == closure_invocation_type, don't crash if
22808         closure_invocation_type is null.
22809
22810 2002-08-13  Martin Baulig  <martin@gnome.org>
22811
22812         Rewrote TypeContainer.FindMembers to use a member cache.  This
22813         gives us a speed increase of about 35% for the self-hosting MCS
22814         build and of about 15-20% for the class libs (both on GNU/Linux).
22815
22816         * report.cs (Timer): New class to get enhanced profiling.  This
22817         whole class is "TIMER" conditional since it remarkably slows down
22818         compilation speed.
22819
22820         * class.cs (MemberList): New class.  This is an IList wrapper
22821         which we're now using instead of passing MemberInfo[]'s around to
22822         avoid copying this array unnecessarily.
22823         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
22824         (ICachingMemberFinder, IMemberContainer): New interface.
22825         (TypeManager.FilterWithClosure): If `criteria' is null, the name
22826         has already been checked, otherwise use it for the name comparision.
22827         (TypeManager.FindMembers): Renamed to RealMemberFinder and
22828         provided wrapper which tries to use ICachingMemberFinder.FindMembers
22829         if possible.  Returns a MemberList, not a MemberInfo [].
22830         (TypeHandle): New class, implements IMemberContainer.  We create
22831         one instance of this class per type, it contains a MemberCache
22832         which is used to do the member lookups.
22833         (MemberCache): New class.  Each instance of this class contains
22834         all members of a type and a name-based hash table.
22835         (MemberCache.FindMembers): This is our new member lookup
22836         function.  First, it looks up all members of the requested name in
22837         the hash table.  Then, it walks this list and sorts out all
22838         applicable members and returns them.
22839
22840 2002-08-13  Martin Baulig  <martin@gnome.org>
22841
22842         In addition to a nice code cleanup, this gives us a performance
22843         increase of about 1.4% on GNU/Linux - not much, but it's already
22844         half a second for the self-hosting MCS compilation.
22845
22846         * typemanager.cs (IMemberFinder): New interface.  It is used by
22847         TypeManager.FindMembers to call FindMembers on a TypeContainer,
22848         Enum, Delegate or Interface.
22849         (TypeManager.finder_to_member_finder): New PtrHashtable.
22850         (TypeManager.finder_to_container): Removed.
22851         (TypeManager.finder_to_delegate): Removed.
22852         (TypeManager.finder_to_interface): Removed.
22853         (TypeManager.finder_to_enum): Removed.
22854
22855         * interface.cs (Interface): Implement IMemberFinder.
22856
22857         * delegate.cs (Delegate): Implement IMemberFinder.
22858
22859         * enum.cs (Enum): Implement IMemberFinder.
22860
22861         * class.cs (TypeContainer): Implement IMemberFinder.
22862
22863 2002-08-12  Martin Baulig  <martin@gnome.org>
22864
22865         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
22866
22867 2002-08-12  Martin Baulig  <martin@gnome.org>
22868
22869         * ecore.cs (ITypeExpression): New interface for expressions which
22870         resolve to a type.
22871         (TypeExpression): Renamed to TypeLookupExpression.
22872         (Expression.DoResolve): If we're doing a types-only lookup, the
22873         expression must implement the ITypeExpression interface and we
22874         call DoResolveType() on it.
22875         (SimpleName): Implement the new ITypeExpression interface.
22876         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
22877         hack, the situation that we're only looking up types can't happen
22878         anymore when this method is called.  Moved the type lookup code to
22879         DoResolveType() and call it.
22880         (SimpleName.DoResolveType): This ITypeExpression interface method
22881         is now doing the types-only lookup.
22882         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
22883         (ResolveFlags): Added MaskExprClass.
22884
22885         * expression.cs (MemberAccess): Implement the ITypeExpression
22886         interface.
22887         (MemberAccess.DoResolve): Added support for a types-only lookup
22888         when we're called via ITypeExpression.DoResolveType().
22889         (ComposedCast): Implement the ITypeExpression interface.
22890
22891         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
22892         Expression.Resolve() with ResolveFlags.Type instead.
22893
22894 2002-08-12  Martin Baulig  <martin@gnome.org>
22895
22896         * interface.cs (Interface.Define): Apply attributes.
22897
22898         * attribute.cs (Attribute.ApplyAttributes): Added support for
22899         interface attributes.
22900
22901 2002-08-11  Martin Baulig  <martin@gnome.org>
22902
22903         * statement.cs (Block.Emit): Only check the "this" variable if we
22904         do not always throw an exception.
22905
22906         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
22907         whether the property has a set accessor.
22908
22909 2002-08-11  Martin Baulig  <martin@gnome.org>
22910
22911         Added control flow analysis support for structs.
22912
22913         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
22914         with control flow analysis turned off.
22915         (IVariable): New interface.
22916         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
22917         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
22918         (FieldExpr.DoResolve): Resolve the instance expression with flow
22919         analysis turned off and do the definite assignment check after the
22920         resolving when we know what the expression will resolve to.
22921
22922         * expression.cs (LocalVariableReference, ParameterReference):
22923         Implement the new IVariable interface, only call the flow analysis
22924         code if ec.DoFlowAnalysis is true.
22925         (This): Added constructor which takes a Block argument.  Implement
22926         the new IVariable interface.
22927         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
22928         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
22929         This does the definite assignment checks for struct members.
22930
22931         * class.cs (Constructor.Emit): If this is a non-static `struct'
22932         constructor which doesn't have any initializer, call
22933         Block.AddThisVariable() to tell the flow analysis code that all
22934         struct elements must be initialized before control returns from
22935         the constructor.
22936
22937         * statement.cs (MyStructInfo): New public class.
22938         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
22939         argument to this indexer.  If non-zero, check an individual struct
22940         member, not the whole struct.
22941         (FlowBranching.CheckOutParameters): Check struct members.
22942         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
22943         overloaded versions of these methods which take an additional
22944         `int field_idx' argument to check struct members.
22945         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
22946         overloaded versions of these methods which take an additional
22947         `string field_name' argument to check struct member.s
22948         (VariableInfo): Implement the IVariable interface.
22949         (VariableInfo.StructInfo): New public property.  Returns the
22950         MyStructInfo instance of the variable if it's a struct or null.
22951         (Block.AddThisVariable): New public method.  This is called from
22952         Constructor.Emit() for non-static `struct' constructor which do
22953         not have any initializer.  It creates a special variable for the
22954         "this" instance variable which will be checked by the flow
22955         analysis code to ensure that all of the struct's fields are
22956         initialized before control returns from the constructor.
22957         (UsageVector): Added support for struct members.  If a
22958         variable/parameter is a struct with N members, we reserve a slot
22959         in the usage vector for each member.  A struct is considered fully
22960         initialized if either the struct itself (slot 0) or all its
22961         members are initialized.
22962
22963 2002-08-08  Martin Baulig  <martin@gnome.org>
22964
22965         * driver.cs (Driver.MainDriver): Only report an error CS5001
22966         if there were no compilation errors.
22967
22968         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
22969         `UnsafeContext' property to determine whether the parent is in
22970         unsafe context rather than checking the parent's ModFlags:
22971         classes nested in an unsafe class are unsafe as well.
22972
22973 2002-08-08  Martin Baulig  <martin@gnome.org>
22974
22975         * statement.cs (UsageVector.MergeChildren): Distinguish between
22976         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
22977         we return.  Added test17() and test18() to test-154.cs.
22978
22979 2002-08-08  Martin Baulig  <martin@gnome.org>
22980
22981         * typemanager.cs (TypeManager.FilterWithClosure): If we have
22982         Family access, make sure the invoking type isn't a subclass of the
22983         queried type (that'd be a CS1540).
22984
22985         * ecore.cs (Expression.MemberLookup): Added overloaded version of
22986         this method which takes an additional `Type invocation_type'.
22987
22988         * expression.cs (BaseAccess.DoResolve): Use the base type as
22989         invocation and query type.
22990         (MemberAccess.DoResolve): If the lookup failed and we're about to
22991         report a CS0122, try a lookup with the ec.ContainerType - if this
22992         succeeds, we must report a CS1540.
22993
22994 2002-08-08  Martin Baulig  <martin@gnome.org>
22995
22996         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
22997         (MethodGroupExpr): Implement the IMemberExpr interface.
22998
22999         * expression (MemberAccess.ResolveMemberAccess): No need to have
23000         any special code for MethodGroupExprs anymore, they're now
23001         IMemberExprs.   
23002
23003 2002-08-08  Martin Baulig  <martin@gnome.org>
23004
23005         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
23006         Family, FamANDAssem and FamORAssem permissions.
23007         (TypeManager.IsSubclassOrNestedChildOf): New public method.
23008
23009 2002-08-08  Martin Baulig  <martin@gnome.org>
23010
23011         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
23012         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
23013         or loop block.
23014
23015 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
23016
23017         * driver.cs: implemented /resource option to embed managed resources.
23018
23019 2002-08-07  Martin Baulig  <martin@gnome.org>
23020
23021         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
23022         (FieldBase.HasFieldInitializer): New public property.
23023         (FieldBase.GetInitializerExpression): New public method.  Resolves and
23024         returns the field initializer and makes sure it is only resolved once.
23025         (TypeContainer.EmitFieldInitializers): Call
23026         FieldBase.GetInitializerExpression to get the initializer, this ensures
23027         that it isn't resolved multiple times.
23028
23029         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
23030         the resolving process (SimpleName/MemberLookup) that we're currently
23031         emitting a field initializer (which must not access any instance members,
23032         this is an error CS0236).
23033
23034         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
23035         argument, if the `IsFieldInitializer' flag is set, we must report and
23036         error CS0236 and not an error CS0120.   
23037
23038 2002-08-07  Martin Baulig  <martin@gnome.org>
23039
23040         * ecore.cs (IMemberExpr): New public interface.
23041         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
23042         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
23043         if the expression is an IMemberExpr.
23044
23045         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
23046         to be null, implicitly default to `this' if we're non-static in
23047         this case.  Simplified the code a lot by using the new IMemberExpr
23048         interface.  Also fixed bug #28176 here.
23049
23050 2002-08-06  Martin Baulig  <martin@gnome.org>
23051
23052         * cs-parser.jay (SimpleLookup): Removed.  We need to create
23053         ParameterReferences during semantic analysis so that we can do a
23054         type-only search when resolving Cast, TypeOf and SizeOf.
23055         (block): Pass the `current_local_parameters' to the Block's
23056         constructor.
23057
23058         * class.cs (ConstructorInitializer): Added `Parameters parameters'
23059         argument to the constructor.
23060         (ConstructorInitializer.Resolve): Create a temporary implicit
23061         block with the parameters.
23062
23063         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
23064         references here if we aren't doing a type-only search.
23065
23066         * statement.cs (Block): Added constructor which takes a
23067         `Parameters parameters' argument.
23068         (Block.Parameters): New public property.
23069
23070         * support.cs (InternalParameters.Parameters): Renamed `parameters'
23071         to `Parameters' and made it public readonly.
23072
23073 2002-08-06  Martin Baulig  <martin@gnome.org>
23074
23075         * ecore.cs (Expression.Warning): Made this public as well.
23076
23077         * report.cs (Report.Debug): Print the contents of collections.
23078
23079 2002-08-06  Martin Baulig  <martin@gnome.org>
23080
23081         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
23082         used to tell Resolve() which kinds of expressions it may return.
23083         (Expression.Resolve): Added overloaded version of this method which
23084         takes a `ResolveFlags flags' argument.  This can be used to tell
23085         Resolve() which kinds of expressions it may return.  Reports a
23086         CS0118 on error.
23087         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
23088         ResolveFlags.SimpleName.
23089         (Expression.Error118): Added overloaded version of this method which
23090         takes a `ResolveFlags flags' argument.  It uses the flags to determine
23091         which kinds of expressions are allowed.
23092
23093         * expression.cs (Argument.ResolveMethodGroup): New public method.
23094         Resolves an argument, but allows a MethodGroup to be returned.
23095         This is used when invoking a delegate.
23096
23097         * TODO: Updated a bit.
23098
23099 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23100
23101         Fixed compilation with csc.
23102
23103         * ecore.cs: Expression.Error made public. Is this correct? Should
23104         Warning be made public too?
23105
23106         * expression.cs: use ea.Location instead of ea.loc.
23107         [FIXME:  Filed as bug #28607: MCS must report these errors.]
23108
23109 2002-08-06  Martin Baulig  <martin@gnome.org>
23110
23111         * ecore.cs (Expression.loc): Moved the location here instead of
23112         duplicating it in all derived classes.
23113         (Expression.Location): New public property.
23114         (Expression.Error, Expression.Warning): Made them non-static and
23115         removed the location argument.
23116         (Expression.Warning): Added overloaded version which takes an
23117         `int level' argument.
23118         (Expression.Error118): Make this non-static and removed the
23119         expression and location arguments.
23120         (TypeExpr): Added location argument to the constructor.
23121
23122         * expression.cs (StaticCallExpr): Added location argument to
23123         the constructor.
23124         (Indirection, PointerArithmetic): Likewise.
23125         (CheckedExpr, UnCheckedExpr): Likewise.
23126         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
23127         (StringPtr): Likewise.
23128
23129
23130 2002-08-05  Martin Baulig  <martin@gnome.org>
23131
23132         * expression.cs (BaseAccess.DoResolve): Actually report errors.
23133
23134         * assign.cs (Assign.DoResolve): Check whether the source
23135         expression is a value or variable.
23136
23137         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
23138         while resolving the corresponding blocks.
23139
23140         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
23141         an error, don't silently return null.
23142
23143         * statement.cs (Block.AddVariable): Do the error reporting here
23144         and distinguish between CS0128 and CS0136.
23145         (Block.DoResolve): Report all unused labels (warning CS0164).
23146         (LabeledStatement): Pass the location to the constructor.
23147         (LabeledStatement.HasBeenReferenced): New property.
23148         (LabeledStatement.Resolve): Set it to true here.
23149
23150         * statement.cs (Return.Emit): Return success even after reporting
23151         a type mismatch error (CS0126 or CS0127), this is what csc does and
23152         it avoids confusing the users with any consecutive errors.
23153
23154 2002-08-05  Martin Baulig  <martin@gnome.org>
23155
23156         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
23157
23158         * const.cs (Const.LookupConstantValue): Catch circular definitions.
23159
23160         * expression.cs (MemberAccess.DoResolve): Silently return if an
23161         error has already been reported.
23162
23163         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
23164         error has already been reported.
23165
23166 2002-08-05  Martin Baulig  <martin@gnome.org>
23167
23168         * statement.cs (UsageVector): Only initialize the `parameters'
23169         vector if we actually have any "out" parameters.
23170
23171 2002-08-05  Martin Baulig  <martin@gnome.org>
23172
23173         * expression.cs (Binary.ResolveOperator): When combining delegates,
23174         they must have the same type.
23175
23176 2002-08-05  Martin Baulig  <martin@gnome.org>
23177
23178         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
23179         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
23180         work with the ms runtime and we also don't need it: if we're a
23181         PropertyBuilder and not in the `indexer_arguments' hash, then we
23182         are a property and not an indexer.
23183
23184         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
23185         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
23186         since the latter one doesn't work with the ms runtime.
23187
23188 2002-08-03  Martin Baulig  <martin@gnome.org>
23189
23190         Fixed bugs #27998 and #22735.
23191
23192         * class.cs (Method.IsOperator): New public field.
23193         (Method.CheckBase): Report CS0111 if there's already a method
23194         with the same parameters in the current class.  Report CS0508 when
23195         attempting to change the return type of an inherited method.
23196         (MethodData.Emit): Report CS0179 if a method doesn't have a body
23197         and it's not marked abstract or extern.
23198         (PropertyBase): New abstract base class for Property and Indexer.
23199         (PropertyBase.CheckBase): Moved here from Property and made it work
23200         for indexers.
23201         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
23202         the same so we can reuse it there.
23203         (Property, Indexer): Derive from PropertyBase.
23204         (MethodSignature.inheritable_property_signature_filter): New delegate
23205         to find properties and indexers.
23206
23207         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
23208         argument and improved error reporting.
23209
23210         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
23211         EmptyReadOnlyParameters and made it a property.
23212
23213         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
23214         version of this method which takes a `PropertyInfo indexer'.
23215         (TypeManager.RegisterIndexer): New method.
23216
23217         * class.cs: Added myself as author of this file :-)
23218
23219 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23220
23221         * class.cs: fixed compilation on windoze.
23222
23223 2002-08-03  Martin Baulig  <martin@gnome.org>
23224
23225         * interface.cs (Interface.GetInterfaceBases): Check whether all
23226         base interfaces are at least as accessible than the current one.
23227
23228         * class.cs (TypeContainer.GetClassBases): Check whether base types
23229         are at least as accessible than the current type.
23230         (TypeContainer.AsAccessible): Implemented and made non-static.
23231         (MemberBase.CheckParameters): Report errors if the accessibility
23232         checks fail.
23233
23234         * delegate.cs (Delegate.Delegate): The default visibility is
23235         internal for top-level types and private for nested types.
23236         (Delegate.Define): Report errors if the accessibility checks fail.
23237
23238         * enum.cs (Enum.Enum): The default visibility is internal for
23239         top-level types and private for nested types.
23240         (Enum.DefineType): Compute the correct visibility.
23241
23242         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
23243         function which takes a `bool is_toplevel' instead of a TypeContainer.
23244
23245         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
23246         builtin type.
23247
23248 2002-08-02  Martin Baulig  <martin@gnome.org>
23249
23250         * expression.cs (LocalVariableReferenc): Added constructor which
23251         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
23252         (LocalVariableReference.IsReadOnly): New property.
23253         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
23254         variable is readonly, use our own readonly flag to do this; you can
23255         use the new constructor to get a writable reference to a read-only
23256         variable.
23257
23258         * cs-parser.jay (foreach_statement, using_statement): Get a writable
23259         reference to the local variable.
23260
23261 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
23262
23263         * rootcontext.cs (ResolveCore): Also include System.Exception
23264
23265         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
23266         we reach an EmptyStatement.
23267
23268         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
23269         is also fine.
23270
23271         * expression.cs (Binary.ResolveOperator): Check error result in
23272         two places.
23273
23274         use brtrue/brfalse directly and avoid compares to null.
23275
23276 2002-08-02  Martin Baulig  <martin@gnome.org>
23277
23278         * class.cs (TypeContainer.Define): Define all nested interfaces here.
23279         Fixes bug #28407, added test-155.cs.
23280
23281 2002-08-01  Martin Baulig  <martin@gnome.org>
23282
23283         * class.cs (Event.EmitDefaultMethod): Make this work with static
23284         events.  Fixes #28311, added verify-3.cs.
23285
23286 2002-08-01  Martin Baulig  <martin@gnome.org>
23287
23288         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
23289         `is_disposable' fields.
23290         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
23291         `hm.is_disposable' if we're using the collection pattern.
23292         (Foreach.EmitCollectionForeach): Use the correct type for the
23293         enumerator's local variable, only emit the try/finally block if
23294         necessary (fixes #27713).
23295
23296 2002-08-01  Martin Baulig  <martin@gnome.org>
23297
23298         * ecore.cs (Expression.report118): Renamed to Error118 and made
23299         it public static.
23300
23301         * statement.cs (Throw.Resolve): Check whether the expression is of
23302         the correct type (CS0118) and whether the type derives from
23303         System.Exception (CS0155).
23304         (Catch.Resolve): New method.  Do the type lookup here and check
23305         whether it derives from System.Exception (CS0155).
23306         (Catch.CatchType, Catch.IsGeneral): New public properties.
23307
23308         * typemanager.cs (TypeManager.exception_type): Added.
23309
23310 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
23311
23312         * driver.cs: Updated About function.
23313
23314 2002-07-31  Martin Baulig  <martin@gnome.org>
23315
23316         Implemented Control Flow Analysis.
23317
23318         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
23319         (EmitContext.CurrentBranching): Added.
23320         (EmitContext.StartFlowBranching): Added.
23321         (EmitContext.EndFlowBranching): Added.
23322         (EmitContext.KillFlowBranching): Added.
23323         (EmitContext.IsVariableAssigned): Added.
23324         (EmitContext.SetVariableAssigned): Added.
23325         (EmitContext.IsParameterAssigned): Added.
23326         (EmitContext.SetParameterAssigned): Added.
23327         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
23328         Added control flow analysis stuff here.
23329
23330         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
23331         resolve the expression as lvalue.
23332         (LocalVariableReference.DoResolve): Check whether the variable has
23333         already been assigned.
23334         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
23335         the parameter as assigned here.
23336         (ParameterReference.DoResolve): Check whether the parameter has already
23337         been assigned.
23338         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
23339         expression as lvalue.
23340
23341         * statement.cs (FlowBranching): New class for the flow analysis code.
23342         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
23343         (LabeledStatement.IsDefined): New public property.
23344         (LabeledStatement.AddUsageVector): New public method to tell flow
23345         analyis that the label may be reached via a forward jump.
23346         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
23347         flow analysis.
23348         (VariableInfo.Number): New public field.  This is used by flow analysis
23349         to number all locals of a block.
23350         (Block.CountVariables): New public property.  This is the number of
23351         local variables in this block (including the locals from all parent
23352         blocks).
23353         (Block.EmitMeta): Number all the variables.
23354
23355         * statement.cs: Added flow analysis support to all classes.
23356
23357 2002-07-31  Martin Baulig  <martin@gnome.org>
23358
23359         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
23360         To get debugging messages, compile mcs with /define:MCS_DEBUG and
23361         then use this argument.
23362
23363         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
23364
23365         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
23366         use this to specify /define options.
23367
23368 2002-07-29  Martin Baulig  <martin@gnome.org>
23369
23370         * statement.cs (Fixed): Moved all code that does variable lookups
23371         and resolvings from Emit to Resolve.
23372
23373         * statement.cs (For): Moved all code that does variable lookups
23374         and resolvings from Emit to Resolve.
23375
23376         * statement.cs (Using): Moved all code that does variable lookups
23377         and resolvings from Emit to Resolve.
23378
23379 2002-07-29  Martin Baulig  <martin@gnome.org>
23380
23381         * attribute.cs (Attribute.Resolve): Explicitly catch a
23382         System.NullReferenceException when creating the
23383         CustromAttributeBuilder and report a different warning message.
23384
23385 2002-07-29  Martin Baulig  <martin@gnome.org>
23386
23387         * support.cs (ParameterData.ParameterName): Added method to
23388         get the name of a parameter.
23389
23390         * typemanager.cs (TypeManager.IsValueType): New public method.
23391
23392 2002-07-29  Martin Baulig  <martin@gnome.org>
23393
23394         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
23395         is a flag which specifies that it's either ref or out.
23396         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
23397         the out parameter to `out Parameter.Modifier mod', also set the
23398         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
23399
23400         * support.cs (InternalParameters.ParameterModifier): Distinguish
23401         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23402         Parameter.Modifier.ISBYREF flag if it's either ref or out.
23403
23404         * expression.cs (Argument.GetParameterModifier): Distinguish
23405         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23406         Parameter.Modifier.ISBYREF flag if it's either ref or out.
23407
23408 2002-07-29  Martin Baulig  <martin@gnome.org>
23409
23410         * expression.cs (ParameterReference.ParameterReference): Added
23411         `Location loc' argument to the constructor.
23412
23413         * cs-parser.jay: Pass location to ParameterReference.
23414
23415 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
23416
23417         * statement.cs (Try): Initialize the location.
23418
23419         * cs-parser.jay: pass location to Try.
23420
23421         * expression.cs (Unary.Reduce): Change the prototype to return
23422         whether a constant fold could be performed or not.  The result is
23423         returned in an out parameters.  In the case of Indirection and
23424         AddressOf, we want to perform the full tests.
23425
23426 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
23427
23428         * statement.cs (Statement.Emit): Flag dead code.
23429
23430 2002-07-27  Andrew Birkett  <andy@nobugs.org>
23431
23432         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
23433
23434 2002-07-27  Martin Baulig  <martin@gnome.org>
23435
23436         * class.cs (MethodData.Define): Put back call to
23437         TypeManager.AddMethod(), accidentally commented this out.
23438
23439         * report.cs (Debug): New public method to print debugging information,
23440         this is `[Conditional ("DEBUG")]'.
23441
23442 2002-07-26  Martin Baulig  <martin@gnome.org>
23443
23444         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
23445         (switch_statement): Push the current_block to the switch_stack and
23446         pop it again when we're done with the switch.
23447         (switch_section): The new block is a child of the current_block.
23448         Fixes bug #24007, added test-152.cs.
23449
23450 2002-07-27  Martin Baulig  <martin@gnome.org>
23451
23452         * expression.cs (Invocation.EmitArguments): When calling a varargs
23453         function with only its fixed arguments, we need to pass an empty
23454         array.
23455
23456 2002-07-27  Martin Baulig  <martin@gnome.org>
23457
23458         Mono 0.13 has been released.
23459
23460 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
23461
23462         * driver.cs: Rename --resource to --linkres, because that is what
23463         we do currently, we dont support --resource yet.
23464
23465         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
23466
23467 2002-07-25  Martin Baulig  <martin@gnome.org>
23468
23469         * class.cs (MethodData): New public class.  This is a `method builder'
23470         class for a method or one accessor of a Property/Indexer/Event.
23471         (MethodData.GetMethodFlags): Moved here from MemberBase.
23472         (MethodData.ApplyAttributes): Likewise.
23473         (MethodData.ApplyObsoleteAttribute): Likewise.
23474         (MethodData.ApplyConditionalAttribute): Likewise.
23475         (MethodData.ApplyDllImportAttribute): Likewise.
23476         (MethodData.CheckAbstractAndExternal): Likewise.
23477         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
23478         (MethodData.Emit): Formerly known as Method.Emit().
23479         (MemberBase): Moved everything which was specific to a single
23480         accessor/method to MethodData.
23481         (Method): Create a new MethodData and call Define() and Emit() on it.
23482         (Property, Indexer, Event): Create a new MethodData objects for each
23483         accessor and call Define() and Emit() on them.
23484
23485 2002-07-25  Martin Baulig  <martin@gnome.org>
23486
23487         Made MethodCore derive from MemberBase to reuse the code from there.
23488         MemberBase now also checks for attributes.
23489
23490         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
23491         (MemberBase.GetMethodFlags): Moved here from class Method and marked
23492         as virtual.
23493         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
23494         `CallingConventions cc' and `Attributes opt_attrs' arguments.
23495         (MemberBase.ApplyAttributes): New virtual method; applies the
23496         attributes to a method or accessor.
23497         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
23498         (MemberBase.ApplyConditionalAttribute): Likewise.
23499         (MemberBase.ApplyDllImportAttribute): Likewise.
23500         (MemberBase.CheckAbstractAndExternal): Likewise.
23501         (MethodCore.ParameterTypes): This is now a property instead of a
23502         method, it's initialized from DoDefineParameters().
23503         (MethodCore.ParameterInfo): Removed the set accessor.
23504         (MethodCore.DoDefineParameters): New protected virtual method to
23505         initialize ParameterTypes and ParameterInfo.
23506         (Method.GetReturnType): We can now simply return the MemberType.
23507         (Method.GetMethodFlags): Override the MemberBase version and add
23508         the conditional flags.
23509         (Method.CheckBase): Moved some code from Define() here, call
23510         DoDefineParameters() here.
23511         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
23512         here to avoid some larger code duplication.
23513         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
23514         ensure that abstract and external accessors don't declare a body.
23515
23516         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
23517         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
23518         lookup in the attribute's parent classes, so we need to abort as soon
23519         as we found the first match.
23520         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
23521         the attribute has no arguments.
23522
23523         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
23524         of a Method.
23525
23526 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23527
23528         * cs-parser.jay: reverted previous patch.
23529
23530 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23531
23532         * cs-parser.jay: fixed bug #22119.
23533
23534 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23535
23536         * attribute.cs: fixed compilation. The error was:
23537         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
23538         be assigned to before control leaves the current method."
23539         [FIXME:  Filed as bug #28186: MCS must report this error.]
23540
23541 2002-07-25  Martin Baulig  <martin@gnome.org>
23542
23543         * attribute.cs (Attribute.Conditional_GetConditionName): New static
23544         method to pull the condition name ouf of a Conditional attribute.
23545         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
23546         the obsolete message and error flag out of an Obsolete attribute.
23547
23548         * class.cs (Method.GetMethodFlags): New public method to get the
23549         TypeManager.MethodFlags for this method.
23550         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
23551         private methods.
23552         (Method.Define): Get and apply the Obsolete and Conditional attributes;
23553         if we're overriding a virtual function, set the new private variable
23554         `parent_method'; call the new TypeManager.AddMethod().
23555
23556         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
23557         the MethodBuilder and the Method in a PtrHashtable.
23558         (TypeManager.builder_to_method): Added for this purpose.
23559         (TypeManager.MethodFlags): Added IsObsoleteError.
23560         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
23561         Obsolete and Conditional arguments in MethodBuilders.  If we discover
23562         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
23563         the message from the attribute.
23564
23565 2002-07-24  Martin Baulig  <martin@gnome.org>
23566
23567         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
23568         preprocessor directives, ensure that the argument to #define/#undef is
23569         exactly one identifier and that it's actually an identifier.
23570
23571         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
23572         did not work ....
23573
23574 2002-07-24  Martin Baulig  <martin@gnome.org>
23575
23576         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
23577         initialize it to TypeManager.object_type in the constructor.
23578         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
23579         of the `hm.get_current' method if we're using the collection pattern.
23580         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
23581         for the explicit conversion to make it work when we're using the collection
23582         pattern and the `Current' property has a different return type than `object'.
23583         Fixes #27713.
23584
23585 2002-07-24  Martin Baulig  <martin@gnome.org>
23586
23587         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
23588         does not match, but don't report any errors.  This method is called in
23589         order for all methods in a MethodGroupExpr until a matching method is
23590         found, so we don't want to bail out if the first method doesn't match.
23591         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
23592         matches, report the 123.  Fixes #28070.
23593
23594 2002-07-24  Martin Baulig  <martin@gnome.org>
23595
23596         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
23597         TypeManager.TypeToCoreType() to the top of the method so the
23598         following equality checks will work.  Fixes #28107.
23599
23600 2002-07-24  Martin Baulig  <martin@gnome.org>
23601
23602         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
23603         operand is of type uint, and the other operand is of type sbyte,
23604         short or int, the operands are converted to type long." -
23605         Actually do what this comment already told us.  Fixes bug #28106,
23606         added test-150.cs.
23607
23608 2002-07-24  Martin Baulig  <martin@gnome.org>
23609
23610         * class.cs (MethodBase): New abstract class.  This is now a base
23611         class for Property, Indexer and Event to avoid some code duplication
23612         in their Define() and DefineMethods() methods.
23613         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
23614         generic methods for Define() and DefineMethods().
23615         (FieldBase): Derive from MemberBase, not MemberCore.
23616         (Property): Derive from MemberBase, not MemberCore.
23617         (Property.DefineMethod): Moved all the code from this method to the
23618         new MethodBase.DefineAccessor(), just call it with appropriate
23619         argumetnts.
23620         (Property.Define): Call the new Property.DoDefine(), this does some
23621         sanity checks and we don't need to duplicate the code everywhere.
23622         (Event): Derive from MemberBase, not MemberCore.
23623         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
23624         accessors, this will also make them work with interface events.
23625         (Indexer): Derive from MemberBase, not MemberCore.
23626         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
23627         (Indexer.Define): Use the new MethodBase functions.
23628
23629         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
23630         argument to the constructor.
23631         (Interface.FindMembers): Added support for interface events.
23632         (Interface.PopluateEvent): Implemented.
23633
23634         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
23635
23636 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
23637
23638         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
23639         but this is required to check for a method name being the same as
23640         the containing class.  
23641
23642         Handle this now.
23643
23644 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23645
23646         * interface.cs: initialize variable.
23647
23648 2002-07-23  Martin Baulig  <martin@gnome.org>
23649
23650         Implemented the IndexerName attribute in interfaces.
23651
23652         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
23653         name if this is an explicit interface implementation.
23654         (Indexer.InterfaceIndexerName): New public variable.  If we're
23655         implementing an interface indexer, this is the IndexerName in that
23656         interface.  Otherwise, it's the IndexerName.
23657         (Indexer.DefineMethod): If we're implementing interface indexer,
23658         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
23659         and Pending.ImplementIndexer methods.
23660         (Indexer.Define): Also define the PropertyBuilder if we're
23661         implementing an interface indexer and this is neither an explicit
23662         interface implementation nor do the IndexerName match the one in
23663         the interface.
23664
23665         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
23666         If a method is defined here, then we always need to create a proxy
23667         for it.  This is used when implementing interface indexers.
23668         (Pending.IsInterfaceIndexer): New public method.
23669         (Pending.ImplementIndexer): New public method.
23670         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
23671         This is used when implementing interface indexers to define a proxy
23672         if necessary.
23673         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
23674         define a proxy if necessary.
23675
23676         * interface.cs (Interface.IndexerName): New public variable.
23677         (Interface.PopulateIndexer): Set the IndexerName.
23678         (Interface.DefineIndexers): New private method.  Populate all the
23679         indexers and make sure their IndexerNames match.
23680
23681         * typemanager.cs (IndexerPropertyName): Added support for interface
23682         indexers.
23683
23684 2002-07-22  Martin Baulig  <martin@gnome.org>
23685
23686         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
23687         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
23688         ret if HasReturnLabel.
23689         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
23690         variables.
23691
23692         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
23693         and set the ec.LoopBeginTryCatchLevel.
23694         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
23695         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
23696         the current ec.TryCatchLevel, the branch goes out of an exception
23697         block.  In this case, we need to use Leave and not Br.
23698
23699 2002-07-22  Martin Baulig  <martin@gnome.org>
23700
23701         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
23702         block unless the block does not always return or it is contained in
23703         another try { ... } catch { ... } block.  Fixes bug #26506.
23704         Added verify-1.cs to the test suite.
23705
23706 2002-07-22  Martin Baulig  <martin@gnome.org>
23707
23708         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
23709         then we do not always return.  Fixes bug #24985.
23710
23711 2002-07-22  Martin Baulig  <martin@gnome.org>
23712
23713         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
23714         lookup on a per-class level; ie. walk up the class hierarchy until we
23715         found at least one applicable method, then choose the best among them.
23716         Fixes bug #24463 and test-29.cs.
23717
23718 2002-07-22  Martin Baulig  <martin@gnome.org>
23719
23720         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
23721         return types of the methods.  The return type is not part of the
23722         signature and we must not check it to make the `new' modifier work.
23723         Fixes bug #27999, also added test-147.cs.
23724         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
23725
23726         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
23727         on the method's return type.
23728
23729 2002-07-21  Martin Baulig  <martin@gnome.org>
23730
23731         * assign.cs: Make this work if the rightmost source is a constant and
23732         we need to do an implicit type conversion.  Also adding a few more tests
23733         to test-38.cs which should have caught this.
23734
23735         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
23736         target in the makefile for this.  The makefile.gnu is primarily intended
23737         for end-users who don't want to debug the compiler.
23738
23739 2002-07-21  Martin Baulig  <martin@gnome.org>
23740
23741         * assign.cs: Improved the Assign class so it can now handle embedded
23742         assignments (X = Y = Z = something).  As a side-effect this'll now also
23743         consume less local variables.  test-38.cs now passes with MCS, added
23744         a few new test cases to that test.
23745
23746 2002-07-20  Martin Baulig  <martin@gnome.org>
23747
23748         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
23749         instructions.  Fixes bug #27977, also added test-146.cs.
23750
23751 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23752
23753         * cs-tokenizer.cs: fixed getHex ().
23754
23755 2002-07-19  Martin Baulig  <martin@gnome.org>
23756
23757         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
23758         not Type.GetType() to lookup the array type.  This is needed when
23759         we're constructing an array of a user-defined type.
23760         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
23761         single-dimensional arrays, but also for single-dimensial arrays of
23762         type decimal.
23763
23764 2002-07-19  Martin Baulig  <martin@gnome.org>
23765
23766         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
23767         this function is called, it's not allowed to share LocalBuilders
23768         among ILGenerators.
23769
23770 2002-07-19  Martin Baulig  <martin@gnome.org>
23771
23772         * expression.cs (Argument.Resolve): Report an error 118 when trying
23773         to pass a type as argument.
23774
23775 2002-07-18  Martin Baulig  <martin@gnome.org>
23776
23777         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
23778         Conv_R_Un for the signed `long' type.
23779
23780 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
23781
23782         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
23783         `expr' for the temporary result, as that will fail if we do
23784         multiple resolves on the same expression.
23785
23786 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
23787
23788         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
23789         ec.TypeContainer for looking up aliases. 
23790
23791         * class.cs (TypeContainer): Remove LookupAlias from here.
23792
23793         * decl.cs (DeclSpace); Move here.
23794
23795 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
23796
23797         * class.cs (FindMembers): Only call filter if the constructor
23798         bulider is not null.
23799
23800         Also handle delegates in `NestedTypes' now.  Now we will perform
23801         type lookups using the standard resolution process.  This also
23802         fixes a bug.
23803
23804         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
23805         This uses Expressions (the limited kind that can be parsed by the
23806         tree) instead of strings.
23807
23808         * expression.cs (ComposedCast.ToString): Implement, used to flag
23809         errors since now we have to render expressions.
23810
23811         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
23812         FormArrayType. 
23813
23814         * ecore.cs (SimpleName.ToString): ditto.
23815
23816         * cs-parser.jay: Instead of using strings to assemble types, use
23817         Expressions to assemble the type (using SimpleName, ComposedCast,
23818         MemberAccess).  This should fix the type lookups in declarations,
23819         because we were using a different code path for this.
23820
23821         * statement.cs (Block.Resolve): Continue processing statements
23822         even when there is an error.
23823
23824 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
23825
23826         * class.cs (Event.Define): Also remove the `remove' method from
23827         the list of pending items.
23828
23829         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
23830         generate more compact code. 
23831
23832 2002-07-17  Martin Baulig  <martin@gnome.org>
23833
23834         * const.cs (Const.LookupConstantValue): Add support for constant
23835         `unchecked' and `checked' expressions.
23836         Also adding test case test-140.cs for this.
23837
23838 2002-07-17  Martin Baulig  <martin@gnome.org>
23839
23840         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
23841         check whether mi.ReturnType implements the IEnumerator interface; the
23842         `==' and the IsAssignableFrom() will fail in this situation.
23843
23844 2002-07-16  Ravi Pratap  <ravi@ximian.com>
23845
23846         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
23847         here too.
23848
23849 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23850
23851         * expression.cs: fixed bug #27811.
23852
23853 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
23854
23855         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
23856         Molaro: when we are a ref, the value already contains a pointer
23857         value, do not take the address of it.
23858
23859 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
23860         * removed mb-parser.jay and mb-tokenizer.cs
23861
23862 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23863
23864         * expression.cs: check against the building corlib void type.
23865
23866 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
23867
23868         * ecore.cs: fix for valuetype static readonly fields: when 
23869         initializing them, we need their address, not the address of a copy.
23870
23871 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
23872
23873         * typemanager.cs: register also enum_type in corlib.
23874
23875 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23876
23877         * class.cs: allow calling this (but not base) initializers in structs.
23878
23879 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
23880
23881         * ecore.cs: make sure we compare against the building base types
23882         in GetTypeSize ().
23883
23884 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
23885
23886         * typemanager.cs: fix TypeToCoreType() to handle void and object
23887         (corlib gets no more typerefs after this change).
23888
23889 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
23890
23891         * expression.cs (ArrayCreation.EmitArrayArguments): use
23892         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
23893
23894         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
23895         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
23896         array indexes, the runtime actually forbids them.
23897
23898         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
23899         for array arguments here.
23900
23901         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
23902         instead of the default for ValueTypes.
23903
23904         (New.DoEmit): Use IsValueType instead of
23905         IsSubclassOf (value_type)
23906         (New.DoResolve): ditto.
23907         (Invocation.EmitCall): ditto.
23908
23909         * assign.cs (Assign): ditto.
23910
23911         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
23912         Statements *are* currently doing part of their resolution during
23913         Emit.  
23914
23915         Expressions do always resolve during resolve, but statements are
23916         only required to propagate resolution to their children.
23917
23918 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
23919
23920         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
23921
23922         (LoadAssembly): Do not add the dll if it is already specified
23923
23924         (MainDriver): Add the System directory to the link path at the end,
23925         after all the other -L arguments. 
23926
23927         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
23928         wrong opcode for loading bytes and bools (ldelem.i1 instead of
23929         ldelem.u1) and using the opposite for sbytes.
23930
23931         This fixes Digger, and we can finally run it.
23932
23933         * driver.cs (UnixParseOption): Move the option parsing here.  
23934         (CSCParseOption): Implement CSC-like parsing of options.
23935
23936         We now support both modes of operation, the old Unix way, and the
23937         new CSC-like way.  This should help those who wanted to make cross
23938         platform makefiles.
23939
23940         The only thing broken is that /r:, /reference: and /lib: are not
23941         implemented, because I want to make those have the same semantics
23942         as the CSC compiler has, and kill once and for all the confussion
23943         around this.   Will be doing this tomorrow.
23944
23945         * statement.cs (Unsafe.Resolve): The state is checked during
23946         resolve, not emit, so we have to set the flags for IsUnsfe here.
23947
23948 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
23949
23950         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
23951         not catch the Error_ObjectRefRequired in SimpleName (as it is
23952         possible to have a class/instance variable name that later gets
23953         deambiguated), we have to check this here.      
23954
23955 2002-07-10  Ravi Pratap  <ravi@ximian.com>
23956
23957         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
23958         make static and put into Expression.
23959
23960         (Event.Define): Register the private field of the event with the 
23961         TypeManager so that GetFieldFromEvent can get at it.
23962
23963         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
23964         keep track of the private field associated with an event which
23965         has no accessors.
23966
23967         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
23968         private field.
23969
23970         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
23971
23972 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
23973
23974         * expression.cs (Binary.EmitBranchable): this routine emits the
23975         Binary expression in a branchable context.  This basically means:
23976         we need to branch somewhere, not just get the value on the stack.
23977
23978         This works together with Statement.EmitBoolExpression.
23979
23980         * statement.cs (Statement.EmitBoolExpression): Use
23981         EmitBranchable. 
23982
23983 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
23984
23985         * statement.cs (For): Reduce the number of jumps in loops.
23986
23987         (For): Implement loop inversion for the For statement.
23988
23989         (Break): We can be breaking out of a Try/Catch controlled section
23990         (foreach might have an implicit try/catch clause), so we need to
23991         use Leave instead of Br.
23992
23993         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
23994         now).  If the instace expression supports IMemoryLocation, we use
23995         the AddressOf method from the IMemoryLocation to extract the
23996         address instead of emitting the instance.
23997
23998         This showed up with `This', as we were emitting the instance
23999         always (Emit) instead of the Address of This.  Particularly
24000         interesting when This is a value type, as we dont want the Emit
24001         effect (which was to load the object).
24002
24003 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
24004
24005         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
24006
24007         * statement.cs (Checked): Set the CheckedState during the resolve
24008         process too, as the ConvCast operations track the checked state on
24009         the resolve process, and not emit.
24010
24011         * cs-parser.jay (namespace_member_declaration): Flag that we have
24012         found a declaration when we do.  This is used to flag error 1529
24013
24014         * driver.cs: Report ok when we display the help only.
24015
24016 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
24017
24018         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
24019
24020 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
24021
24022         * cs-tokenizer.cs (define): We also have to track locally the
24023         defines.  AllDefines is just used for the Conditional Attribute,
24024         but we also need the local defines for the current source code. 
24025
24026 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
24027
24028         * statement.cs (While, For, Do): These loops can exit through a
24029         Break statement, use this information to tell whether the
24030         statement is the last piece of code.
24031
24032         (Break): Flag that we break.
24033
24034         * codegen.cs (EmitContexts): New `Breaks' state variable.
24035
24036 2002-07-03  Martin Baulig  <martin@gnome.org>
24037
24038         * class.cs (TypeContainer.MethodModifiersValid): Allow override
24039         modifiers in method declarations in structs.  Otherwise, you won't
24040         be able to override things like Object.Equals().
24041
24042 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
24043
24044         * class.cs (Method, Property, Indexer): Do not allow the public
24045         modifier to be used in explicit interface implementations.
24046
24047         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
24048         override modifiers in method declarations in structs
24049
24050 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
24051
24052         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
24053         integer or real overflow, report an error
24054
24055 2002-07-02  Martin Baulig  <martin@gnome.org>
24056
24057         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
24058         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
24059         to tell the runtime about our newly created System.Object and
24060         System.ValueType types.
24061
24062 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
24063
24064         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
24065         struct instead of Ldarg/Starg.
24066
24067 2002-07-02  Martin Baulig  <martin@gnome.org>
24068
24069         * expression.cs (Indirection.Indirection): Call
24070         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
24071
24072 2002-07-02  Martin Baulig  <martin@gnome.org>
24073
24074         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
24075         ValueType, call TypeManager.TypeToCoreType() on it.
24076         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
24077         the OpCodes.Newarr argument.
24078
24079 2002-07-02  Martin Baulig  <martin@gnome.org>
24080
24081         * expression.cs (Invocation.EmitCall): When compiling corlib,
24082         replace all calls to the system's System.Array type to calls to
24083         the newly created one.
24084
24085         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
24086         System.Array methods.
24087         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
24088         from the system's System.Array type which must be replaced.
24089
24090 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
24091
24092         * typemanager.cs: load unverifiable_code_ctor so we can build
24093         corlib using the correct type. Avoid using GetTypeCode() with
24094         TypeBuilders.
24095         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
24096         TypeManager.object_type to allow building corlib.
24097
24098 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
24099
24100         * ecore.cs: handle System.Enum separately in LoadFromPtr().
24101
24102 2002-07-01  Martin Baulig  <martin@gnome.org>
24103
24104         * class.cs: Make the last change actually work, we need to check
24105         whether `ifaces != null' to avoid a crash.
24106
24107 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24108
24109         * class.cs: when we build structs without fields that implement
24110         interfaces, we need to add the interfaces separately, since there is
24111         no API to both set the size and add the interfaces at type creation
24112         time.
24113
24114 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24115
24116         * expression.cs: the dimension arguments to the array constructors
24117         need to be converted if they are a long.
24118
24119 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
24120
24121         * class.cs: don't emit ldarg.0 if there is no parent constructor
24122         (fixes showstopper for corlib).
24123
24124 2002-06-29  Martin Baulig  <martin@gnome.org>
24125
24126         MCS now compiles corlib on GNU/Linux :-)
24127
24128         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
24129         ie. check for MethodImplOptions.InternalCall.
24130
24131         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
24132         and TypeManager.attribute_type are null, so we must explicitly check
24133         whether parent is not null to find out whether it's an attribute type.
24134         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
24135         and SetBuilder, not only if the property is neither abstract nor external.
24136         This is necessary to set the MethodImplOptions on the accessor methods.
24137         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
24138         SetBuilder, see Property.Emit().
24139
24140         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
24141         populate "System.Object", "System.ValueType" and "System.Attribute" since
24142         they've already been populated from BootCorlib_PopulateCoreTypes().
24143
24144 2002-06-29  Martin Baulig  <martin@gnome.org>
24145
24146         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
24147         is the NullLiteral, we also need to make sure that target_type is not
24148         an enum type.   
24149
24150 2002-06-29  Martin Baulig  <martin@gnome.org>
24151
24152         * rootcontext.cs (RootContext.ResolveCore): We must initialize
24153         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
24154         before calling BootstrapCorlib_ResolveDelegate ().
24155
24156 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24157
24158         * statement.cs: fixed build-breaker. All tests passed ok.
24159
24160 2002-06-27  Martin Baulig  <martin@gnome.org>
24161
24162         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
24163         for System.Decimal when compiling corlib.
24164
24165 2002-06-27  Martin Baulig  <martin@gnome.org>
24166
24167         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
24168         switch blocks which contain nothing but a default clause.
24169
24170 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
24171
24172        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
24173
24174 2002-06-27  Martin Baulig  <martin@gnome.org>
24175
24176         * ecore.cs (PropertyExpr.PropertyExpr): Call
24177         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
24178
24179         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
24180         is already a TypeBuilder.
24181
24182 2002-06-27  Martin Baulig  <martin@gnome.org>
24183
24184         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
24185         `target_type == TypeManager.array_type', not IsAssignableFrom() in
24186         the "from an array-type to System.Array" case.  This makes it work
24187         when compiling corlib.
24188
24189 2002-06-27  Martin Baulig  <martin@gnome.org>
24190
24191         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
24192         non-static PropertyExpr, set its InstanceExpression.  This makes
24193         the `ICollection.Count' property work in System/Array.cs.
24194
24195 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
24196
24197         * driver.cs: Made error handling more consistent.  Errors now
24198         tracked by Report class, so many methods which used to return int
24199         now return void.  Main() now prints success/failure and 
24200         errors/warnings message.
24201
24202         Renamed '--probe' compiler argument to '--expect-error'.  Removed
24203         the magic number return values (123 and 124).  Now, if the
24204         expected error occurs, the compiler exits with success (exit value
24205         0).  If the compilation completes without seeing that particular
24206         error, the compiler exits with failure (exit value 1).  The
24207         makefile in mcs/errors has been changed to handle the new behaviour.
24208
24209         * report.cs: Made 'expected error' number a property and renamed
24210         it from 'Probe' to 'ExpectedError'.
24211
24212         * genericparser.cs: Removed error handling support, since it is
24213         now all done by Report class.
24214
24215         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
24216         class, so parse() no longer returns an int.
24217
24218         * namespace.cs: Use Report.Error instead of GenericParser.error
24219
24220 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
24221
24222         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
24223         TypeContainer.AddOperator): At the front of the list put the
24224         explicit implementations, so they get resolved/defined first. 
24225
24226 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
24227
24228         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
24229         interface type is implemented by this TypeContainer.  Used during
24230         explicit interface implementation.
24231
24232         (Property.Define, Indexer.Define, Method.Define): Validate that
24233         the given interface in the explicit implementation is one of the
24234         base classes for the containing type.
24235
24236         Also if we are explicitly implementing an interface, but there is
24237         no match in the pending implementation table, report an error.
24238
24239         (Property.Define): Only define the property if we are
24240         not explicitly implementing a property from an interface.  Use the
24241         correct name also for those properties (the same CSC uses,
24242         although that is really not needed).
24243
24244         (Property.Emit): Do not emit attributes for explicitly implemented
24245         properties, as there is no TypeBuilder.
24246
24247         (Indexer.Emit): ditto.
24248
24249         Hiding then means that we do not really *implement* a pending
24250         implementation, which makes code fail.
24251
24252 2002-06-22  Martin Baulig  <martin@gnome.org>
24253
24254         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
24255         the return value of Object.GetType().  [FIXME: we need to do this whenever
24256         we get a type back from the reflection library].
24257
24258 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
24259
24260         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
24261
24262 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
24263
24264         * attribute.cs: Return null if we can not look up the type.
24265
24266         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
24267         the interface types found.
24268
24269         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
24270         interface types found.
24271
24272         * typemanager.cs (GetInterfaces): Make this routine returns alll
24273         the interfaces and work around the lame differences between
24274         System.Type and System.Reflection.Emit.TypeBuilder in the results
24275         result for GetInterfaces.
24276
24277         (ExpandInterfaces): Given an array of interface types, expand and
24278         eliminate repeated ocurrences of an interface.  This expands in
24279         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
24280         be IA, IB, IC.
24281
24282 2002-06-21  Martin Baulig  <martin@gnome.org>
24283
24284         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
24285         on System.Enum.
24286
24287 2002-06-21  Martin Baulig  <martin@gnome.org>
24288
24289         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
24290         and called with one of the core types, return the corresponding typebuilder for
24291         that type.
24292
24293         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
24294         element type.
24295
24296 2002-06-21  Martin Baulig  <martin@gnome.org>
24297
24298         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
24299         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
24300         (Expression.ConvertReferenceExplicit): Likewise.
24301
24302         * expression.cs (ElementAccess.DoResolve): Likewise.
24303         (ElementAccess.DoResolveLValue): Likewise.
24304
24305 2002-06-10  Martin Baulig  <martin@gnome.org>
24306
24307         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
24308         add the "value" parameter to the parameter list.
24309
24310         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
24311         to our caller.
24312
24313 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
24314
24315         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
24316         the argument to an int, uint, long or ulong, per the spec.  Also
24317         catch negative constants in array creation.
24318
24319 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
24320
24321         * class.cs: do not allow the same interface to appear twice in
24322         the definition list.
24323
24324 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
24325
24326         * ecore.cs: don't use ldlen with System.Array.
24327
24328 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
24329
24330         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
24331
24332 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
24333
24334         * modifiers.cs: produce correct field attributes for protected
24335         internal. Easy fix so miguel can work on ther harder stuff:-)
24336
24337 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
24338
24339         * pending.cs: New file.  Move the code from class.cs here.
24340         Support clearning the pending flag for all methods (when not doing
24341         explicit interface implementation).
24342
24343 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
24344
24345         * rootcontext.cs: added a couple more types needed to bootstrap.
24346
24347 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
24348
24349         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
24350         constructor in the type, instead of any constructor in the type
24351         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
24352         a bug in the Mono runtime when applying the params attribute). 
24353
24354 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
24355         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
24356
24357 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
24358
24359         * expression.cs (Unary.ResolveOperator): Use TypeManager
24360         to resolve the type.
24361
24362 2002-06-13  Ravi Pratap  <ravi@ximian.com>
24363
24364         * cs-parser.jay (enum_member_declaration): Pass in the attributes
24365         attached.
24366
24367         * enum.cs (AddEnumMember): Add support to store the attributes associated 
24368         with each member too.
24369
24370         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
24371         field builders too - this takes care of the enum member case.
24372
24373 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
24374
24375         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
24376         address-of operator on both value types and pointers.
24377
24378 2002-06-10  Martin Baulig  <martin@gnome.org>
24379
24380         * interface.cs (Interface.PopulateIndexer): Add the indexer's
24381         PropertyBuilder to the `property_builders' list.
24382
24383         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
24384         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
24385         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
24386         find any indexers which are inherited from an interface.
24387
24388 2002-06-09  Martin Baulig  <martin@gnome.org>
24389
24390         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
24391         the same type as the constant if necessary.  There's also a test-130.cs
24392         for this.
24393
24394         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
24395
24396         * typemanager.cs (TypeManager.ChangeType): Previously known as
24397         Enum.ChangeEnumType().
24398
24399 2002-06-09  Martin Baulig  <martin@gnome.org>
24400
24401         * expression.cs (Cast.TryReduce): Added support for consts.
24402
24403 2002-06-08  Ravi Pratap  <ravi@ximian.com>
24404
24405         * class.cs (Accessor): Hold attributes information so we can pass
24406         it along.
24407
24408         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
24409         Modify to pass in attributes attached to the methods.
24410
24411         (add_accessor_declaration, remove_accessor_declaration): Ditto.
24412
24413         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
24414         to handle the Accessor kind :-)
24415
24416         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
24417
24418 2002-06-08  Martin Baulig  <martin@gnome.org>
24419
24420         * expression.cs (Unary.TryReduceNegative): Added support for
24421         ULongConstants.
24422
24423 2002-06-08  Martin Baulig  <martin@gnome.org>
24424
24425         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
24426         name can't be found in the `defined_names' - the caller will do a
24427         MemberLookup in this case and thus find methods in System.Enum
24428         such as Enum.IsDefined().
24429
24430 2002-06-08  Martin Baulig  <martin@gnome.org>
24431
24432         * enum.cs (Enum.ChangeEnumType): This is a custom version of
24433         Convert.ChangeType() which works with TypeBuilder created types.
24434         (Enum.LookupEnumValue, Enum.Define): Use it here.
24435
24436         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
24437         `TypeBuilder.BaseType != null' check.
24438         (TypeContainer.FindMembers): Only lookup parent members if we
24439         actually have a parent.
24440         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
24441         (ConstructorInitializer.Resolve): Likewise.
24442
24443         * interface.cs (Interface.FindMembers): Added
24444         `TypeBuilder.BaseType != null' check.
24445
24446         * rootcontext.cs (RootContext.ResolveCore): Added
24447         "System.Runtime.CompilerServices.IndexerNameAttribute" to
24448         classes_second_stage.
24449
24450         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
24451         debug_type and trace_type when compiling with --nostdlib.       
24452
24453 2002-06-07  Martin Baulig  <martin@gnome.org>
24454
24455         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
24456         (AddField): Set it to true when adding a non-static field.
24457         (DefineType): Use `have_nonstatic_fields' to find out whether we
24458         have non-static fields, not `Fields != null'.
24459
24460 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
24461
24462         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
24463         dereferencing a null on the static-field code path)
24464
24465 2002-05-30  Martin Baulig  <martin@gnome.org>
24466
24467         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
24468         to take command line arguments.  Use reflection to call the new
24469         custom `Initialize' function on the symbol writer and pass it the
24470         command line arguments.
24471
24472         * driver.cs (--debug-args): New command line argument to pass command
24473         line arguments to the symbol writer.
24474
24475 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
24476
24477         * assign.cs (DoResolve): Forgot to do the implicit conversion to
24478         the target type for indexers and properties.  Thanks to Joe for
24479         catching this.
24480
24481 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
24482
24483         * typemanager.cs (MethodFlags): returns the method flags
24484         (Obsolete/ShouldIgnore) that control warning emission and whether
24485         the invocation should be made, or ignored. 
24486
24487         * expression.cs (Invocation.Emit): Remove previous hack, we should
24488         not do this on matching a base type, we should do this based on an attribute
24489
24490         Only emit calls to System.Diagnostics.Debug and
24491         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
24492         on the command line.
24493
24494         * rootcontext.cs: Global settings for tracing and debugging.
24495
24496         * cs-tokenizer.cs (define): New utility function to track
24497         defines.   Set the global settings for TRACE and DEBUG if found.
24498
24499 2002-05-25  Ravi Pratap  <ravi@ximian.com>
24500
24501         * interface.cs (Populate*): Pass in the TypeContainer as well as
24502         the DeclSpace as parameters so that we can create EmitContexts and
24503         then use that to apply attributes etc.
24504
24505         (PopulateMethod, PopulateEvent, PopulateProperty)
24506         (PopulateIndexer): Apply attributes everywhere.
24507
24508         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
24509         etc.
24510
24511         (ApplyAttributes): Update accordingly.
24512
24513         We now apply interface attributes for all members too.
24514
24515 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
24516
24517         * class.cs (Indexer.Define); Correctly check if we are explicit
24518         implementation (instead of checking the Name for a ".", we
24519         directly look up if the InterfaceType was specified).
24520
24521         Delay the creation of the PropertyBuilder.
24522
24523         Only create the PropertyBuilder if we are not an explicit
24524         interface implementation.   This means that explicit interface
24525         implementation members do not participate in regular function
24526         lookups, and hence fixes another major ambiguity problem in
24527         overload resolution (that was the visible effect).
24528
24529         (DefineMethod): Return whether we are doing an interface
24530         implementation. 
24531
24532         * typemanager.cs: Temporary hack until we get attributes in
24533         interfaces (Ravi is working on that) and we get IndexerName
24534         support in interfaces.
24535
24536         * interface.cs: Register the indexers as properties.
24537
24538         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
24539         warning, I have verified that this is a bug in the .NET runtime
24540         (JavaScript suffers of the same problem).
24541
24542         * typemanager.cs (MemberLookup): When looking up members for
24543         interfaces, the parent of an interface is the implicit
24544         System.Object (so we succeed in searches of Object methods in an
24545         interface method invocation.  Example:  IEnumerable x;  x.ToString
24546         ()) 
24547
24548 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
24549
24550         * class.cs (Event): Events should also register if they do
24551         implement the methods that an interface requires.
24552
24553         * typemanager.cs (MemberLookup); use the new GetInterfaces
24554         method. 
24555
24556         (GetInterfaces): The code used to lookup interfaces for a type is
24557         used in more than one place, factor it here. 
24558
24559         * driver.cs: Track the errors at the bottom of the file, we kept
24560         on going.
24561
24562         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
24563         instance if the method we are calling is static!
24564
24565 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
24566
24567         * attribute.cs (ApplyAttributes): Make this function filter out
24568         the IndexerName attribute (as that attribute in reality is never
24569         applied) and return the string constant for the IndexerName
24570         attribute. 
24571
24572         * class.cs (TypeContainer.Emit): Validate that all the indexers
24573         have the same IndexerName attribute, and if so, set the
24574         DefaultName attribute on the class. 
24575
24576         * typemanager.cs: The return value might contain other stuff (not
24577         only methods).  For instance, consider a method with an "Item"
24578         property and an Item method.
24579
24580         * class.cs: If there is a problem with the parameter types,
24581         return. 
24582
24583 2002-05-24  Ravi Pratap  <ravi@ximian.com>
24584
24585         * ecore.cs (ImplicitConversionExists): Wrapper function which also
24586         looks at user defined conversion after making a call to 
24587         StandardConversionExists - we need this for overload resolution.
24588
24589         * expression.cs : Update accordingly the various method calls.
24590
24591         This fixes 2 bugs filed against implicit user defined conversions 
24592
24593 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
24594
24595         * statement.cs: Track the result of the assignment.
24596
24597 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
24598
24599         * expression.cs (MemberAccess): Improved error reporting for
24600         inaccessible members.
24601
24602 2002-05-22  Martin Baulig  <martin@gnome.org>
24603
24604         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
24605         itself with debugging support.
24606
24607 2002-05-22  Martin Baulig  <martin@gnome.org>
24608
24609         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
24610         Removed, this isn't needed anymore.
24611
24612 2002-05-20  Martin Baulig  <martin@gnome.org>
24613
24614         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
24615         be underlying type for an enum.
24616
24617 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
24618
24619         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
24620         that splits out the loading of just the core types.
24621
24622         * rootcontext.cs (ResolveCore): Split the struct resolution in
24623         two, so we can load the enumeration underlying types before any
24624         enums are used.
24625
24626         * expression.cs (Is): Bandaid until we fix properly Switch (see
24627         bug #24985 for details).
24628
24629         * typemanager.cs (ImplementsInterface): The hashtable will contain
24630         a null if there are no interfaces implemented.
24631
24632 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
24633
24634         * cs-parser.jay (indexer_declarator): It is fine to have array
24635         parameters
24636
24637 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
24638
24639         * typemanager.cs: (RegisterBuilder): New function used to register
24640         TypeBuilders that implement interfaces.  Since
24641         TypeBuilder.GetInterfaces (as usual) does not work with lame
24642         Reflection.Emit. 
24643         (AddUserType): register interfaces.
24644
24645         (ImplementsInterface): Use the builder_to_ifaces hash if we are
24646         dealing with TypeBuilder.  Also, arrays are showing up as
24647         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
24648         methods can not be invoked on them!
24649
24650         * ecore.cs (ExplicitReferenceConversionExists): Made public.
24651         (ImplicitReferenceConversionExists): Split out from
24652         StandardConversionExists. 
24653
24654         * expression.cs (As): We were only implementing one of the three
24655         cases for the as operator.  We now implement them all.
24656         (Is): Implement the various other cases for Is as well.
24657
24658         * typemanager.cs (CACHE): New define used to control if we want or
24659         not the FindMembers cache.  Seems to have a negative impact on
24660         performance currently
24661
24662         (MemberLookup): Nested types have full acess to
24663         enclosing type members
24664
24665         Remove code that coped with instance/static returns for events, we
24666         now catch this in RealFindMembers.
24667
24668         (RealFindMembers): only perform static lookup if the instance
24669         lookup did not return a type or an event.  
24670
24671 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
24672
24673         * assign.cs (CompoundAssign): We pass more semantic information
24674         now to Compound Assignments than we did before: now we have all
24675         the information at hand, and now we resolve the target *before* we
24676         do the expression expansion, which allows the "CacheValue" method
24677         to have the effect we intended (before, a [x] += 1 would generate
24678         two differen ArrayAccess expressions from the ElementAccess,
24679         during the resolution process).
24680
24681         (CompoundAssign.DoResolve): Resolve target and original_source here.
24682
24683 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
24684
24685         * expression.cs (ArrayAccess): dropped debugging information. 
24686
24687         * typemanager.cs: Small bug fix: I was always returning i_members,
24688         instead of one of i_members or s_members (depending on which had
24689         the content).
24690
24691         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
24692         method is invoked before any code generation takes place, and it
24693         is a mechanism to inform that the expression will be invoked more
24694         than once, and that the method should use temporary values to
24695         avoid having side effects
24696
24697         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
24698
24699         * ecore.cs (Expression.CacheTemporaries): Provide empty default
24700         implementation.
24701
24702         * expression.cs (Indirection, ArrayAccess): Add support for
24703         CacheTemporaries in these two bad boys. 
24704
24705         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
24706         ldobj or ldind_ref.  
24707         (StoreFromPtr): Handle stobj as well.
24708
24709         * expression.cs (UnaryMutator): Share more code.
24710
24711         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
24712         down: I was not tracking the Filter function as well, which
24713         was affecting the results of the cache.
24714
24715 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
24716
24717         * attribute.cs: Remove the hack to handle the CharSet property on
24718         StructLayouts. 
24719
24720 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
24721
24722         * attribute.cs (DoResolve): More uglyness, we now only try to
24723         resolve the attribute partially, to extract the CharSet
24724         information (only if we are a StructLayout attribute).  Otherwise 
24725
24726         (GetExtraTypeInfo): Add some code to conditionally kill in the
24727         future this.   I am more and more convinced that the .NET
24728         framework has special code to handle the attribute setting on
24729         certain elements.
24730
24731         * expression.cs (IsParamsMethodApplicable): Revert my previous
24732         foreach change here, it was wrong.
24733
24734 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
24735
24736         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
24737         (pp_expr): do not abort on unknown input, just return.
24738         (eval): abort if there are pending chars.
24739
24740         * attribute.cs (Attribute.Resolve): Positional parameters are
24741         optional.  Deal with that case.
24742
24743         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
24744         the Ansi/Unicode/Auto information for the type.
24745
24746         (TypeContainer.DefineType): instantiate the EmitContext here, as
24747         we will be using it during the type definition (to resolve
24748         attributes) and during the emit phase.
24749
24750         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
24751         to pull type information out of the attributes
24752
24753         (Attribute.Resolve): track the constructor builder, and allow for
24754         multiple invocations (structs and classes will use this).
24755
24756         * ecore.cs (MemberLookupFinal): new version with all the
24757         parameters customizable.
24758
24759         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
24760         constructors.  Return if the result value is null (as the error
24761         would have been flagged already by MemberLookupFinal)
24762
24763         Do not allow instances of abstract classes or interfaces to be
24764         created.
24765
24766         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
24767         We have to compare the assembly property here when dealing with
24768         FamANDAssem and Assembly access modifiers, because we might be
24769         creating an assembly from *modules* (that means that we are not
24770         getting TypeBuilders for types defined in other modules that are
24771         part of this assembly).
24772
24773         (Method.Emit): If the method is marked abstract and has a body,
24774         emit an error. 
24775
24776         (TypeContainer.DefineMembers): If both the defined member and the
24777         parent name match are methods, then do not emit any warnings: let
24778         the Method.Define routine take care of flagging warnings.  But if
24779         there is a mismatch (method overrides something else, or method is
24780         overriwritten by something, then emit warning).
24781
24782         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
24783         set to null, this means `do not check for the return type on the
24784         signature'. 
24785
24786         (Method.Define): set the return type for the method signature to
24787         null, so that we get methods with the same name and parameters and
24788         different return types.  This is used to flag warning 114 (you are
24789         hiding a method, and you probably want to use the new/override
24790         keywords instead).
24791
24792         * typemanager.cs (MemberLookup): Implemented proper access
24793         control, closing a long standing set of bug reports.  The problem
24794         was that the Framework only has two bits: Public and NonPublic,
24795         and NonPublic includes private and protected methods, but we need
24796         to enforce the FamANDAssem, FamOrAssem and Family. 
24797
24798 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
24799
24800         * statement.cs (GotoCase): Return true: Ammounts to giving up
24801         knowledge on whether we return or not, and letting the other case
24802         be responsible for it.
24803
24804 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
24805
24806         * driver.cs: Do not load directories for each file processed, only
24807         do it if there is a pattern.
24808
24809         * ecore.cs: Report readonly assigns here as well, as we might have
24810         been resolved only by MemberAccess.
24811
24812         (SimpleName.SimpleNameResolve): Also be useful for LValue
24813         resolution.   We need this to propagate assign to local readonly variables
24814
24815         * typemanager.cs: Use a ptrhashtable for the criteria, because we
24816         do not want to reuse potential criteria memory.
24817
24818         * class.cs (MyEventBuilder): Set reflected_type;
24819
24820         * ecore.cs (Constantify): Added support for constifying bools.
24821
24822         (RootContext.LookupType): Added a cache for values looked up in
24823         the declaration space.
24824
24825         * typemanager.cs (FindMembers): Now is a front-end to
24826         RealFindMembers, and provides a two-level hashtable-based cache to
24827         the request.  
24828
24829         15% performance improvement: from 22.5 to 19.2 seconds.
24830
24831         * expression.cs (IsParamsMethodApplicable): use foreach.
24832         (Invocation.DoResolve): ditto.
24833         (New.DoResolve): ditto.
24834         (ArrayCreation.DoResolve): ditto.
24835
24836         * ecore.cs (FindMostEncompassingType): use foreach.
24837
24838         * delegate.cs (NewDelegate.DoResolve): Use foreach
24839
24840         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
24841         (RemoveMethods): use foreach.
24842
24843         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
24844         nested foreach statements instead of for, and also break out of
24845         the inner loop once a match is found.
24846
24847         (Invocation.OverloadResolve): Use foreach, simplify the code. 
24848
24849 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
24850
24851         * cfold.cs (BinaryFold): During an enumeration evaluation context,
24852         we actually unwrap the expression to allow for extra information
24853         to be extracted. 
24854
24855         * expression.cs: Use Shr_Un on unsigned operations. 
24856
24857 2002-05-08  Ravi Pratap  <ravi@ximian.com>
24858
24859         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
24860         applicable operators was not being considered correctly. This closes
24861         the bug Miguel reported.
24862
24863 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
24864
24865         * attribute.cs: check that the type derives from System.Attribute
24866         and report the correct error in that case (moved the duplicate code to
24867         its own method, too).
24868
24869 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
24870
24871         * attribute.cs: lookup attribute type name as the spec says: first the
24872         bare attribute name and then name + "Attribute" (nant compiles with
24873         mcs after this fix).
24874
24875 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
24876
24877         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
24878         Because of the way we parse things, we should try to see if a
24879         UIntConstant can fit in an integer.
24880
24881 2002-05-07  Ravi Pratap  <ravi@ximian.com>
24882
24883         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
24884         when we are in an explicit context.
24885
24886         (ConvertReferenceExplicit): When converting from Iface type S to Class
24887         T make sure the rules are implemented as an OR.
24888
24889         * parameter.cs (ParameterType): Make it a property for now although the
24890         purpose really isn't anything immediate.
24891
24892         * expression.cs (Is*Applicable): Do better checking on the parameter type
24893         of a ref/out parameter. The ones from the system assemblies are already 
24894         marked with the correct type so we don't need to do any correction.
24895
24896         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
24897         the object type is standard too so include that.
24898
24899 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
24900
24901         * ecore.cs (StandardConversionExists): Augment with missing code:
24902         deal with IntConstant, LongConstants and Enumerations.
24903
24904         * assign.cs: Report the error, instead of failing silently
24905
24906         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
24907         typecontainer that they are declared, because the
24908         typecontainer/namespace will have the list of using clauses that
24909         need to be applied.
24910
24911         Assembly Attributes were escaping the normal registration
24912         mechanism. 
24913
24914         (EmitCode): Apply attributes within an EmitContext that represents
24915         the container they were declared on.
24916
24917         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
24918
24919 2002-05-06  Ravi Pratap  <ravi@ximian.com>
24920
24921         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
24922         Revamp completely - make much cleaner as we now operate only
24923         on a set of Types.
24924
24925         (FindMostSpecificSource, FindMostSpecificTarget): New methods
24926         to implement the logic detailed in the spec more correctly.
24927
24928         (UserDefinedConversion): Update accordingly.
24929
24930 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
24931
24932         * statement.cs: Return flow analysis information up.
24933
24934         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
24935         and the default.
24936
24937         (token): Do not consume an extra character before calling
24938         decimal_digits.
24939
24940 2002-05-06  Piers Haken <piersh@friskit.com>
24941
24942         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
24943
24944 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
24945
24946         * class.cs (Constructor.Emit): Set the IsStatic flag in the
24947         EmitContext during the instance constructor initializer
24948         resolution, to stop access to instance variables.
24949
24950         This is mandated by the spec, last paragraph of the `constructor
24951         initializers' section. 
24952
24953 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
24954
24955         * cs-parser.jay, class.cs (Accessor): new class used to represent
24956         an accessor (get or set).  In the past we used `null' to represent
24957         a missing accessor.  But this is ambiguous because there was no
24958         way to tell in abstract indexers/properties if one of them was
24959         specified.
24960
24961         Now there is a way of addressing that.
24962
24963         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
24964         instead of FindMembers.
24965
24966         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
24967         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
24968
24969         * attribute.cs: Treat indexers and properties as the same in terms
24970         of applying attributes
24971
24972         * ecore.cs (FindMostEncompassedType): Use statically initialized
24973         EmptyExpressions()s like we do elsewhere to avoid creating useless
24974         objects (and we take this out of the tight loop).
24975
24976         (GetConversionOperators): Move the code to extract the actual
24977         operators to a separate routine to clean things up.
24978
24979 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
24980
24981         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
24982         events are always registered FieldBuilders.
24983
24984         * class.cs (FieldBase): New class shared by Fields 
24985
24986         * delegate.cs: If we are a toplevel delegate, use our full name.
24987         If we are a nested delegate, then only use our tail name.
24988
24989 2002-05-02  Ravi Pratap  <ravi@ximian.com>
24990
24991         * expression.cs (IsApplicable): Ensure that we add the "&" to
24992         ref/out types before comparing it with the type of the argument.
24993
24994         (IsParamsMethodApplicable): Ditto.
24995
24996         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
24997         silly me ;-)
24998
24999         * delegate.cs : Handle the case when we have more than one applicable
25000         method. Flag an error only when we finish checking all.
25001
25002 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
25003
25004         * expression.cs: Add support for boolean static initializers.
25005
25006 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
25007
25008         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
25009
25010         * parameter.cs (ComputeParameterTypes,
25011         ComputeAndDefineParameterTypes): Better error handling: now we
25012         clear the `types' cache if we fail during any of the type lookups.
25013         We also return the status code correctly to our caller
25014
25015         * delegate.cs: If we fail to define a delegate, abort the extra
25016         steps. 
25017
25018         * expression.cs (Binary.ResolveOperator): for
25019         operator==(object,object) and operator !=(object, object) we also
25020         have to verify that there is an implicit conversion from one to
25021         the other.
25022
25023         (ArrayAccess.DoResolve): Array Access can operate on
25024         non-variables. 
25025
25026 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
25027
25028         * assign.cs (CompoundAssign): A new class used as a "flag" that
25029         the assignment actually is happening as part of a compound
25030         assignment operator.
25031
25032         During compound assignment, a few new rules exist to enable things
25033         like:
25034
25035         byte b |= 1 + 2
25036
25037         From the spec:
25038
25039         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
25040         to the type of x) if y is implicitly convertible to the type of x,
25041         and the operator is a builtin operator and the return type of the
25042         operator is explicitly convertible to the type of x. 
25043
25044         * rootcontext.cs: Reset warning level to 2.  4 catches various
25045         "interesting" features in mcs, we must clean this up at some
25046         point, but currently am trying to kill other bugs ;-)
25047
25048         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
25049         in container classes as well.  
25050
25051         * expression.cs (Binary.ResolveOperator): Handle string case
25052         before anything else (as operator overloading does emit an error
25053         before doing anything else).
25054
25055         This code could go away when we move to a table driven model, but
25056         i could not come up with a good plan last night.
25057
25058 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
25059
25060         * typemanager.cs (CSharpName): reimplementation using regex.
25061         * class.cs: added null check for fields in Emit
25062         * rootcontext.cs: set warninglevel to 4
25063
25064 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
25065
25066         * typemanager.cs (CSharpName): reimplemented with Lupus
25067         suggestion.
25068
25069 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
25070
25071         * statement.cs (If): correclty implement Resolve, because we were
25072         not catching sem errors in there.  The same process is needed
25073         everywhere else. 
25074         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
25075
25076
25077         (Statement.Warning_DeadCodeFound): Factorize code.
25078         (While): Report dead code here too.
25079
25080         (Statement): Added Resolve virtual method to allow
25081         for resolution split from the emit code.
25082
25083 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
25084
25085         * statement.cs (EmitBoolExpression): No longer try to resolve the
25086         expression here.    
25087         (MakeBoolean): New utility function that resolve, implicitly
25088         converts to boolean and tags the expression. 
25089
25090
25091         (If, Do): Implement dead code elimination.
25092         (While): Implement loop inversion
25093
25094         (Do, While, For, If): Resolve the expression prior to calling our
25095         code generation.
25096
25097 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
25098
25099         * class.cs:
25100           - added method Report28 (warning: program has more than one entry point)
25101           - added method IsEntryPoint, implements paragraph 10.1 of the spec
25102           - modified method Method.Define, the part at the end of the method
25103
25104         * rootcontext.cs: added static public Location EntryPointLocation;
25105           
25106         * ../errors/cs0028.cs : Add test case for the above warning.              
25107
25108         * typemanager.cs:
25109           - modified method CSharpName to allow arrays of primitive type to
25110             be printed nicely (e.g. instead of System.Int32[][] it now prints
25111             int[][])
25112           - added method CSharpSignature: returns the signature of a method
25113             in string format to be used in reporting errors, warnings, etc.
25114
25115         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
25116         with String.Empty.
25117
25118 2002-04-26  Ravi Pratap  <ravi@ximian.com>
25119
25120         * delegate.cs (Define): Fix extremely silly bug where I was
25121         setting the type of the 'object' parameter of the BeginInvoke
25122         method to System.IAsyncResult instead of System.Object ;-)
25123
25124 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
25125
25126         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
25127         here. 
25128
25129         (Constructor.Emit): return if we fail to initialize the
25130         constructor.  Another door closed!  
25131
25132         * expression.cs (New.DoResolve): Improve error message (from -6 to
25133         1501).  Use DeclaredOnly lookup to find the exact constructor.
25134
25135         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
25136         loop.  This is useful.
25137
25138         * cs-parser.jay: Adjust the default parameters so that destructors
25139         have the proper signature.
25140
25141 2002-04-26  Martin Baulig  <martin@gnome.org>
25142
25143         * driver.cs (LoadAssembly): If `assembly' contains any characters
25144         which are only valid in path names and not in assembly names
25145         (currently slash, backslash and point), use Assembly.LoadFrom ()
25146         instead of Assembly.Load () on the `assembly' (before iteration
25147         over the link_paths).
25148
25149 2002-04-26  Martin Baulig  <martin@gnome.org>
25150
25151         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
25152
25153 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
25154
25155         * class.cs (Property): use the new typemanager.MemberLookup
25156
25157         (TypeContainer.MemberLookup): Implement using the
25158         TypeManager.MemberLookup now. 
25159
25160         * typemanager.cs: Make MemberLookup a function of the TypeManager,
25161         and return MemberInfos, so that these can be used without an
25162         EmitContext (what we had before).
25163
25164 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
25165
25166         * expression.cs: Fix the case where the argument to params if the
25167         type of the params.  I omitted handling this before.   Fixed
25168
25169 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
25170
25171         * driver.cs: Call BootCorlib_PopulateCoreType
25172
25173         * class.cs (Property.CheckBase): Check for properties only, not
25174         for all members. 
25175
25176         * interface.cs: Temporary hack: try/catch around the
25177         CustomAttributeBuilder, because I am getting an exception that I
25178         do not understand.
25179
25180         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
25181         types whose definitions are required to be there (attributes are
25182         defined before standard types).
25183
25184         Compute definitions as we boot the various types, as they are used
25185         immediately (value_type class will need object_type, but if we do
25186         not initialize object_type, we will pass a null, which will let
25187         the runtime pick the System.Object from the existing corlib, which
25188         is not what we want).
25189
25190 2002-04-22  Patrik Torstensson <totte@labs2.com>
25191
25192         * cs-tokenizer.cs: fixed a number of trim() issues.
25193
25194 2002-04-22  Ravi Pratap  <ravi@ximian.com>
25195
25196         * expression.cs (Argument.Type): Ensure that we return the correct
25197         type when we have out or ref parameters [in which case we 
25198         append a "&"].
25199
25200 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
25201
25202         * class.cs (Property, Indexer): Allow extern modifier in there. 
25203
25204         * typemanager.cs (InitBaseTypes): Initializes object_type and
25205         value_type, since those will be used early on during the bootstrap
25206         process to compile corlib.
25207
25208         (InitCoreTypes): Move code from here to InitBaseTypes.
25209
25210 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
25211
25212         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
25213         single-dimension arrays as using the ldlen opcode.  
25214
25215         Daniel Lewis discovered this optimization.  
25216
25217         * typemanager.cs: Add signature for System.Array::get_Length
25218
25219 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25220
25221         * statement.cs: report the error when the foreach does not apply to an
25222         array nor a collection.
25223
25224 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
25225
25226         * expression.cs: Add implicit conversions to the operator ~.
25227
25228         * constant.cs (DecimalConstant.Emit): Emit decimal value.
25229
25230         * typemanager.cs: Locate the decimal constructor.
25231
25232 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25233
25234         * attribute.cs: use the new property of TypeOf.
25235         * expression.cs: added 'get' property around typearg.
25236
25237         These changes fix a build breaker reported by NickD. Is this the
25238         correct way to fix?  If not, please, revert my changes and make it
25239         work :-).
25240
25241 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
25242
25243         * attribute.cs: Add support for typeof in attribute invocations.
25244         I am not sure that this is right though.
25245
25246 2002-04-14  Duncan Mak  <duncan@ximian.com>
25247
25248         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
25249         Binary.Operator.Division case.
25250
25251 2002-04-13  Ravi Pratap  <ravi@ximian.com>
25252
25253         * class.cs (DefineType): Ensure that we do a proper check on
25254         attribute types and also register it with the TypeManager.
25255
25256         (TypeContainer.Targets): The default for attribute types is
25257         AttributeTargets.All.
25258
25259         * attribute.cs (ApplyAttributes): Registering the attribute type
25260         is done elsewhere, not when we discover we have a Usage attribute.
25261
25262 2002-04-12  Ravi Pratap  <ravi@ximian.com>
25263
25264         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
25265         and get rid of is_delegate parameter.
25266
25267         * everywhere : update.
25268
25269 2002-04-12  Ravi Pratap  <ravi@ximian.com>
25270
25271         * cs-parser.jay (compilation_unit): Revamp completely to use
25272         some new ideas that I got from Rhys' grammar to solve the problems
25273         with assembly level attributes.
25274
25275         (outer_declaration): New grammar production.
25276
25277         (attribute_sections): Add.
25278
25279         (opt_attributes): Base on attribute_sections
25280
25281         (namespace_declaration): Allow opt_attributes to tackle the case
25282         when we have assembly level attributes - we are clever in this
25283         regard now ;-)
25284
25285         * attribute.cs (ApplyAttributes): Do not worry about assembly 
25286         attributes in the non-global context.
25287
25288         * rootcontext.cs (AddGlobalAttributes): Go back to using this
25289         instead of SetGlobalAttributes.
25290
25291         * class.cs, rootcontext.cs : Ensure we define and generate 
25292         attribute types before anything else.
25293
25294         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
25295         and flag the new error -20 for the case when the attribute type
25296         does not have valid targets specified. csc does not catch this.
25297
25298         * ../errors/errors.txt : update for error # -20
25299
25300 2002-04-11  Ravi Pratap  <ravi@ximian.com>
25301
25302         * support.cs (InternalParameters.ParameterModifier): Do some null
25303         checking and return sane values.
25304
25305         * class.cs (Method.Define): If we are a PInvoke method, ensure
25306         that we are static and extern. Report error # 601
25307
25308         * ../errors/cs0601.cs : Add test case for the above error.
25309
25310 2002-04-07  Ravi Pratap  <ravi@ximian.com>
25311
25312         * rootcontext.cs (attribute_types): We need to keep type of
25313         all attribute types separately and emit code for them first.
25314
25315         (RegisterAttribute) : Implement.
25316
25317         * class.cs (DefineType): Check if the current Type is a custom
25318         attribute type and register it accordingly.
25319
25320         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
25321         adding the first attribute twice and rename to
25322
25323         (SetGlobalAttributes): this.
25324
25325         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
25326         lookups.
25327
25328         * attribute.cs (ApplyAttributes): Take an additional argument telling us
25329         if we are processing global arguments. Hmm, I am unsure of this.
25330
25331 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25332
25333         * expression.cs: added static array of strings to avoid calling
25334         Enum.ToString () for Operator in Binary. Significant recover of
25335         performance.
25336
25337 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
25338
25339         * class.cs (FindMembers): Allow the Builders of the various
25340         members to be null.  If they are skip them.  This only happens
25341         during the PInvoke declaration.
25342
25343 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
25344
25345         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
25346         failure, so we do not keep going afterwards.
25347
25348         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
25349         wanted to pass `false' as the `is_delegate' argument.  If this is
25350         the case, why not use delegate_type == null to mean `is_delegate =
25351         false' and anything else as is_delegate = true.
25352
25353 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
25354
25355         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
25356         code for the section, not the beginning of the tests.
25357
25358 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
25359
25360         * cfold.cs: Handle operator + (Enum x, Underlying x) 
25361
25362         * expression.cs (Binary): same.  Warn about errors where we have
25363         Enum/Enum in operator + as well.
25364
25365 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
25366
25367         * statement.cs:
25368                 - added support for switch(bool)
25369                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
25370                 - add TableSwitchEmit() to handle table-based switch statements
25371
25372 2002-04-05  Ravi Pratap  <ravi@ximian.com>
25373
25374         * expression.cs (Invocation.OverloadResolve): Factor out code which
25375         does parameter compatibility checking with arguments so that we can 
25376         re-use the code even from Delegate.VerifyApplicability
25377
25378         (VerifyArgumentsCompat): Move above code here.
25379
25380         * delegate.cs (VerifyApplicability): Get rid of duplicate code
25381         and instead make a call to the above method.
25382
25383 2002-03-31  Ravi Pratap  <ravi@ximian.com>
25384
25385         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
25386         We use it to keep track of classes which are attribute types.
25387
25388 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
25389
25390         * delegate.cs (Delegate.Define): Correctly define the types in the
25391         presence of fixed and array parameters.
25392
25393         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
25394         doing FindMembers.
25395
25396         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
25397         include NonPublic after the first iteration.
25398
25399         * class.cs (Indexer.CheckBase): Only check if both parents are
25400         non-null. 
25401
25402         * cs-parser.jay (accessor_body): If empty, set to null.
25403
25404         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
25405         same code path here to resolve constants names that we did have in
25406         MemberAccess.DoResolve.  There is too much code duplicated here.
25407
25408 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
25409
25410         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
25411
25412         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
25413         to MakeUnionSet.
25414
25415         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
25416         tokens, numbers and strings.
25417
25418         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
25419         parenthesis.
25420
25421         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
25422         asyncronous parameters and the regular parameters.  
25423
25424         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
25425         specify the target directory.
25426
25427         * expression.cs: (This.DoResolve): Simplify
25428         (As.Emit): Optimize, do not generate IsInst if the expression is
25429         always of the given type.
25430
25431         (Is.DoResolve): Bug fix, we were reporting both always/never for
25432         the is expression.
25433
25434         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
25435         creating too many unnecessary arrays.
25436
25437 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
25438
25439         * class.cs (EmitFieldInitializer): Use Assign expression to assign
25440         fields instead of rolling our own initializer.   Takes care of all
25441         implicit conversions, and drops unnecessary static checks/argument.
25442
25443 2002-03-31  Dick Porter  <dick@ximian.com>
25444
25445         * driver.cs: use the GetDirectories() return values properly, and
25446         use "/" as path separator.
25447
25448 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
25449
25450         * expression.cs (Unary): Optimize - - expr into expr.
25451         (Binary): Optimize a + (-b) into a -b.
25452
25453         * codegen.cs (CodeGen): Made all methods static.
25454
25455 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
25456
25457         * rootcontext.cs: 
25458
25459         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
25460         TypeBuilder property.
25461
25462         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
25463         instead. 
25464
25465         * tree.cs: Removed the various RecordXXXX, and replaced with a
25466         single RecordDecl.  Removed all the accessor methods, and just
25467         left a single access point Type 
25468
25469         * enum.cs: Rename DefineEnum to DefineType.
25470
25471         * decl.cs: New abstract method `DefineType' used to unify the
25472         Defines for Enumerations, Interfaces, TypeContainers and
25473         Delegates.
25474
25475         (FindType): Moved LookupInterfaceOrClass here.  Moved the
25476         LookupBaseClasses method that used to live in class.cs and
25477         interface.cs here, and renamed to FindType.
25478
25479         * delegate.cs: Implement DefineType.  Take advantage of the
25480         refactored pattern for locating the parent builder without taking
25481         the parent_builder argument (which we know does not work if we are
25482         nested, and triggering a toplevel definition).
25483
25484 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
25485
25486         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
25487         accessibility of a member has changed during override and report
25488         an error if so.
25489
25490         * class.cs (Method.Define, Property.Define): Only complain on
25491         overrides if the method is private, any other accessibility is
25492         fine (and since we just checked the permission is the same, we are
25493         good to go).
25494
25495         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
25496         and elif are processed always.  The other pre-processing
25497         directives are only processed if we are "taking" the path
25498
25499 2002-03-29  Martin Baulig  <martin@gnome.org>
25500
25501         * class.cs (Method.Emit): Only emit symbolic debugging info if the
25502         current location is not Null.
25503
25504         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
25505         a separate method so we can profile it.
25506
25507         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
25508         `span.Seconds' are just seconds, but no minutes or hours.
25509         (MainDriver): Profile the CodeGen.SaveSymbols calls.
25510
25511 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
25512
25513         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
25514         Remove the gratuitous set of Final:
25515
25516                                 // If an interface implementation, then we can set Final.
25517                                 if (((flags & MethodAttributes.Abstract) == 0) &&
25518                                     implementing.DeclaringType.IsInterface)
25519                                         flags |= MethodAttributes.Final;
25520
25521         I do not know what I was smoking when I used that.
25522
25523
25524         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
25525         step into fixing the name resolution issues for delegates and
25526         unifying the toplevel name resolution.
25527
25528 2002-03-28  Martin Baulig  <martin@gnome.org>
25529
25530         * class.cs (Method.Emit): If we have a symbol writer, call its
25531         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
25532         tell it about the current method.
25533
25534         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
25535         writer that we're going to emit the first byte of IL code for a new
25536         statement (a new source line).
25537         (EmitContext.EmitTopBlock): If we have a symbol writer, call
25538         EmitContext.Mark() before emitting any code.
25539
25540         * location.cs (SymbolDocument): Return null when we're Null.
25541
25542         * statement.cs (Statement): Moved the `Location loc' variable here.
25543         (Statement.EmitBoolExpression): If we have a symbol writer, call
25544         ec.Mark() before emitting any code to tell it that we're at the
25545         beginning of a new statement.
25546         (StatementExpression): Added `Location' argument to the constructor.
25547         (Block): Added public readonly variable `StartLocation' and public
25548         variable `EndLocation'.  The latter is to be set using SetEndLocation().
25549         (Block): Added constructor which takes a start and end location.
25550         (Block.SetEndLocation): New method. This sets the end location.
25551         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
25552         local variables we create.
25553         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
25554         each statement and do also mark the begin and end of the block.
25555
25556         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
25557         tell it the current lexer.Location, use Location.Null for the end of the
25558         block.
25559         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
25560         current block, set its end location using SetEndLocation().
25561         (statement_expression): StatementExpression constructor now takes the
25562         lexer.Location as additional argument.
25563         (for_statement, declare_local_variables): Likewise.
25564         (declare_local_variables): When creating a new implicit block, use the
25565         new Block constructor and pass it the lexer.Location.
25566
25567 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
25568
25569         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
25570         members also on the parent interfaces recursively.
25571
25572 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
25573
25574         * report.cs: Use new formats, since Gonzalo finished the missing
25575         bits. 
25576
25577         * expression.cs (Binary.ResolveOperator): added missing operator|
25578         operator& and operator^ for bool/bool.
25579
25580         * cs-parser.jay: CheckDef now takes a Location argument that is
25581         used to report errors more precisly (instead of reporting the end
25582         of a definition, we try to track something which is a lot closer
25583         to the source of the problem).
25584
25585         * cs-tokenizer.cs: Track global token use, so we can properly flag
25586         the use of #define/#undef after the first token has been seen.
25587
25588         Also, rename the reportXXXX to Error_DescriptiveName
25589
25590         * decl.cs (DeclSpace.IsTopLevel): Move property here from
25591         TypeContainer, so that Enum and Interface can use this too.
25592
25593         * class.cs (TypeContainer.LookupInterfaceOrClass,
25594         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
25595         `builder' argument.  Typically this was used to pass the parent
25596         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
25597         the definition).  
25598
25599         The problem is that a nested class could trigger the definition of
25600         a toplevel class, and the builder would be obviously wrong in that
25601         case. 
25602
25603         So we drop this argument, and we compute dynamically the
25604         TypeBuilder/ModuleBuilder (the correct information was available
25605         to us anyways from DeclSpace.Parent)
25606
25607         * interface.cs (Interface.DefineInterface): Drop builder
25608         parameter cleanup like class.cs
25609
25610         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
25611         like class.cs
25612
25613         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
25614         values. 
25615
25616         (Try.Emit): Propagate the returns value from the statement.
25617
25618         (Return.Emit): Even if we are leavning 
25619
25620         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
25621
25622         * modifiers.cs: Fix the computation of MethodAttributes flags.
25623
25624 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
25625
25626         * driver.cs: allow compilation of files that start with '/'.
25627         Add a default case when checking the argument of --target.
25628
25629 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
25630
25631         * interface.cs: Implement the same search algorithm for types in
25632         the interface code.
25633
25634         * delegate.cs: Do not allow multiple definition.
25635
25636         * Recovered ChangeLog that got accidentally amputated
25637
25638         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
25639
25640         * rootcontext.cs: Load manually enum to allow core classes to
25641         contain enumerations.
25642
25643         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
25644         Update to new static methods in TypeManager.
25645
25646         * typemanager.cs (GetMethod, GetConstructor): Use our
25647         implementation of FindMembers to find the members, since during
25648         corlib compilation, the types are TypeBuilders and GetMethod and
25649         GetConstructor do not work.
25650
25651         Make all methods in TypeManager static.
25652
25653         (InitCodeHelpers): Split the functionality from
25654         the InitCodeTypes function.
25655
25656         * driver.cs: Call InitCodeHelpers after we have populated the
25657         types. 
25658
25659         * cs-parser.jay (delegate_declaration): we did not used to compute
25660         the delegate name correctly for void delegates.
25661
25662 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
25663
25664         * rootcontext.cs (RootContext): Init the interface_resolve_order
25665         and type_container_resolve_order always.
25666
25667         (ResolveCore, BootstrapCorlib_ResolveClass,
25668         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
25669         compiler when compiling with --nostdlib
25670
25671         * class.cs (TypeContainer.DefineType): Check that our parent is
25672         not null.  This test is most important when we are bootstraping
25673         the core types.
25674
25675         * codegen.cs: Split out the symbol writing code.
25676
25677 2002-03-25  Martin Baulig  <martin@gnome.org>
25678
25679         * driver.cs (-g): Made -g an alias for --debug.
25680
25681 2002-03-24  Martin Baulig  <martin@gnome.org>
25682
25683         * codegen.cs (SymbolWriter): New public variable. Returns the
25684         current symbol writer.
25685         (CodeGen): Added `bool want_debugging_support' argument to the
25686          constructor. If true, tell the ModuleBuild that we want debugging
25687         support and ask it for the ISymbolWriter.
25688         (Save): If we have a symbol writer, call it's Close() method after
25689         saving the assembly.
25690
25691         * driver.c (--debug): New command line argument to create a
25692         debugger information file.
25693
25694         * location.cs (SymbolDocument): New public property. Returns an
25695         ISymbolDocumentWriter object for the current source file or null
25696         if we don't have a symbol writer.
25697
25698 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
25699
25700         * driver.cs (LoadAssembly): Correctly return when all the paths
25701         have been tried and not before.
25702
25703         * statement.cs (Switch.Emit): return the actual coverage for this
25704         statement (returns/not-returns)
25705
25706         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
25707         switch of the statement if we are the last switch section.  That
25708         kills two problems: try/catch problems (we used to emit an empty
25709         nop at the end) and switch statements where all branches would
25710         return. 
25711
25712 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
25713
25714         * driver.cs: Add default assemblies (the equivalent to the
25715         Microsoft CSC.RSP file)
25716
25717         * cs-tokenizer.cs: When updating `cols and setting it to zero,
25718         also update tokens_seen and set it to false.
25719
25720         * driver.cs: Implement --recurse for Mike.
25721
25722         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
25723         correctly splitting out the paths.
25724
25725 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
25726
25727         * interface.cs (Interface.PopulateProperty): Instead of using
25728         `parent' as the declaration space for the set parameters, use
25729         `this' 
25730
25731         * support.cs (InternalParameters): InternalParameters constructor
25732         takes a DeclSpace instead of a TypeContainer.
25733
25734         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
25735         types are being initialized, load the address of it before calling
25736         the function.  
25737
25738         (New): Provide a mechanism to disable the generation of local
25739         value type temporaries when the caller will be providing us with
25740         an address to store it.
25741
25742         (ArrayCreation.EmitDynamicInitializers): Use it.
25743
25744 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
25745
25746         * expression.cs (Invocation.EmitArguments): Only probe for array
25747         property if there is more than one argument.  Sorry about that.
25748
25749         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
25750         empty param arrays.
25751
25752         * class.cs (Method.LabelParameters): Fix incorrect code path that
25753         prevented the `ParamArrayAttribute' from being applied to the
25754         params attribute.
25755
25756 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
25757
25758         * support.cs (ReflectionParameters): Correctly compute whether the
25759         last argument is a params array.  Fixes the problem with
25760         string.Split ('a')
25761
25762         * typemanager.cs: Make the assemblies array always be non-null
25763         (empty, but non-null)
25764
25765         * tree.cs (RecordDecl): New function that abstracts the recording
25766         of names.  This reports error 101, and provides a pointer to the
25767         previous declaration.  Fixes a crash in the compiler.
25768
25769         * cs-parser.jay (constructor_declaration): Update to new grammar,
25770         and provide a constructor_body that can be empty.
25771
25772 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
25773
25774         * driver.cs: Add support for --resources.
25775
25776         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
25777         Make all types for the various array helper methods be integer.
25778
25779         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
25780         CheckState to ConvCast.
25781
25782         (ConvCast): Now it takes a `checked' state argument, to avoid
25783         depending on the emit context for the conversion, and just using
25784         the resolve time setting.
25785
25786         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
25787         instead of Invocation.EmitArguments.  We do not emit the original
25788         arguments, instead we emit those which have been converted to
25789         unsigned int expressions.
25790
25791         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
25792
25793         * codegen.cs: ditto.
25794
25795         * expression.cs (LocalVariableReference): Drop the use of the
25796         Store function that depended on the variable index.
25797
25798         * statement.cs (VariableInfo): Drop the `Idx' property from this
25799         class, as this is not taking into account the indexes for
25800         temporaries tat we generate during the execution, getting the
25801         indexes wrong.
25802
25803         * class.cs: First emit class initializers, then call the parent
25804         constructor. 
25805
25806         * expression.cs (Binary): Fix opcode emision.
25807         (UnaryMutator.EmitCode): Support checked code generation
25808
25809         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
25810         matches for events for both the Static and Instance scans,
25811         pointing to the same element.   Fix that.
25812
25813 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
25814
25815         * rootcontext.cs (ResolveTree): Always set the
25816         interface_resolve_order, because nested interfaces will be calling
25817         into us.
25818
25819         * class.cs (GetInterfaceOrClass): Track the same resolution
25820         process used by TypeManager.LookupType.  This fixes the nested
25821         type lookups in class declarations (separate path from
25822         LookupType). 
25823
25824         (TypeContainer.DefineType): Also define nested interfaces.
25825         (TypeContainer.RegisterOrder): New public function used to
25826         register the order in which child interfaces need to be closed.
25827
25828         Nested interfaces need to be closed after their parents have been
25829         created. 
25830
25831         * interface.cs (InterfaceAttr): Put all the logic for computing
25832         the interface attribute here. 
25833
25834         (DefineInterface): Register our interface order with the
25835         RootContext or with the TypeContainer depending on the case.
25836
25837 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
25838
25839         * cs-parser.jay: rework foreach statement to work with the new
25840         changes to the policy on SimpleNames.
25841
25842         * report.cs: support Stacktrace on warnings as well.
25843
25844         * makefile: drop --unsafe and /unsafe from the compile.
25845
25846 2002-03-13  Ravi Pratap  <ravi@ximian.com>
25847
25848         * ecore.cs (StandardConversionExists): Modify to take an Expression
25849         as the first parameter. Ensure we do null -> reference type conversion
25850         checking.
25851
25852         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
25853         temporary Expression objects.
25854
25855 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
25856
25857         * interface.cs: workaround bug in method overloading resolution
25858         (there is already a bugzilla bug for it).
25859
25860 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
25861
25862         We could also solve this problem by having a separate path for
25863         performing type lookups, instead of DoResolve, we could have a
25864         ResolveType entry point, and only participating pieces of the
25865         production (simplename, deref, array) would implement this. 
25866
25867         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
25868         signal SimpleName to only resolve type names and not attempt to
25869         resolve anything else.
25870
25871         * expression.cs (Cast): Set the flag.
25872
25873         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
25874
25875         * class.cs: Only report 108 if there is no `new' modifier.
25876
25877         * cs-parser.jay: rework foreach statement to work with the new
25878         changes to the policy on SimpleNames.
25879
25880         * report.cs: support Stacktrace on warnings as well.
25881
25882         * makefile: drop --unsafe and /unsafe from the compile.
25883
25884 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
25885
25886         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25887         lookups here, instead of doing that at parse time.  This means
25888         that our grammar will not introduce `LocalVariableReferences' as
25889         expressions at this point.  That solves the problem of code like
25890         this:
25891
25892         class X {
25893            static void Main ()
25894            { int X = 1;
25895             { X x = null }}}
25896
25897         This is only half the fix.  The full fix requires parameters to
25898         also be handled in this way.
25899
25900         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
25901         makes the use more obvious of the DeclSpace.  The
25902         ec.TypeContainer.TypeBuilder is now only used to pull the
25903         TypeBuilder for it.
25904
25905         My theory is that I can get rid of the TypeBuilder completely from
25906         the EmitContext, and have typecasts where it is used (from
25907         DeclSpace to where it matters).  
25908
25909         The only pending problem is that the code that implements Aliases
25910         is on TypeContainer, and probably should go in DeclSpace.
25911
25912         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25913         lookups here, instead of doing that at parse time.  This means
25914         that our grammar will not introduce `LocalVariableReferences' as
25915         expressions at this point.  That solves the problem of code like
25916         this:
25917
25918         class X {
25919            static void Main ()
25920            { int X = 1;
25921             { X x = null }}}
25922
25923         This is only half the fix.  The full fix requires parameters to
25924         also be handled in this way.
25925
25926         * class.cs (Property.DefineMethod): When implementing an interface
25927         method, set newslot, when implementing an abstract method, do not
25928         set the flag (before we tried never setting it, or always setting
25929         it, which is the difference).
25930         (Indexer.DefineMethod): same.
25931         (Method.DefineMethod): same.
25932
25933         * ecore.cs: Only set the status used flag if we get back a Field.
25934
25935         * attribute.cs: Temporary hack, so Paolo can keep working.
25936
25937 2002-03-08  Ravi Pratap  <ravi@ximian.com>
25938
25939         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
25940         the unmanaged type in the case we have a MarshalAs attribute.
25941
25942         (Resolve): Handle the case when we are parsing the special MarshalAs
25943         attribute [we need to store the unmanaged type to use later]
25944
25945         * typemanager.cs (marshal_as_attr_type): Built in type for the 
25946         MarshalAs Attribute.
25947
25948         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
25949         on parameters and accordingly set the marshalling info.
25950
25951 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
25952
25953         * class.cs: Optimizing slightly by removing redundant code after
25954         we switched to the `NoTypes' return value.
25955         (Property.DefineMethod): use NoTypes here too.
25956
25957         This fixes the bug I introduced in my last batch of changes.
25958
25959 2002-03-05  Ravi Pratap  <ravi@ximian.com>
25960
25961         * tree.cs (RecordEnum): Add. We now keep track of enums too.
25962
25963         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
25964         Enums since those are types too. 
25965
25966         * cs-parser.jay (enum_declaration): Record enums as we parse them.
25967
25968         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
25969         thanks to a call during the lookup process.
25970
25971 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
25972
25973         * statement.cs (Foreach): Lots of work to accomodate a particular
25974         kind of foreach statement that I had not kept in mind.  It is
25975         possible to have foreachs on classes that provide a GetEnumerator
25976         method that return objects that implement the "pattern" for using
25977         a foreach, there is no need to support GetEnumerator
25978         specifically. 
25979
25980         This is needed to compile nant.
25981
25982         * decl.cs: Only report 114 if the member is not `Finalize' and if
25983         the warning level is at least 2.
25984
25985         * class.cs: Moved the compare function from Method to
25986         MethodSignature. 
25987
25988         (MethodSignature.InheritableMemberSignatureCompare): Add new
25989         filter function that is used to extract inheritable methods from a
25990         class. 
25991
25992         (Method.Define): Use the new `inheritable_method_signature_filter'
25993         delegate
25994
25995         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
25996         command. 
25997
25998 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
25999
26000         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
26001
26002         * cs-parser.jay: Add opt_semicolon to the interface declaration.
26003
26004         * expression.cs: Pass location information to
26005         ConvertImplicitStandard. 
26006
26007         * class.cs: Added debugging code to track return values from
26008         interfaces. 
26009
26010 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
26011
26012         * expression.cs (Is.DoResolve): If either side of the `is' is an
26013         interface, do not flag the warning.
26014
26015         * ecore.cs (ImplicitReferenceConversion): We need a separate test
26016         for interfaces
26017
26018         * report.cs: Allow for --fatal to be used with --probe.
26019
26020         * typemanager.cs (NoTypes): Move the definition for the empty Type
26021         array here. 
26022
26023         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
26024         properties. 
26025         (TypeContainer.DefineProxy): New function used to proxy to parent
26026         implementations when implementing interfaces.
26027         (TypeContainer.ParentImplements): used to lookup if our parent
26028         implements a public function that is required by an interface.
26029         (TypeContainer.VerifyPendingMethods): Hook this up.
26030
26031         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
26032         `modules' and `assemblies' arraylists into arrays.  We only grow
26033         these are the very early start up of the program, so this improves
26034         the speedof LookupType (nicely measured).
26035
26036         * expression.cs (MakeByteBlob): Replaced unsafe code with
26037         BitConverter, as suggested by Paolo.
26038
26039         * cfold.cs (ConstantFold.Binary): Special case: perform constant
26040         folding of string concatenation, but if either side is a string,
26041         and the other is not, then return null, and let the runtime use
26042         the concatenation on the string plus the object (using
26043         `Object.ToString'). 
26044
26045 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
26046
26047         Constant Folding has been implemented now.
26048
26049         * expression.cs (Unary.Reduce): Do not throw an exception, catch
26050         the error instead on types that are not supported in one's
26051         complement. 
26052
26053         * constant.cs (Constant and all children): New set of functions to
26054         perform implict and explicit conversions.
26055
26056         * ecore.cs (EnumConstant): Implement the new functions to perform
26057         conversion by proxying to the child expression.
26058
26059         * codegen.cs: (ConstantCheckState): Constant evaluation has its
26060         own separate setting that can not be turned off from the command
26061         line using --unchecked or --checked and is only controlled using
26062         the checked/unchecked statements and expressions.  This setting is
26063         used by the constant folder to flag errors.
26064
26065         * expression.cs (CheckedExpr, UncheckedExpr): Set the
26066         ConstantCheckState as well.   
26067
26068         During Resolve, they also have to flag the state, because the
26069         constant folder runs completely in the Resolve phase.
26070
26071         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
26072         well.
26073
26074 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
26075
26076         * cfold.cs: New file, this file contains the constant folder.
26077
26078         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
26079         argument to track whether we are using the resulting address to
26080         load or store a value and provide better error messages. 
26081
26082         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
26083         new AddressOf arguments.
26084
26085         * statement.cs (Foreach.EmitCollectionForeach): Update
26086
26087         * expression.cs (Argument.Emit): Call AddressOf with proper
26088         arguments to track usage.
26089
26090         (New.DoEmit): Call AddressOf with new arguments.
26091
26092         (Unary.Emit): Adjust AddressOf call.
26093
26094 2002-03-01  Ravi Pratap  <ravi@ximian.com>
26095
26096         * cs-parser.jay (member_access): Change the case for pre-defined types
26097         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
26098         this suggestion.
26099
26100         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
26101         a method body.
26102
26103         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
26104         essentially like methods and apply attributes like MethodImplOptions to them too.
26105
26106         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
26107         not being null.
26108
26109         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
26110         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
26111         is the DeclSpace.
26112
26113         * Update code everywhere accordingly.
26114
26115         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
26116
26117         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
26118
26119 2002-02-28  Ravi Pratap  <ravi@ximian.com>
26120
26121         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
26122         try performing lookups against those instead of jumping straight into using
26123         the 'using' clauses.
26124
26125         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
26126
26127         (LookupType): Perform lookups in implicit parents too.
26128
26129         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
26130         sequence as RootContext.LookupType. 
26131
26132         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
26133         the various cases of namespace lookups into this method.
26134
26135 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
26136
26137         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
26138         in positional arguments)
26139
26140         * class.cs (Operator): Update the AllowedModifiers to contain
26141         extern. 
26142
26143         * cs-parser.jay: Update operator declaration to allow for the
26144         operator body to be empty.
26145
26146         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
26147         values. 
26148
26149 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
26150
26151         * class.cs (Method.Emit): Label parameters.
26152
26153         * driver.cs: Return 1 or 0 as the program exit code.
26154
26155 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
26156
26157         * expression.cs: Special case the `null' object when trying to
26158         auto-compute the type, as anything can be explicitly converted to
26159         that. 
26160
26161         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
26162         spotting this Paolo.
26163
26164         (Expression.ImplicitNumericConversion): Perform comparissions of
26165         the type using the underlying type in the case of an enumeration
26166         rather than using the enumeration type for the compare.
26167
26168         Cope with the underlying == type case, which is not possible to
26169         catch before. 
26170
26171         (Expression.ConvertNumericExplicit): Perform comparissions of
26172         the type using the underlying type in the case of an enumeration
26173         rather than using the enumeration type for the compare.
26174
26175         * driver.cs: If the user does not supply an extension, assume .exe
26176
26177         * cs-parser.jay (if_statement): Rewrote so that we can track the
26178         location for the if statement.
26179
26180         * expression.cs (Binary.ConstantFold): Only concat strings when
26181         the operation is "+", not everything ;-)
26182
26183         * statement.cs (Statement.EmitBoolExpression): Take a location
26184         argument. 
26185         (If, While, Do): Track location.
26186
26187         * expression.cs (Binary.ResolveOperator): In the object + string
26188         case, I was missing a call to ConvertImplicit
26189
26190 2002-02-25  Ravi Pratap  <ravi@ximian.com>
26191
26192         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
26193         Location arguments. Ensure we use RootContext.LookupType to do our work
26194         and not try to do a direct Type.GetType and ModuleBuilder.GetType
26195
26196         * interface.cs (PopulateMethod): Handle the type of the parameter being
26197         null gracefully.
26198
26199         * expression.cs (Invocation.BetterFunction): Handle the case when we 
26200         have a params method with no fixed arguments and a call is made with no
26201         arguments.
26202
26203 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
26204
26205         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
26206         the verbatim-string-literal
26207
26208         * support.cs (InternalParameters.ParameterModifier): handle null
26209         fixed parameters.
26210         (InternalParameters.ParameterType): ditto.
26211
26212         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
26213         duplicating the name of the variable parameter.
26214         (GetParameterByName): Fix bug where we were not looking up array
26215         paramters if they were the only present (thanks Paolo!).
26216         (GetParameterInfo): We only have an empty set of types if both
26217         fixed and array are set to null.
26218         (GetParameterInfo-idx): Handle FixedParameter == null
26219
26220         * cs-parser.jay: Handle the case where there is no catch
26221         statements (missing null test).
26222
26223 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
26224
26225         * driver.cs (MainDriver): Be conservative on our command line
26226         handling.
26227
26228         Catch DirectoryNotFoundException when calling GetFiles.
26229
26230         (SplitPathAndPattern): Used to split the input specification into
26231         a path and a pattern that we can feed to Directory.GetFiles.
26232
26233 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
26234
26235         * statement.cs (Fixed): Implement the last case of the Fixed
26236         statement (string handling).
26237
26238         * expression.cs (StringPtr): New class used to return a char * to
26239         a string;  Used by the Fixed statement.
26240
26241         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
26242
26243         * expression.cs (Binary.ResolveOperator): Remove redundant
26244         MemberLookup pn parent type.
26245         Optimize union call, we do not need a union if the types are the same.
26246         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
26247         type.
26248
26249         Specialize the use of MemberLookup everywhere, instead of using
26250         the default settings. 
26251
26252         (StackAlloc): Implement stackalloc keyword.
26253
26254         * cs-parser.jay: Add rule to parse stackalloc.
26255
26256         * driver.cs: Handle /h, /help, /?
26257
26258         * expression.cs (MakeByteBlob): Removed the hacks we had in place
26259         before we supported unsafe code.
26260
26261         * makefile: add --unsafe to the self compilation of mcs.
26262
26263 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
26264
26265         * expression.cs (PointerArithmetic): New class that is used to
26266         perform pointer arithmetic.
26267         (Binary.Resolve): Handle pointer arithmetic
26268         Handle pointer comparission.
26269         (ArrayPtr): Utility expression class that is used to take the
26270         address of an array.
26271
26272         (ElementAccess): Implement array access for pointers
26273
26274         * statement.cs (Fixed): Implement fixed statement for arrays, we
26275         are missing one more case before we are done.
26276
26277         * expression.cs (Indirection): Implement EmitAssign and set the
26278         ExprClass to Variable.  This allows pointer dereferences to be
26279         treated as variables, and to have values assigned to them.
26280
26281         * ecore.cs (Expression.StoreFromPtr): New utility function to
26282         store values dereferencing.
26283
26284 2002-02-20  Ravi Pratap  <ravi@ximian.com>
26285
26286         * expression.cs (Binary.ResolveOperator): Ensure that we are
26287         not trying to operate on a void type - this fixes the reported
26288         bug.
26289
26290         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
26291         the parent implementation is sealed.
26292
26293         * ../errors/cs0239.cs : Add.
26294
26295         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
26296
26297         * typemanager.cs (unverifiable_code_type): Corresponds to 
26298         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
26299         which have unsafe code in them.
26300
26301         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
26302         unsafe context.
26303
26304 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
26305
26306         * cs-tokenizer.cs: Add support for @"litreal strings"
26307
26308         Make tokenizer accept pre-processor directives
26309         on any column (remove the old C-like limitation). 
26310
26311         * rootcontext.cs (EmitCode): Emit any global attributes.
26312         (AddGlobalAttributes): Used to keep track of assembly attributes. 
26313
26314         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
26315
26316         * cs-parser.jay: Add support for global attributes.  
26317
26318 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
26319
26320         * expression.cs (Indirection): New helper class.  Unary will
26321         create Indirection classes to be able to implement the
26322         IMemoryLocation interface on it.
26323
26324 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
26325
26326         * cs-parser.jay (fixed_statement): reference the right statement.
26327
26328         * statement.cs (Fixed.Emit): Finish implementing the fixed
26329         statement for the &x case.
26330
26331 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
26332
26333         * class.cs (Property.Define, Method.Define): Remove newslot when
26334         `implementing'.  
26335
26336         * modifiers.cs: My use of NewSlot when `Abstract' was set was
26337         wrong.  NewSlot should only be used if the `new' keyword is present.
26338
26339         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
26340         locating our system dir.  Sorry about this.
26341
26342 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
26343
26344         * driver.cs (GetSystemDir): Compute correctly the location of our
26345         system assemblies.  I was using the compiler directory instead of
26346         the library directory.
26347
26348 2002-02-13  Ravi Pratap  <ravi@ximian.com>
26349
26350         * expression.cs (BetterFunction): Put back in what Miguel commented out
26351         since it is the correct fix. The problem is elsewhere ;-)
26352
26353         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
26354         parameters of the parms method are themselves compatible or not !
26355
26356         (StandardConversionExists): Fix very dangerous bug where we were forgetting
26357         to check that a class implements an interface before saying that an implicit
26358         conversion was allowed. Use ImplementsInterface to do the checking.
26359
26360 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
26361
26362         * class.cs (Method.Define): Track whether we are an explicit
26363         implementation or not.  And only call DefineMethodOverride if we
26364         are an explicit implementation.
26365
26366         (Property.DefineMethod): Ditto.
26367
26368 2002-02-11  Ravi Pratap  <ravi@ximian.com>
26369
26370         * expression.cs (BetterFunction): Catch hideous bug which was
26371          preventing us from detecting ambiguous calls due to implicit casts i.e
26372         cs0121.
26373
26374 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
26375
26376         * support.cs (Pair): Remove un-needed method.  I figured why I was
26377         getting the error in cs-parser.jay, the variable in a foreach loop
26378         is readonly, and the compiler does not really treat this as a variable.
26379
26380         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
26381         instead of EQUALS in grammar.  
26382
26383         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
26384
26385         * expression.cs (Unary.DoResolve): Check whether the argument is
26386         managed or not.
26387
26388 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
26389
26390         * support.cs: Api for Pair to set a value.  Despite the fact that
26391         the variables are public the MS C# compiler refuses to compile
26392         code that accesses the field if the variable is part of a foreach
26393         statement. 
26394
26395         * statement.cs (Fixed): Begin implementation of the fixed
26396         statement.
26397
26398         (Block.AddVariable): Return the VariableInfo on success and null
26399         on failure instead of true/false. 
26400
26401         * cs-parser.jay (foreach): Catch errors on variables already
26402         defined (we were ignoring this value before) and properly unwind
26403         the block hierarchy
26404
26405         (fixed_statement): grammar for the fixed statement.
26406
26407 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
26408
26409         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
26410         pointer types to be incretemented.
26411
26412         (SizeOf): Implement.
26413
26414         * cs-parser.jay (pointer_member_access): Implement
26415         expr->IDENTIFIER production.
26416
26417         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
26418         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
26419         on safe contexts.
26420
26421         (Unary): Implement indirection.
26422
26423         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
26424         use in non-unsafe context).
26425
26426         (SimpleName.DoResolve): Check for pointers in field access on safe
26427         contexts. 
26428
26429         (Expression.LoadFromPtr): Factor the load-indirect code in this
26430         function.  This was duplicated in UnboxCast and ParameterReference
26431
26432 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
26433
26434         * expression.cs (ComposedCast): report an error if a pointer cast
26435         is used in a safe region.
26436
26437         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
26438         pointer type casts in unsafe context.
26439
26440         * codegen.cs (EmitContext): Set up IsUnsafe.
26441
26442         * cs-parser.jay (non_expression_type): Add productions for pointer
26443         casts. 
26444
26445         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
26446         code.  We should not use force into static mode if the method is
26447         not virtual.  Fixes bug in MIS
26448
26449         * statement.cs (Do.Emit, While.Emit, For.Emit,
26450         Statement.EmitBoolExpression): Add support to Do and While to
26451         propagate infinite loop as `I do return' semantics.
26452
26453         Improve the For case to also test for boolean constants.
26454
26455         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
26456         to the list of attributes we can add.
26457
26458         Remove `EmitContext' argument.
26459
26460         * class.cs (Method.Define): Apply parameter attributes.
26461         (Constructor.Define): Apply parameter attributes.
26462         (MethodCore.LabelParameters): Move here the core of labeling
26463         parameters. 
26464
26465         * support.cs (ReflectionParameters.ParameterModifier,
26466         InternalParameters.ParameterModifier): Use IsByRef on the type and
26467         only return the OUT bit for these parameters instead of in/out/ref
26468         flags.
26469
26470         This is because I miss-understood things.  The ParameterInfo.IsIn
26471         and IsOut represent whether the parameter has the [In] and [Out]
26472         attributes set.  
26473
26474 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
26475
26476         * ecore.cs (FieldExpr.Emit): Release temporaries.
26477
26478         * assign.cs (LocalTemporary.Release): new function.
26479
26480         * codegen.cs (EmitContext.GetTemporaryStorage,
26481         EmitContext.FreeTemporaryStorage): Rework the way we deal with
26482         temporary storage.  Now we can "put back" localbuilders when we
26483         are done with them
26484
26485 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
26486
26487         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
26488         need to make a copy of the variable to generate verifiable code.
26489
26490 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
26491
26492         * driver.cs: Compute dynamically the system directory.
26493
26494         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
26495         Slower, but more generally useful.  Used by the abstract
26496         registering implementation. 
26497
26498         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
26499         the rules for the special rule on Type/instances.  First check if
26500         we have the same name, and if so, try that special static path
26501         rather than the instance path.
26502
26503 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
26504
26505         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
26506         for, while and if.
26507
26508         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
26509         Enum, ValueType, Delegate or Array for non-corlib compiles.
26510
26511         * cs-tokenizer.cs: Catch long identifiers (645)
26512
26513         * typemanager.cs (IndexerPropetyName): Ravi never tested this
26514         piece of code.
26515
26516         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
26517         fix, we were returning too early, so we were not registering
26518         pending methods from abstract classes.
26519
26520         Do not register pending methods if the class is abstract.
26521
26522         * expression.cs (Conditional.DoResolve): Report circular implicit
26523         conversions when we neecd to compute it for conditional
26524         expressions. 
26525
26526         (Is.DoResolve): If the expression is always of the provided type,
26527         flag warning 183.  If the expression can not ever be of the
26528         provided type flag warning 184.
26529
26530         * class.cs: Catch 169 as well.
26531
26532         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
26533         read. 
26534
26535 2002-01-18  Nick Drochak  <ndrochak@gol.com>
26536
26537         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
26538
26539 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
26540
26541         * interface.cs: (PopulateMethod): Check for pointers being defined
26542         only if the unsafe context is active.
26543         (PopulateProperty): ditto.
26544         (PopulateIndexer): ditto.
26545
26546         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
26547         specified.  If pointers are present, make sure that they are
26548         present in an unsafe context.
26549         (Constructor, Constructor.Define): ditto.
26550         (Field, Field.Define): ditto.
26551         (Property, Property.Define): ditto.
26552         (Event, Event.Define): ditto.
26553
26554         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
26555         hashtable if there are classes or structs defined.
26556
26557         * expression.cs (LocalVariableReference.DoResolve): Simplify this
26558         code, as the constant resolution moved.
26559
26560         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
26561         the metadata, so we can flag error 133. 
26562
26563         * decl.cs (MemberCore.UnsafeOK): New function to test that a
26564         pointer is being declared in an unsafe context.
26565
26566 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
26567
26568         * modifiers.cs (Modifiers.Check): Require a Location argument.
26569         Report error 227 for Unsafe use.
26570
26571         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
26572
26573         * statement.cs (For.Emit): If the test is null, then report that
26574         we do `return', as we wont reach anything afterwards.
26575
26576         (Switch.SwitchGoverningType): Track the expression that matched
26577         the conversion.
26578
26579         * driver.cs: Allow negative numbers as an error code to flag.
26580
26581         * cs-parser.jay: Handle 1551.
26582
26583         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
26584
26585 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
26586
26587         * cs-parser.jay: Report 1518 (type declaration can only contain
26588         class, struct, interface, enum or delegate)
26589
26590         (switch_label): Report 1523 (keywords `case' or `default' must
26591         preced code)
26592
26593         (opt_switch_sections): Report 1522 (empty switch)
26594
26595         * driver.cs: Report 1515 (response file specified multiple times)
26596         Report 1516 (Source file specified multiple times).
26597
26598         * expression.cs (Argument.Resolve): Signal 1510
26599
26600         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
26601         access not allowed in static code)
26602
26603 2002-01-11  Ravi Pratap  <ravi@ximian.com>
26604
26605         * typemanager.cs (IsPointerType): Utility method which we are going
26606         to need a lot.
26607
26608         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
26609         the object type, so we take care of that.
26610
26611         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
26612
26613         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
26614         added to non-params parameters :-)
26615
26616         * typemanager.cs (CSharpName): Include 'void' type too. 
26617
26618         (void_ptr_type): Include in the set of core types.
26619
26620         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
26621         duplicating code.
26622
26623         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
26624         an unsafe context.
26625
26626         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
26627         completely forgotten about it.
26628
26629 2002-01-10  Ravi Pratap  <ravi@ximian.com>
26630
26631         * cs-parser.jay (pointer_type): Add. This begins our implementation
26632         of parsing rules for unsafe code.
26633
26634         (unsafe_statement): Implement.
26635
26636         (embedded_statement): Modify to include the above.
26637
26638         * statement.cs (Unsafe): Implement new class for unsafe blocks.
26639
26640         * codegen.cs (EmitContext.InUnsafe): Add. This determines
26641         if the current context is an unsafe one.
26642
26643         * cs-parser.jay (local_variable_pointer_type): Since local variable types
26644         are handled differently, we need separate rules for them.
26645
26646         (local_variable_declaration): Update to use local_variable_pointer_type
26647         to allow variable declarations of unmanaged pointer types.
26648
26649         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
26650         in unsafe contexts.
26651
26652         * ../errors/cs0214.cs : Add.
26653
26654 2002-01-16  Nick Drochak  <ndrochak@gol.com>
26655
26656         * makefile: remove 'response' file when cleaning.
26657
26658 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
26659
26660         * cs-parser.jay: Report 1524.
26661
26662 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
26663
26664         * typemanager.cs (RegisterMethod): drop checking if we have
26665         registered this from here
26666
26667 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
26668
26669         * class.cs (Method.EmitDestructor): Implement calling our base
26670         destructor. 
26671
26672         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
26673         value of InFinally.
26674
26675         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
26676         this routine and will wrap the call in a try/catch block.  Deal
26677         with the case.
26678
26679 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
26680
26681         * ecore.cs (Expression.MemberLookup): instead of taking a
26682         parameter `same_type' that was used to tell whether we could
26683         access private members we compute our containing type from the
26684         EmitContext.
26685
26686         (FieldExpr): Added partial support for volatile fields.  This does
26687         not work for volatile fields exposed from assemblies, as I can not
26688         figure out how to extract the modreq from it.
26689
26690         Updated all the source files to use this.
26691
26692         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
26693         because it is referenced by MemberLookup very often. 
26694
26695 2002-01-09  Ravi Pratap  <ravi@ximian.com>
26696
26697         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
26698         TypeBuilder.GetCustomAttributes to retrieve what we need.
26699
26700         Get rid of redundant default_member_attr_type as this is the same as
26701         default_member_type which already exists.
26702
26703         * interface.cs, attribute.cs : Update accordingly.
26704
26705 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
26706
26707         * typemanager.cs: Enable IndexerPropertyName again.  It does not
26708         work for TYpeBuilders though.  Ravi, can you please fix this?
26709
26710         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
26711
26712         * expression.cs (Argument.Emit): Handle the case of ref objects
26713         being passed to ref functions;  
26714
26715         (ParameterReference.EmitLoad): Loads the content of the pointer
26716         without dereferencing.
26717
26718 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
26719
26720         * cs-tokenizer.cs: Implemented the pre-processing expressions.
26721
26722 2002-01-08  Ravi Pratap  <ravi@ximian.com>
26723
26724         * class.cs (Indexer.DefineMethod): Incorporate the interface
26725         type in the name of the method if we are doing explicit interface
26726         implementation.
26727
26728         * expression.cs (ConversionExists): Remove as it is completely obsolete.
26729
26730         (BetterConversion): Fix extremely trivial bug where we were referring to
26731         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
26732         again !
26733
26734         * ../errors/bug16.cs : Add although we have fixed it.
26735
26736 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
26737
26738         * expression.cs (BaseIndexer): Begin implementation.
26739
26740         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
26741
26742         * cs-parser.jay (indexer_declarator): Use qualified_identifier
26743         production directly to remove a shift/reduce, and implement
26744         explicit interface implementation.
26745
26746         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
26747         after a floating point suffix.
26748
26749         * expression.cs (DoNumericPromotions): Improved the conversion for
26750         uint/uint.  If we have a constant, we avoid doing a typecast to a
26751         larger type.
26752
26753         * class.cs (Indexer): Implement explicit interface implementation
26754         for indexers.
26755
26756 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
26757
26758         * class.cs: make the default instance constructor public and hidebysig.
26759
26760 2001-01-03  Ravi Pratap  <ravi@ximian.com>
26761
26762         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
26763         so we can call it from elsewhere.
26764
26765         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
26766         we emit it internally if the class has a defined indexer; otherwise the user
26767         emits it by decorating the class definition with the DefaultMemberAttribute.
26768
26769         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
26770         attribute is not used on a type which defines an indexer.
26771
26772         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
26773         character when we skip whitespace.
26774
26775         * ../errors/cs0646.cs : Add.
26776
26777 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
26778
26779         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
26780         again. 
26781
26782         * makefile: Add practical target `mcs3.exe' which builds the third
26783         generation compiler. 
26784
26785         * expression.cs (New): Fix structures constructor calling.
26786
26787         * class.cs (Property, Method, Indexer): Emit Final flag on the
26788         method if we are an interface implementation and we are not
26789         abstract. 
26790
26791         * ecore.cs (PropertyExpr): New public field `IsBase', tells
26792         whether this property is referencing a `base' method.
26793
26794         * expression.cs (Invocation.EmitCall): take an extra argument:
26795         is_base, this is used to determine whether the `call' or
26796         `callvirt' opcode should be used.
26797
26798
26799         * delegate.cs: update EmitCall.
26800
26801         * class.cs (Method.Define): Set NewSlot for the cases where we are
26802         not implementing an interface method.
26803
26804         (Property.Define): ditto.
26805
26806 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
26807
26808         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
26809         'r'.  Allows mcs to parse itself fully.
26810
26811 2002-01-02  Ravi Pratap  <ravi@ximian.com>
26812
26813         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
26814         of the number of initializers that require the InitializeArray method.
26815
26816         (CheckIndices): Store the Expression in all cases - not the plain value. Also
26817         update the above field where necessary.
26818
26819         (MakeByteBlob): Update accordingly.
26820
26821         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
26822         greater than 2.
26823
26824         (EmitDynamicInitializers): Update in accordance with the new optimization.
26825
26826         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
26827         same OpCode applies.
26828
26829         * cs-parser.jay : Fix some glaring errors I introduced.
26830
26831 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
26832
26833         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
26834         so that we can check for name clashes there too.
26835
26836         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
26837         for interface indexers.
26838
26839         * interfaces.cs (Define): Emit the default member attribute.
26840
26841         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
26842         variable was being referred to while setting the value ;-)
26843
26844 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
26845
26846         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
26847         byte-by-byte information when we know the data is zero.
26848
26849         Make the block always a multiple of 4, because
26850         DefineInitializedData has a bug.
26851
26852         * assign.cs: Fix, we should assign from the temporary, not from
26853         the source. 
26854
26855         * expression.cs (MakeByteBlob): Fix my incorrect code.
26856
26857 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
26858
26859         * typemanager.cs (EnumToUnderlying): This function is used to get
26860         the underlying type from an enumeration, because it does not
26861         always work. 
26862
26863         * constant.cs: Use the I4_S form for values between -128 and 127.
26864
26865         * statement.cs (Block.LookupLabel): Looks up a label.
26866         (Block): Drop support for labeled blocks.
26867
26868         (LabeledStatement): New kind of statement that represents a label
26869         only.
26870
26871         (Goto): Finally implement this bad boy.
26872
26873         * cs-parser.jay: Update to reflect new mechanism to implement
26874         labels.
26875
26876 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
26877
26878         * codegen.cs (EmitContext.This): a codegen property that keeps the
26879         a single instance of this instead of creating many different this
26880         instances. 
26881
26882         * delegate.cs (Delegate.DoResolve): Update to use the property;
26883
26884         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
26885
26886         * expression.cs (BaseAccess.DoResolve): Ditto.
26887
26888 2001-12-29  Ravi Pratap  <ravi@ximian.com>
26889
26890         * typemanager.cs (methodimpl_attr_type): Add to hold the type
26891         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
26892
26893         (InitCoreTypes): Update accordingly.
26894
26895         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
26896         so we can quickly store the state.
26897
26898         (ApplyAttributes): Set the correct implementation flags
26899         for InternalCall methods.
26900
26901 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
26902
26903         * expression.cs (EmitCall): if a method is not virtual, then do
26904         not use callvirt on it.
26905
26906         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
26907         user defined stuff) requires the use of stobj, which takes an
26908         address on the stack instead of an array and an index.  So emit
26909         the Ldelema operation for it.
26910
26911         (EmitStoreOpcode): Use stobj for valuetypes.
26912
26913         (UnaryMutator.EmitCode): Use the right 1 value depending on
26914         whether we are dealing with int64/uint64, float or doubles.
26915
26916         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
26917         constructors that I implemented last night.
26918
26919         (Constructor.IsDefault): Fix to work properly for static
26920         constructors.
26921
26922         * cs-parser.jay (CheckDef): report method signature errors.
26923         Update error number 103 to be 132.
26924
26925         * decl.cs: New AdditionResult enumeration value: MethodExists.
26926         Although we do this check for methods later on in the semantic
26927         analysis, catching repeated default constructors is so easy that
26928         we catch these here. 
26929
26930         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
26931         promotions code.
26932
26933         (ParameterReference.EmitAssign, Emit): handle
26934         bools as bytes.
26935
26936         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
26937         (ArrayAccess.EmitStoreOpcode): ditto.
26938
26939         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
26940
26941         * expression.cs (MakeByteBlob): Complete all the missing types
26942         (uint, short, ushort, byte, sbyte)
26943
26944         * class.cs: Only init instance field initializers on instance
26945         constructors. 
26946
26947         Rename `constructors' to instance_constructors. 
26948
26949         (TypeContainer.AddConstructor): Only add constructors to the list
26950         if it is not static.
26951
26952         Make sure that we handle default_static_constructor independently
26953         everywhere where we handle instance_constructors
26954
26955 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
26956
26957         * class.cs: Do not lookup or create a base initializer for a
26958         static constructor.
26959
26960         (ConstructorInitializer.Resolve): use the proper type to lookup
26961         for constructors.
26962
26963         * cs-parser.jay: Report error 1585 (modifiers between type and name).
26964
26965         * enum.cs, interface.cs: Remove CloseType, this is taken care by
26966         in DeclSpace. 
26967
26968         * decl.cs: CloseType is now an virtual method, the default
26969         implementation just closes this type.
26970
26971 2001-12-28  Ravi Pratap  <ravi@ximian.com>
26972
26973         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
26974         to PreserveSig by default. Also emit HideBySig on such methods.
26975
26976         Basically, set the defaults to standard values.
26977
26978         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
26979         argument, if candidate is better, it can't be worse than the best !
26980
26981         (Invocation): Re-write bits to differentiate between methods being
26982         applicable in their expanded form and their normal form - for params
26983         methods of course.
26984
26985         Get rid of use_standard everywhere as only standard conversions are allowed
26986         in overload resolution. 
26987
26988         More spec conformance.
26989
26990 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
26991
26992         * driver.cs: Add --timestamp, to see where the compiler spends
26993         most of its time.
26994
26995         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
26996         `this' in static code.
26997
26998         (SimpleName.DoResolve): Implement in terms of a helper function
26999         that allows static-references to be passed upstream to
27000         MemberAccess.
27001
27002         (Expression.ResolveWithSimpleName): Resolve specially simple
27003         names when called by MemberAccess to implement the special
27004         semantics. 
27005
27006         (Expression.ImplicitReferenceConversion): Handle conversions from
27007         Null to reference types before others, as Null's type is
27008         System.Object. 
27009
27010         * expression.cs (Invocation.EmitCall): Handle the special case of
27011         calling methods declared on a reference type from a ValueType
27012         (Base classes System.Object and System.Enum)
27013
27014         (MemberAccess.Resolve): Only perform lookups on Enumerations if
27015         the left hand side is a TypeExpr, not on every enumeration. 
27016
27017         (Binary.Resolve): If types are reference types, then do a cast to
27018         object on operators != and == of both arguments.
27019
27020         * typemanager.cs (FindMembers): Extract instance and static
27021         members if requested.
27022
27023         * interface.cs (PopulateProperty): Use void_type instead of null
27024         as the return type for the setter method.
27025
27026         (PopulateIndexer): ditto.
27027
27028 2001-12-27  Ravi Pratap  <ravi@ximian.com>
27029
27030         * support.cs (ReflectionParameters): Fix minor bug where we
27031         were examining the wrong parameter for the ParamArray attribute.
27032
27033         Cope with requests for the type of the parameter at position
27034         greater than the params parameter's. We now return the element
27035         type of the params array as that makes more sense.
27036
27037         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
27038         accordingly as we no longer have to extract the element type
27039         ourselves.
27040
27041         (Invocation.OverloadResolve): Update.
27042
27043 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
27044
27045         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
27046         against IEnumerator, test whether the return value is a descendant
27047         of the IEnumerator interface.
27048
27049         * class.cs (Indexer.Define): Use an auxiliary method to implement
27050         the other bits of the method definition.  Begin support for
27051         explicit interface implementation.
27052
27053         (Property.DefineMethod): Use TypeManager.void_type instead of null
27054         for an empty return value.
27055
27056 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
27057
27058         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
27059         dealing with a FieldExpr which is composed of a FieldBuilder, in
27060         the code path we did extract the constant, but we should have
27061         obtained the underlying value to be able to cast it (otherwise we
27062         end up in an infinite loop, this is what Ravi was running into).
27063
27064         (ArrayCreation.UpdateIndices): Arrays might be empty.
27065
27066         (MemberAccess.ResolveMemberAccess): Add support for section
27067         14.5.4.1 that deals with the special case of E.I when E is a type
27068         and something else, that I can be a reference to a static member.
27069
27070         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
27071         handle a particular array type to create byte blobs, it is just
27072         something we dont generate byteblobs for.
27073
27074         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
27075         arguments. 
27076
27077         * location.cs (Push): remove the key from the hashtable that we
27078         are about to add.   This happens for empty files.
27079
27080         * driver.cs: Dispose files after we have parsed them.
27081
27082         (tokenize): new function that only runs the tokenizer on its
27083         input, for speed testing.
27084
27085 2001-12-26  Ravi Pratap  <ravi@ximian.com>
27086
27087         * class.cs (Event.Define): Define the private field only if there
27088         are no accessors defined.
27089
27090         * expression.cs (ResolveMemberAccess): If there is no associated
27091         field with the event, that means we have an event defined with its
27092         own accessors and we should flag error cs0070 since transforming
27093         ourselves into a field is not valid in that case.
27094
27095         * ecore.cs (SimpleName.DoResolve): Same as above.
27096
27097         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
27098         and charset to sane values.
27099
27100 2001-12-25  Ravi Pratap  <ravi@ximian.com>
27101
27102         * assign.cs (DoResolve): Perform check on events only if they 
27103         are being accessed outside the declaring type.
27104
27105         * cs-parser.jay (event_declarations): Update rules to correctly
27106         set the type of the implicit parameter etc.
27107
27108         (add_accessor, remove_accessor): Set current local parameters.
27109
27110         * expression.cs (Binary): For delegate addition and subtraction,
27111         cast the return value from the method into the appropriate delegate
27112         type.
27113
27114 2001-12-24  Ravi Pratap  <ravi@ximian.com>
27115
27116         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
27117         of these as the workaround is unnecessary.
27118
27119         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
27120         delegate data - none of that is needed at all.
27121
27122         Re-write bits to extract the instance expression and the delegate method
27123         correctly.
27124
27125         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
27126         on delegates too.
27127
27128         * attribute.cs (ApplyAttributes): New method to take care of common tasks
27129         of attaching attributes instead of duplicating code everywhere.
27130
27131         * everywhere : Update code to do attribute emission using the above method.
27132
27133 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
27134
27135         * expression.cs (IsParamsMethodApplicable): if there are not
27136         parameters, return immediately.
27137
27138         * ecore.cs: The 0 literal can be implicity converted to an enum
27139         type. 
27140
27141         (SimpleName.DoResolve): First lookup the type, then lookup the
27142         members. 
27143
27144         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
27145         want to get its address.  If the InstanceExpression is not
27146         addressable, store the result in a temporary variable, then get
27147         the address of it.
27148
27149         * codegen.cs: Only display 219 errors on warning level or above. 
27150
27151         * expression.cs (ArrayAccess): Make it implement the
27152         IMemoryLocation interface.
27153
27154         (Binary.DoResolve): handle the operator == (object a, object b)
27155         and operator != (object a, object b) without incurring into a
27156         BoxedCast (because 5 != o should never be performed).
27157
27158         Handle binary enumerator operators.
27159
27160         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
27161         value type, otherwise use Ldelem_ref.
27162
27163         Use precomputed names;
27164
27165         (AddressOf): Implement address of
27166
27167         * cs-parser.jay (labeled_statement): Fix recursive block
27168         addition by reworking the production.
27169
27170         * expression.cs (New.DoEmit): New has a special case:
27171                 
27172                  If we are dealing with a ValueType, we have a few
27173                  situations to deal with:
27174                 
27175                     * The target of New is a ValueType variable, that is
27176                       easy, we just pass this as the variable reference
27177                 
27178                     * The target of New is being passed as an argument,
27179                       to a boxing operation or a function that takes a
27180                       ValueType.
27181                 
27182                       In this case, we need to create a temporary variable
27183                       that is the argument of New.
27184
27185
27186 2001-12-23  Ravi Pratap  <ravi@ximian.com>
27187
27188         * rootcontext.cs (LookupType): Check that current_type is not null before
27189         going about looking at nested types.
27190
27191         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
27192         not implement the IAssignMethod interface any more.
27193
27194         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
27195         where we tranform them into FieldExprs if they are being resolved from within
27196         the declaring type.
27197
27198         * ecore.cs (SimpleName.DoResolve): Do the same here.
27199
27200         * assign.cs (DoResolve, Emit): Clean up code considerably. 
27201
27202         * ../errors/bug10.cs : Add.
27203
27204         * ../errors/cs0070.cs : Add.
27205
27206         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
27207
27208         * assign.cs : Get rid of EventIsLocal everywhere.
27209
27210 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
27211
27212         * ecore.cs (ConvertIntLiteral): finished the implementation.
27213
27214         * statement.cs (SwitchLabel): Convert the value we are using as a
27215         key before looking up the table.
27216
27217 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
27218
27219         * codegen.cs (EmitTopBlock): Require a Location argument now.
27220
27221         * cs-parser.jay (constructor_declarator): We need to setup
27222         current_local_parameters before we parse the
27223         opt_constructor_initializer, to allow the variables to be bound
27224         to the constructor arguments.
27225
27226         * rootcontext.cs (LookupType): First lookup nested classes in our
27227         class and our parents before we go looking outside our class.
27228
27229         * expression.cs (ConstantFold): Extract/debox the values at the
27230         beginnning. 
27231
27232         * rootcontext.cs (EmitCode): Resolve the constants first before we
27233         resolve the types.  This is not really needed, but it helps debugging.
27234
27235         * statement.cs: report location.
27236
27237         * cs-parser.jay: pass location to throw statement.
27238
27239         * driver.cs: Small bug fix.
27240
27241         * report.cs: Updated format to be 4-zero filled digits.
27242
27243 2001-12-22  Ravi Pratap  <ravi@ximian.com>
27244
27245         * expression.cs (CheckIndices): Fix minor bug where the wrong
27246         variable was being referred to ;-)
27247
27248         (DoEmit): Do not call EmitStaticInitializers when the 
27249         underlying type is System.Object.
27250
27251 2001-12-21  Ravi Pratap  <ravi@ximian.com>
27252
27253         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
27254         and do the usual workaround for SRE.
27255
27256         * class.cs (MyEventBuilder.EventType): New member to get at the type
27257         of the event, quickly.
27258
27259         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
27260
27261         * assign.cs (Assign.DoResolve): Handle the case when the target
27262         is an EventExpr and perform the necessary checks.
27263
27264         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
27265         interface.
27266
27267         (SimpleName.MemberStaticCheck): Include check for EventExpr.
27268
27269         (EventExpr): Set the type in the constructor itself since we 
27270         are meant to be born fully resolved.
27271
27272         (EventExpr.Define): Revert code I wrote earlier.
27273                 
27274         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
27275         instance expression is null. The instance expression is a This in that case
27276         or a null, depending on whether it is a static method or not.
27277
27278         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
27279         refers to more than one method.
27280
27281         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
27282         and accordingly flag errors.
27283
27284 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
27285
27286         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
27287
27288 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
27289
27290         * location.cs (ToString): Provide useful rutine.
27291
27292 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
27293
27294         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
27295         objects, return the actual integral boxed.
27296
27297         * statement.cs (SwitchLabel): define an ILLabel for each
27298         SwitchLabel. 
27299
27300         (Switch.CheckSwitch): If the value is a Literal, extract
27301         the underlying literal.
27302
27303         Also in the unused hashtable we had, add the SwitchLabel so we can
27304         quickly look this value up.
27305
27306         * constant.cs: Implement a bunch of new constants.  Rewrite
27307         Literal based on this.  Made changes everywhere to adapt to this.
27308
27309         * expression.cs (Expression.MakeByteBlob): Optimize routine by
27310         dereferencing array only once, and also copes with enumrations.
27311
27312         bytes are two bytes wide, not one.
27313
27314         (Cast): Perform constant conversions.
27315
27316         * ecore.cs (TryImplicitIntConversion): Return literals instead of
27317         wrappers to the literals here.
27318
27319         * expression.cs (DoNumericPromotions): long literals can converted
27320         to ulong implicity (this is taken care of elsewhere, but I was
27321         missing this spot).
27322
27323         * ecore.cs (Expression.Literalize): Make the return type Literal,
27324         to improve type checking.
27325
27326         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
27327
27328 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
27329
27330         * literal.cs: Revert code from ravi that checked the bounds.  The
27331         bounds are sane by the definition of the type itself. 
27332
27333         * typemanager.cs: Fix implementation of ImplementsInterface.  We
27334         need to actually look up in our parent hierarchy for interfaces
27335         implemented. 
27336
27337         * const.cs: Use the underlying type for enumerations
27338
27339         * delegate.cs: Compute the basename for the delegate creation,
27340         that should fix the delegate test case, and restore the correct
27341         Type Lookup semantics in rootcontext
27342
27343         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
27344         referencing a nested type with the Reflection API is using the "+"
27345         sign. 
27346
27347         * cs-parser.jay: Do not require EOF token at the end.
27348
27349 2001-12-20  Ravi Pratap  <ravi@ximian.com>
27350
27351         * rootcontext.cs (LookupType): Concatenate type names with
27352         a '.' instead of a '+' The test suite passes again.
27353
27354         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
27355         field of the enumeration.
27356
27357         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
27358         the case when the member is an EventExpr.
27359
27360         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
27361         static has an associated instance expression.
27362
27363         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
27364
27365         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
27366
27367         * class.cs (Event.Define): Register event and perform appropriate checks
27368         for error #111.
27369
27370         We define the Add and Remove methods even if the use provides none because
27371         in that case, we provide default implementations ourselves.
27372
27373         Define a private field of the type of the event. This is done by the CSC compiler
27374         and we should be doing it too ;-)
27375
27376         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
27377         More methods we use in code we generate.
27378
27379         (multicast_delegate_type, delegate_type): Two separate types since the distinction
27380         is important.
27381
27382         (InitCoreTypes): Update accordingly for the above.
27383
27384         * class.cs (Event.Emit): Generate code for default accessors that we provide
27385
27386         (EmitDefaultMethod): Do the job in the above.
27387
27388         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
27389         appropriate place.
27390
27391 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
27392
27393         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
27394         builders even if we were missing one.
27395
27396         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
27397         pass the Basename as our class name instead of the Name.  The
27398         basename will be correctly composed for us.
27399
27400         * parameter.cs (Paramters): Now takes a Location argument.
27401
27402         * decl.cs (DeclSpace.LookupType): Removed convenience function and
27403         make all the code call directly LookupType in RootContext and take
27404         this chance to pass the Location information everywhere.
27405
27406         * Everywhere: pass Location information.
27407
27408 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
27409
27410         * class.cs (Constructor.Define): Updated way of detecting the
27411         length of the parameters.
27412
27413         (TypeContainer.DefineType): Use basename as the type name for
27414         nested types.
27415
27416         (TypeContainer.Define): Do not recursively define types here, as
27417         definition is taken care in order by the RootContext.
27418
27419         * tree.cs: Keep track of namespaces in a per-file basis.
27420
27421         * parameter.cs (Parameter.ComputeSignature): Update to use
27422         DeclSpace. 
27423
27424         (Parameters.GetSignature): ditto.
27425
27426         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
27427         instead of a TypeContainer.
27428
27429         (Interface.SemanticAnalysis): Use `this' instead of our parent to
27430         resolve names.  Because we need to be resolve in our context, not
27431         our parents.
27432
27433         * driver.cs: Implement response files.
27434
27435         * class.cs (TypeContainer.DefineType): If we are defined, do not
27436         redefine ourselves.
27437
27438         (Event.Emit): Emit the code for add/remove handlers.
27439         (Event.Define): Save the MethodBuilders for add/remove.
27440
27441         * typemanager.cs: Use pair here too.
27442
27443         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
27444         DictionaryEntry requires the first argument to be non-null.  
27445
27446         (enum_declaration): Compute full name for registering the
27447         enumeration.
27448
27449         (delegate_declaration): Instead of using
27450         formal_parameter_list, use opt_formal_parameter_list as the list
27451         can be empty.
27452
27453         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
27454         (EventParsing): New property that controls whether `add' and
27455         `remove' are returned as tokens or identifiers (for events);
27456
27457 2001-12-19  Ravi Pratap  <ravi@ximian.com>
27458
27459         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
27460         use MyEventBuilder only and let it wrap the real builder for us.
27461
27462         (MyEventBuilder): Revamp constructor etc.
27463
27464         Implement all operations that we perform on EventBuilder in precisely the same
27465         way here too.
27466
27467         (FindMembers): Update to use the EventBuilder member.
27468
27469         (Event.Emit): Update accordingly.
27470
27471 2001-12-18  Ravi Pratap  <ravi@ximian.com>
27472
27473         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
27474         by calling the appropriate methods.
27475
27476         (GetCustomAttributes): Make stubs as they cannot possibly do anything
27477         useful.
27478
27479         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
27480
27481 2001-12-17  Ravi Pratap  <ravi@ximian.com>
27482
27483         * delegate.cs (Delegate.Populate): Check that the return type
27484         and various parameters types are indeed accessible.
27485
27486         * class.cs (Constructor.Define): Same here.
27487
27488         (Field.Define): Ditto.
27489
27490         (Event.Define): Ditto.
27491
27492         (Operator.Define): Check that the underlying Method defined itself
27493         correctly - so it's MethodBuilder should not be null.
27494
27495         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
27496         expression happens to be null.
27497
27498         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
27499         members but as of now we don't seem to be able to do anything really useful with it.
27500
27501         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
27502         not the EventBuilder.
27503
27504 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
27505
27506         * cs-tokenizer.cs: Add support for defines.
27507         Add support for #if, #elif, #else, #endif
27508
27509         (eval_var): evaluates a variable.
27510         (eval): stubbed for evaluating functions.
27511
27512         * cs-parser.jay: Pass the defines information
27513
27514         * driver.cs: Add --define command line option.
27515
27516         * decl.cs: Move MemberCore here.
27517
27518         Make it the base class for DeclSpace.  This allows us to catch and
27519         report 108 and 109 for everything now.
27520
27521         * class.cs (TypeContainer.Define): Extract all the members
27522         before populating and emit the warning 108 (new keyword required
27523         to override) instead of having each member implement this.
27524
27525         (MemberCore.Define): New abstract method, we will be using this in
27526         the warning reporting engine in Populate.
27527
27528         (Operator.Define): Adjust to new MemberCore protocol. 
27529
27530         * const.cs (Const): This does not derive from Expression, it is a
27531         temporary object we use to create fields, it is a MemberCore. 
27532
27533         * class.cs (Method.Define): Allow the entry point to be in a
27534         specific class.
27535
27536         * driver.cs: Rewrite the argument handler to clean it up a bit.
27537
27538         * rootcontext.cs: Made it just an auxiliary namespace feature by
27539         making everything static.
27540
27541         * driver.cs: Adapt code to use RootContext type name instead of
27542         instance variable.
27543
27544         * delegate.cs: Remove RootContext argument.
27545
27546         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
27547         argument. 
27548
27549         * class.cs (Event.Define): The lookup can fail.
27550
27551         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
27552
27553         * expression.cs: Resolve the this instance before invoking the code.
27554
27555 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
27556
27557         * cs-parser.jay: Add a production in element_access that allows
27558         the thing to become a "type" reference.  This way we can parse
27559         things like "(string [])" as a type.
27560
27561         Note that this still does not handle the more complex rules of
27562         casts. 
27563
27564
27565         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
27566
27567         * ecore.cs: (CopyNewMethods): new utility function used to
27568         assemble the list of methods from running FindMembers.
27569
27570         (MemberLookup): Rework FindMembers so that 
27571
27572 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
27573
27574         * class.cs (TypeContainer): Remove Delegates who fail to be
27575         defined.
27576
27577         * delegate.cs (Populate): Verify that we dont get null return
27578         values.   TODO: Check for AsAccessible.
27579
27580         * cs-parser.jay: Use basename to emit error 574 (destructor should
27581         have the same name as container class), not the full name.
27582
27583         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
27584         possible representation.  
27585
27586         Also implements integer type suffixes U and L.
27587
27588 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
27589
27590         * expression.cs (ArrayCreation.DoResolve): We need to do the
27591         argument resolution *always*.
27592
27593         * decl.cs: Make this hold the namespace.  Hold the root context as
27594         well.
27595         (LookupType): Move here.
27596
27597         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
27598
27599         * location.cs (Row, Name): Fixed the code, it was always returning
27600         references to the first file.
27601
27602         * interface.cs: Register properties defined through interfaces.
27603
27604         * driver.cs: Add support for globbing on the command line
27605
27606         * class.cs (Field): Make it derive from MemberCore as well.
27607         (Event): ditto.
27608
27609 2001-12-15  Ravi Pratap  <ravi@ximian.com>
27610
27611         * class.cs (Event::Define): Check that the type of the event is a delegate
27612         type else flag error #66.
27613
27614         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
27615         same.
27616
27617         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
27618         values of EntryPoint, CharSet etc etc.
27619
27620         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
27621
27622         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
27623         be null and we should ignore this. I am not sure if this is really clean. Apparently,
27624         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
27625         which needs this to do its work.
27626
27627         * ../errors/cs0066.cs : Add.
27628
27629 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
27630
27631         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
27632         helper functions.
27633
27634         * class.cs: (MethodSignature.MethodSignature): Removed hack that
27635         clears out the parameters field.
27636         (MemberSignatureCompare): Cleanup
27637
27638         (MemberCore): New base class used to share code between MethodCore
27639         and Property.
27640
27641         (RegisterRequiredImplementations) BindingFlags.Public requires
27642         either BindingFlags.Instace or Static.  Use instance here.
27643
27644         (Property): Refactored code to cope better with the full spec.
27645
27646         * parameter.cs (GetParameterInfo): Return an empty array instead
27647         of null on error.
27648
27649         * class.cs (Property): Abstract or extern properties have no bodies.
27650
27651         * parameter.cs (GetParameterInfo): return a zero-sized array.
27652
27653         * class.cs (TypeContainer.MethodModifiersValid): Move all the
27654         method modifier validation to the typecontainer so we can reuse
27655         this on properties.
27656
27657         (MethodCore.ParameterTypes): return an empty sized array of types.
27658
27659         (Property.Define): Test property modifier validity.
27660
27661         Add tests for sealed/override too.
27662
27663         (Method.Emit): abstract or extern methods have no bodies.
27664
27665 2001-12-14  Ravi Pratap  <ravi@ximian.com>
27666
27667         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
27668         thing.
27669
27670         (Method::Define, ::Emit): Modify accordingly.
27671
27672         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
27673
27674         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
27675
27676         * makefile: Pass in /unsafe.
27677
27678 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
27679
27680         * class.cs (MakeKey): Kill routine.
27681
27682         * class.cs (TypeContainer.Define): Correctly define explicit
27683         method implementations (they require the full interface name plus
27684         the method name).
27685
27686         * typemanager.cs: Deply the PtrHashtable here and stop using the
27687         lame keys.  Things work so much better.
27688
27689         This of course broke everyone who depended on `RegisterMethod' to
27690         do the `test for existance' test.  This has to be done elsewhere.
27691
27692         * support.cs (PtrHashtable): A hashtable that avoid comparing with
27693         the object stupid Equals method (because, that like fails all over
27694         the place).  We still do not use it.
27695
27696         * class.cs (TypeContainer.SetRequiredInterface,
27697         TypeContainer.RequireMethods): Killed these two routines and moved
27698         all the functionality to RegisterRequiredImplementations.
27699
27700         (TypeContainer.RegisterRequiredImplementations): This routine now
27701         registers all the implementations required in an array for the
27702         interfaces and abstract methods.  We use an array of structures
27703         which can be computed ahead of time to reduce memory usage and we
27704         also assume that lookups are cheap as most classes will not
27705         implement too many interfaces.
27706
27707         We also avoid creating too many MethodSignatures.
27708
27709         (TypeContainer.IsInterfaceMethod): Update and optionally does not
27710         clear the "pending" bit if we find that there are problems with
27711         the declaration.
27712
27713         (TypeContainer.VerifyPendingMethods): Update to report errors of
27714         methods that look like implementations but are not.
27715
27716         (TypeContainer.Define): Add support for explicit interface method
27717         implementation. 
27718
27719 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
27720
27721         * typemanager.cs: Keep track of the parameters here instead of
27722         being a feature of the TypeContainer.
27723
27724         * class.cs: Drop the registration of parameters here, as
27725         InterfaceMethods are also interface declarations.
27726
27727         * delegate.cs: Register methods with the TypeManager not only with
27728         the TypeContainer.  This code was buggy.
27729
27730         * interface.cs: Full registation here.
27731
27732 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
27733
27734         * expression.cs: Remove reducer for binary expressions, it can not
27735         be done this way.
27736
27737         * const.cs: Put here the code that used to go into constant.cs
27738
27739         * constant.cs: Put here the code for constants, this is a new base
27740         class for Literals.
27741
27742         * literal.cs: Make Literal derive from Constant.
27743
27744 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
27745
27746         * statement.cs (Return.Emit): Report error 157 if the user
27747         attempts to return from a finally block.
27748
27749         (Return.Emit): Instead of emitting a return, jump to the end of
27750         the function.
27751
27752         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
27753         LocalBuilder to store the result of the function.  ReturnLabel is
27754         the target where we jump.
27755
27756
27757 2001-12-09  Radek Doulik  <rodo@ximian.com>
27758
27759         * cs-parser.jay: remember alias in current namespace
27760
27761         * ecore.cs (SimpleName::DoResolve): use aliases for types or
27762         namespaces
27763
27764         * class.cs (LookupAlias): lookup alias in my_namespace
27765
27766         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
27767         aliases hashtable
27768         (LookupAlias): lookup alias in this and if needed in parent
27769         namespaces
27770
27771 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
27772
27773         * support.cs: 
27774
27775         * rootcontext.cs: (ModuleBuilder) Made static, first step into
27776         making things static.  I need this to avoid passing the
27777         TypeContainer when calling ParameterType.
27778
27779         * support.cs (InternalParameters.ParameterType): Remove ugly hack
27780         that did string manipulation to compute the type and then call
27781         GetType.  Use Parameter.ParameterType instead.
27782
27783         * cs-tokenizer.cs: Consume the suffix for floating values.
27784
27785         * expression.cs (ParameterReference): figure out whether this is a
27786         reference parameter or not.  Kill an extra variable by computing
27787         the arg_idx during emission.
27788
27789         * parameter.cs (Parameters.GetParameterInfo): New overloaded
27790         function that returns whether a parameter is an out/ref value or not.
27791
27792         (Parameter.ParameterType): The type of the parameter (base,
27793         without ref/out applied).
27794
27795         (Parameter.Resolve): Perform resolution here.
27796         (Parameter.ExternalType): The full type (with ref/out applied).
27797
27798         * statement.cs (Using.Emit, Using.EmitExpression): Implement
27799         support for expressions on the using statement.
27800
27801 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
27802
27803         * statement.cs (Using.EmitLocalVariableDecls): Split the
27804         localvariable handling of the using statement.
27805
27806         (Block.EmitMeta): Keep track of variable count across blocks.  We
27807         were reusing slots on separate branches of blocks.
27808
27809         (Try.Emit): Emit the general code block, we were not emitting it. 
27810
27811         Check the type of the declaration to be an IDisposable or
27812         something that can be implicity converted to it. 
27813
27814         Emit conversions if required.
27815
27816         * ecore.cs (EmptyExpression): New utility class.
27817         (Expression.ImplicitConversionExists): New utility function.
27818
27819 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
27820
27821         * statement.cs (Using): Implement.
27822
27823         * expression.cs (LocalVariableReference): Support read only variables.
27824
27825         * statement.cs: Remove the explicit emit for the Leave opcode.
27826         (VariableInfo): Add a readonly field.
27827
27828 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
27829
27830         * ecore.cs (ConvCast): new class used to encapsulate the various
27831         explicit integer conversions that works in both checked and
27832         unchecked contexts.
27833
27834         (Expression.ConvertNumericExplicit): Use new ConvCast class to
27835         properly generate the overflow opcodes.
27836
27837 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
27838
27839         * statement.cs: The correct type for the EmptyExpression is the
27840         element_type, not the variable type.  Ravi pointed this out.
27841
27842 2001-12-04  Ravi Pratap  <ravi@ximian.com>
27843
27844         * class.cs (Method::Define): Handle PInvoke methods specially
27845         by using DefinePInvokeMethod instead of the usual one.
27846
27847         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
27848         above to do the task of extracting information and defining the method.
27849
27850 2001-12-04  Ravi Pratap  <ravi@ximian.com>
27851
27852         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
27853         of the condition for string type.
27854
27855         (Emit): Move that here. 
27856
27857         (ArrayCreation::CheckIndices): Keep string literals in their expression
27858         form.
27859
27860         (EmitDynamicInitializers): Handle strings appropriately.
27861
27862 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
27863
27864         * codegen.cs (EmitContext): Replace multiple variables with a
27865         single pointer to the current Switch statement.
27866
27867         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
27868         EmitContext.
27869
27870 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
27871
27872         * statement.cs 
27873
27874         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
27875         default'.
27876
27877         (Foreach.Emit): Foreach on arrays was not setting
27878         up the loop variables (for break/continue).
27879
27880         (GotoCase): Semi-implented.
27881
27882 2001-12-03  Ravi Pratap  <ravi@ximian.com>
27883
27884         * attribute.cs (CheckAttribute): Handle system attributes by using
27885         Attribute.GetAttributes to examine information we need.
27886
27887         (GetValidPlaces): Same here.
27888
27889         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
27890
27891         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
27892
27893         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
27894
27895         (Method::Define): Set appropriate flags if we have a DllImport attribute.
27896
27897         (Method::Emit): Handle the case when we are a PInvoke method.
27898
27899 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
27900
27901         * expression.cs: Use ResolveWithSimpleName on compound names.
27902
27903 2001-12-02  Ravi Pratap  <ravi@ximian.com>
27904
27905         * constant.cs (EmitConstant): Make sure we resolve the associated expression
27906         before trying to reduce it.
27907
27908         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
27909
27910         * constant.cs (LookupConstantValue): Implement.
27911
27912         (EmitConstant): Use the above in emitting the constant.
27913
27914         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
27915         that are user-defined by doing a LookupConstantValue on them.
27916
27917         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
27918         too, like above.
27919
27920 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
27921
27922         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
27923
27924         (BaseAccess.DoResolve): Implement.
27925
27926         (MemberAccess.DoResolve): Split this routine into a
27927         ResolveMemberAccess routine that can be used independently
27928
27929 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
27930
27931         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
27932         As that share bits of the implementation.  Is returns a boolean,
27933         while As returns the Type that is being probed.
27934
27935 2001-12-01  Ravi Pratap  <ravi@ximian.com>
27936
27937         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
27938         instead of a Literal - much easier.
27939
27940         (EnumInTransit): Remove - utterly useless :-)
27941
27942         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
27943
27944         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
27945
27946         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
27947         chain when we have no associated expression.
27948
27949 2001-11-30  Ravi Pratap  <ravi@ximian.com>
27950
27951         * constant.cs (Define): Use Location while reporting the errror.
27952
27953         Also emit a warning when 'new' is used and there is no inherited
27954         member to hide.
27955
27956         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
27957         populated.
27958
27959         (LookupEnumValue): Implement to lookup an enum member's value and define it
27960         if necessary.
27961
27962         (Populate): Re-write accordingly to use the above routine.
27963
27964 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
27965
27966         * expression.cs (This): Fix prototype for DoResolveLValue to
27967         override the base class DoResolveLValue.
27968
27969         * cs-parser.cs: Report errors cs574 and cs575 (destructor
27970         declarations) 
27971
27972         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
27973         (we need to load the address of the field here).  This fixes
27974         test-22. 
27975
27976         (FieldExpr.DoResolveLValue): Call the DoResolve
27977         function to initialize the Instance expression.
27978
27979         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
27980         correctly the GetEnumerator operation on a value type.
27981
27982         * cs-parser.jay: Add more simple parsing error catches.
27983
27984         * statement.cs (Switch): Add support for string switches.
27985         Handle null specially.
27986
27987         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
27988
27989 2001-11-28  Ravi Pratap  <ravi@ximian.com>
27990
27991         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
27992
27993         (declare_local_constant): New helper function.
27994
27995         * statement.cs (AddConstant): Keep a separate record of constants
27996
27997         (IsConstant): Implement to determine if a variable is a constant.
27998
27999         (GetConstantExpression): Implement.
28000
28001         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
28002
28003         * statement.cs (IsVariableDefined): Re-write.
28004
28005 2001-11-27  Ravi Pratap  <ravi@ximian.com>
28006
28007         * class.cs (TypeContainer::FindMembers): Look for constants
28008         in the case when we are looking for MemberTypes.Field
28009
28010         * expression.cs (MemberAccess::DoResolve): Check that in the
28011         case we are a FieldExpr and a Literal, we are not being accessed
28012         by an instance reference.
28013
28014         * cs-parser.jay (local_constant_declaration): Implement.
28015
28016         (declaration_statement): Implement for constant declarations.
28017
28018 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
28019
28020         * statement.cs (Switch): Catch double defaults.
28021
28022         (Switch): More work on the switch() statement
28023         implementation.  It works for integral values now, need to finish
28024         string support.
28025
28026
28027 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
28028
28029         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
28030         integer literals into other integer literals.  To be used by
28031         switch. 
28032
28033 2001-11-24  Ravi Pratap  <ravi@ximian.com>
28034
28035         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
28036         some memory.
28037
28038         (EmitDynamicInitializers): Cope with the above since we extract data
28039         directly from ArrayData now.
28040
28041         (ExpectInitializers): Keep track of whether initializers are mandatory
28042         or not.
28043
28044         (Bounds): Make it a hashtable to prevent the same dimension being 
28045         recorded for every element in that dimension.
28046
28047         (EmitDynamicInitializers): Fix bug which prevented the Set array method
28048         from being found.
28049
28050         Also fix bug which was causing the indices to be emitted in the reverse
28051         order.
28052
28053 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
28054
28055         * expression.cs (ArrayCreation): Implement the bits that Ravi left
28056         unfinished.  They do not work, because the underlying code is
28057         sloppy.
28058
28059 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28060
28061         * cs-parser.jay: Remove bogus fixme.
28062
28063         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
28064         on Switch statement.
28065
28066 2001-11-23  Ravi Pratap  <ravi@ximian.com>
28067
28068         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
28069         the same. 
28070
28071         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
28072         parameter. Apparently, any expression is allowed. 
28073
28074         (ValidateInitializers): Update accordingly.
28075
28076         (CheckIndices): Fix some tricky bugs thanks to recursion.
28077
28078         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
28079         I was being completely brain-dead.
28080
28081         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
28082         and re-write acordingly.
28083
28084         (DelegateInvocation): Re-write accordingly.
28085
28086         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
28087
28088         (MakeByteBlob): Handle types more correctly.
28089
28090         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
28091         initialization from expressions but it is incomplete because I am a complete
28092         Dodo :-|
28093
28094 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28095
28096         * statement.cs (If.Emit): Fix a bug that generated incorrect code
28097         on If.  Basically, we have to return `true' (ie, we do return to
28098         our caller) only if both branches of the if return.
28099
28100         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
28101         short-circuit operators, handle them as short circuit operators. 
28102
28103         (Cast.DoResolve): Resolve type.
28104         (Cast.Cast): Take an expression as the target type.
28105
28106         * cs-parser.jay (cast_expression): Remove old hack that only
28107         allowed a limited set of types to be handled.  Now we take a
28108         unary_expression and we resolve to a type during semantic
28109         analysis.
28110
28111         Use the grammar productions from Rhys to handle casts (this is
28112         not complete like Rhys syntax yet, we fail to handle that corner
28113         case that C# has regarding (-x), but we will get there.
28114
28115 2001-11-22  Ravi Pratap  <ravi@ximian.com>
28116
28117         * class.cs (EmitFieldInitializer): Take care of the case when we have a
28118         field which is an array type.
28119
28120         * cs-parser.jay (declare_local_variables): Support array initialization too.
28121
28122         * typemanager.cs (MakeKey): Implement.
28123
28124         (everywhere): Use the above appropriately.
28125
28126         * cs-parser.jay (for_statement): Update for array initialization while
28127         declaring variables.
28128
28129         * ecore.cs : The error message was correct, it's the variable's names that
28130         were misleading ;-) Make the code more readable.
28131
28132         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
28133         the correct type etc.
28134
28135         (ConvertExplicit): Handle Enum types by examining the underlying type.
28136
28137 2001-11-21  Ravi Pratap  <ravi@ximian.com>
28138
28139         * parameter.cs (GetCallingConvention): Always return
28140         CallingConventions.Standard for now.
28141
28142 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28143
28144         * expression.cs (Binary.ResolveOperator): Update the values of `l'
28145         and `r' after calling DoNumericPromotions.
28146
28147         * ecore.cs: Fix error message (the types were in the wrong order).
28148
28149         * statement.cs (Foreach.ProbeCollectionType): Need to pass
28150         BindingFlags.Instance as well 
28151
28152         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
28153         implicit int literal conversion in an empty cast so that we
28154         propagate the right type upstream.
28155
28156         (UnboxCast): new class used to unbox value types.
28157         (Expression.ConvertExplicit): Add explicit type conversions done
28158         by unboxing.
28159
28160         (Expression.ImplicitNumericConversion): Oops, forgot to test for
28161         the target type before applying the implicit LongLiterals to ULong
28162         literal cast.
28163
28164 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
28165
28166         * cs-parser.jay (for_statement): Reworked the way For works: now
28167         we declare manually any variables that are introduced in
28168         for_initializer to solve the problem of having out-of-band code
28169         emition (that is what got for broken).
28170
28171         (declaration_statement): Perform the actual variable declaration
28172         that used to be done in local_variable_declaration here.
28173
28174         (local_variable_declaration): Do not declare anything, just pass
28175         the information on a DictionaryEntry
28176
28177 2001-11-20  Ravi Pratap  <ravi@ximian.com>
28178
28179         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
28180         re-write of the logic to now make it recursive.
28181
28182         (UpdateIndices): Re-write accordingly.
28183
28184         Store element data in a separate ArrayData list in the above methods.
28185
28186         (MakeByteBlob): Implement to dump the array data into a byte array.
28187
28188 2001-11-19  Ravi Pratap  <ravi@ximian.com>
28189
28190         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
28191         into CheckIndices.
28192
28193         * constant.cs (Define): Implement.
28194
28195         (EmitConstant): Re-write fully.
28196
28197         Pass in location info.
28198
28199         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
28200         respectively.
28201
28202         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
28203         DictionaryEntry since we need location info too.
28204
28205         (constant_declaration): Update accordingly.
28206
28207         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
28208         code into another method : UpdateIndices.
28209
28210 2001-11-18  Ravi Pratap  <ravi@ximian.com>
28211
28212         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
28213         some type checking etc.
28214
28215 2001-11-17  Ravi Pratap  <ravi@ximian.com>
28216
28217         * expression.cs (ArrayCreation::ValidateInitializers): Implement
28218         bits to provide dimension info if the user skips doing that.
28219
28220         Update second constructor to store the rank correctly.
28221
28222 2001-11-16  Ravi Pratap  <ravi@ximian.com>
28223
28224         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
28225         and try to implement.
28226
28227         * ../errors/cs0150.cs : Add.
28228
28229         * ../errors/cs0178.cs : Add.
28230
28231 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
28232
28233         * statement.cs: Implement foreach on multi-dimensional arrays. 
28234
28235         * parameter.cs (Parameters.GetParameterByName): Also lookup the
28236         name of the params argument.
28237
28238         * expression.cs: Use EmitStoreOpcode to get the right opcode while
28239         initializing the array.
28240
28241         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
28242         we can use this elsewhere.
28243
28244         * statement.cs: Finish implementation of foreach for single
28245         dimension arrays.
28246
28247         * cs-parser.jay: Use an out-of-band stack to pass information
28248         around, I wonder why I need this.
28249
28250         foreach_block: Make the new foreach_block the current_block.
28251
28252         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
28253         function used to return a static Parameters structure.  Used for
28254         empty parameters, as those are created very frequently.
28255
28256         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
28257
28258 2001-11-15  Ravi Pratap  <ravi@ximian.com>
28259
28260         * interface.cs : Default modifier is private, not public. The
28261         make verify test passes again.
28262
28263 2001-11-15  Ravi Pratap  <ravi@ximian.com>
28264
28265         * support.cs (ReflectionParameters): Fix logic to determine
28266         whether the last parameter is a params one. Test 9 passes again.
28267
28268         * delegate.cs (Populate): Register the builders we define with
28269         RegisterParameterForBuilder. Test 19 passes again.
28270
28271         * cs-parser.jay (property_declaration): Reference $6 instead
28272         of $$ to get at the location.
28273
28274         (indexer_declaration): Similar stuff.
28275
28276         (attribute): Ditto.
28277
28278         * class.cs (Property): Register parameters for the Get and Set methods
28279         if they exist. Test 23 passes again.
28280
28281         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
28282         call to EmitArguments as we are sure there aren't any params arguments. 
28283         Test 32 passes again.
28284
28285         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
28286         IndexOutOfRangeException. 
28287
28288         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
28289         Test 33 now passes again.
28290
28291 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
28292
28293         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
28294         broke a bunch of things.  Will have to come up with a better way
28295         of tracking locations.
28296
28297         * statement.cs: Implemented foreach for single dimension arrays.
28298
28299 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
28300
28301         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
28302         an error.  This removes the lookup from the critical path.
28303
28304         * cs-parser.jay: Removed use of temporary_loc, which is completely
28305         broken. 
28306
28307 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
28308
28309         * support.cs (ReflectionParameters.ParameterModifier): Report
28310         whether the argument is a PARAMS argument or not.
28311
28312         * class.cs: Set the attribute `ParamArrayAttribute' on the
28313         parameter argument.
28314
28315         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
28316         and cons_param_array_attribute (ConstructorInfo for
28317         ParamArrayAttribute)., 
28318
28319         * codegen.cs: Emit the return using the `Return' statement, that
28320         way we can report the error correctly for missing return values. 
28321
28322         * class.cs (Method.Emit): Clean up.
28323
28324         * expression.cs (Argument.Resolve): Take another argument: the
28325         location where this argument is used.  Notice that this is not
28326         part of the "Argument" class as to reduce the size of the
28327         structure (we know the approximate location anyways).
28328
28329         Test if the argument is a variable-reference, if not, then
28330         complain with a 206.
28331
28332         (Argument.Emit): Emit addresses of variables.
28333
28334         (Argument.FullDesc): Simplify.
28335
28336         (Invocation.DoResolve): Update for Argument.Resolve.
28337
28338         (ElementAccess.DoResolve): ditto.
28339
28340         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
28341         method should be virtual, as this method is always virtual.
28342
28343         (NewDelegate.DoResolve): Update for Argument.Resolve.
28344
28345         * class.cs (ConstructorInitializer.DoResolve): ditto.
28346
28347         * attribute.cs (Attribute.Resolve): ditto.
28348
28349 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
28350
28351         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
28352
28353         * expression.cs (ParameterReference): Drop IStackStorage and implement
28354         IAssignMethod instead. 
28355
28356         (LocalVariableReference): ditto.
28357
28358         * ecore.cs (FieldExpr): Drop IStackStorage and implement
28359         IAssignMethod instead. 
28360
28361 2001-11-13  Miguel de Icaza <miguel@ximian.com>
28362
28363         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
28364         enumerations that are used in heavily used structures derive from
28365         byte in a laughable and pathetic attempt to reduce memory usage.
28366         This is the kind of pre-optimzations that you should not do at
28367         home without adult supervision.
28368
28369         * expression.cs (UnaryMutator): New class, used to handle ++ and
28370         -- separatedly from the other unary operators.  Cleans up the
28371         code, and kills the ExpressionStatement dependency in Unary.
28372
28373         (Unary): Removed `method' and `Arguments' from this class, making
28374         it smaller, and moving it all to SimpleCall, so I can reuse this
28375         code in other locations and avoid creating a lot of transient data
28376         strucutres when not required.
28377
28378         * cs-parser.jay: Adjust for new changes.
28379
28380 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
28381
28382         * enum.cs (Enum.Populate): If there is a failure during
28383         definition, return
28384
28385         * cs-parser.jay (opt_enum_base): we used to catch type errors
28386         here, but this is really incorrect.  The type error should be
28387         catched during semantic analysis.
28388
28389 2001-12-11  Ravi Pratap  <ravi@ximian.com>
28390
28391         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
28392         current_local_parameters as expected since I, in my stupidity, had forgotten
28393         to do this :-)
28394
28395         * attribute.cs (GetValidPlaces): Fix stupid bug.
28396
28397         * class.cs (Method::Emit): Perform check on applicability of attributes.
28398
28399         (Constructor::Emit): Ditto.
28400
28401         (Field::Emit): Ditto.
28402
28403         (Field.Location): Store location information.
28404
28405         (Property, Event, Indexer, Operator): Ditto.
28406
28407         * cs-parser.jay (field_declaration): Pass in location for each field.
28408
28409         * ../errors/cs0592.cs : Add.
28410
28411 2001-11-12  Ravi Pratap  <ravi@ximian.com>
28412
28413         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
28414
28415         (InitCoreTypes): Update accordingly.
28416
28417         (RegisterAttrType, LookupAttr): Implement.
28418
28419         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
28420         info about the same.
28421
28422         (Resolve): Update to populate the above as necessary.
28423
28424         (Error592): Helper.
28425
28426         (GetValidPlaces): Helper to the above.
28427
28428         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
28429
28430         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
28431
28432 2001-11-12  Ravi Pratap  <ravi@ximian.com>
28433
28434         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
28435
28436         * ../errors/cs0617.cs : Add.
28437
28438 2001-11-11  Ravi Pratap  <ravi@ximian.com>
28439
28440         * enum.cs (Emit): Rename to Populate to be more consistent with what
28441         we expect it to do and when exactly it is called.
28442
28443         * class.cs, rootcontext.cs : Update accordingly.
28444
28445         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
28446         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
28447
28448         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
28449
28450         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
28451         of a fieldinfo using the above, when dealing with a FieldBuilder.
28452
28453 2001-11-10  Ravi Pratap  <ravi@ximian.com>
28454
28455         * ../errors/cs0031.cs : Add.
28456
28457         * ../errors/cs1008.cs : Add.
28458
28459         * ../errrors/cs0543.cs : Add.
28460
28461         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
28462         enum type.
28463
28464         (FindMembers): Implement.
28465
28466         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
28467         enums and delegates too.
28468
28469         (enum_types): Rename to builder_to_enum.
28470
28471         (delegate_types): Rename to builder_to_delegate.
28472
28473         * delegate.cs (FindMembers): Implement.
28474
28475 2001-11-09  Ravi Pratap  <ravi@ximian.com>
28476
28477         * typemanager.cs (IsEnumType): Implement.
28478
28479         * enum.cs (Emit): Re-write parts to account for the underlying type
28480         better and perform checking etc.
28481
28482         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
28483         of the underlying type.
28484
28485         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
28486         value
28487
28488         * enum.cs (error31): Helper to report error #31.
28489
28490         * cs-parser.jay (enum_declaration): Store location of each member too.
28491
28492         * enum.cs (member_to_location): New hashtable. 
28493
28494         (AddEnumMember): Update location hashtable.
28495
28496         (Emit): Use the location of each member while reporting errors.
28497
28498 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
28499
28500         * cs-parser.jay: A for_initializer if is a
28501         local_variable_declaration really ammount to have an implicit
28502         block with the variable declaration and no initializer for for.
28503
28504         * statement.cs (For.Emit): Cope with null initializers.
28505
28506         This fixes the infinite loop on for initializers.
28507
28508 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
28509
28510         * enum.cs: More cleanup.
28511
28512         * ecore.cs: Remove dead code.
28513
28514         * class.cs (Property.Emit): More simplification.
28515         (Event.Emit): ditto.
28516
28517         Reworked to have less levels of indentation.
28518
28519 2001-11-08  Ravi Pratap  <ravi@ximian.com>
28520
28521         * class.cs (Property): Emit attributes.
28522
28523         (Field): Ditto.
28524
28525         (Event): Ditto.
28526
28527         (Indexer): Ditto.
28528
28529         (Operator): Ditto.
28530
28531         * enum.cs (Emit): Ditto.
28532
28533         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
28534         Enums too.
28535
28536         * class.cs (Field, Event, etc.): Move attribute generation into the
28537         Emit method everywhere.
28538
28539         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
28540         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
28541         as we had no way of defining nested enums !
28542
28543         * rootcontext.cs : Adjust code accordingly.
28544
28545         * typemanager.cs (AddEnumType): To keep track of enum types separately.
28546
28547 2001-11-07  Ravi Pratap  <ravi@ximian.com>
28548
28549         * expression.cs (EvalConstantExpression): Move into ecore.cs
28550
28551         * enum.cs (Enum): Rename some members and make them public and readonly
28552         according to our convention.
28553
28554         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
28555         nothing else.
28556
28557         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
28558
28559         (Enum::Emit): Write a simple version for now which doesn't try to compute
28560         expressions. I shall modify this to be more robust in just a while.
28561
28562         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
28563
28564         (TypeContainer::CloseType): Create the Enum types too.
28565
28566         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
28567
28568         * expression.cs (EvalConstantExpression): Get rid of completely.
28569
28570         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
28571         user-defined values and other cases.
28572
28573         (IsValidEnumLiteral): Helper function.
28574
28575         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
28576         out there in the case we had a literal FieldExpr.
28577
28578         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
28579
28580         (Literalize): Revamp a bit to take two arguments.
28581
28582         (EnumLiteral): New class which derives from Literal to wrap enum literals.
28583
28584 2001-11-06  Ravi Pratap  <ravi@ximian.com>
28585
28586         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
28587
28588         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
28589
28590         (Resolve): Use the above to ensure we have proper initializers.
28591
28592 2001-11-05  Ravi Pratap  <ravi@ximian.com>
28593
28594         * expression.cs (Expression::EvalConstantExpression): New method to 
28595         evaluate constant expressions.
28596
28597         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
28598
28599 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
28600
28601         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
28602         in an array.
28603
28604         (Binary.ResolveOperator): Handle operator != (object a, object b)
28605         and operator == (object a, object b);
28606
28607         (Binary.DoNumericPromotions): Indicate whether the numeric
28608         promotion was possible.
28609
28610         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
28611         Implement.  
28612
28613         Made the ArrayAccess implement interface IAssignMethod instead of
28614         IStackStore as the order in which arguments are passed reflects
28615         this.
28616
28617         * assign.cs: Instead of using expr.ExprClass to select the way of
28618         assinging, probe for the IStackStore/IAssignMethod interfaces.
28619
28620         * typemanager.cs: Load InitializeArray definition.
28621
28622         * rootcontext.cs (RootContext.MakeStaticData): Used to define
28623         static data that can be used to initialize arrays. 
28624
28625 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
28626
28627         * expression.cs: Handle operator== and operator!= for booleans.
28628
28629         (Conditioal.Reduce): Implement reducer for the ?: operator.
28630
28631         (Conditional.Resolve): Implement dead code elimination.
28632
28633         (Binary.Resolve): Catch string literals and return a new
28634         concatenated string.
28635
28636         (Unary.Reduce): Implement reduction of unary expressions.
28637
28638         * ecore.cs: Split out the expression core handling here.
28639
28640         (Expression.Reduce): New method used to perform constant folding
28641         and CSE.  This is needed to support constant-expressions. 
28642
28643         * statement.cs (Statement.EmitBoolExpression): Pass true and false
28644         targets, and optimize for !x.
28645
28646 2001-11-04  Ravi Pratap  <ravi@ximian.com>
28647
28648         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
28649         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
28650         set custom atttributes.
28651
28652         * literal.cs (Literal::GetValue): New abstract method to return the actual
28653         value of the literal, cast as an object.
28654
28655         (*Literal): Implement GetValue method.
28656
28657         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
28658         expressions to the arraylist but objects of type Argument.
28659
28660         * class.cs (TypeContainer::Emit): Emit our attributes too.
28661
28662         (Method::Emit, Constructor::Emit): Ditto.
28663
28664         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
28665         to be ignoring earlier.
28666
28667 2001-11-03  Ravi Pratap  <ravi@ximian.com>
28668
28669         * attribute.cs (AttributeSection::Define): Implement to do the business
28670         of constructing a CustomAttributeBuilder.
28671
28672         (Attribute): New trivial class. Increases readability of code.  
28673
28674         * cs-parser.jay : Update accordingly.
28675
28676         (positional_argument_list, named_argument_list, named_argument): New rules
28677
28678         (attribute_arguments): Use the above so that we are more correct.
28679
28680 2001-11-02  Ravi Pratap  <ravi@ximian.com>
28681
28682         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
28683         to perform all checks for a method with a params parameter.
28684
28685         (Invocation::OverloadResolve): Update to use the above method and therefore
28686         cope correctly with params method invocations.
28687
28688         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
28689         params too.
28690
28691         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
28692         constructors in our parent too because we can't afford to miss out on 
28693         protected ones ;-)
28694
28695         * attribute.cs (AttributeSection): New name for the class Attribute
28696
28697         Other trivial changes to improve readability.
28698
28699         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
28700         use the new class names.
28701
28702 2001-11-01  Ravi Pratap  <ravi@ximian.com>
28703
28704         * class.cs (Method::Define): Complete definition for params types too
28705
28706         (Indexer::Define): Ditto.
28707
28708         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
28709         Cope everywhere with a request for info about the array parameter.
28710
28711 2001-11-01  Ravi Pratap  <ravi@ximian.com>
28712
28713         * tree.cs (RecordNamespace): Fix up to check for the correct key.
28714
28715         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
28716         local_variable_type to extract the string corresponding to the type.
28717
28718         (local_variable_type): Fixup the action to use the new helper method.
28719
28720         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
28721         go.
28722
28723         * expression.cs : Clean out code which uses the above.
28724
28725 2001-10-31  Ravi Pratap  <ravi@ximian.com>
28726
28727         * typemanager.cs (RegisterMethod): Check if we already have an existing key
28728         and bale out if necessary by returning a false.
28729
28730         (RegisterProperty): Ditto.
28731
28732         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
28733         and print out appropriate error messages.
28734
28735         * interface.cs (everywhere): Ditto.
28736
28737         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
28738         location to constructor.
28739
28740         * class.cs (Property, Event, Indexer): Update accordingly.
28741
28742         * ../errors/cs111.cs : Added.
28743
28744         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
28745         of a method, as laid down by the spec.
28746
28747         (Invocation::OverloadResolve): Use the above method.
28748
28749 2001-10-31  Ravi Pratap  <ravi@ximian.com>
28750
28751         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
28752         now take a TypeContainer and a Parameters object.
28753
28754         (ParameterData): Modify return type of ParameterModifier method to be 
28755         Parameter.Modifier and not a string.
28756
28757         (ReflectionParameters, InternalParameters): Update accordingly.
28758
28759         * expression.cs (Argument::GetParameterModifier): Same here.
28760
28761         * support.cs (InternalParameters::ParameterType): Find a better way of determining
28762         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
28763         symbol in it at all so maybe this is only for now.
28764
28765 2001-10-30  Ravi Pratap  <ravi@ximian.com>
28766
28767         * support.cs (InternalParameters): Constructor now takes an extra argument 
28768         which is the actual Parameters class.
28769
28770         (ParameterDesc): Update to provide info on ref/out modifiers.
28771
28772         * class.cs (everywhere): Update call to InternalParameters to pass in
28773         the second argument too.
28774
28775         * support.cs (ParameterData): Add ParameterModifier, which is a method 
28776         to return the modifier info [ref/out etc]
28777
28778         (InternalParameters, ReflectionParameters): Implement the above.
28779
28780         * expression.cs (Argument::ParameterModifier): Similar function to return
28781         info about the argument's modifiers.
28782
28783         (Invocation::OverloadResolve): Update to take into account matching modifiers 
28784         too.
28785
28786         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
28787         a new SetFormalParameters object which we pass to InternalParameters.
28788
28789 2001-10-30  Ravi Pratap  <ravi@ximian.com>
28790
28791         * expression.cs (NewArray): Merge into the ArrayCreation class.
28792
28793 2001-10-29  Ravi Pratap  <ravi@ximian.com>
28794
28795         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
28796         NewUserdefinedArray into one as there wasn't much of a use in having
28797         two separate ones.
28798
28799         * expression.cs (Argument): Change field's name to ArgType from Type.
28800
28801         (Type): New readonly property which returns the proper type, taking into 
28802         account ref/out modifiers.
28803
28804         (everywhere): Adjust code accordingly for the above.
28805
28806         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
28807         whether we are emitting for a ref or out parameter.
28808
28809         * expression.cs (Argument::Emit): Use the above field to set the state.
28810
28811         (LocalVariableReference::Emit): Update to honour the flag and emit the
28812         right stuff.
28813
28814         * parameter.cs (Attributes): Set the correct flags for ref parameters.
28815
28816         * expression.cs (Argument::FullDesc): New function to provide a full desc.
28817
28818         * support.cs (ParameterData): Add method ParameterDesc to the interface.
28819
28820         (ReflectionParameters, InternalParameters): Implement the above method.
28821
28822         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
28823         reporting errors.
28824
28825         (Invocation::FullMethodDesc): Ditto. 
28826
28827 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
28828
28829         * cs-parser.jay: Add extra production for the second form of array
28830         creation. 
28831
28832         * expression.cs (ArrayCreation): Update to reflect the above
28833         change. 
28834
28835         * Small changes to prepare for Array initialization.
28836
28837 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
28838
28839         * typemanager.cs (ImplementsInterface): interface might be null;
28840         Deal with this problem;
28841
28842         Also, we do store negative hits on the cache (null values), so use
28843         this instead of calling t.GetInterfaces on the type everytime.
28844
28845 2001-10-28  Ravi Pratap  <ravi@ximian.com>
28846
28847         * typemanager.cs (IsBuiltinType): New method to help determine the same.
28848
28849         * expression.cs (New::DoResolve): Get rid of array creation code and instead
28850         split functionality out into different classes.
28851
28852         (New::FormArrayType): Move into NewBuiltinArray.
28853
28854         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
28855         quite useless.
28856
28857         (NewBuiltinArray): New class to handle creation of built-in arrays.
28858
28859         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
28860         account creation of one-dimensional arrays.
28861
28862         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
28863
28864         (NewUserdefinedArray::DoResolve): Implement.
28865
28866         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
28867
28868         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
28869         we maintain inside the TypeManager. This is necessary to perform lookups on the
28870         module builder.
28871
28872         (LookupType): Update to perform GetType on the module builders too.     
28873
28874         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
28875
28876         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
28877
28878 2001-10-23  Ravi Pratap  <ravi@ximian.com>
28879
28880         * expression.cs (New::DoResolve): Implement guts of array creation.
28881
28882         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
28883
28884 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
28885
28886         * expression.cs: Fix bug I introduced lsat night that broke
28887         Delegates. 
28888
28889         (Expression.Resolve): Report a 246 error (can not resolve name)
28890         if we find a SimpleName in the stream.
28891
28892         (Expression.ResolveLValue): Ditto.
28893
28894         (Expression.ResolveWithSimpleName): This function is a variant of
28895         ResolveName, this one allows SimpleNames to be returned without a
28896         warning.  The only consumer of SimpleNames is MemberAccess
28897
28898 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
28899
28900         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
28901         might arrive here.  I have my doubts that this is correct.
28902
28903         * statement.cs (Lock): Implement lock statement.
28904
28905         * cs-parser.jay: Small fixes to support `lock' and `using'
28906
28907         * cs-tokenizer.cs: Remove extra space
28908
28909         * driver.cs: New flag --checked, allows to turn on integer math
28910         checking. 
28911
28912         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
28913         Threading.Monitor.Exit 
28914
28915 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
28916
28917         * expression.cs (IndexerAccess::DoResolveLValue): Set the
28918         Expression Class to be IndexerAccess.
28919
28920         Notice that Indexer::DoResolve sets the eclass to Value.
28921
28922 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
28923
28924         * class.cs (TypeContainer::Emit): Emit code for indexers.
28925
28926         * assign.cs (IAssignMethod): New interface implemented by Indexers
28927         and Properties for handling assignment.
28928
28929         (Assign::Emit): Simplify and reuse code. 
28930
28931         * expression.cs (IndexerAccess, PropertyExpr): Implement
28932         IAssignMethod, clean up old code. 
28933
28934 2001-10-22  Ravi Pratap  <ravi@ximian.com>
28935
28936         * typemanager.cs (ImplementsInterface): New method to determine if a type
28937         implements a given interface. Provides a nice cache too.
28938
28939         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
28940         method.
28941
28942         (ConvertReferenceExplicit): Ditto.
28943
28944         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
28945         various methods, with correct names etc.
28946
28947         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
28948         Operator.UnaryNegation.
28949
28950         * cs-parser.jay (operator_declarator): Be a little clever in the case where
28951         we have a unary plus or minus operator.
28952
28953         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
28954         UnaryMinus.
28955
28956         * everywhere : update accordingly.
28957
28958         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
28959         respectively.
28960
28961         * class.cs (Method::Define): For the case where we are implementing a method
28962         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
28963         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
28964
28965 2001-10-21  Ravi Pratap  <ravi@ximian.com>
28966
28967         * interface.cs (FindMembers): Implement to work around S.R.E
28968         lameness.
28969
28970         * typemanager.cs (IsInterfaceType): Implement.
28971
28972         (FindMembers): Update to handle interface types too.
28973
28974         * expression.cs (ImplicitReferenceConversion): Re-write bits which
28975         use IsAssignableFrom as that is not correct - it doesn't work.
28976
28977         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
28978         and accordingly override EmitStatement.
28979
28980         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
28981         using the correct logic :-)
28982
28983 2001-10-19  Ravi Pratap  <ravi@ximian.com>
28984
28985         * ../errors/cs-11.cs : Add to demonstrate error -11 
28986
28987 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
28988
28989         * assign.cs (Assign::Resolve): Resolve right hand side first, and
28990         then pass this as a hint to ResolveLValue.
28991
28992         * expression.cs (FieldExpr): Add Location information
28993
28994         (FieldExpr::LValueResolve): Report assignment to readonly
28995         variable. 
28996
28997         (Expression::ExprClassFromMemberInfo): Pass location information.
28998
28999         (Expression::ResolveLValue): Add new method that resolves an
29000         LValue. 
29001
29002         (Expression::DoResolveLValue): Default invocation calls
29003         DoResolve. 
29004
29005         (Indexers): New class used to keep track of indexers in a given
29006         Type. 
29007
29008         (IStackStore): Renamed from LValue, as it did not really describe
29009         what this did.  Also ResolveLValue is gone from this interface and
29010         now is part of Expression.
29011
29012         (ElementAccess): Depending on the element access type
29013
29014         * typemanager.cs: Add `indexer_name_type' as a Core type
29015         (System.Runtime.CompilerServices.IndexerNameAttribute)
29016
29017         * statement.cs (Goto): Take a location.
29018
29019 2001-10-18  Ravi Pratap  <ravi@ximian.com>
29020
29021         * delegate.cs (Delegate::VerifyDelegate): New method to verify
29022         if two delegates are compatible.
29023
29024         (NewDelegate::DoResolve): Update to take care of the case when
29025         we instantiate a delegate from another delegate.
29026
29027         * typemanager.cs (FindMembers): Don't even try to look up members
29028         of Delegate types for now.
29029
29030 2001-10-18  Ravi Pratap  <ravi@ximian.com>
29031
29032         * delegate.cs (NewDelegate): New class to take care of delegate
29033         instantiation.
29034
29035         * expression.cs (New): Split the delegate related code out into 
29036         the NewDelegate class.
29037
29038         * delegate.cs (DelegateInvocation): New class to handle delegate 
29039         invocation.
29040
29041         * expression.cs (Invocation): Split out delegate related code into
29042         the DelegateInvocation class.
29043
29044 2001-10-17  Ravi Pratap  <ravi@ximian.com>
29045
29046         * expression.cs (New::DoResolve): Implement delegate creation fully
29047         and according to the spec.
29048
29049         (New::DoEmit): Update to handle delegates differently.
29050
29051         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
29052         because of which we were printing out arguments in reverse order !
29053
29054         * delegate.cs (VerifyMethod): Implement to check if the given method
29055         matches the delegate.
29056
29057         (FullDelegateDesc): Implement.
29058
29059         (VerifyApplicability): Implement.
29060
29061         * expression.cs (Invocation::DoResolve): Update to accordingly handle
29062         delegate invocations too.
29063
29064         (Invocation::Emit): Ditto.
29065
29066         * ../errors/cs1593.cs : Added.
29067
29068         * ../errors/cs1594.cs : Added.
29069
29070         * delegate.cs (InstanceExpression, TargetMethod): New properties.
29071
29072 2001-10-16  Ravi Pratap  <ravi@ximian.com>
29073
29074         * typemanager.cs (intptr_type): Core type for System.IntPtr
29075
29076         (InitCoreTypes): Update for the same.
29077
29078         (iasyncresult_type, asynccallback_type): Ditto.
29079
29080         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
29081         correct.
29082
29083         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
29084         too.
29085
29086         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
29087         the builders for the 4 members of a delegate type :-)
29088
29089         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
29090         type.
29091
29092         * expression.cs (New::DoResolve): Implement guts for delegate creation.
29093
29094         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
29095
29096 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
29097
29098         * statement.cs (Break::Emit): Implement.   
29099         (Continue::Emit): Implement.
29100
29101         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29102         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29103         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29104         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
29105         end loop
29106
29107         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
29108         properties that track the label for the current loop (begin of the
29109         loop and end of the loop).
29110
29111 2001-10-15  Ravi Pratap  <ravi@ximian.com>
29112
29113         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
29114         use of emitting anything at all.
29115
29116         * class.cs, rootcontext.cs : Get rid of calls to the same.
29117
29118         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
29119
29120         (Populate): Define the constructor correctly and set the implementation
29121         attributes.
29122
29123         * typemanager.cs (delegate_types): New hashtable to hold delegates that
29124         have been defined.
29125
29126         (AddDelegateType): Implement.
29127
29128         (IsDelegateType): Implement helper method.
29129
29130         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
29131
29132         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
29133         and accordingly handle it.
29134
29135         * delegate.cs (Populate): Take TypeContainer argument.
29136         Implement bits to define the Invoke method. However, I still haven't figured out
29137         how to take care of the native int bit :-(
29138
29139         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
29140         Qualify the name of the delegate, not its return type !
29141
29142         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
29143         conversion.
29144
29145         (StandardConversionExists): Checking for array types turns out to be recursive.
29146
29147         (ConvertReferenceExplicit): Implement array conversion.
29148
29149         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
29150
29151 2001-10-12  Ravi Pratap  <ravi@ximian.com>
29152
29153         * cs-parser.jay (delegate_declaration): Store the fully qualified
29154         name as it is a type declaration.
29155
29156         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
29157         readonly.
29158
29159         (DefineDelegate): Renamed from Define. Does the same thing essentially,
29160         as TypeContainer::DefineType.
29161
29162         (Populate): Method in which all the definition of the various methods (Invoke)
29163         etc is done.
29164
29165         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
29166         see.
29167
29168         (CloseDelegate): Finally creates the delegate.
29169
29170         * class.cs (TypeContainer::DefineType): Update to define delegates.
29171         (Populate, Emit and CloseType): Do the same thing here too.
29172
29173         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
29174         delegates in all these operations.
29175
29176 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
29177
29178         * expression.cs: LocalTemporary: a new expression used to
29179         reference a temporary that has been created.
29180
29181         * assign.cs: Handle PropertyAccess back here, so that we can
29182         provide the proper semantic access to properties.
29183
29184         * expression.cs (Expression::ConvertReferenceExplicit): Implement
29185         a few more explicit conversions. 
29186
29187         * modifiers.cs: `NEW' modifier maps to HideBySig.
29188
29189         * expression.cs (PropertyExpr): Make this into an
29190         ExpressionStatement, and support the EmitStatement code path. 
29191
29192         Perform get/set error checking, clean up the interface.
29193
29194         * assign.cs: recognize PropertyExprs as targets, and if so, turn
29195         them into toplevel access objects.
29196
29197 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
29198
29199         * expression.cs: PropertyExpr::PropertyExpr: use work around the
29200         SRE.
29201
29202         * typemanager.cs: Keep track here of our PropertyBuilders again to
29203         work around lameness in SRE.
29204
29205 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
29206
29207         * expression.cs (LValue::LValueResolve): New method in the
29208         interface, used to perform a second resolution pass for LValues. 
29209
29210         (This::DoResolve): Catch the use of this in static methods.
29211
29212         (This::LValueResolve): Implement.
29213
29214         (This::Store): Remove warning, assigning to `this' in structures
29215         is 
29216
29217         (Invocation::Emit): Deal with invocation of
29218         methods on value types.  We need to pass the address to structure
29219         methods rather than the object itself.  (The equivalent code to
29220         emit "this" for structures leaves the entire structure on the
29221         stack instead of a pointer to it). 
29222
29223         (ParameterReference::DoResolve): Compute the real index for the
29224         argument based on whether the method takes or not a `this' pointer
29225         (ie, the method is static).
29226
29227         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
29228         value types returned from functions when we need to invoke a
29229         method on the sturcture.
29230
29231
29232 2001-10-11  Ravi Pratap  <ravi@ximian.com>
29233
29234         * class.cs (TypeContainer::DefineType): Method to actually do the business of
29235         defining the type in the Modulebuilder or Typebuilder. This is to take
29236         care of nested types which need to be defined on the TypeBuilder using
29237         DefineNestedMethod.
29238
29239         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
29240         methods in RootContext, only ported to be part of TypeContainer.
29241
29242         (TypeContainer::GetInterfaceOrClass): Ditto.
29243
29244         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
29245
29246         * interface.cs (Interface::DefineInterface): New method. Does exactly
29247         what RootContext.CreateInterface did earlier, only it takes care of nested types 
29248         too.
29249
29250         (Interface::GetInterfaces): Move from RootContext here and port.
29251
29252         (Interface::GetInterfaceByName): Same here.
29253
29254         * rootcontext.cs (ResolveTree): Re-write.
29255
29256         (PopulateTypes): Re-write.
29257
29258         * class.cs (TypeContainer::Populate): Populate nested types too.
29259         (TypeContainer::Emit): Emit nested members too.
29260
29261         * typemanager.cs (AddUserType): Do not make use of the FullName property,
29262         instead just use the name argument passed in as it is already fully
29263         qualified.
29264
29265         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
29266         to TypeContainer mapping to see if a type is user-defined.
29267
29268         * class.cs (TypeContainer::CloseType): Implement. 
29269
29270         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
29271         the default constructor.
29272
29273         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
29274         twice.
29275
29276         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
29277
29278         * interface.cs (CloseType): Create the type here.
29279
29280         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
29281         the hierarchy.
29282
29283         Remove all the methods which are now in TypeContainer.
29284
29285 2001-10-10  Ravi Pratap  <ravi@ximian.com>
29286
29287         * delegate.cs (Define): Re-write bits to define the delegate
29288         correctly.
29289
29290 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
29291
29292         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
29293
29294         * expression.cs (ImplicitReferenceConversion): handle null as well
29295         as a source to convert to any reference type.
29296
29297         * statement.cs (Return): Perform any implicit conversions to
29298         expected return type.  
29299
29300         Validate use of return statement.  
29301
29302         * codegen.cs (EmitContext): Pass the expected return type here.
29303
29304         * class.cs (Method, Constructor, Property): Pass expected return
29305         type to EmitContext.
29306
29307 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
29308
29309         * expression.cs: Make DoResolve take an EmitContext instead of a
29310         TypeContainer.
29311
29312         Replaced `l' and `location' for `loc', for consistency.
29313
29314         (Error, Warning): Remove unneeded Tc argument.
29315
29316         * assign.cs, literal.cs, constant.cs: Update to new calling
29317         convention. 
29318
29319         * codegen.cs: EmitContext now contains a flag indicating whether
29320         code is being generated in a static method or not.
29321
29322         * cs-parser.jay: DecomposeQI, new function that replaces the old
29323         QualifiedIdentifier.  Now we always decompose the assembled
29324         strings from qualified_identifier productions into a group of
29325         memberaccesses.
29326
29327 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
29328
29329         * rootcontext.cs: Deal with field-less struct types correctly now
29330         by passing the size option to Define Type.
29331
29332         * class.cs: Removed hack that created one static field. 
29333
29334 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
29335
29336         * statement.cs: Moved most of the code generation here. 
29337
29338 2001-10-09  Ravi Pratap  <ravi@ximian.com>
29339
29340         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
29341         seem very right.
29342
29343         (ElementAccess): Remove useless bits for now - keep checks as the spec
29344         says.
29345
29346 2001-10-08  Ravi Pratap  <ravi@ximian.com>
29347
29348         * expression.cs (ElementAccess::DoResolve): Remove my crap code
29349         and start performing checks according to the spec.
29350
29351 2001-10-07  Ravi Pratap  <ravi@ximian.com>
29352
29353         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
29354         rank_specifiers instead.
29355
29356         (rank_specifiers): Change the order in which the rank specifiers are stored
29357
29358         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
29359
29360         * expression.cs (ElementAccess): Implement the LValue interface too.
29361
29362 2001-10-06  Ravi Pratap  <ravi@ximian.com>
29363
29364         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
29365         except that user defined conversions are not included.
29366
29367         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
29368         perform the conversion of the return type, if necessary.
29369
29370         (New::DoResolve): Check whether we are creating an array or an object
29371         and accordingly do the needful.
29372
29373         (New::Emit): Same here.
29374
29375         (New::DoResolve): Implement guts of array creation.
29376
29377         (New::FormLookupType): Helper function.
29378
29379 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
29380
29381         * codegen.cs: Removed most of the code generation here, and move the
29382         corresponding code generation bits to the statement classes. 
29383
29384         Added support for try/catch/finalize and throw.
29385
29386         * cs-parser.jay: Added support for try/catch/finalize.
29387
29388         * class.cs: Catch static methods having the flags override,
29389         virtual or abstract.
29390
29391         * expression.cs (UserCast): This user cast was not really doing
29392         what it was supposed to do.  Which is to be born in fully resolved
29393         state.  Parts of the resolution were being performed at Emit time! 
29394
29395         Fixed this code.
29396
29397 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
29398
29399         * expression.cs: Implicity convert the result from UserCast.
29400
29401 2001-10-05  Ravi Pratap  <ravi@ximian.com>
29402
29403         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
29404         prevented it from working correctly. 
29405
29406         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
29407         merely ConvertImplicit.
29408
29409 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
29410
29411         * typemanager.cs: Make the LookupTypeContainer function static,
29412         and not per-instance.  
29413
29414         * class.cs: Make static FindMembers (the one that takes a Type
29415         argument). 
29416
29417         * codegen.cs: Add EmitForeach here.
29418
29419         * cs-parser.jay: Make foreach a toplevel object instead of the
29420         inline expansion, as we need to perform semantic analysis on it. 
29421
29422 2001-10-05  Ravi Pratap  <ravi@ximian.com>
29423
29424         * expression.cs (Expression::ImplicitUserConversion): Rename to
29425         UserDefinedConversion.
29426
29427         (Expression::UserDefinedConversion): Take an extra argument specifying 
29428         whether we look for explicit user conversions too.
29429
29430         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
29431
29432         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
29433
29434         (ExplicitUserConversion): Make it a call to UserDefinedConversion
29435         with the appropriate arguments.
29436
29437         * cs-parser.jay (cast_expression): Record location too.
29438
29439         * expression.cs (Cast): Record location info.
29440
29441         (Expression::ConvertExplicit): Take location argument.
29442
29443         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
29444         to determine if we are doing explicit conversions.
29445
29446         (UserCast::Emit): Update accordingly.
29447
29448         (Expression::ConvertExplicit): Report an error if everything fails.
29449
29450         * ../errors/cs0030.cs : Add.
29451
29452 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
29453
29454         * modifiers.cs: If the ABSTRACT keyword is present, also set the
29455         virtual and newslot bits. 
29456
29457         * class.cs (TypeContainer::RegisterRequiredImplementations):
29458         Record methods we need.
29459
29460         (TypeContainer::MakeKey): Helper function to make keys for
29461         MethodBases, since the Methodbase key is useless.
29462
29463         (TypeContainer::Populate): Call RegisterRequiredImplementations
29464         before defining the methods.   
29465
29466         Create a mapping for method_builders_to_methods ahead of time
29467         instead of inside a tight loop.
29468
29469         (::RequireMethods):  Accept an object as the data to set into the
29470         hashtable so we can report interface vs abstract method mismatch.
29471
29472 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
29473
29474         * report.cs: Make all of it static.
29475
29476         * rootcontext.cs: Drop object_type and value_type computations, as
29477         we have those in the TypeManager anyways.
29478
29479         Drop report instance variable too, now it is a global.
29480
29481         * driver.cs: Use try/catch on command line handling.
29482
29483         Add --probe option to debug the error reporting system with a test
29484         suite. 
29485
29486         * report.cs: Add support for exiting program when a probe
29487         condition is reached.
29488
29489 2001-10-03  Ravi Pratap  <ravi@ximian.com>
29490
29491         * expression.cs (Binary::DoNumericPromotions): Fix the case when
29492         we do a forcible conversion regardless of type, to check if 
29493         ForceConversion returns a null.
29494
29495         (Binary::error19): Use location to report error.
29496
29497         (Unary::error23): Use location here too.
29498
29499         * ../errors/cs0019.cs : Check in.
29500
29501         * ../errors/cs0023.cs : Check in.
29502
29503         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
29504         case of a non-null MethodInfo object with a length of 0 !
29505
29506         (Binary::ResolveOperator): Flag error if overload resolution fails to find
29507         an applicable member - according to the spec :-)
29508         Also fix logic to find members in base types.
29509
29510         (Unary::ResolveOperator): Same here.
29511
29512         (Unary::report23): Change name to error23 and make first argument a TypeContainer
29513         as I was getting thoroughly confused between this and error19 :-)
29514
29515         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
29516         (::FindMostEncompassedType): Implement.
29517         (::FindMostEncompassingType): Implement.
29518         (::StandardConversionExists): Implement.
29519
29520         (UserImplicitCast): Re-vamp. We now need info about most specific
29521         source and target types so that we can do the necessary conversions.
29522
29523         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
29524         mathematical union with no duplicates.
29525
29526 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
29527
29528         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
29529         in order from base classes to child classes, so that we can in
29530         child classes look up in our parent for method names and
29531         attributes (required for handling abstract, virtual, new, override
29532         constructs: we need to instrospect our base class, and if we dont
29533         populate the classes in order, the introspection might be
29534         incorrect.  For example, a method could query its parent before
29535         the parent has any methods and would determine that the parent has
29536         no abstract methods (while it could have had them)).
29537
29538         (RootContext::CreateType): Record the order in which we define the
29539         classes.
29540
29541 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
29542
29543         * class.cs (TypeContainer::Populate): Also method definitions can
29544         fail now, keep track of this.
29545
29546         (TypeContainer::FindMembers): Implement support for
29547         DeclaredOnly/noDeclaredOnly flag.
29548
29549         (Constructor::Emit) Return the ConstructorBuilder.
29550
29551         (Method::Emit) Return the MethodBuilder. 
29552         Check for abstract or virtual methods to be public.
29553
29554         * rootcontext.cs (RootContext::CreateType): Register all the
29555         abstract methods required for the class to be complete and the
29556         interface methods that must be implemented. 
29557
29558         * cs-parser.jay: Report error 501 (method requires body if it is
29559         not marked abstract or extern).
29560
29561         * expression.cs (TypeOf::Emit): Implement.
29562
29563         * typemanager.cs: runtime_handle_type, new global type.
29564
29565         * class.cs (Property::Emit): Generate code for properties.
29566
29567 2001-10-02  Ravi Pratap  <ravi@ximian.com>
29568
29569         * expression.cs (Unary::ResolveOperator): Find operators on base type
29570         too - we now conform exactly to the spec.
29571
29572         (Binary::ResolveOperator): Same here.
29573
29574         * class.cs (Operator::Define): Fix minor quirk in the tests.
29575
29576         * ../errors/cs0215.cs : Added.
29577
29578         * ../errors/cs0556.cs : Added.
29579
29580         * ../errors/cs0555.cs : Added.
29581
29582 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
29583
29584         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
29585         single integer which is really efficient
29586
29587 2001-10-01  Ravi Pratap  <ravi@ximian.com>
29588
29589         *  expression.cs (Expression::ImplicitUserConversion): Use location
29590         even in the case when we are examining True operators.
29591  
29592         * class.cs (Operator::Define): Perform extensive checks to conform
29593         with the rules for operator overloading in the spec.
29594
29595         * expression.cs (Expression::ImplicitReferenceConversion): Implement
29596         some of the other conversions mentioned in the spec.
29597
29598         * typemanager.cs (array_type): New static member for the System.Array built-in
29599         type.
29600
29601         (cloneable_interface): For System.ICloneable interface.
29602
29603         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
29604         we start resolving the tree and populating types.
29605
29606         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
29607  
29608 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
29609
29610         * expression.cs (Expression::ExprClassFromMemberInfo,
29611         Expression::Literalize): Create literal expressions from
29612         FieldInfos which are literals.
29613
29614         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
29615         type casts, because they were wrong.  The test suite in tests
29616         caught these ones.
29617
29618         (ImplicitNumericConversion): ushort to ulong requires a widening
29619         cast. 
29620
29621         Int32 constant to long requires widening cast as well.
29622
29623         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
29624         for integers because the type on the stack is not i4.
29625
29626 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
29627
29628         * expression.cs (report118): require location argument. 
29629
29630         * parameter.cs: Do not dereference potential null value.
29631
29632         * class.cs: Catch methods that lack the `new' keyword when
29633         overriding a name.  Report warnings when `new' is used without
29634         anything being there to override.
29635
29636         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
29637
29638         * class.cs: Only add constructor to hashtable if it is non-null
29639         (as now constructors can fail on define).
29640
29641         (TypeManager, Class, Struct): Take location arguments.
29642
29643         Catch field instance initialization in structs as errors.
29644
29645         accepting_filter: a new filter for FindMembers that is static so
29646         that we dont create an instance per invocation.
29647
29648         (Constructor::Define): Catch errors where a struct constructor is
29649         parameterless 
29650
29651         * cs-parser.jay: Pass location information for various new
29652         constructs. 
29653
29654         * delegate.cs (Delegate): take a location argument.
29655
29656         * driver.cs: Do not call EmitCode if there were problesm in the
29657         Definition of the types, as many Builders wont be there. 
29658
29659         * decl.cs (Decl::Decl): Require a location argument.
29660
29661         * cs-tokenizer.cs: Handle properly hex constants that can not fit
29662         into integers, and find the most appropiate integer for it.
29663
29664         * literal.cs: Implement ULongLiteral.
29665
29666         * rootcontext.cs: Provide better information about the location of
29667         failure when CreateType fails.
29668
29669 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
29670
29671         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
29672         as well.
29673
29674         * expression.cs (Binary::CheckShiftArguments): Add missing type
29675         computation.
29676         (Binary::ResolveOperator): Add type to the logical and and logical
29677         or, Bitwise And/Or and Exclusive Or code paths, it was missing
29678         before.
29679
29680         (Binary::DoNumericPromotions): In the case where either argument
29681         is ulong (and most signed types combined with ulong cause an
29682         error) perform implicit integer constant conversions as well.
29683
29684 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
29685
29686         * expression.cs (UserImplicitCast): Method should always be
29687         non-null. 
29688         (Invocation::BetterConversion): Simplified test for IntLiteral.
29689
29690         (Expression::ImplicitNumericConversion): Split this routine out.
29691         Put the code that performs implicit constant integer conversions
29692         here. 
29693
29694         (Expression::Resolve): Become a wrapper around DoResolve so we can
29695         check eclass and type being set after resolve.
29696
29697         (Invocation::Badness): Remove this dead function
29698
29699         (Binary::ResolveOperator): Do not compute the expensive argumnets
29700         unless we have a union for it.
29701
29702         (Probe::Emit): Is needs to do an isinst and then
29703         compare against null.
29704
29705         (::CanConvert): Added Location argument.  If the Location argument
29706         is null (Location.Null), then we do not report errors.  This is
29707         used by the `probe' mechanism of the Explicit conversion.  We do
29708         not want to generate an error for something that the user
29709         explicitly requested to be casted.  But the pipeline for an
29710         explicit cast first tests for potential implicit casts.
29711
29712         So for now, if the Location is null, it means `Probe only' to
29713         avoid adding another argument.   Might have to revise this
29714         strategy later.
29715
29716         (ClassCast): New class used to type cast objects into arbitrary
29717         classes (used in Explicit Reference Conversions).
29718
29719         Implement `as' as well.
29720
29721         Reverted all the patches from Ravi below: they were broken:
29722
29723                 * The use of `level' as a mechanism to stop recursive
29724                   invocations is wrong.  That was there just to catch the
29725                   bug with a strack trace but not as a way of addressing
29726                   the problem.
29727
29728                   To fix the problem we have to *understand* what is going
29729                   on and the interactions and come up with a plan, not
29730                   just get things going.
29731
29732                 * The use of the type conversion cache that I proposed
29733                   last night had an open topic: How does this work across
29734                   protection domains.  A user defined conversion might not
29735                   be public in the location where we are applying the
29736                   conversion, a different conversion might be selected
29737                   (ie, private A->B (better) but public B->A (worse),
29738                   inside A, A->B applies, but outside it, B->A will
29739                   apply).
29740
29741                 * On top of that (ie, even if the above is solved),
29742                   conversions in a cache need to be abstract.  Ie, `To
29743                   convert from an Int to a Short use an OpcodeCast', not
29744                   `To convert from an Int to a Short use the OpcodeCast on
29745                   the variable 5' (which is what this patch was doing).
29746
29747 2001-09-28  Ravi Pratap  <ravi@ximian.com>
29748
29749         * expression.cs (Invocation::ConversionExists): Re-write to use
29750         the conversion cache
29751
29752         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
29753         cache all conversions done, not just user-defined ones.
29754
29755         (Invocation::BetterConversion): The real culprit. Use ConversionExists
29756         to determine if a conversion exists instead of acutually trying to 
29757         perform the conversion. It's faster too.
29758
29759         (Expression::ConvertExplicit): Modify to use ConversionExists to check
29760         and only then attempt the implicit conversion.
29761
29762 2001-09-28  Ravi Pratap  <ravi@ximian.com>
29763
29764         * expression.cs (ConvertImplicit): Use a cache for conversions
29765         already found. Check level of recursion and bail out if necessary.
29766
29767 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
29768
29769         * typemanager.cs (string_concat_string_string, string_concat_object_object):
29770         Export standard methods that we expect for string operations.
29771
29772         * statement.cs (Block::UsageWarning): Track usage of variables and
29773         report the errors for not used variables.
29774
29775         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
29776         operator. 
29777
29778 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
29779
29780         * codegen.cs: remove unnneded code 
29781
29782         * expression.cs: Removed BuiltinTypeAccess class
29783
29784         Fix the order in which implicit conversions are
29785         done.  
29786
29787         The previous fixed dropped support for boxed conversions (adding a
29788         test to the test suite now)
29789
29790         (UserImplicitCast::CanConvert): Remove test for source being null,
29791         that code is broken.  We should not feed a null to begin with, if
29792         we do, then we should track the bug where the problem originates
29793         and not try to cover it up here.
29794
29795         Return a resolved expression of type UserImplicitCast on success
29796         rather than true/false.  Ravi: this is what I was talking about,
29797         the pattern is to use a static method as a "constructor" for
29798         objects. 
29799
29800         Also, do not create arguments until the very last minute,
29801         otherwise we always create the arguments even for lookups that
29802         will never be performed. 
29803
29804         (UserImplicitCast::Resolve): Eliminate, objects of type
29805         UserImplicitCast are born in a fully resolved state. 
29806
29807         * typemanager.cs (InitCoreTypes): Init also value_type
29808         (System.ValueType). 
29809
29810         * expression.cs (Cast::Resolve): First resolve the child expression.
29811
29812         (LValue): Add new method AddressOf to be used by
29813         the `&' operator.  
29814
29815         Change the argument of Store to take an EmitContext instead of an
29816         ILGenerator, because things like FieldExpr need to be able to call
29817         their children expression to generate the instance code. 
29818
29819         (Expression::Error, Expression::Warning): Sugar functions for
29820         reporting errors.
29821
29822         (Expression::MemberLookup): Accept a TypeContainer instead of a
29823         Report as the first argument.
29824
29825         (Expression::ResolvePrimary): Killed.  I still want to improve
29826         this as currently the code is just not right.
29827
29828         (Expression::ResolveMemberAccess): Simplify, but it is still
29829         wrong. 
29830
29831         (Unary::Resolve): Catch errors in AddressOf operators.
29832
29833         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
29834         index to a byte for the short-version, or the compiler will choose
29835         the wrong Emit call, which generates the wrong data.
29836
29837         (ParameterReference::Emit, ::Store): same.
29838
29839         (FieldExpr::AddressOf): Implement.
29840
29841         * typemanager.cs: TypeManager: made public variable instead of
29842         property.
29843
29844         * driver.cs: document --fatal.
29845
29846         * report.cs (ErrorMessage, WarningMessage): new names for the old
29847         Error and Warning classes.
29848
29849         * cs-parser.jay (member_access): Turn built-in access to types
29850         into a normal simplename
29851
29852 2001-09-27  Ravi Pratap  <ravi@ximian.com>
29853
29854         * expression.cs (Invocation::BetterConversion): Fix to cope
29855         with q being null, since this was introducing a bug.
29856
29857         * expression.cs (ConvertImplicit): Do built-in conversions first.
29858
29859 2001-09-27  Ravi Pratap  <ravi@ximian.com>
29860
29861         * expression.cs (UserImplicitCast::Resolve): Fix bug.
29862
29863 2001-09-27  Ravi Pratap  <ravi@ximian.com>
29864
29865         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
29866         I had introduced long ago (what's new ?).
29867
29868         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
29869         the work of all the checking. 
29870         (ConvertImplicit): Call CanConvert and only then create object if necessary.
29871         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
29872
29873         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
29874         that is the right way. 
29875
29876         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
29877         overloading resolution. Use everywhere instead of cutting and pasting code.
29878
29879         (Binary::ResolveOperator): Use MakeUnionSet.
29880
29881         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
29882         we have to convert to bool types. Not complete yet.
29883
29884 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
29885
29886         * typemanager.cs (TypeManager::CSharpName): support ushort.
29887
29888         * expression.cs (Expression::TryImplicitIntConversion): Attempts
29889         to provide an expression that performsn an implicit constant int
29890         conversion (section 6.1.6).
29891         (Expression::ConvertImplicitRequired): Reworked to include
29892         implicit constant expression conversions.
29893
29894         (Expression::ConvertNumericExplicit): Finished.
29895
29896         (Invocation::Emit): If InstanceExpression is null, then it means
29897         that we perform a call on this.
29898
29899 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
29900
29901         * expression.cs (Unary::Emit): Remove some dead code.
29902         (Probe): Implement Resolve and Emit for `is'.
29903         (Expression::ConvertImplicitRequired): Attempt to do constant
29904         expression conversions here.  Maybe should be moved to
29905         ConvertImplicit, but I am not sure.
29906         (Expression::ImplicitLongConstantConversionPossible,
29907         Expression::ImplicitIntConstantConversionPossible): New functions
29908         that tell whether is it possible to apply an implicit constant
29909         expression conversion.
29910
29911         (ConvertNumericExplicit): Started work on explicit numeric
29912         conversions.
29913
29914         * cs-parser.jay: Update operator constants.
29915
29916         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
29917         (Parameters::GetSignature): Hook up VerifyArgs here.
29918         (Parameters::VerifyArgs): Verifies that no two arguments have the
29919         same name. 
29920
29921         * class.cs (Operator): Update the operator names to reflect the
29922         ones that the spec expects (as we are just stringizing the
29923         operator names).
29924
29925         * expression.cs (Unary::ResolveOperator): Fix bug: Use
29926         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
29927         previous usage did only work for our methods.
29928         (Expression::ConvertImplicit): Handle decimal implicit numeric
29929         conversions as well.
29930         (Expression::InternalTypeConstructor): Used to invoke constructors
29931         on internal types for default promotions.
29932
29933         (Unary::Emit): Implement special handling for the pre/post
29934         increment/decrement for overloaded operators, as they need to have
29935         the same semantics as the other operators.
29936
29937         (Binary::ResolveOperator): ditto.
29938         (Invocation::ConversionExists): ditto.
29939         (UserImplicitCast::Resolve): ditto.
29940
29941 2001-09-26  Ravi Pratap  <ravi@ximian.com>
29942
29943         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
29944         operator, return after emitting body. Regression tests pass again !
29945
29946         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
29947         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
29948         (Invocation::OverloadResolve): Ditto.
29949         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
29950
29951         * everywhere : update calls to the above methods accordingly.
29952
29953 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
29954
29955         * assign.cs (Assign): Make it inherit from ExpressionStatement.
29956
29957         * expression.cs (ExpressionStatement): New base class used for
29958         expressions that can appear in statements, so that we can provide
29959         an alternate path to generate expression that do not leave a value
29960         on the stack.
29961
29962         (Expression::Emit, and all the derivatives): We no longer return
29963         whether a value is left on the stack or not.  Every expression
29964         after being emitted leaves a single value on the stack.
29965
29966         * codegen.cs (EmitContext::EmitStatementExpression): Use the
29967         facilties of ExpressionStatement if possible.
29968
29969         * cs-parser.jay: Update statement_expression.
29970
29971 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
29972
29973         * driver.cs: Change the wording of message
29974
29975 2001-09-25  Ravi Pratap  <ravi@ximian.com>
29976
29977         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
29978         the type of the expression to the return type of the method if
29979         we have an overloaded operator match ! The regression tests pass again !
29980         (Unary::ResolveOperator): Ditto.
29981
29982         * expression.cs (Invocation::ConversionExists): Correct the member lookup
29983         to find "op_Implicit", not "implicit" ;-)
29984         (UserImplicitCast): New class to take care of user-defined implicit conversions.
29985         (ConvertImplicit, ForceConversion): Take TypeContainer argument
29986
29987         * everywhere : Correct calls to the above accordingly.
29988
29989         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
29990         (ConvertImplicit): Do user-defined conversion if it exists.
29991
29992 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
29993
29994         * assign.cs: track location.
29995         (Resolve): Use implicit conversions on assignment.
29996
29997         * literal.cs: Oops.  Not good, Emit of short access values should
29998         pass (Bytes) or the wrong argument will be selected.
29999
30000         * expression.cs (Unary::Emit): Emit code for -expr.
30001
30002         (Unary::ResolveOperator): Handle `Substract' for non-constants
30003         (substract from zero from the non-constants).
30004         Deal with Doubles as well. 
30005
30006         (Expression::ConvertImplicitRequired): New routine that reports an
30007         error if no implicit conversion exists. 
30008
30009         (Invocation::OverloadResolve): Store the converted implicit
30010         expressions if we make them
30011
30012 2001-09-24  Ravi Pratap  <ravi@ximian.com>
30013
30014         * class.cs (ConstructorInitializer): Take a Location argument.
30015         (ConstructorBaseInitializer): Same here.
30016         (ConstructorThisInitializer): Same here.
30017
30018         * cs-parser.jay : Update all calls accordingly.
30019
30020         * expression.cs (Unary, Binary, New): Take location argument.
30021         Update accordingly everywhere.
30022
30023         * cs-parser.jay : Update all calls to the above to take a location
30024         argument.
30025
30026         * class.cs : Ditto.
30027
30028 2001-09-24  Ravi Pratap  <ravi@ximian.com>
30029
30030         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
30031         (Invocation::BetterConversion): Same here
30032         (Invocation::ConversionExists): Ditto.
30033
30034         (Invocation::ConversionExists): Implement.
30035
30036 2001-09-22  Ravi Pratap  <ravi@ximian.com>
30037
30038         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
30039         Also take an additional TypeContainer argument.
30040
30041         * All over : Pass in TypeContainer as argument to OverloadResolve.
30042
30043         * typemanager.cs (CSharpName): Update to check for the string type and return
30044         that too.
30045
30046         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
30047         a given method.
30048
30049 2001-09-21  Ravi Pratap  <ravi@ximian.com>
30050
30051         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
30052         (Invocation::BetterFunction): Implement.
30053         (Invocation::BetterConversion): Implement.
30054         (Invocation::ConversionExists): Skeleton, no implementation yet.
30055
30056         Okay, things work fine !
30057
30058 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
30059
30060         * typemanager.cs: declare and load enum_type, delegate_type and
30061         void_type. 
30062
30063         * expression.cs (Expression::Emit): Now emit returns a value that
30064         tells whether a value is left on the stack or not.  This strategy
30065         might be reveted tomorrow with a mechanism that would address
30066         multiple assignments.
30067         (Expression::report118): Utility routine to report mismatches on
30068         the ExprClass.
30069
30070         (Unary::Report23): Report impossible type/operator combination
30071         utility function.
30072
30073         (Unary::IsIncrementableNumber): Whether the type can be
30074         incremented or decremented with add.
30075         (Unary::ResolveOperator): Also allow enumerations to be bitwise
30076         complemented. 
30077         (Unary::ResolveOperator): Implement ++, !, ~,
30078
30079         (Invocation::Emit): Deal with new Emit convetion.
30080
30081         * All Expression derivatives: Updated their Emit method to return
30082         whether they leave values on the stack or not.
30083
30084         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
30085         stack for expressions that are statements. 
30086
30087 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
30088
30089         * expression.cs (LValue): New interface.  Must be implemented by
30090         LValue objects.
30091         (LocalVariableReference, ParameterReference, FieldExpr): Implement
30092         LValue interface.
30093
30094         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
30095         interface for generating code, simplifies the code.
30096
30097 2001-09-20  Ravi Pratap  <ravi@ximian.com>
30098
30099         * expression.cs (everywhere): Comment out return statements in ::Resolve
30100         methods to avoid the warnings.
30101
30102 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
30103
30104         * driver.cs (parse): Report error 2001 if we can not open the
30105         source file.
30106
30107         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
30108         not resolve it.
30109
30110         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
30111         object. 
30112
30113         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
30114         otherwise nested blocks end up with the same index.
30115
30116         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
30117
30118         * expression.cs:  Instead of having FIXMEs in the Resolve
30119         functions, throw exceptions so it is obvious that we are facing a
30120         bug. 
30121
30122         * cs-parser.jay (invocation_expression): Pass Location information.
30123
30124         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
30125         Use a basename for those routines because .NET does not like paths
30126         on them. 
30127
30128         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
30129         already defined.
30130
30131 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
30132
30133         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
30134         are loading the correct data types (throws an exception if not).
30135         (TypeManager::InitCoreTypes): Use CoreLookupType
30136
30137         * expression.cs (Unary::ResolveOperator): return the child
30138         expression for expressions which are just +expr.
30139         (Unary::ResolveOperator): Return negative literals for -LITERAL
30140         expressions (otherwise they are Unary {Literal}).
30141         (Invocation::Badness): Take into account `Implicit constant
30142         expression conversions'.
30143
30144         * literal.cs (LongLiteral): Implement long literal class.
30145         (IntLiteral): export the `Value' of the intliteral. 
30146
30147 2001-09-19  Ravi Pratap  <ravi@ximian.com>
30148
30149         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
30150
30151         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
30152         instead of 'Operator'
30153
30154         * expression.cs (Binary::ResolveOperator): Update accordingly.
30155         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
30156         and 'Minus'
30157
30158         * cs-parser.jay (unary_expression): Update to use the new names.
30159
30160         * gen-treedump.cs (GetUnary): Same here.
30161
30162         * expression.cs (Unary::Resolve): Implement.
30163         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
30164         operators are found instead of making noise ;-)
30165         (Unary::ResolveOperator): New method to do precisely the same thing which
30166         Binary::ResolveOperator does for Binary expressions.
30167         (Unary.method, .Arguments): Add.
30168         (Unary::OperName): Implement.   
30169         (Unary::ForceConversion): Copy and Paste !
30170
30171         * class.cs (Operator::Define): Fix a small bug for the case when we have 
30172         a unary operator.
30173
30174         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
30175         for the inbuilt operators. Only overloading works for now ;-)
30176
30177 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
30178
30179         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
30180         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
30181
30182         * expression.cs (This::Emit): Implement. 
30183         (This::Resolve): Implement.
30184         (TypeOf:Resolve): Implement.
30185         (Expression::ResolveSimpleName): Add an implicit this to instance
30186         field references. 
30187         (MemberAccess::Resolve): Deal with Parameters and Fields. 
30188         Bind instance variable to Field expressions.
30189         (FieldExpr::Instance): New field used to track the expression that
30190         represents the object instance.
30191         (FieldExpr::Resolve): Track potential errors from MemberLookup not
30192         binding 
30193         (FieldExpr::Emit): Implement.
30194
30195         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
30196         the last instruction contains a return opcode to avoid generating
30197         the last `ret' instruction (this generates correct code, and it is
30198         nice to pass the peverify output).
30199
30200         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
30201         initializer for static and instance variables.
30202         (Constructor::Emit): Allow initializer to be null in the case of
30203         static constructors.  Only emit initializer for instance
30204         constructors. 
30205
30206         (TypeContainer::FindMembers): Return a null array if there are no
30207         matches.
30208
30209         Also fix the code for the MemberTypes.Method branch, as it was not
30210         scanning that for operators (or tried to access null variables before).
30211
30212         * assign.cs (Assign::Emit): Handle instance and static fields. 
30213
30214         * TODO: Updated.
30215
30216         * driver.cs: Stop compilation if there are parse errors.
30217
30218         * cs-parser.jay (constructor_declaration): Provide default base
30219         initializer for non-static constructors.
30220         (constructor_declarator): Do not provide a default base
30221         initializers if none was specified.
30222         Catch the fact that constructors should not have parameters.
30223
30224         * class.cs: Do not emit parent class initializers for static
30225         constructors, that should be flagged as an error.
30226
30227 2001-09-18  Ravi Pratap  <ravi@ximian.com>
30228
30229         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
30230         Move back code into TypeContainer::Populate.
30231
30232 2001-09-18  Ravi Pratap  <ravi@ximian.com>
30233
30234         * class.cs (TypeContainer::AddConstructor): Fix the check to
30235         compare against Name, not Basename. 
30236         (Operator::OpType): Change Plus and Minus to Add and Subtract.
30237
30238         * cs-parser.jay : Update accordingly.
30239
30240         * class.cs (TypeContainer::FindMembers): For the case where we are searching
30241         for methods, don't forget to look into the operators too.
30242         (RegisterMethodBuilder): Helper method to take care of this for
30243         methods, constructors and operators.
30244         (Operator::Define): Completely revamp.
30245         (Operator.OperatorMethod, MethodName): New fields.
30246         (TypeContainer::Populate): Move the registering of builders into
30247         RegisterMethodBuilder.
30248         (Operator::Emit): Re-write.
30249
30250         * expression.cs (Binary::Emit): Comment out code path to emit method
30251         invocation stuff for the case when we have a user defined operator. I am
30252         just not able to get it right !
30253
30254 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
30255
30256         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
30257         argument. 
30258
30259         (Expression::MemberLookup): Provide a version that allows to
30260         specify the MemberTypes and BindingFlags. 
30261
30262         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
30263         so it was not fetching variable information from outer blocks.
30264
30265         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
30266         Beforefieldinit as it was buggy.
30267
30268         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
30269         that Ravi put here.  
30270
30271         * class.cs (Constructor::Emit): Only emit if block is not null.
30272         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
30273         deal with this by semantically definining it as if the user had
30274         done it.
30275
30276         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
30277         constructors as we now "emit" them at a higher level.
30278
30279         (TypeContainer::DefineDefaultConstructor): Used to define the
30280         default constructors if none was provided.
30281
30282         (ConstructorInitializer): Add methods Resolve and Emit. 
30283
30284         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
30285
30286 2001-09-17  Ravi Pratap  <ravi@ximian.com>
30287
30288         * class.cs (TypeContainer::EmitDefaultConstructor): Register
30289         the default constructor builder with our hashtable for methodbuilders
30290         to methodcores.
30291
30292         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
30293         and argument_count is 0 in which case we have a match.
30294         (Binary::ResolveOperator): More null checking and miscellaneous coding
30295         style cleanup.
30296
30297 2001-09-17  Ravi Pratap  <ravi@ximian.com>
30298
30299         * rootcontext.cs (IsNameSpace): Compare against null.
30300
30301         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
30302
30303         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
30304         and Unary::Operator.
30305
30306         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
30307         accordingly.
30308
30309         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
30310         we have overloaded operators.
30311         (Binary::ResolveOperator): Implement the part which does the operator overload
30312         resolution.
30313
30314         * class.cs (Operator::Emit): Implement.
30315         (TypeContainer::Emit): Emit the operators we have too.
30316
30317         * expression.cs (Binary::Emit): Update to emit the appropriate code for
30318         the case when we have a user-defined operator.
30319
30320 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
30321
30322         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
30323
30324 2001-09-16  Ravi Pratap  <ravi@ximian.com>
30325
30326         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
30327         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
30328         (Constructor::Emit): Implement.
30329         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
30330         if we have no work to do. 
30331         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
30332         Emit method.
30333
30334         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
30335         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
30336
30337         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
30338         of parent.parent.
30339
30340 2001-09-15  Ravi Pratap  <ravi@ximian.com>
30341
30342         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
30343         in the source.
30344         (Tree::RecordNamespace): Method to do what the name says ;-)
30345         (Tree::Namespaces): Property to get at the namespaces hashtable.
30346
30347         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
30348         keep track.
30349
30350         * rootcontext.cs (IsNamespace): Fixed it :-)
30351
30352 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
30353
30354         * class.cs (TypeContainer::FindMembers): Add support for
30355         constructors. 
30356         (MethodCore): New class that encapsulates both the shared aspects
30357         of a Constructor and a Method.  
30358         (Method, Constructor): Factored pieces into MethodCore.
30359
30360         * driver.cs: Added --fatal which makes errors throw exceptions.
30361         Load System assembly as well as part of the standard library.
30362
30363         * report.cs: Allow throwing exceptions on errors for debugging.
30364
30365         * modifiers.cs: Do not use `parent', instead use the real type
30366         container to evaluate permission settings.
30367
30368         * class.cs: Put Ravi's patch back in.  He is right, and we will
30369         have to cope with the
30370
30371 2001-09-14  Ravi Pratap  <ravi@ximian.com>
30372
30373         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
30374         FamORAssem, not FamANDAssem.
30375
30376 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
30377
30378         * driver.cs: Added --parse option that only parses its input files
30379         and terminates.
30380
30381         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
30382         incorrect.  IsTopLevel is not used to tell whether an object is
30383         root_types or not (that can be achieved by testing this ==
30384         root_types).  But to see if this is a top-level *class* (not
30385         necessarly our "toplevel" container). 
30386
30387 2001-09-14  Ravi Pratap  <ravi@ximian.com>
30388
30389         * enum.cs (Enum::Define): Modify to call the Lookup method on the
30390         parent instead of a direct call to GetType.
30391
30392 2001-09-14  Ravi Pratap  <ravi@ximian.com>
30393
30394         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
30395         Modifiers.TypeAttr. This should just be a call to that method.
30396
30397         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
30398         object so that we can determine if we are top-level or not.
30399
30400         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
30401         TypeContainer too.
30402
30403         * enum.cs (Enum::Define): Ditto.
30404
30405         * modifiers.cs (FieldAttr): Re-write.
30406
30407         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
30408         (TypeContainer::HaveStaticConstructor): New property to provide access
30409         to precisely that info.
30410
30411         * modifiers.cs (MethodAttr): Re-write.
30412         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
30413
30414         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
30415         of top-level types as claimed.
30416
30417 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
30418
30419         * expression.cs (MemberLookup): Fruitless attempt to lookup
30420         constructors.  Maybe I need to emit default constructors?  That
30421         might be it (currently .NET emits this for me automatically).
30422         (Invocation::OverloadResolve): Cope with Arguments == null.
30423         (Invocation::EmitArguments): new function, shared by the new
30424         constructor and us.
30425         (Invocation::Emit): Handle static and instance methods.  Emit
30426         proper call instruction for virtual or non-virtual invocations.
30427         (New::Emit): Implement.
30428         (New::Resolve): Implement.
30429         (MemberAccess:Resolve): Implement.
30430         (MethodGroupExpr::InstanceExpression): used conforming to the spec
30431         to track instances.
30432         (FieldExpr::Resolve): Set type.
30433
30434         * support.cs: Handle empty arguments.
30435                 
30436         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
30437         SimpleLookup): Auxiliary routines to help parse a qualifier
30438         identifier.  
30439
30440         Update qualifier_identifier rule.
30441
30442         * codegen.cs: Removed debugging messages.
30443
30444         * class.cs: Make this a global thing, this acts just as a "key" to
30445         objects that we might have around.
30446
30447         (Populate): Only initialize method_builders_to_methods once.
30448
30449         * expression.cs (PropertyExpr): Initialize type from the
30450         PropertyType. 
30451
30452         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
30453         Resolve pattern.  Attempt to implicitly convert value to boolean.
30454         Emit code.
30455
30456         * expression.cs: Set the type for the int32/int32 argument case.
30457         (Binary::ResolveOperator): Set the return type to boolean for
30458         comparission operators
30459
30460         * typemanager.cs: Remove debugging print code.
30461
30462         (Invocation::Resolve): resolve type.
30463
30464         * class.cs: Allocate a MemberInfo of the correct size, as the code
30465         elsewhere depends on the test to reflect the correct contents.
30466
30467         (Method::) Keep track of parameters, due to System.Reflection holes
30468
30469         (TypeContainer::Populate): Keep track of MethodBuilders to Method
30470         mapping here.
30471
30472         (TypeContainer::FindMembers): Use ArrayList and then copy an array
30473         of the exact size and return that.
30474
30475         (Class::LookupMethodByBuilder): New function that maps
30476         MethodBuilders to its methods.  Required to locate the information
30477         on methods because System.Reflection bit us again.
30478
30479         * support.cs: New file, contains an interface ParameterData and
30480         two implementations: ReflectionParameters and InternalParameters
30481         used to access Parameter information.  We will need to grow this
30482         as required.
30483
30484         * expression.cs (Invocation::GetParameterData): implement a cache
30485         and a wrapper around the ParameterData creation for methods. 
30486         (Invocation::OverloadResolve): Use new code.
30487
30488 2001-09-13  Ravi Pratap  <ravi@ximian.com>
30489
30490         * class.cs (TypeContainer::EmitField): Remove and move into 
30491         (Field::Define): here and modify accordingly.
30492         (Field.FieldBuilder): New member.
30493         (TypeContainer::Populate): Update accordingly.
30494         (TypeContainer::FindMembers): Implement.
30495
30496 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
30497
30498         * statement.cs: (VariableInfo::VariableType): New field to be
30499         initialized with the full type once it is resolved. 
30500
30501 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
30502
30503         * parameter.cs (GetParameterInfo): Use a type cache to compute
30504         things only once, and to reuse this information
30505
30506         * expression.cs (LocalVariableReference::Emit): Implement.
30507         (OpcodeCast::Emit): fix.
30508
30509         (ParameterReference::Resolve): Implement.
30510         (ParameterReference::Emit): Implement.
30511
30512         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
30513         that are expressions need to stay as Expressions.
30514
30515         * typemanager.cs (CSharpName): Returns the C# name of a type if
30516         possible. 
30517
30518         * expression.cs (Expression::ConvertImplicit): New function that
30519         implements implicit type conversions.
30520
30521         (Expression::ImplicitReferenceConversion): Implements implicit
30522         reference conversions.
30523
30524         (EmptyCast): New type for transparent casts.
30525
30526         (OpcodeCast): New type for casts of types that are performed with
30527         a sequence of bytecodes.
30528
30529         (BoxedCast): New type used for casting value types into reference
30530         types.  Emits a box opcode.
30531
30532         (Binary::DoNumericPromotions): Implements numeric promotions of
30533         and computation of the Binary::Type.
30534
30535         (Binary::EmitBranchable): Optimization.
30536
30537         (Binary::Emit): Implement code emission for expressions.
30538
30539         * typemanager.cs (TypeManager): Added two new core types: sbyte
30540         and byte.
30541
30542 2001-09-12  Ravi Pratap  <ravi@ximian.com>
30543
30544         * class.cs (TypeContainer::FindMembers): Method which does exactly
30545         what Type.FindMembers does, only we don't have to use reflection. No
30546         implementation yet.
30547
30548         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
30549         typecontainer objects as we need to get at them.
30550         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
30551
30552         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
30553         typecontainer object.
30554
30555         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
30556         of just a Report object.
30557
30558 2001-09-11  Ravi Pratap  <ravi@ximian.com>
30559
30560         * class.cs (Event::Define): Go back to using the prefixes "add_" and
30561         "remove_"
30562         (TypeContainer::Populate): Now define the delegates of the type too.
30563         (TypeContainer.Delegates): Property to access the list of delegates defined
30564         in the type.
30565
30566         * delegates.cs (Delegate::Define): Implement partially.
30567
30568         * modifiers.cs (TypeAttr): Handle more flags.
30569
30570 2001-09-11  Ravi Pratap  <ravi@ximian.com>
30571
30572         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
30573         and not <=
30574         (Operator::Define): Re-write logic to get types by using the LookupType method
30575         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
30576         (Indexer::Define): Ditto.
30577         (Event::Define): Ditto.
30578         (Property::Define): Ditto.
30579
30580 2001-09-10  Ravi Pratap  <ravi@ximian.com>
30581
30582         * class.cs (TypeContainer::Populate): Now define operators too. 
30583         (TypeContainer.Operators): New property to access the list of operators
30584         in a type.
30585         (Operator.OperatorMethodBuilder): New member to hold the method builder
30586         for the operator we are defining.
30587         (Operator::Define): Implement.
30588
30589 2001-09-10  Ravi Pratap  <ravi@ximian.com>
30590
30591         * class.cs (Event::Define): Make the prefixes of the accessor methods
30592         addOn_ and removeOn_ 
30593
30594         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
30595         of the location being passed in too. Ideally, this should go later since all
30596         error reporting should be done through the Report object.
30597
30598         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
30599         (Populate): Iterate thru the indexers we have and define them too.
30600         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
30601         for the get and set accessors.
30602         (Indexer::Define): Implement.
30603
30604 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
30605
30606         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
30607         my previous implementation, did not work.
30608
30609         * typemanager.cs: Add a couple of missing types (the longs).
30610
30611         * literal.cs: Use TypeManager.bool_type instead of getting it.
30612
30613         * expression.cs (EventExpr): New kind of expressions.
30614         (Expressio::ExprClassFromMemberInfo): finish
30615
30616 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
30617
30618         * assign.cs: Emit stores to static fields differently.
30619
30620 2001-09-08  Ravi Pratap  <ravi@ximian.com>
30621
30622         * Merge in changes and adjust code to tackle conflicts. Backed out my
30623         code in Assign::Resolve ;-) 
30624
30625 2001-09-08  Ravi Pratap  <ravi@ximian.com>
30626
30627         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
30628         instead Report.Error and also pass in the location.
30629         (CSharpParser::Lexer): New readonly property to return the reference
30630         to the Tokenizer object.
30631         (declare_local_variables): Use Report.Error with location instead of plain 
30632         old error.
30633         (CheckDef): Ditto.
30634
30635         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
30636         (Operator.CheckBinaryOperator): Ditto.
30637
30638         * cs-parser.jay (operator_declarator): Update accordingly.
30639
30640         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
30641         (CheckBinaryOperator): Same here.
30642
30643         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
30644         on the name without any prefixes of namespace names etc. This is because we
30645         already might have something already fully qualified like 
30646         'System.Console.WriteLine'
30647
30648         * assign.cs (Resolve): Begin implementation. Stuck ;-)
30649
30650 2001-09-07  Ravi Pratap  <ravi@ximian.com>
30651
30652         * cs-tokenizer.cs (location): Return a string which also contains
30653         the file name.
30654
30655         * expression.cs (ElementAccess): New class for expressions of the
30656         type 'element access.'
30657         (BaseAccess): New class for expressions of the type 'base access.'
30658         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
30659         respectively.
30660
30661         * cs-parser.jay (element_access): Implement action.
30662         (base_access): Implement actions.
30663         (checked_expression, unchecked_expression): Implement.
30664
30665         * cs-parser.jay (local_variable_type): Correct and implement.
30666         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
30667
30668         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
30669
30670         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
30671         name and the specifiers.
30672
30673         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
30674
30675         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
30676         making them all public ;-)
30677
30678         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
30679         class anyways.
30680
30681 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
30682
30683         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
30684         PropertyExprs.
30685         (FieldExpr, PropertyExprs): New resolved expressions.
30686         (SimpleName::MemberStaticCheck): Perform static checks for access
30687         to non-static fields on static methods. Maybe this should be
30688         generalized for MemberAccesses. 
30689         (SimpleName::ResolveSimpleName): More work on simple name
30690         resolution. 
30691
30692         * cs-parser.jay (primary_expression/qualified_identifier): track
30693         the parameter index.
30694
30695         * codegen.cs (CodeGen::Save): Catch save exception, report error.
30696         (EmitContext::EmitBoolExpression): Chain to expression generation
30697         instead of temporary hack.
30698         (::EmitStatementExpression): Put generic expression code generation.
30699
30700         * assign.cs (Assign::Emit): Implement variable assignments to
30701         local variables, parameters and fields.
30702
30703 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
30704
30705         * statement.cs (Block::GetVariableInfo): New method, returns the
30706         VariableInfo for a variable name in a block.
30707         (Block::GetVariableType): Implement in terms of GetVariableInfo
30708
30709         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
30710         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
30711
30712 2001-09-06  Ravi Pratap  <ravi@ximian.com>
30713
30714         * cs-parser.jay (operator_declaration): Continue on my quest : update
30715         to take attributes argument.
30716         (event_declaration): Ditto.
30717         (enum_declaration): Ditto.
30718         (indexer_declaration): Ditto.
30719
30720         * class.cs (Operator::Operator): Update constructor accordingly.
30721         (Event::Event): Ditto.
30722
30723         * delegate.cs (Delegate::Delegate): Same here.
30724
30725         * enum.cs (Enum::Enum): Same here.
30726
30727 2001-09-05  Ravi Pratap  <ravi@ximian.com>
30728
30729         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
30730
30731         * ../tests/cs0658.cs : New file to demonstrate error 0658.
30732
30733         * attribute.cs (Attributes): New class to encapsulate all attributes which were
30734         being passed around as an arraylist.
30735         (Attributes::AddAttribute): Method to add attribute sections.
30736
30737         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
30738         (struct_declaration): Update accordingly.
30739         (constant_declaration): Update.
30740         (field_declaration): Update.
30741         (method_header): Update.
30742         (fixed_parameter): Update.
30743         (parameter_array): Ditto.
30744         (property_declaration): Ditto.
30745         (destructor_declaration): Ditto.
30746
30747         * class.cs (Struct::Struct): Update constructors accordingly.
30748         (Class::Class): Ditto.
30749         (Field::Field): Ditto.
30750         (Method::Method): Ditto.
30751         (Property::Property): Ditto.
30752         (TypeContainer::OptAttribute): update property's return type.
30753
30754         * interface.cs (Interface.opt_attributes): New member.
30755         (Interface::Interface): Update to take the extra Attributes argument.
30756
30757         * parameter.cs (Parameter::Parameter): Ditto.
30758
30759         * constant.cs (Constant::Constant): Ditto.
30760
30761         * interface.cs (InterfaceMemberBase): New OptAttributes field.
30762         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
30763         the attributes as a parameter.
30764         (InterfaceProperty): Update constructor call.
30765         (InterfaceEvent): Ditto.
30766         (InterfaceMethod): Ditto.
30767         (InterfaceIndexer): Ditto.
30768
30769         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
30770         pass the attributes too.
30771         (interface_event_declaration): Ditto.
30772         (interface_property_declaration): Ditto.
30773         (interface_method_declaration): Ditto.
30774         (interface_declaration): Ditto.
30775
30776 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
30777
30778         * class.cs (Method::Define): Track the "static Main" definition to
30779         create an entry point. 
30780
30781         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
30782         EntryPoint if we find it. 
30783
30784         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
30785         (EmitContext::ig): Make this variable public.
30786
30787         * driver.cs: Make the default output file be the first file name
30788         with the .exe extension.  
30789
30790         Detect empty compilations
30791
30792         Handle various kinds of output targets.  Handle --target and
30793         rename -t to --dumper.
30794
30795         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
30796         methods inherited from Expression return now an Expression.  This
30797         will is used during the tree rewriting as we resolve them during
30798         semantic analysis.
30799
30800         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
30801         the spec.  Missing entirely is the information about
30802         accessability of elements of it.
30803
30804         (Expression::ExprClassFromMemberInfo): New constructor for
30805         Expressions that creates a fully initialized Expression based on
30806         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
30807         a Type.
30808
30809         (Invocation::Resolve): Begin implementing resolution of invocations.
30810
30811         * literal.cs (StringLiteral):  Implement Emit.
30812
30813 2001-09-05  Ravi Pratap  <ravi@ximian.com>
30814
30815         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
30816         member.
30817
30818 2001-09-04  Ravi Pratap  <ravi@ximian.com>
30819
30820         * cs-parser.jay (attribute_arguments): Implement actions.
30821         (attribute): Fix bug in production. Implement action.
30822         (attribute_list): Implement.
30823         (attribute_target): Implement.
30824         (attribute_target_specifier, opt_target_specifier): Implement
30825         (CheckAttributeTarget): New method to check if the attribute target
30826         is valid.
30827         (attribute_section): Implement.
30828         (opt_attributes): Implement.
30829
30830         * attribute.cs : New file to handle attributes.
30831         (Attribute): Class to hold attribute info.
30832
30833         * cs-parser.jay (opt_attribute_target_specifier): Remove production
30834         (attribute_section): Modify production to use 2 different rules to 
30835         achieve the same thing. 1 s/r conflict down !
30836         Clean out commented, useless, non-reducing dimension_separator rules.
30837
30838         * class.cs (TypeContainer.attributes): New member to hold list
30839         of attributes for a type.
30840         (Struct::Struct): Modify to take one more argument, the attribute list.
30841         (Class::Class): Ditto.
30842         (Field::Field): Ditto.
30843         (Method::Method): Ditto.
30844         (Property::Property): Ditto.
30845
30846         * cs-parser.jay (struct_declaration): Update constructor call to
30847         pass in the attributes too.
30848         (class_declaration): Ditto.
30849         (constant_declaration): Ditto.
30850         (field_declaration): Ditto.
30851         (method_header): Ditto.
30852         (fixed_parameter): Ditto.
30853         (parameter_array): Ditto.
30854         (property_declaration): Ditto.
30855
30856         * constant.cs (Constant::Constant): Update constructor similarly.
30857         Use System.Collections.
30858
30859         * parameter.cs (Parameter::Parameter): Update as above.
30860
30861 2001-09-02  Ravi Pratap  <ravi@ximian.com>
30862
30863         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
30864         (TypeContainer.delegates): New member to hold list of delegates.
30865
30866         * cs-parser.jay (delegate_declaration): Implement the action correctly 
30867         this time as I seem to be on crack ;-)
30868
30869 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
30870
30871         * rootcontext.cs (RootContext::IsNamespace): new function, used to
30872         tell whether an identifier represents a namespace.
30873
30874         * expression.cs (NamespaceExpr): A namespace expression, used only
30875         temporarly during expression resolution.
30876         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
30877         utility functions to resolve names on expressions.
30878
30879 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
30880
30881         * codegen.cs: Add hook for StatementExpressions. 
30882
30883         * class.cs: Fix inverted test for static flag in methods.
30884
30885 2001-09-02  Ravi Pratap  <ravi@ximian.com>
30886
30887         * class.cs (Operator::CheckUnaryOperator): Correct error number used
30888         to make it coincide with MS' number.
30889         (Operator::CheckBinaryOperator): Ditto.
30890
30891         * ../errors/errors.txt : Remove error numbers added earlier.
30892
30893         * ../errors/cs1019.cs : Test case for error # 1019
30894
30895         * ../errros/cs1020.cs : Test case for error # 1020
30896
30897         * cs-parser.jay : Clean out commented cruft.
30898         (dimension_separators, dimension_separator): Comment out. Ostensibly not
30899         used anywhere - non-reducing rule.
30900         (namespace_declarations): Non-reducing rule - comment out.
30901
30902         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
30903         with TypeContainer::AddEnum.
30904
30905         * delegate.cs : New file for delegate handling classes.
30906         (Delegate): Class for declaring delegates.
30907
30908         * makefile : Update.
30909
30910         * cs-parser.jay (delegate_declaration): Implement.
30911
30912 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
30913
30914         * class.cs (Event::Define): Implement.
30915         (Event.EventBuilder): New member.
30916
30917         * class.cs (TypeContainer::Populate): Update to define all enums and events
30918         we have.
30919         (Events): New property for the events arraylist we hold. Shouldn't we move to using
30920         readonly fields for all these cases ?
30921
30922 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
30923
30924         * class.cs (Property): Revamp to use the convention of making fields readonly.
30925         Accordingly modify code elsewhere.
30926
30927         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
30928         the Define method of the Property class.
30929
30930         * class.cs : Clean up applied patch and update references to variables etc. Fix 
30931         trivial bug.
30932         (TypeContainer::Populate): Update to define all the properties we have. Also
30933         define all enumerations.
30934
30935         * enum.cs (Define): Implement.
30936
30937 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
30938
30939         * cs-parser.jay (overloadable_operator): The semantic value is an
30940         enum of the Operator class.
30941         (operator_declarator): Implement actions.
30942         (operator_declaration): Implement.
30943
30944         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
30945         validity of definitions.
30946         (Operator::CheckBinaryOperator): Static method to check for binary operators
30947         (TypeContainer::AddOperator): New method to add an operator to a type.
30948
30949         * cs-parser.jay (indexer_declaration): Added line to actually call the
30950         AddIndexer method so it gets added ;-)
30951
30952         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
30953         already taken care of by the MS compiler ?  
30954
30955 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
30956
30957         * class.cs (Operator): New class for operator declarations.
30958         (Operator::OpType): Enum for the various operators.
30959
30960 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
30961
30962         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
30963         ostensibly handle this in semantic analysis.
30964
30965         * cs-parser.jay (general_catch_clause): Comment out
30966         (specific_catch_clauses, specific_catch_clause): Ditto.
30967         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
30968         (catch_args, opt_catch_args): New productions.
30969         (catch_clause): Rewrite to use the new productions above
30970         (catch_clauses): Modify accordingly.
30971         (opt_catch_clauses): New production to use in try_statement
30972         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
30973         and re-write the code in the actions to extract the specific and
30974         general catch clauses by being a little smart ;-)
30975
30976         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
30977         Hooray, try and catch statements parse fine !
30978
30979 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
30980
30981         * statement.cs (Block::GetVariableType): Fix logic to extract the type
30982         string from the hashtable of variables.
30983
30984         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
30985         I end up making that mistake ;-)
30986         (catch_clauses): Fixed gross error which made Key and Value of the 
30987         DictionaryEntry the same : $1 !!
30988
30989 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
30990
30991         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
30992
30993         * cs-parser.jay (event_declaration): Correct to remove the semicolon
30994         when the add and remove accessors are specified. 
30995
30996 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
30997
30998         * cs-parser.jay (IndexerDeclaration): New helper class to hold
30999         information about indexer_declarator.
31000         (indexer_declarator): Implement actions.
31001         (parsing_indexer): New local boolean used to keep track of whether
31002         we are parsing indexers or properties. This is necessary because 
31003         implicit_parameters come into picture even for the get accessor in the 
31004         case of an indexer.
31005         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
31006
31007         * class.cs (Indexer): New class for indexer declarations.
31008         (TypeContainer::AddIndexer): New method to add an indexer to a type.
31009         (TypeContainer::indexers): New member to hold list of indexers for the
31010         type.
31011
31012 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
31013
31014         * cs-parser.jay (add_accessor_declaration): Implement action.
31015         (remove_accessor_declaration): Implement action.
31016         (event_accessors_declaration): Implement
31017         (variable_declarators): swap statements for first rule - trivial.
31018
31019         * class.cs (Event): New class to hold information about event
31020         declarations.
31021         (TypeContainer::AddEvent): New method to add an event to a type
31022         (TypeContainer::events): New member to hold list of events.
31023
31024         * cs-parser.jay (event_declaration): Implement actions.
31025
31026 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
31027
31028         * cs-parser.jay (dim_separators): Implement. Make it a string
31029         concatenating all the commas together, just as they appear.
31030         (opt_dim_separators): Modify accordingly
31031         (rank_specifiers): Update accordingly. Basically do the same
31032         thing - instead, collect the brackets here.
31033         (opt_rank_sepcifiers): Modify accordingly.
31034         (array_type): Modify to actually return the complete type string
31035         instead of ignoring the rank_specifiers.
31036         (expression_list): Implement to collect the expressions
31037         (variable_initializer): Implement. We make it a list of expressions
31038         essentially so that we can handle the array_initializer case neatly too.
31039         (variable_initializer_list): Implement.
31040         (array_initializer): Make it a list of variable_initializers
31041         (opt_array_initializer): Modify accordingly.
31042
31043         * expression.cs (New::NType): Add enumeration to help us
31044         keep track of whether we have an object/delegate creation
31045         or an array creation.
31046         (New:NewType, New::Rank, New::Indices, New::Initializers): New
31047         members to hold data about array creation.
31048         (New:New): Modify to update NewType
31049         (New:New): New Overloaded contructor for the array creation
31050         case.
31051
31052         * cs-parser.jay (array_creation_expression): Implement to call
31053         the overloaded New constructor.
31054
31055 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
31056
31057         * class.cs (TypeContainer::Constructors): Return member
31058         constructors instead of returning null.
31059
31060 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
31061
31062         * typemanager.cs (InitCoreTypes): Initialize the various core
31063         types after we have populated the type manager with the user
31064         defined types (this distinction will be important later while
31065         compiling corlib.dll)
31066
31067         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
31068         on Expression Classification.  Now all expressions have a method
31069         `Resolve' and a method `Emit'.
31070
31071         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
31072         generation from working.     Also add some temporary debugging
31073         code. 
31074
31075 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
31076
31077         * codegen.cs: Lots of code generation pieces.  This is only the
31078         beginning, will continue tomorrow with more touches of polish.  We
31079         handle the fundamentals of if, while, do, for, return.  Others are
31080         trickier and I need to start working on invocations soon.
31081
31082         * gen-treedump.cs: Bug fix, use s.Increment here instead of
31083         s.InitStatement. 
31084
31085         * codegen.cs (EmitContext): New struct, used during code
31086         emission to keep a context.   Most of the code generation will be
31087         here. 
31088
31089         * cs-parser.jay: Add embedded blocks to the list of statements of
31090         this block.  So code generation proceeds in a top down fashion.
31091
31092 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
31093
31094         * statement.cs: Add support for multiple child blocks.
31095
31096 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
31097
31098         * codegen.cs (EmitCode): New function, will emit the code for a
31099         Block of code given a TypeContainer and its ILGenerator. 
31100
31101         * statement.cs (Block): Standard public readonly optimization.
31102         (Block::Block constructors): Link children. 
31103         (Block::Child): Child Linker.
31104         (Block::EmitVariables): Emits IL variable declarations.
31105
31106         * class.cs: Drop support for MethodGroups here, delay until
31107         Semantic Analysis.
31108         (Method::): Applied the same simplification that I did before, and
31109         move from Properties to public readonly fields.
31110         (Method::ParameterTypes): Returns the parameter types for the
31111         function, and implements a cache that will be useful later when I
31112         do error checking and the semantic analysis on the methods is
31113         performed.
31114         (Constructor::GetCallingConvention): Renamed from CallingConvetion
31115         and made a method, optional argument tells whether this is a class
31116         or a structure to apply the `has-this' bit.
31117         (Method::GetCallingConvention): Implement, returns the calling
31118         convention. 
31119         (Method::Define): Defines the type, a second pass is performed
31120         later to populate the methods.
31121
31122         (Constructor::ParameterTypes): implement a cache similar to the
31123         one on Method::ParameterTypes, useful later when we do semantic
31124         analysis. 
31125
31126         (TypeContainer::EmitMethod):  New method.  Emits methods.
31127
31128         * expression.cs: Removed MethodGroup class from here.
31129
31130         * parameter.cs (Parameters::GetCallingConvention): new method.
31131
31132 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
31133
31134         * class.cs (TypeContainer::Populate): Drop RootContext from the
31135         argument. 
31136
31137         (Constructor::CallingConvention): Returns the calling convention.
31138         (Constructor::ParameterTypes): Returns the constructor parameter
31139         types. 
31140
31141         (TypeContainer::AddConstructor): Keep track of default constructor
31142         and the default static constructor.
31143
31144         (Constructor::) Another class that starts using `public readonly'
31145         instead of properties. 
31146
31147         (Constructor::IsDefault): Whether this is a default constructor. 
31148
31149         (Field::) use readonly public fields instead of properties also.
31150
31151         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
31152         track of static constructors;  If none is used, turn on
31153         BeforeFieldInit in the TypeAttributes. 
31154
31155         * cs-parser.jay (opt_argument_list): now the return can be null
31156         for the cases where there are no arguments. 
31157
31158         (constructor_declarator): If there is no implicit `base' or
31159         `this', then invoke the default parent constructor. 
31160
31161         * modifiers.cs (MethodAttr): New static function maps a set of
31162         modifiers flags into a MethodAttributes enum
31163         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
31164         MethodAttr, TypeAttr to represent the various mappings where the
31165         modifiers are used.
31166         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
31167
31168 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
31169
31170         * parameter.cs (GetParameterInfo): Fix bug where there would be no
31171         method arguments.
31172
31173         * interface.cs (PopulateIndexer): Implemented the code generator
31174         for interface indexers.
31175
31176 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
31177
31178         * interface.cs (InterfaceMemberBase): Now we track the new status
31179         here.  
31180
31181         (PopulateProperty): Implement property population.  Woohoo!  Got
31182         Methods and Properties going today. 
31183
31184         Removed all the properties for interfaces, and replaced them with
31185         `public readonly' fields. 
31186
31187 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
31188
31189         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
31190         initialize their hashtables/arraylists only when they are needed
31191         instead of doing this always.
31192
31193         * parameter.cs: Handle refs and out parameters.
31194
31195         * cs-parser.jay: Use an ArrayList to construct the arguments
31196         instead of the ParameterCollection, and then cast that to a
31197         Parameter[] array.
31198
31199         * parameter.cs: Drop the use of ParameterCollection and use
31200         instead arrays of Parameters.
31201
31202         (GetParameterInfo): Use the Type, not the Name when resolving
31203         types. 
31204
31205 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
31206
31207         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
31208         and instead use public readonly fields.
31209
31210         * class.cs: Put back walking code for type containers.
31211
31212 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
31213
31214         * class.cs (MakeConstant): Code to define constants.
31215
31216         * rootcontext.cs (LookupType): New function.  Used to locate types 
31217
31218
31219 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
31220
31221         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
31222         this System.Reflection code is.  Kudos to Microsoft
31223
31224         * typemanager.cs: Implement a type cache and avoid loading all
31225         types at boot time.  Wrap in LookupType the internals.  This made
31226         the compiler so much faster.  Wow.  I rule!
31227
31228         * driver.cs: Make sure we always load mscorlib first (for
31229         debugging purposes, nothing really important).
31230
31231         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
31232         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
31233
31234         * rootcontext.cs: Lookup types on their namespace;  Lookup types
31235         on namespaces that have been imported using the `using' keyword.
31236
31237         * class.cs (TypeContainer::TypeAttr): Virtualize.
31238         (Class::TypeAttr): Return attributes suitable for this bad boy.
31239         (Struct::TypeAttr): ditto.
31240         Handle nested classes.
31241         (TypeContainer::) Remove all the type visiting code, it is now
31242         replaced with the rootcontext.cs code
31243
31244         * rootcontext.cs (GetClassBases): Added support for structs. 
31245
31246 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
31247
31248         * interface.cs, statement.cs, class.cs, parameter.cs,
31249         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
31250         Drop use of TypeRefs, and use strings instead.
31251
31252 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
31253
31254         * rootcontext.cs: 
31255
31256         * class.cs (Struct::Struct): set the SEALED flags after
31257         checking the modifiers.
31258         (TypeContainer::TypeAttr): new property, returns the
31259         TypeAttributes for a class.  
31260
31261         * cs-parser.jay (type_list): Oops, list production was creating a
31262         new list of base types.
31263
31264         * rootcontext.cs (StdLib): New property.
31265         (GetInterfaceTypeByName): returns an interface by type name, and
31266         encapsulates error handling here.
31267         (GetInterfaces): simplified.
31268         (ResolveTree): Encapsulated all the tree resolution here.
31269         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
31270         types. 
31271
31272         * driver.cs: Add support for --nostdlib, to avoid loading the
31273         default assemblies.
31274         (Main): Do not put tree resolution here. 
31275
31276         * rootcontext.cs: Beginning of the class resolution.
31277
31278 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
31279
31280         * rootcontext.cs: Provide better error reporting. 
31281
31282         * cs-parser.jay (interface_base): set our $$ to be interfaces.
31283
31284         * rootcontext.cs (CreateInterface): Handle the case where there
31285         are no parent interfaces.
31286
31287         (CloseTypes): Routine to flush types at the end.
31288         (CreateInterface): Track types.
31289         (GetInterfaces): Returns an array of Types from the list of
31290         defined interfaces.
31291
31292         * typemanager.c (AddUserType): Mechanism to track user types (puts
31293         the type on the global type hash, and allows us to close it at the
31294         end). 
31295
31296 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
31297
31298         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
31299         RecordInterface instead.
31300
31301         * cs-parser.jay: Updated to reflect changes above.
31302
31303         * decl.cs (Definition): Keep track of the TypeBuilder type that
31304         represents this type here.  Not sure we will use it in the long
31305         run, but wont hurt for now.
31306
31307         * driver.cs: Smaller changes to accomodate the new code.
31308
31309         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
31310         when done. 
31311
31312         * rootcontext.cs (CreateInterface):  New method, used to create
31313         the System.TypeBuilder type for interfaces.
31314         (ResolveInterfaces): new entry point to resolve the interface
31315         hierarchy. 
31316         (CodeGen): Property, used to keep track of the code generator.
31317
31318 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
31319
31320         * cs-parser.jay: Add a second production for delegate_declaration
31321         with `VOID'.
31322
31323         (enum_body): Put an opt_comma here instead of putting it on
31324         enum_body or enum_member_declarations so we can handle trailing
31325         commas on enumeration members.  Gets rid of a shift/reduce.
31326
31327         (type_list): Need a COMMA in the middle.
31328
31329         (indexer_declaration): Tell tokenizer to recognize get/set
31330
31331         * Remove old targets.
31332
31333         * Re-add the parser target.
31334
31335 2001-07-13  Simon Cozens <simon@simon-cozens.org>
31336
31337         * cs-parser.jay: Add precendence rules for a number of operators
31338         ot reduce the number of shift/reduce conflicts in the grammar.
31339
31340 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
31341
31342         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
31343         and put it here.
31344
31345         Get rid of old crufty code.
31346
31347         * rootcontext.cs: Use this to keep track of the parsed
31348         representation and the defined types available to the program. 
31349
31350         * gen-treedump.cs: adjust for new convention.
31351
31352         * type.cs: Split out the type manager, and the assembly builder
31353         from here. 
31354
31355         * typemanager.cs: the type manager will live here now.
31356
31357         * cil-codegen.cs: And the code generator here. 
31358
31359 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
31360
31361         * makefile: Fixed up for easy making.
31362
31363 2001-07-13  Simon Cozens <simon@simon-cozens.org>
31364
31365         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
31366         the 
31367
31368         (unary_expression): Expand pre_increment_expression and
31369         post_decrement_expression to reduce a shift/reduce.
31370
31371 2001-07-11  Simon Cozens
31372
31373         * cs-tokenizer.cs: Hex numbers should begin with a 0.
31374
31375         Improve allow_keyword_as_indent name.
31376
31377 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
31378
31379         * Adjustments for Beta2. 
31380
31381 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
31382
31383         * decl.cs: Added `Define' abstract method.
31384         (InTransit): new property, used to catch recursive definitions. 
31385
31386         * interface.cs: Implement `Define'. 
31387
31388         * modifiers.cs: Map Modifiers.constants to
31389         System.Reflection.TypeAttribute flags.
31390
31391         * class.cs: Keep track of types and user-defined types.
31392         (BuilderInit): New method for creating an assembly
31393         (ResolveType): New function to launch the resolution process, only
31394         used by interfaces for now.
31395
31396         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
31397         that are inserted into the name space. 
31398
31399 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
31400
31401         * ARGH.  I have screwed up my tree so many times due to the use of
31402         rsync rather than using CVS.  Going to fix this at once. 
31403
31404         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
31405         load types.
31406
31407 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
31408
31409         * Experiment successful: Use System.Type rather that our own
31410         version of Type.  
31411
31412 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
31413
31414         * cs-parser.jay: Removed nsAliases from here.
31415
31416         Use new namespaces, handle `using XXX;' 
31417
31418         * namespace.cs: Reimplemented namespace handling, use a recursive
31419         definition of the class.  Now we can keep track of using clauses
31420         and catch invalid using clauses.
31421
31422 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
31423
31424         * gen-treedump.cs: Adapted for all the renaming.
31425
31426         * expression.cs (Expression): this class now has a Type property
31427         which returns an expression Type.
31428
31429         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
31430         `Type', as this has a different meaning now in the base
31431
31432 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
31433
31434         * interface.cs, class.cs: Removed from all the sources the
31435         references to signature computation, as we can not do method
31436         signature computation during the parsing time, as we are not
31437         trying to solve at that point distinguishing:
31438
31439         class X {
31440                 void a (Blah x) {}
31441                 void a (NS.Blah x) {}
31442         }
31443
31444         Which depending on the context might be valid or not, as we do not
31445         know if Blah is the same thing as NS.Blah at that point.
31446
31447         * Redid everything so the code uses TypeRefs now instead of
31448         Types.  TypeRefs are just temporary type placeholders, that need
31449         to be resolved.  They initially have a pointer to a string and the
31450         current scope in which they are used.  This is used later by the
31451         compiler to resolve the reference to an actual Type. 
31452
31453         * DeclSpace is no longer a CIR.Type, and neither are
31454         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
31455         are all DeclSpaces, but no Types. 
31456
31457         * type.cs (TypeRefManager): This implements the TypeRef manager,
31458         which keeps track of all the types that need to be resolved after
31459         the parsing has finished. 
31460
31461 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
31462
31463         * ARGH.  We are going to have to store `foreach' as a class rather
31464         than resolving it, as we need to verify error 1579 after name
31465         resolution.   *OR* we could keep a flag that says `This request to
31466         IEnumerator comes from a foreach statement' which we can then use
31467         to generate the error.
31468
31469 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
31470
31471         * class.cs (TypeContainer.AddMethod): we now add methods to the
31472         MethodGroup instead of the method hashtable.  
31473
31474         * expression.cs: Add MethodGroup abstraction, which gets us one
31475         step closer to the specification in the way we handle method
31476         declarations.  
31477
31478         * cs-parser.jay (primary_expression): qualified_identifier now
31479         tried to match up an identifier to a local variable reference or
31480         to a parameter reference.
31481
31482         current_local_parameters is now a parser global variable that
31483         points to the current parameters for the block, used during name
31484         lookup.
31485
31486         (property_declaration): Now creates an implicit `value' argument to
31487         the set accessor.
31488
31489 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
31490
31491         * parameter.cs: Do not use `param' arguments as part of the
31492         signature, per the spec.
31493
31494 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
31495
31496         * decl.cs: Base class for classes, structs and interfaces.  This
31497         is the "Declaration Space" 
31498
31499         * cs-parser.jay: Use CheckDef for checking declaration errors
31500         instead of having one on each function.
31501
31502         * class.cs: Factor out some code for handling error handling in
31503         accordance to the "Declarations" section in the "Basic Concepts"
31504         chapter in the ECMA C# spec.
31505
31506         * interface.cs: Make all interface member classes derive from
31507         InterfaceMemberBase.
31508
31509 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
31510
31511         * Many things: all interfaces are parsed and generated in
31512         gen-treedump.  Support for member variables, constructors,
31513         destructors, properties, constants is there.
31514
31515         Beginning of the IL backend, but very little done, just there for
31516         testing purposes. 
31517
31518 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
31519
31520         * cs-parser.jay: Fix labeled statement.
31521
31522         * cs-tokenizer.cs (escape): Escape " and ' always.
31523         ref_line, ref_name: keep track of the line/filename as instructed
31524         by #line by the compiler.
31525         Parse #line.
31526
31527 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
31528
31529         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
31530         to match the values in System.CodeDOM.
31531
31532         Divid renamed to Divide.
31533
31534         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
31535         statements. 
31536         (Statements.set): remove.
31537
31538         * System.CodeDOM/CodeCatchClause.cs: always have a valid
31539         statements. 
31540
31541         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
31542         falseStatements always have valid values. 
31543
31544         * cs-parser.jay: Use System.CodeDOM now.
31545