ea392cfcfe8e1868e8872fed6e9674a67d0a04ff
[mono.git] / mcs / mcs / ChangeLog
1 2009-01-28  Marek Safar  <marek.safar@gmail.com>
2
3         A fix for bug #470227
4         * cs-tokenizer.cs: Remove too agressive parser optimization.
5
6 2009-01-28  Marek Safar  <marek.safar@gmail.com>
7
8         A fix for bug #324319
9         * class.cs: Remove too early base type resolve.
10
11 2009-01-27  Marek Safar  <marek.safar@gmail.com>
12
13         A fix for bug #324319
14         * ecore.cs: Explicitly type null when assigning to type argument to
15         make pass verifier check.
16
17 2009-01-27  Marek Safar  <marek.safar@gmail.com>
18
19         * anonymous.cs: Fixed recent regression when initializing captured 
20         this.
21
22 2009-01-26  Marek Safar  <marek.safar@gmail.com>
23
24         A fix for bug #469019
25         * anonymous.cs: Use all parent type parameters when instantiating
26         nested generic storey.
27
28 2009-01-26  Marek Safar  <marek.safar@gmail.com>
29
30         * expression.cs: Check for null instance methodgroup expression.
31
32 2009-01-26  Marek Safar  <marek.safar@gmail.com>
33
34         A fix for bug #469244
35         * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
36         instance inside a conditional expression.
37
38 2009-01-23  Marek Safar  <marek.safar@gmail.com>
39
40         * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
41         expression.cs, report.cs, ecore.cs, attribute.cs: Use common 
42         GetElementType and HasElementType. IsValueType clean up.
43
44 2009-01-23  Marek Safar  <marek.safar@gmail.com>
45
46         * nullable.cs: Use common EmitCall.
47         
48         * expression.cs: Emit constraint. for virtual calls only.
49
50 2009-01-23  Marek Safar  <marek.safar@gmail.com>
51
52         * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs, 
53         expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
54         driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
55         checks.
56
57 2009-01-22  Jb Evain  <jbevain@novell.com>
58
59         * anonymous.cs: make anonymous types' ToString implementation
60         match what csc outputs.
61
62 2009-01-21  Marek Safar  <marek.safar@gmail.com>
63
64         * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
65         up.
66
67 2009-01-17  Marek Safar  <marek.safar@gmail.com>
68
69         * convert.cs, ecore.cs: Explicitly casts type arguments to pass
70         verifier checks.
71
72 2009-01-16  Marek Safar  <marek.safar@gmail.com>
73
74         * nullable.cs (LiftedBinaryOperator): Check for all possible null
75         expressions.
76
77 2009-01-15  Marek Safar  <marek.safar@gmail.com>
78
79         A fix for bug #466634
80         * statement.cs: Add reference for nested storey when only this
81         is captured.
82
83 2009-01-15  Marek Safar  <marek.safar@gmail.com>
84
85         A fix for bug #466474
86         * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
87         was specified.
88
89 2009-01-15  Marek Safar  <marek.safar@gmail.com>
90
91         * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
92         Fixed nested stories parent referencing process. Also fixes #463985.
93
94 2009-01-06  Marek Safar  <marek.safar@gmail.com>
95
96         * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs, 
97         class.cs, cs-parser.jay, codegen.cs: Clean up destructor
98         implementation. Also fixes #463108.
99
100 2009-01-05  Marek Safar  <marek.safar@gmail.com>
101
102         A fix for bug #416109
103         * decl.cs: Issue correct CLSAttribute warning location.
104
105 2009-01-05  Marek Safar  <marek.safar@gmail.com>
106
107         A fix for bug #456775
108         * attribute.cs: Use attribute owner scope when resolving attribute
109         arguments.
110
111 2009-01-05  Marek Safar  <marek.safar@gmail.com>
112
113         A fix for bug #457257
114         * decl.cs: Fixed incorrect member declaring type comparison.
115
116 2009-01-05  Marek Safar  <marek.safar@gmail.com>
117
118         A fix for bug #460896
119         * driver.cs: Handle /RES resources as embeddable.
120
121 2009-01-05  Marek Safar  <marek.safar@gmail.com>
122
123         A fix for bug #462515
124         * ecore.cs: Report inacessible members upwards.
125
126 2009-01-05  Marek Safar  <marek.safar@gmail.com>
127
128         A fix for bug #463190, #463192
129         * decl.cs, namespace.cs: Also import internal extension classes.
130
131 2009-01-04  Marek Safar  <marek.safar@gmail.com>
132
133         A fix for bug #463415
134         * generic.cs: Use right index for RemoveDependentTypes.
135
136 2009-01-02  Marek Safar  <marek.safar@gmail.com>
137
138         A fix for bug #463196
139         * expression.cs: Fixed enum to null comparison.
140
141 2009-01-02  Marek Safar  <marek.safar@gmail.com>
142
143         A fix for bug #463121
144         * nullable.cs: Fixed nullable user equality operator comparison.
145
146 2009-01-02  Marek Safar  <marek.safar@gmail.com>
147
148         A fix for bug #462950
149         * class.cs, decl.cs: Use full explicit name when defining automatic
150         property backing field.
151
152 2009-01-02  Marek Safar  <marek.safar@gmail.com>
153
154         A fix for bug #462592
155         * pending.cs: Emit type arguments for generic proxy method.
156
157 2008-12-30  Marek Safar  <marek.safar@gmail.com>
158
159         * expression.cs (As): Mutate all type arguments.
160
161 2008-12-29  Marek Safar  <marek.safar@gmail.com>
162
163         A fix for bug #462622
164         * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
165         context.
166
167 2008-12-29  Marek Safar  <marek.safar@gmail.com>
168
169         A fix for bug #450782
170         * ecore.cs: Consider more variables of form V.I to be fixed.
171
172 2008-12-29  Marek Safar  <marek.safar@gmail.com>
173
174         A fix for bug #460712
175         * typemanager.cs: Core types could be imported.
176
177 2008-12-28  Marek Safar  <marek.safar@gmail.com>
178
179         A fix for bugs #460847, #460772, #458049, #457339, #447807
180         * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
181         statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
182         cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
183         user lambdas used inside query clauses.
184
185 2008-12-18  Marek Safar  <marek.safar@gmail.com>
186
187         A fix for bug #460229
188         * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
189
190 2008-12-18  Marek Safar  <marek.safar@gmail.com>
191
192         A fix for bug #459952
193         * decl.cs, namespace.cs: Use common CheckAccessLevel.
194
195 2008-12-18  Marek Safar  <marek.safar@gmail.com>
196
197         A fix for bug #459630
198         * convert.cs: Enum to valuetype conversion is not allowed.
199
200 2008-12-18  Marek Safar  <marek.safar@gmail.com>
201
202         A fix for bug #457087
203         * generic.cs: Don't crash when constraint comes from type
204         declaration.
205
206 2008-12-16  Marek Safar  <marek.safar@gmail.com>
207
208         A fix for bug #459221
209         * anonymous.cs, statement.cs: Delay only captured this
210         initialization.
211
212 2008-12-12  Marek Safar  <marek.safar@gmail.com>
213
214         A fix for bug #457489
215         * anonymous.cs, statement.cs: Split anonymous storey instantiation
216         and initialization to capture scope initializers correctly.
217
218 2008-12-11  Marek Safar  <marek.safar@gmail.com>
219
220         * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
221         ParameterReference refactoring.
222
223 2008-12-03  Marek Safar  <marek.safar@gmail.com>
224
225         * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
226         to be imported from any assembly.
227
228 2008-12-03  Marek Safar  <marek.safar@gmail.com>
229
230         * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
231         statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
232         from anonymous method and lambda expression.
233
234 2008-12-01  Marek Safar  <marek.safar@gmail.com>
235
236         A fix for bug #448560
237         * expression.cs (As): Box any generic type arguments to be
238         verifiable.
239
240 2008-11-29  Raja R Harinath  <harinath@hurrynot.org>
241
242         Add tripwire for implicit conversion bugs
243         * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
244         for CS1501 error.
245         (MethodGroupExpr.OverloadResolve): Add sanity check between
246         IsApplicable and VerifyArgumentsCompat.
247         (VerifyArgumentsCompat): Report CS1501 where appropriate.
248
249 2008-11-29  Raja R Harinath  <harinath@hurrynot.org>
250
251         Fix build break in System.Data_test
252         * convert.cs (ImplicitConversionExists): Move NullLiteral
253         conversions ...
254         (ImplicitStandardConversionExists): ... here.
255
256 2008-11-28  Marek Safar  <marek.safar@gmail.com>
257
258         * literal.cs: Emit correctly explicit null to nullable cast.
259
260 2008-11-28  Marek Safar  <marek.safar@gmail.com>
261
262         * ecore.cs, generics.cs: Fixed crash when type arguments fail to
263         resolve.
264
265 2008-11-28  Marek Safar  <marek.safar@gmail.com>
266
267         A fix for bug #449005
268         * convert.cs, nullable.cs: Use only one implicit nullable
269         conversion.
270
271 2008-11-27  Marek Safar  <marek.safar@gmail.com>
272
273         * convert.cs, literal.cs: More Convert cleanup is needed.
274
275 2008-11-27  Marek Safar  <marek.safar@gmail.com>
276
277         * decl.cs, class.cs: Fixed misleading error message.
278
279 2008-11-26  Marek Safar  <marek.safar@gmail.com>
280
281         A fix for bug #449005
282         * nullable.cs (EmitEquality): Disable optimization for user operator
283         operands.
284
285 2008-11-25  Marek Safar  <marek.safar@gmail.com>
286
287         A fix for bug #447027
288         * anonymous.cs (HoistedVariable): Cache also outer access to deal
289         with context variables stored as expression instances.
290
291 2008-11-25  Marek Safar  <marek.safar@gmail.com>
292
293         A fix for bug #447027
294         * delegate.cs: Fixed delegate VerifyMethod logic.
295
296 2008-11-24  Marek Safar  <marek.safar@gmail.com>
297
298         * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
299         but not verifiable.
300
301 2008-11-21  Marek Safar  <marek.safar@gmail.com>
302
303         * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
304         member type resolve to follow normal flow, instead of random
305         property access.
306
307 2008-11-21  Marek Safar  <marek.safar@gmail.com>
308
309         * iterators.cs (GetEnumeratorStatement): Re-use already resolved
310         type.
311
312 2008-11-21  Marek Safar  <marek.safar@gmail.com>
313
314         * const.cs: Emit decimal array constant as literal.
315
316 2008-11-20  Marek Safar  <marek.safar@gmail.com>
317
318         * iterators.cs, ecore.cs: Removed CurrentBlock statement.
319
320 2008-11-19  Marek Safar  <marek.safar@gmail.com>
321
322         * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
323         into real property (saves 8 MB for corlib compilation).
324
325 2008-11-19  Marek Safar  <marek.safar@gmail.com>
326
327         * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
328         nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
329         generic-mcs.cs: Small cleanup of TypeArguments.
330
331 2008-11-18  Marek Safar  <marek.safar@gmail.com>
332
333         * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
334         expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
335         of ConstructedType expression, renamed to GenericTypeExpr.
336
337 2008-11-17  Marek Safar  <marek.safar@gmail.com>
338
339         A fix for bug #445303
340         * location.cs (IsConditionalDefined): Handle undefined global
341         defines.
342
343 2008-11-17  Marek Safar  <marek.safar@gmail.com>
344
345         A fix for bug #444678
346         * expression.cs (TryReduceConstant): Always create new constant
347         instance.
348
349 2008-11-17  Marek Safar  <marek.safar@gmail.com>
350
351         A fix for bug #444673
352         * ecore.cs: Ignore open generic types when used as generic type
353         instance fields.
354
355 2008-11-17  Marek Safar  <marek.safar@gmail.com>
356
357         A fix for bug #445458
358         * expression.cs, cs-parser.jay: Don't crash when an expression
359         statement is null.
360
361 2008-11-17  Marek Safar  <marek.safar@gmail.com>
362
363         A fix for bug #445464
364         * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
365         inside unbound type.
366
367 2008-11-14  Jb Evain  <jbevain@novell.com>
368
369         * driver.cs: ignore empty -nowarn argument such as
370         the one in -nowarn:12,13,,.
371
372 2008-11-13  Marek Safar  <marek.safar@gmail.com>
373
374         A fix for bug #444271
375         * anonymous.cs: Rescan parent storeys when best candidate was
376         undone.
377
378 2008-11-13  Marek Safar  <marek.safar@gmail.com>
379
380         * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
381         useless UnboundTypeExpression.
382         
383         * attribute.cs: Do check obsolete attribute on generic types.
384
385 2008-11-12  Marek Safar  <marek.safar@gmail.com>
386
387         A fix for bugs #425680, #400139
388         * ecore.cs, expression.cs: Trying to do some almost_matched_members
389         refactoring.
390
391 2008-11-11  Marek Safar  <marek.safar@gmail.com>
392
393         A fix for bug #435747
394         * assign.cs, expression.cs: Cleanup New assignment to emit correcly
395         compound value types assignment. Few micro optimizations added.
396
397 2008-11-10  Marek Safar  <marek.safar@gmail.com>
398
399         A fix for bug #442610
400         * anonymous.cs (MutateConstructor): More SRE hacking.
401
402 2008-11-10  Marek Safar  <marek.safar@gmail.com>
403
404         A fix for bug #442579
405         * ecore.cs: Also initialize expanded form of a method with 1 params
406         parameter.
407
408 2008-11-06  Marek Safar  <marek.safar@gmail.com>
409
410         * expression.cs (UnaryMutator): Do early l-side check.
411
412 2008-11-05  Miguel de Icaza  <miguel@novell.com>
413
414         * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
415         Init, otherwise we would crash later on when checking for friend
416         assemblies. 
417
418         * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
419         Otherwise we never get any meaningful information as to what
420         failed. 
421
422 2008-11-05  Marek Safar  <marek.safar@gmail.com>
423
424         A fix for bug #436318
425         * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
426
427 2008-11-05  Miguel de Icaza  <miguel@novell.com>
428
429         * namespace.cs: Turns out that it was a really bad idea to hide
430         the errors for namespaces not found here in eval mode.    
431
432         * eval.cs: When we process using clauses, only enter those into
433         the list of valid using clauses after they have been validated.   
434
435         The above change gives the proper semantics: it does not
436         senselessly report the same errors with broken using statements by
437         never storing them in the first place when they are invalid.
438
439 2008-11-05  Marek Safar  <marek.safar@gmail.com>
440
441         A fix for bug #421839
442         * cs-parser.jay: Remove expression from coalesce rule to force lower
443         priority than the assignment operator.
444
445 2008-11-05  Marek Safar  <marek.safar@gmail.com>
446
447         A fix for bug #437875
448         * nullable.cs: Compile correctly method group operand used with null
449         coalescing operator.
450
451 2008-11-04  Marek Safar  <marek.safar@gmail.com>
452
453         A fix for bug #434589
454         * expression.cs (Binary): Ignore lifted conversions when at least
455         one operand is of reference type.
456
457 2008-11-04  Marek Safar  <marek.safar@gmail.com>
458
459         * cs-parser.jay: Better syntax error report.
460
461 2008-11-03  Marek Safar  <marek.safar@gmail.com>
462
463         A fix for bug #436792
464         * cs-parser.jay: Use GetLocation to access location.
465
466 2008-11-03  Marek Safar  <marek.safar@gmail.com>
467
468         A fix for bug #440774
469         * cs-parser.jay: Also set current_array_type when parsing local
470         variables types.
471
472 2008-11-03  Marek Safar  <marek.safar@gmail.com>
473
474         A fix for bug #440785
475         * expression.cs (As): Don't resolve self modifing expression
476         multiple times.
477
478 2008-11-03  Marek Safar  <marek.safar@gmail.com>
479
480         A fix for bug #439447
481         * cs-tokenizer.cs: Tokenize surrogates only where allowed.
482
483 2008-11-03  Marek Safar  <marek.safar@gmail.com>
484
485         A fix for bug #437571
486         * cs-parser.jay: Fixes internal error for invalid expression
487         statements.
488
489 2008-10-17  Marek Safar  <marek.safar@gmail.com>
490
491         * ecore.cs: Resolve correctly ambiguous params delegate methods.
492
493 2008-10-17  Marek Safar  <marek.safar@gmail.com>
494
495         * generic.cs, anonymous.cs: Simplified GetDeclarations.
496
497 2008-10-17  Marek Safar  <marek.safar@gmail.com>
498
499         * cs-tokenizer.cs: More precise cast parsing.
500
501 2008-10-16  Martin Baulig  <martin@ximian.com>
502
503         * anonymous.cs (AnonymousMethodStorey): Put back the
504         `hoisted_locals' hashtable and use it in EmitType().
505
506 2008-10-15  Marek Safar  <marek.safar@gmail.com>
507
508         * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
509         cs-parser.jay: Tokenizer optimizations and memory reduction, saves
510         ~5MB for corlib.
511
512 2008-10-14  Marek Safar  <marek.safar@gmail.com>
513
514         * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
515
516 2008-10-14  Marek Safar  <marek.safar@gmail.com>
517
518         * statement.cs: Mutate scope initializers.
519
520 2008-10-14  Marek Safar  <marek.safar@gmail.com>
521
522         * expression.cs: Use typeless value for This constant.
523         
524         * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
525
526 2008-10-14  Marek Safar  <marek.safar@gmail.com>
527
528         * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
529         tokenizer.
530
531 2008-10-13  Marek Safar  <marek.safar@gmail.com>
532
533         * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
534         type to type cast.
535
536 2008-10-13  Marek Safar  <marek.safar@gmail.com>
537
538         * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
539         parser and tokenizer. Fixes many ambiguities including #433258.
540
541 2008-10-10  Marek Safar  <marek.safar@gmail.com>
542
543         * cs-parser.jay: Fixed missing accessor recovery.
544
545 2008-10-10  Marek Safar  <marek.safar@gmail.com>
546
547         A fix for bug #433701
548         * expression.cs: Better error message.
549
550 2008-10-10  Marek Safar  <marek.safar@gmail.com>
551
552         * cs-parser.jay, expression.cs: Start reporting real parser errors.
553         
554         * Makefile: Disabled unused debug symbols.
555
556         Also fixes: #320556, #321097, #321656, #321876, #351316
557
558 2008-10-09  Miguel de Icaza  <miguel@novell.com>
559
560         * eval.cs: rename "<interactive>" to "{interactive}", to work
561         around a requirement in the compiler that this be a valid
562         filename, and in Windows it is not (433886).
563
564 2008-10-09  Marek Safar  <marek.safar@gmail.com>
565
566         * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
567
568 2008-10-08  Marek Safar  <marek.safar@gmail.com>
569
570         * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
571         cs-parser.jay: Generic type declaration and type arguments cleanup.
572
573 2008-10-05  Marek Safar  <marek.safar@gmail.com>
574
575         * cs-parser.jay: Allow parsing weird array creation construct.
576
577 2008-10-05  Marek Safar  <marek.safar@gmail.com>
578
579         * cs-parser.jay: Conflicts reduction.
580
581 2008-10-04  Marek Safar  <marek.safar@gmail.com>
582
583         * cs-parser.jay: Conflicts reduction.
584
585 2008-10-04  Raja R Harinath  <harinath@hurrynot.org>
586
587         Fix #398325
588         * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
589         property.  Add a 'count' hint about the use of the shared vector.
590         Ensure that we don't leak out dirty bits.
591         (UsageVector.MergeChild): Throw away information about variables
592         in child vectors.
593         Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
594
595 2008-10-03  Marek Safar  <marek.safar@gmail.com>
596
597         A fix for bug #431746
598         * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
599         parameters when iterator is created.
600
601 2008-10-03  Marek Safar  <marek.safar@gmail.com>
602
603         A fix for bug #431827
604         * expression.cs: Fixed right based pointer arithmetic operations
605         emit.
606
607 2008-10-03  Marek Safar  <marek.safar@gmail.com>
608
609         A fix for bug #353779
610         * assign.cs, expression.cs: Fixed compound assignment conversions.
611
612 2008-10-02  Marek Safar  <marek.safar@gmail.com>
613
614         A fix for bug #375262
615         * statement.cs: Refactor ArrayForeach to be usable with string
616         indexer. Optimized single dimentional arrays foreach.
617
618 2008-10-02  Marek Safar  <marek.safar@gmail.com>
619
620         A fix for bug #431255
621         * anonymous.cs, expression.cs: Removed broken optimization.
622
623 2008-10-01  Marek Safar  <marek.safar@gmail.com>
624
625         * anonymous.cs: Use full type parameters of parent generic
626         containers. Removed unnecessary AddParentStoreyReference call.
627
628 2008-10-01  Marek Safar  <marek.safar@gmail.com>
629
630         A fix for bug #324702
631         * class.cs: Use better shorter names for explicit interface member
632         implementations.
633
634         * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
635
636 2008-10-01  Marek Safar  <marek.safar@gmail.com>
637         
638         * expression.cs: Use new interface to check fixed expression.
639
640 2008-10-01  Marek Safar  <marek.safar@gmail.com>
641
642         A fix for bug #421101
643         * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
644         interface to check for fixed fixed-buffers.
645
646 2008-10-01  Marek Safar  <marek.safar@gmail.com>
647
648         A fix for bug #429264
649         * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
650         
651         * delegate.cs: Removed unnecessary casts.
652
653 2008-09-30  Marek Safar  <marek.safar@gmail.com>
654
655         A fix for bug #352151
656         * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
657         class.cs: Fixed already defined explicit interface members check.
658
659 2008-09-29  Rodrigo Kumpera  <rkumpera@novell.com>
660
661         cs-tokenizer.cs: Fix typo.
662
663 2008-09-28  Miguel de Icaza  <miguel@novell.com>
664
665         * eval.cs (InteractiveBase): The quit command now just sets a
666         flag, instead of calling Environment.Exit(), it is milder on
667         embedded hosts. 
668
669         CompiledMethod is now in Mono.CSharp, not nested inside
670         the Evaluator, it was inconvenient to use.
671
672 2008-09-27  Miguel de Icaza  <miguel@novell.com>
673
674         * eval.cs (Evaluator): Introduce Compile method, to allow compiled
675         code to be invoked without having to reparse.
676
677 2008-09-27  Miguel de Icaza  <miguel@novell.com>
678
679         * ecore.cs: The recent changes to FieldExpr broke this as well.
680         Fixes LINQ queries in the interactive shell.
681
682         * Multiple files: indentation fixing for the Mono coding
683         guidelines for the switch statement.
684
685         * eval.cs: Make the Evaluator API thread safe.
686
687 2008-09-26  Marek Safar  <marek.safar@gmail.com>
688
689         * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
690         constructor parsing.
691
692 2008-09-26  Marek Safar  <marek.safar@gmail.com>
693
694         A fix for bug #325326
695         * statement.cs: Check possible mistaken empty statement using
696         explicit blocks only.
697
698 2008-09-25  Miguel de Icaza  <miguel@novell.com>
699
700         * eval.cs (LoadAssembly, ReferenceAssembly): Call
701         RootNamespace.ComputeNamespaces to update the internal list of
702         namespaces, this is no longer done for us.
703
704         (InteractiveBase): Use the Evaluator APIs instead of calling into
705         Driver directly
706
707 2008-09-25  Marek Safar  <marek.safar@gmail.com>
708
709         A fix for bug #429264
710         * expression.cs: Missing mutator for access to multidimensional
711         arrays.
712
713 2008-09-25  Marek Safar  <marek.safar@gmail.com>
714
715         * class.cs, statement: Emit DebuggerHidden attribute for iterator
716         entry wrapper.
717         
718         * driver.cs: Missing input argument check.
719
720 2008-09-25  Marek Safar  <marek.safar@gmail.com>
721
722         * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
723         expression.cs, statement.cs, rootcontext.cs, class.cs, 
724         cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
725         DefineMembers.
726
727 2008-09-24  Miguel de Icaza  <miguel@novell.com>
728
729         * ecore.cs (FieldExpr): Only initialize eclass when we return a
730         fully constructed FieldExpr, fixes the regression introduced in
731         the last commit.
732         
733         * ecore.cs, expression.cs: Plug back the eclass initialization as
734         otherwise it regresses `csharp'. 
735
736 2008-09-24  Marek Safar  <marek.safar@gmail.com>
737
738         * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
739         ecore.cs, attribute.cs: Moved obsolete method checks from emit
740         phase to resolve phase. It resolves problems with expression trees
741         and fixes bugs #323796, #325156.
742
743 2008-09-23  Marek Safar  <marek.safar@gmail.com>
744
745         * codegen.cs: Report better error when symbol writer is missing.
746
747 2008-09-23  Marek Safar  <marek.safar@gmail.com>
748
749         * codegen.cs: Set .NET symbol writer.
750         
751         * decl.cs: Guard against null generic arguments.
752         
753         * report.cs: Don't report exactly same additional details.
754
755 2008-09-22  Marek Safar  <marek.safar@gmail.com>
756
757         A fix for bug #324917
758         * cs-parser.jay: Add missing multidimensional non-expression type
759         ranks.
760         
761 2008-09-22  Marek Safar  <marek.safar@gmail.com>
762
763         A fix for bug #428191
764         * anonymous.cs: Create an outer generic fields also for non-storey
765         anonymous methods.
766
767 2008-09-22  Marek Safar  <marek.safar@gmail.com>
768
769         A fix for bug #378294
770         * class.cs: Make fixed size buffers gmcs feature only.
771
772 2008-09-22  Marek Safar  <marek.safar@gmail.com>
773
774         A fix for bug #355622, #324993
775         * assign.cs, const.cs, class.cs: Create new EmitContext for each
776         field initializer.
777
778 2008-09-19  Marek Safar  <marek.safar@gmail.com>
779
780         * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
781         error reporting.
782
783 2008-09-19  Marek Safar  <marek.safar@gmail.com>
784
785         A fix for bug #416110
786         * generic.cs: Struct constraint results in default ctor and
787         ValueType base type constraint to be set.
788
789 2008-09-19  Marek Safar  <marek.safar@gmail.com>
790
791         A fix for bug #423791
792         * generic.cs: Fixed params output type type-inference.
793
794 2008-09-19  Marek Safar  <marek.safar@gmail.com>
795
796         * cs-parser.jay, expression.cs: Fixed few expression crashes.
797         
798 2008-09-19  Marek Safar  <marek.safar@gmail.com>
799
800         * cs-tokenizer.cs: Don't break on extra partial modifier.
801
802 2008-09-19  Marek Safar  <marek.safar@gmail.com>
803
804         A fix for bug #427592
805         * generic.cs: Use common parameter resolve method.
806
807 2008-09-18  Marek Safar  <marek.safar@gmail.com>
808
809         A fix for bug #414758
810         * expression.cs, ecore.cs: Fixed crash when accessing non-static
811         property.
812
813 2008-09-18  Marek Safar  <marek.safar@gmail.com>
814
815         * driver.cs, namespace.cs: Read types and namespaces after all
816         requested assemblies are loaded, fixes issues with System.Core
817         auto-reference, and #419888.
818
819 2008-09-18  Marek Safar  <marek.safar@gmail.com>
820
821         A fix for bug #417705
822         * cs-parser.jay: Fixed as/is operator expression split.
823
824 2008-09-18  Marek Safar  <marek.safar@gmail.com>
825
826         * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
827         Fixed expression tree representation of empty new expression and
828         new initializer expression.
829
830 2008-09-18  Miguel de Icaza  <miguel@novell.com>
831
832         * eval.cs: Remove warning, keep reference to driver around.
833
834         * Hide fields that do not need to be public.
835
836 2008-09-17  Marek Safar  <marek.safar@gmail.com>
837
838         A fix for bug #426385
839         * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
840         conversion for array elements.
841
842 2008-09-17  Marek Safar  <marek.safar@gmail.com>
843
844         * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
845         void parsing conflicts.
846
847 2008-09-15  Marek Safar  <marek.safar@gmail.com>
848
849         A fix for bug #425601
850         * driver.cs, typemanager.cs, namespace.cs: Automatically reference
851         System.Core only when there is no custom ExtensionAttribute
852         implementation.
853
854 2008-09-15  Miguel de Icaza  <miguel@novell.com>
855
856         * namespace.cs: Do not report CS0246 (name
857
858 2008-09-12  Marek Safar  <marek.safar@gmail.com>
859
860         A fix for bug #425669
861         * generic.cs: Don't cache generic static anonymous method 
862         containers.
863
864 2008-09-12  Marek Safar  <marek.safar@gmail.com>
865
866         * generic.cs, class.cs, delegate.cs: Check recursive inherited
867         conflicting constraints.
868
869 2008-09-12  Raja R Harinath  <harinath@hurrynot.org>
870
871         * cs-tokenizer.cs (consume_identifier): Allow partial methods in
872         mcs too.
873
874 2008-09-12  Marek Safar  <marek.safar@gmail.com>
875
876         * literal.cs, convert.cs, expression.cs, statement.cs: More null
877         to null pointer conversion fixes.
878
879 2008-09-11  Marek Safar  <marek.safar@gmail.com>
880
881         * cs-parser.jay, expression.cs: An implicitly typed local variable
882         declarator cannot use an array initializer.
883
884 2008-09-11  Marek Safar  <marek.safar@gmail.com>
885
886         * cs-parser.jay: Reduced number of printed tokens, add sorting.
887
888 2008-09-11  Marek Safar  <marek.safar@gmail.com>
889
890         * generic.cs (InflatedConstraints): Don't crash when constraints
891         are different.
892         
893         * cs-parser.jay: const_declarator is a block.
894
895         * constant.cs: Check for not allowed NaN conversions.
896
897 2008-09-10  Miguel de Icaza  <miguel@novell.com>
898
899         * driver.cs: Drop --shell argument, the compiler is no longer a
900         REPL. 
901
902         * eval.cs: Move most of the code that deals with evaluation into
903         this file and document the public API from repl.cs
904
905         * repl.cs: Remove from here.
906         
907 2008-09-10  Marek Safar  <marek.safar@gmail.com>
908
909         A fix for bug #424684
910         * generic.cs: Generic class constraints must come first.
911
912 2008-09-09  Miguel de Icaza  <miguel@novell.com>
913
914         * cs-parser.jay: Improve error reporting for syntax errors in
915         statements and expressions, we now report the expected tokens
916         instead of reporting the useless "; expected".
917
918         Drop the strings from the token declaration, it turns out that
919         they did not do what I thought they did.  Instead they were adding
920         two sets of tokens to the tables.
921
922 2008-09-09  Marek Safar  <marek.safar@gmail.com>
923
924         * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
925         delegate.cs: Share special type check.
926
927 2008-09-09  Marek Safar  <marek.safar@gmail.com>
928
929         A fix for bug #423981
930         * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
931
932 2008-09-09  Marek Safar  <marek.safar@gmail.com>
933
934         * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
935         ConvertImplicitly.
936
937 2008-09-09  Marek Safar  <marek.safar@gmail.com>
938
939         A fix for bugs: #324750, #335946
940         * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom 
941         lookup rule to determine ?-based tokens.
942
943 2008-09-08  Miguel de Icaza  <miguel@novell.com>
944
945         * repl.cs (OptionalAssign.EmitStatement): It is possible that some
946         expressions (like event adding or removing) end up here, so we
947         need to treat those as statements.
948
949         Add LoadAssembly method.
950
951 2008-09-04  Miguel de Icaza  <miguel@novell.com>
952
953         * repl.cs: Add Time method.
954
955 2008-09-05  Marek Safar  <marek.safar@gmail.com>
956
957         * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
958
959 2008-09-05  Miguel de Icaza  <miguel@novell.com>
960
961         * repl.cs: Add workaround for old compilers.
962
963 2008-09-04  Jb Evain  <jbevain@novell.com>
964
965         * repl.cs (PrettyPrint): pretty print everything that
966         implements IDictionary, as well as IEnumerables. Also,
967         add a quit helper property.
968
969 2008-09-04  Marek Safar  <marek.safar@gmail.com>
970
971         * constant.cs: Better error reporting for decimal literals.
972         
973         * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
974         field attributes.
975         
976 2008-09-04  Marek Safar  <marek.safar@gmail.com>
977                         Miguel de Icaza  <miguel@novell.com>
978
979         A fix for bug #422951
980         * assign.cs (Assign.DoResolve): Perform the type conversions
981         checks before we attempt to initialize `New' initializers. 
982
983 2008-09-04  Marek Safar  <marek.safar@gmail.com>
984
985         A fix for bug #422853
986         * delegate.cs (DelegateCreation): Add special handling for
987         EmptyExpression.Null instance expression which is just another
988         hack for undecided member instance exression.
989
990 2008-09-04  Marek Safar  <marek.safar@gmail.com>
991
992         * expression.cs, ecore.cs: Emit full expression tree for reduced
993         binary expressions.
994
995 2008-09-04  Marek Safar  <marek.safar@gmail.com>
996
997         * expression.cs (This): Guard against multi-resolving.
998         
999         * ecore.cs, statement.cs (Throw): Simplified.
1000         
1001         * flowanalysis.cs: Also verify event fields.
1002
1003 2008-09-04  Miguel de Icaza  <miguel@novell.com>
1004
1005         * assign.cs (Assign.DoResolve): Perform the type conversions
1006         checks before we attempt to initialize `New' initializers. 
1007
1008         * repl.cs (PrettyPrint): Add Hashtable prettyprint
1009
1010         * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
1011         public. 
1012
1013         * repl.cs: Update help.
1014
1015 2008-09-03  Miguel de Icaza  <miguel@novell.com>
1016
1017         * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
1018         handling of the default config handling, including the special
1019         treatment of System.Core assembly. 
1020
1021         Fixes the REPL processing for LINQ.
1022
1023 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1024
1025         A fix for bug #422507
1026         * expression.cs (UnboxCast): Add missing child expression mutator.
1027
1028 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1029
1030         * driver.cs: Don't self reference System.Core assembly.
1031
1032 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1033
1034         A fix for bug #422507
1035         * expression.cs (StringConcat): Add missing type mutator.
1036
1037 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1038
1039         * generic.cs (TypeInferenceContext): Follow equality rule for
1040         constructed type lower bound type inference.
1041
1042 2008-09-02  Miguel de Icaza  <miguel@novell.com>
1043
1044         * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
1045         <dblank@cs.brynmawr.edu> which updates the cursor position on
1046         refresh.
1047         
1048 2008-09-02  Marek Safar  <marek.safar@gmail.com>
1049
1050         A fix for bug #367145
1051         * driver.cs: Fixed import of extension methods when using -noconfig
1052         option.
1053
1054 2008-09-02  Marek Safar  <marek.safar@gmail.com>
1055
1056         * iterator.cs: Don't emit GetEnumerator method twice but call a generic
1057         version from non-generic implementation instead.
1058
1059 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1060
1061         A fix for bug #418908
1062         * class.cs: Use AddScopeStatement for field initializers.
1063
1064 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1065
1066         A fix for bug #415385
1067         * ecore.cs, convert.cs: Do method group conversion for equal group types.
1068
1069 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1070
1071         A fix for bug #421736
1072         * iterators.cs: Don't crash on unreachable iterators.
1073
1074 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1075
1076         A fix for bug #421628
1077         * parameter.cs, attribute.cs: Clone also parameter attributes.
1078
1079 2008-08-30  Miguel de Icaza  <miguel@novell.com>
1080
1081         * namespace.cs (LookupType): In EvalMode, try to replace
1082         the TypeBuilder from our cache with a Type as Reflection.Emit does
1083         not  like to mix code from older assemblies emitted and new
1084         assemblies emitted. 
1085
1086         This sounds like a serious Mono bug that prevents multiple
1087         assemblies to be generated and consumed at the same time.
1088
1089         * cs-parser.jay (push_current_class): Do not make interactive
1090         classes internal or private, make them public as we currently
1091         generate each new class in a new assembly.   
1092
1093 2008-08-29  Miguel de Icaza  <miguel@novell.com>
1094
1095         * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
1096         remove types that are entered into the global namespace during
1097         parsing so that we can remove them on failure.
1098  
1099         * cs-parser.jay: Parsing: we now keep track of types that are
1100         entered into global variables and queue those in case the parsing
1101         or resolution fail.
1102  
1103         This happens in a few situations: during partial-input, we invoke
1104         the parser repeatedly for example with the string "class X", this
1105         would cause X to be registed, and we need to remove this
1106         registration so that another parse attempt later with say "class X {"
1107         would actually work.
1108  
1109         Additionally, if there is an error in the resolution phase, for
1110         example: "class X : NonExistant {}" th
1111         
1112         * cs-parser.jay: Be more precise with the errors being raised,
1113         instead of flagging all exceptions during parsing to be attributed
1114         to the parsing process, distinguish those from errors happening in
1115         the actions and hint that using -v would produce the actual
1116         exception. 
1117
1118         * repl.cs: Do not load all compiler references on each reset,
1119         doing the partial reset takes care of this.
1120         
1121 2008-08-28  Miguel de Icaza  <miguel@novell.com>
1122
1123         * repl.cs: Add support for loading all the files from
1124         ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
1125         as shell libraries.
1126
1127         Introduce a micro-parser that is able to deambiguate on its input
1128         whether we are dealing with a compilation unit (namespace, class,
1129         interface, struct, delegate) declaration or a statement.   This
1130         allows both declarations and statements to be entered. 
1131
1132         Set history size by default to 300 lines.
1133
1134         Instead of distinguishing based on the parser.InteractiveResult,
1135         have only two cases: statements were parsed, or a compilation unit
1136         was.   Always pull the Using statement additions from the
1137         compilation unit parse.
1138         
1139         * cs-tokenizer.cs: Rename tokens to better describe their intent
1140         (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
1141         
1142         * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
1143         EvalMode is used to trigger the lookup of global variables while
1144         StatementMode is used turn variable declarations into static
1145         fields.
1146
1147         * getline.cs: Allow history size to be set.
1148         
1149 2008-08-29  Marek Safar  <marek.safar@gmail.com>
1150
1151         A fix for bug #360755
1152         * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
1153
1154 2008-08-29  Marek Safar  <marek.safar@gmail.com>
1155
1156         * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
1157         
1158         * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
1159         member name, it is too confusing
1160         
1161         * decl.cs, class.cs: Don't report unused fields with attached attribute.
1162         
1163         * rootcontext.cs: Finally default to warning level 4.
1164
1165 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1166
1167         * class.cs (CheckBase): Ignore overloaded operators.
1168
1169 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1170
1171         A fix for bug #420830
1172         * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
1173
1174 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1175
1176         A fix for bug #420832
1177         * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
1178
1179 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1180
1181         A fix for bug #420386
1182         * nullables.cs: Fixed logic of nullable user comparison operators involving
1183         null values.
1184
1185 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1186         
1187         * attribute (IsClsCompliant): Use FALSE value for pointer types.
1188
1189 2008-08-27  Miguel de Icaza  <miguel@novell.com>
1190
1191         * repl.cs: Add support for aborting the running code with C-c. 
1192
1193 2008-08-27  Raja R Harinath  <harinath@hurrynot.org>
1194
1195         * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
1196
1197 2008-08-27  Miguel de Icaza  <miguel@novell.com>
1198
1199         * cs-parser.jay (interactive_statement_list): A new set of rules
1200         for hosting statements that uses the "interactive_" prefix.   
1201
1202         * repl.cs: Add support for parsing `using' as a statement or as a
1203         directive.  Deambiguating before passing this to the parser.
1204
1205         We need to distinguish statement_expressions that occur at the
1206         toplevel vs those that occur embedded into expressions.
1207
1208         * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com> 
1209         that fixes the cursor key handling, and a history bug.
1210         
1211 2008-08-26  Miguel de Icaza  <miguel@novell.com>
1212
1213         * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
1214         limitations in Console, instead the 2.0 bootstrap libraries now
1215         include the Console bits.
1216
1217         Also, remove the use of Nullables from getline.cs
1218
1219         ------------
1220         
1221         Interactive support for the C# compiler.   Use gmcs --shell to
1222         enter a read-eval-print loop shell.
1223
1224         Docs: http://www.mono-project.com/CsharpRepl
1225         
1226         * sources: include repl.cs here and getline.cs for gmcs.exe,
1227         everything else is getline.cs impaired.
1228
1229         * Makefile: when bootstrapping pass a special flag
1230         BOOTSTRAP_COMPILER which we use to prevent failures in compilation
1231         as we use NET_2_0 define to pull 2.0 APIs from System.Console.
1232         This distinguishes those two cases.
1233
1234         * repl.cs: Support for a read-eval-print loop.   Will be soon
1235         refactored into eval support and then REPL on top of it.
1236
1237         * ecore.cs: If a simplename lookup fails, before erroring out,
1238         if we are in EvalMode to resolve the name to a declaration in the
1239         Eval-land.    
1240
1241         This means that variable declarations that happened in previous
1242         classes (as repl puts every statement in a separate class) are
1243         made visible in this way.
1244
1245         * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
1246         triggered an error due to the end of file being reached.   This is
1247         used to do multi-line input, and notify the caller that the user
1248         needs to provide more text before a successful parse.
1249
1250         Add new grammar rules after the INTERACTIVE_PARSER token is seen
1251         to drive the evaluation with a custom wrapper. 
1252
1253         * driver.cs: Add support for --shell, and refactor some code to be
1254         reused from repl.cs
1255         
1256         * namespace.cs: Add support for serializing the contents of the
1257         namespaces and reloading them.  
1258
1259         * getline.cs: A managed implementation of ReadLine under
1260         X11/Apache2 license terms.  Easy to embed in other applications as
1261         well.
1262
1263         * namespace.cs: Add some functions to save and restore the
1264         namespace state.
1265
1266         * rootcontext.cs: New public field.
1267
1268         * cs-tokenizer.cs: Add support for one of the possible characters
1269         we introduce into the token stream.  
1270
1271         This patch does not affect the regular tokenization process, the
1272         only performance hit would happen if there is an invalid character
1273         on the input string.
1274
1275         * support.cs: Move isatty helper routine here.
1276
1277         * codegen.cs: Small cleanup, and add a mechanism to initialize the
1278         code generator for in-memory assemblies.
1279
1280 2008-08-26  Marek Safar  <marek.safar@gmail.com>
1281
1282         * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
1283         parameter cannot be always used as a type.
1284
1285 2008-08-21  Marek Safar  <marek.safar@gmail.com>
1286
1287         * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
1288
1289 2008-08-21  Marek Safar  <marek.safar@gmail.com>
1290
1291         * convert.cs: Implement explicit array to IList<T> conversion.
1292
1293 2008-08-20  Marek Safar  <marek.safar@gmail.com>
1294
1295         A fix for bug #362740
1296         * cs-tokenizer.cs: Handle UTF-16 surrogates.
1297
1298 2008-08-20  Marek Safar  <marek.safar@gmail.com>
1299         
1300         * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
1301         pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
1302         flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
1303         expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
1304         handling to use just one type of infrastructure and deal with generics
1305         more effectivelly.
1306
1307 2008-07-23  Martin Baulig  <martin@ximian.com>
1308
1309         *** Merged this from trunk revision 108527 ***
1310
1311         * statement.cs
1312         (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
1313         (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
1314         scope variable.
1315
1316 2008-08-15  Marek Safar  <marek.safar@gmail.com>
1317         
1318         * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
1319         error checks.
1320
1321 2008-08-15  Marek Safar  <marek.safar@gmail.com>
1322         
1323         * delegate.cs: Fixed compiler crash when creating delegate using partial
1324         method.
1325         
1326         * typemanager.cs: MulticastDelegate is not a delegate.
1327
1328 2008-08-14  Marek Safar  <marek.safar@gmail.com>
1329         
1330         * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
1331         checks.
1332
1333 2008-08-14  Raja R Harinath  <harinath@hurrynot.org>
1334
1335         * cs-parser.jay (type): Allow 'var' in mcs too.
1336         (local_variable_type): Likewise.
1337
1338 2008-08-14  Marek Safar  <marek.safar@gmail.com>
1339         
1340         * driver.cs: Removed broken -noconfig variants.
1341
1342 2008-08-14  Marek Safar  <marek.safar@gmail.com>
1343         
1344         A fix for bug #417078
1345         * expression.cs: Emit correctly left side pointer operators.
1346
1347 2008-08-13  Marek Safar  <marek.safar@gmail.com>
1348
1349         * generic.cs, lambda.cs: Inflate method generic arguments only.
1350
1351 2008-08-12  Marek Safar  <marek.safar@gmail.com>
1352
1353         * class.cs: Fixed struct layout check regression.
1354
1355 2008-08-12  Marek Safar  <marek.safar@gmail.com>
1356
1357         * cs-parser.jay, enum.cs: Simplified enum parsing.
1358         
1359         * decl.cs: Check all type parameters conflicts.
1360         
1361         * expression.cs, statement.cs, attribute.cs: More expression checks.
1362
1363 2008-08-11  Marek Safar  <marek.safar@gmail.com>
1364
1365         * generic.cs: Add type inference types restriction.
1366         
1367         * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
1368         anonymous.cs, expression.cs: Allocate less accessor parameters.
1369
1370 2008-08-08  Marek Safar  <marek.safar@gmail.com>
1371
1372         * typemanager.cs, ecore.cs: Ambiguous operators can come from different
1373         classes.
1374
1375 2008-08-08  Marek Safar  <marek.safar@gmail.com>
1376
1377         * convert.cs, delegate.cs: Fixed delegate compatibility conversion. 
1378
1379 2008-08-07  Marek Safar  <marek.safar@gmail.com>
1380
1381         * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
1382         Also fixes #362146 and #381592.
1383
1384 2008-08-07  Marek Safar  <marek.safar@gmail.com>
1385
1386         * ecore.cs: Reduced constant cannot be used as an attribute value.
1387         
1388         * cs-parser.jay: Base expression has to be a type.
1389         
1390         * expression.cs (Conditional): Uses ReducedExpression.
1391
1392 2008-08-06  Marek Safar  <marek.safar@gmail.com>
1393
1394         A fix for bug #376826
1395         * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
1396         address of hoisted local variable or parameter cannot be taken.
1397
1398 2008-08-05  Marek Safar  <marek.safar@gmail.com>
1399
1400         * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly 
1401         anonymous method inside checked/unchecked expression.
1402
1403 2008-08-05  Marek Safar  <marek.safar@gmail.com>
1404
1405         * typemanager.cs (IsEqual): Guard against null.
1406         
1407         * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
1408         attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
1409         routine. Fixed few misleading conversion errors.
1410
1411 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1412
1413         * class.cs: Consider generics when checking cycles in struct layout.
1414
1415 2008-08-04  Raja R Harinath  <harinath@hurrynot.org>
1416
1417         * cs-tokenizer.cs (get_cmd_arg): Simplify.  Don't be too pedantic.
1418
1419 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1420
1421         A fix for bug #414165
1422         * anonymous.cs: Use same anonymous implementation method for all anonymous
1423         method emits.
1424
1425 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1426
1427         * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
1428         constraints.
1429
1430 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1431
1432         * cs-parser.jay: Typeof argument has to be a type expression.
1433         
1434         * namespace.cs: Check alias and namespace definitions collisions.
1435         
1436         * class.cs, pending.cs: Moved explicit interface accessor implementation
1437         check.
1438         
1439         * delegate.cs, expression.cs: Verify special name invocations.
1440         
1441 2008-08-01  Marek Safar  <marek.safar@gmail.com>
1442
1443         * cs-parser.jay: Don't choke on empty generic type arguments.
1444         
1445         * cs-tokenizer.cs: Handle escaped preprocessor directives.
1446         
1447         * expression.cs, ecore.cs: Minor expressions bugs.
1448
1449 2008-08-01  Marek Safar  <marek.safar@gmail.com>
1450
1451         * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
1452         and added more error handling.
1453         
1454         * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
1455         
1456         *  modifiers.cs, enum.cs: Fixed.
1457
1458 2008-07-31  Jb Evain  <jbevain@novell.com>
1459
1460         * driver.cs: remove -pkg ability of smcs.
1461
1462 2008-07-30  Marek Safar  <marek.safar@gmail.com>
1463
1464         * statement.cs (Switch): Correctly set empty default target for single
1465         blocks.
1466
1467 2008-07-30  Marek Safar  <marek.safar@gmail.com>
1468
1469         * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
1470         string switch statement implementation to use string dictionary which
1471         significantly (2-8x) improves performance of generated code.
1472
1473 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1474
1475         A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
1476         * modifiers.cs (GetDescription): Fixed FamANDAssem case.
1477         
1478 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1479
1480         A fix for bug #412595
1481         * typemanager.cs, convert.cs, expression.cs: Some types are never
1482         convertible to each other.
1483
1484 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1485
1486         * nullable.cs (CreateNullConstant): An error messages update.
1487
1488 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1489
1490         A fix for bug #412595
1491         * cfold.cs: Don't cast undefined bool constant.
1492
1493 2008-07-29  Martin Baulig  <martin@ximian.com>
1494
1495         * symbolwriter.cs
1496         (SymbolWriter.Reset): New public static method.
1497
1498         * driver.cs
1499         (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
1500
1501 2008-07-28  Marek Safar  <marek.safar@gmail.com>
1502
1503         * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
1504         
1505         * expression.cs (ElementAccess): Exact size allocation.
1506
1507 2008-07-26  Marek Safar  <marek.safar@gmail.com>
1508
1509         * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
1510
1511 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1512
1513         * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
1514         
1515         * class.cs: Removed $PRIVATE$ field hack which caused problems during
1516         flow analysis.
1517
1518 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1519
1520         A fix for bug #412217
1521         * assign.cs: Mutate also assignment type.
1522
1523 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1524
1525         A fix for bug #323644
1526         * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
1527         indexers.
1528
1529 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1530
1531         A fix for bug #412134
1532         * expression.cs (ResolveOperatorEnum): Do implicit conversion of
1533         non-enumerable operands when overloading equality or bitwise operators.
1534
1535 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1536
1537         * anonymous.cs: Cache closed generic anonymous method delegates.
1538
1539 2008-07-24  Marek Safar  <marek.safar@gmail.com>
1540
1541         * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs, 
1542         anonymous.cs, statement.cs: Always emit anonymous method as static method
1543         when is instance free. Use nesting for nested anynomous methods blocks.
1544         
1545 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1546
1547         * anonymous.cs (MutateGenericMethod): Added extra code path for imported
1548         types.
1549
1550 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1551
1552         * expression.cs: Removed MakeSimpleCall.
1553
1554 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1555
1556         A fix for bug #323012
1557         * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
1558         Base method implementing interface has to be public.
1559
1560 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1561
1562         * cs-parser.jay: Don't break on missing argument.
1563
1564 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1565
1566         A fix for bug #320993
1567         * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
1568           enum.cs, codegen.cs: Report CLS compliance errors as warnings.
1569
1570 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1571
1572         A fix for bug #320748
1573         * convert.cs: Implicit user operators cannot convert to interfaces
1574
1575 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1576
1577         A fix for bug #312686
1578         * driver.cs: Ignore empty assembly references.
1579
1580 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1581
1582         A fix for bug #387040
1583         * ecore.cs: Skip constrains check for an explicit implementation.
1584
1585 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1586
1587         A fix for bug #409045
1588         * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
1589           cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
1590           identifiers are file specific unless passed as input arguments.
1591
1592 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1593
1594          * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
1595          to emit UnmanagedMarshal data under 2.0 profile.
1596
1597 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1598
1599         A fix for bug #410369
1600         * parameter.cs: Clone correctly ParamsParameter.
1601
1602 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1603
1604         * expression.cs (Argument): Always report type for type based expressions
1605         errors.
1606
1607 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1608
1609         A fix for bug #410666
1610         * anonymous.cs: Correctly initialize generic storey reference.
1611
1612 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1613
1614         * convert.cs: Don't box same type arguments.
1615
1616 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1617
1618         * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
1619         Finished missing generic type mutators.
1620
1621 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1622
1623         * iterators.cs, statement.cs: Finished statements CloneTo.
1624
1625 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1626
1627         * anonymous.cs: ExpressionTreeProxy is of Value type expression.
1628         
1629         * expression.cs: Emit optimized default value expressions in expression tree
1630         array initializer.
1631
1632 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1633
1634         * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
1635
1636 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1637
1638         A fix for bug #367536
1639         * cs-parser.jay: Check static constructor of generic types for an access
1640         modifier.
1641
1642 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1643
1644         A fix for bug #353800
1645         * lambda.cs: Emit ret for contextual statements.
1646         
1647         * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
1648         up emitting redundant ret for all anonymous methods with return.
1649
1650 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1651
1652         A fix for bug #365188
1653         * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
1654         create anonymous method storey in unreachable block.
1655
1656 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1657
1658         * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
1659         class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
1660         driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
1661         statement.cs: Fixed relevant defects found by Gendarme.
1662
1663 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1664
1665         A fix for bug #325291
1666         * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs, 
1667         statement.cs: Replaced IAnonymousHost with top level block flag.
1668
1669 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1670
1671         * cs-parser.jay: Clean up unused open_parens.
1672
1673 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1674
1675         * ecore.cs: Custom error message for a range variable assignment.
1676
1677 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1678
1679         * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
1680         load.
1681
1682 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1683
1684         * literal.cs: Null literal is of object type.
1685
1686 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1687
1688         * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
1689         expression of nullable equality comparison.
1690
1691 2008-07-15  Marek Safar  <marek.safar@gmail.com>
1692
1693         * expression.cs(PointerArithmetic): Removed redundant assignment.
1694
1695 2008-07-15  Marek Safar  <marek.safar@gmail.com>
1696
1697         * decl.cs (GetSignatureForError): Report full namespace name for containers.
1698
1699 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1700
1701         A fix for bug #408361
1702         * anonymous.cs (MutateGenericMethod): Store generic type arguments before
1703         they are replaced by GetMethod.
1704
1705 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1706
1707         A fix for bug #408721 by jeremie.laval@gmail.com
1708         * expression.cs (Indirection): Implemented CloneTo.
1709
1710 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1711
1712         * statement.cs (AssignableSlots): Temporary disabled variable initialization
1713         assert check.
1714
1715 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1716
1717         * report.cs (EnableReporting): Don't reinitialize 0-based values.
1718
1719 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1720
1721         * linq.cs: Reset tranparent parameter counter in probing mode.
1722
1723 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1724
1725         * anonymous.cs: Mutate anonymous method type.
1726
1727 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1728
1729         * ecore.cs, anonymous.cs: Mutate field expressions.
1730
1731 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1732
1733         A fix for bug #369670
1734         * linq.cs, statement.cs: Use explicit block for query expressions variables.
1735
1736 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1737
1738         * report.cs, ecore.cs: Flush recorder only when silent mode is off.
1739
1740 2008-07-10  Raja R Harinath  <harinath@hurrynot.org>
1741
1742         Fix bug #314902
1743         * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
1744         only one '>', and finds a '>>', abort the generic lookahead.
1745
1746 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1747
1748         A fix for bug #319902
1749         * cs-tokenizer.cs: Always look-ahed for `>='  when tokenizing `>'.
1750
1751 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1752
1753         A fix for bug #406371
1754         * statement.cs: Moved EmitSymbolInfo to Block.
1755
1756 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1757
1758         * ecore.cs: Report better error for extension method overload failures.
1759
1760 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1761
1762         * expression.cs (Is): No need to box reference values.
1763
1764 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1765
1766         * class.cs: Use event resolve context when initializing CreateEmitContext.
1767
1768 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1769
1770         A fix for bug #394436
1771         * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
1772         method used inside expression trees. Added more LINQ to expression tree
1773         conversions.
1774
1775 2008-07-08  Marek Safar  <marek.safar@gmail.com>
1776
1777         A fix for bug #378189, #370577
1778         * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
1779         from expression.
1780
1781 2008-07-08  Marek Safar  <marek.safar@gmail.com>
1782
1783         * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
1784         hierarchically.
1785
1786 2008-07-08  Marek Safar  <marek.safar@gmail.com>
1787
1788         A fix for bug #406702
1789         * anonymous.cs: Always park anonymous method in the nearest parent storey.
1790
1791 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1792
1793         A fix for bug #406648
1794         * cs-parser.jay: Report nullable use in mcs for some cases.
1795
1796 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1797
1798         * ecore.cs: Improved argument mismatch error messages.
1799
1800 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1801
1802         * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
1803
1804 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1805
1806         * expression.cs (TypeOf): Mutate type argument.
1807
1808 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1809
1810         * class.cs: Report missing partial modifier for correct type.
1811
1812 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1813
1814         * ecore.cs, expression.cs (VariableReference): Variable property is 
1815         protected.
1816
1817 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1818
1819         * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
1820         
1821 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1822
1823         * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
1824         method delegates.
1825
1826 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1827
1828         * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
1829         anonymous method storey to an instance method when only "this" is hoisted.
1830
1831 2008-07-03  Marek Safar  <marek.safar@gmail.com>
1832
1833         A fix for bug #321615
1834         * expression.cs: Pointer comparisons use unsigned operator.
1835
1836 2008-07-03  Marek Safar  <marek.safar@gmail.com>
1837
1838         * expression.cs: Fixed native pointer conversions. Also fixes #321615.
1839
1840 2008-07-02  Marek Safar  <marek.safar@gmail.com>
1841
1842         A fix for bug #404905
1843         * class.cs: Always initialize local unsafe variables.
1844
1845 2008-06-30  Marek Safar  <marek.safar@gmail.com>
1846
1847         A fix for bug #396987
1848         * expression.cs (NewInitialize): Clear local temporary variable for next run
1849
1850 2008-06-27  Marek Safar  <marek.safar@gmail.com>
1851
1852         A fix for bug #401020
1853         * ecore.cs: Both types and modifiers have to match for ref and out arguments
1854
1855 2008-06-27  Marek Safar  <marek.safar@gmail.com>
1856
1857         A fix for bug #398319
1858         * cs-parser.jay: Implemented undocumented base access expression inside
1859         anonymous types.
1860
1861 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1862
1863         A fix for bug #404227
1864         * cs-parser.jay: Parse namespace declaration using qualified identifier.
1865
1866 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1867
1868         A fix for bug #404227
1869         * convert.cs: Fixed explicit array to interface cast.
1870
1871 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1872
1873         A fix for bug #403894
1874         * delegate.cs: Mutate DelegateInvocation type.
1875
1876 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1877
1878         A fix for bug #379348
1879         * delegate.cs: Box a load of generic parameters.
1880
1881 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1882
1883         * expression.cs: Add an array creation arguments mutate.
1884
1885 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1886
1887         A fix for bug #386068
1888         * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
1889         parameter.
1890
1891 2008-06-25  Marek Safar  <marek.safar@gmail.com>
1892
1893         * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
1894         CloneTo.
1895
1896 2008-06-25  Marek Safar  <marek.safar@gmail.com>
1897
1898         A fix for bug #403518
1899         * delegate.cs: Type correctly anonymous method new invocation.
1900
1901 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1902
1903         A fix for bug #394826
1904         * anonymous.cs: Fully qualify members when resolving anonymous type internal
1905         calls.
1906
1907 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1908
1909         A fix for bug #394826
1910         * anonymous.cs, iterators.cs: Construct generic storey only when is really
1911         needed.
1912
1913 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1914
1915         * class.cs: Clone indexer parameters for localized capturing.
1916
1917 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1918
1919         A fix for bug #402379
1920         * expression.cs: Don't crash when an object initializer resolve fails.
1921
1922 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1923
1924         A fix for bug #402888
1925         * expression.cs: Mutate conditional expression.
1926
1927 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1928
1929         A fix for bug #401012
1930         * class.cs: Keep StructLayout in shared container.
1931
1932 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1933
1934         A fix for bug #400438
1935         * decl.cs, class.cs: Only properties can be automatically implemented.
1936
1937 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1938
1939         * statement.cs (ChangeToIterator): Copy also labels.
1940
1941 2008-06-23  Marek Safar  <marek.safar@gmail.com>
1942
1943         * ecore.cs: Pass type argument details to parent extension method.
1944
1945 2008-06-23  Marek Safar  <marek.safar@gmail.com>
1946
1947         A fix for bug #375966
1948         * delegate.cs: Fixed IsTypeCovariant generic type conversions.
1949
1950 2008-06-23  Raja R Harinath  <harinath@hurrynot.org>
1951
1952         * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
1953
1954 2008-06-22  Marek Safar  <marek.safar@gmail.com>
1955
1956         A fix for bug #394347
1957         * anonymous.cs: Cache compatible delegates as compatibility check produces
1958         a new method every time.
1959
1960 2008-06-20  Marek Safar  <marek.safar@gmail.com>
1961
1962         * anonymous.cs: Propagate storey reference for single references.
1963
1964 2008-06-20  Marek Safar  <marek.safar@gmail.com>
1965
1966         A fix for bug #387615
1967         * assign.cs, expression.cs: Correctly clone compound assignment.
1968
1969 2008-06-19  Marek Safar  <marek.safar@gmail.com>
1970
1971         A fix for bug #359611, #359604
1972         * anonymous.cs: Mutate all types of hoisted parameters.
1973
1974 2008-06-19  Marek Safar  <marek.safar@gmail.com>
1975
1976         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
1977         delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
1978         expression.cs, codegen.cs, statement.cs
1979         
1980         Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
1981         #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
1982         
1983         ** Anonymous methods, lambda expressions rewrite **
1984         
1985         Anonymous expressions are now resolved when an explicit block is resolved 
1986         and they don't require any registration procedure anymore. Further,
1987         anonymous methods are defined when explicit block is emitted which allows
1988         better control of whole process and opens possibilities for more
1989         optimizations as well as alternative to reverse whole process.
1990         
1991         A concept of `MutateHoistedGenericType' was introduced to keep the resolve
1992         process consistent and to correctly emit hoisted generic methods when they
1993         have at least 1 hoisted variable.
1994         
1995 2008-06-17  Martin Baulig  <martin@ximian.com>
1996
1997         * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
1998         iterator method.
1999         (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
2000         virtual property; check it in Emit().
2001         (PropertyMethod.IsDebuggerHidden): Override, check whether we're
2002         an iterator.
2003         (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
2004         an iterator.
2005         (Indexer.Define): Likewise.
2006
2007 2008-06-17  Marek Safar  <marek.safar@gmail.com>
2008
2009         * convert.cs: Don't use IsInterface on type arguments.
2010         
2011         * delegate.cs: DelegateInvocation uses MethodInfo.
2012         
2013         * parameter.cs: Removed IsTypeParameter.
2014         
2015         * generic-mcs.cs: More missing stuff.
2016
2017 2008-06-16  Martin Baulig  <martin@ximian.com>
2018
2019         * modifiers.cs
2020         (Modifiers.DEBUGGER_HIDDEN): New public const.
2021
2022         * typemanager.cs
2023         (TypeManager.GetDebuggerHiddenAttribute): New public static method.
2024
2025         * class.cs
2026         (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
2027         (AbstractPropertyEventMethod): Likewise.
2028         (Constructor.Emit): Likewise.
2029         (SourceMethod.SetCompilerGenerated): Removed.
2030
2031         * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
2032         on MoveNext().
2033
2034         * anonymous.cs
2035         (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
2036         if we're an `IteratorHost'.
2037         (AnonymousMethodMethod..ctor): Don't set
2038         `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
2039         not on the method.
2040
2041 2008-06-16  Marek Safar  <marek.safar@gmail.com>
2042
2043         * statement.cs: Clean-up foreach statements.
2044
2045 2008-06-12  Marek Safar  <marek.safar@gmail.com>
2046
2047         * class.cs: Stop using public method which should not exist
2048         (MethodBuilder.SetGenericMethodSignature).
2049
2050 2008-06-11  Martin Baulig  <martin@ximian.com>
2051
2052         * location.cs
2053         (Location.LookupFile): Add `CompilationUnit' argument; when given
2054         a relative file name, make it relative to the directory the .cs
2055         file is located in instead of using the current directory.
2056
2057 2008-06-11  Martin Baulig  <martin@ximian.com>
2058
2059         * class.cs
2060         (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
2061         (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
2062         (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
2063         (SourceMethod.SetCompilerGenerated): Likewise.
2064
2065 2008-06-11  Marek Safar  <marek.safar@gmail.com>
2066
2067         * codegen.cs, driver: Only write symbol file when it's asked for.
2068
2069 2008-06-11  Marek Safar  <marek.safar@gmail.com>
2070
2071         * codegen.cs: Don't use assembly writer error handling for symbol writer.
2072
2073 2008-06-10  Martin Baulig  <martin@ximian.com>
2074
2075         * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
2076
2077 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2078
2079         A fix for bug #316290
2080         * expression.cs: Include decimal operators in predefined table.
2081         
2082         * parameters.cs: More readonlyness.
2083
2084 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2085
2086         A fix for bug #397213
2087         * cs-parser.jay: One more missing current_local_parameters reset.
2088
2089 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2090
2091         A fix for bug #396633
2092         * class.cs: Host backing field in partial container.
2093
2094 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2095
2096         A fix for bug #397068
2097         * expression.cs: Check both operand types when predefined operator is used.
2098
2099 2008-06-05  Martin Baulig  <martin@ximian.com>
2100
2101         Merged the `debugger-kahalo' branch.
2102
2103         * class.cs
2104         (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
2105         we're an iterator method.
2106         (SourceMethod): Reflect latest symbol writer changes;
2107         SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
2108         now `start_row' and `end_row'.
2109         (Constructor.Emit): Fix the logic whether to emit symbol information.
2110
2111         * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
2112         generated methods.
2113
2114         * location.cs
2115         (CompilationUnit): New public class; derives from `SourceFile'.
2116         (SourceFileEntry.DefineSymbolInfo): New public method.
2117         (SourceFileEntry.SetChecksum): New public method.
2118         (Location): Encode hidden line numbers by using `column == 255';
2119         the .ctor now accepts `column == -1' to mark a hidden line number.
2120         (Location.Hidden): New public property.
2121         (Location.CheckPoint): Add `CompilationUnit'.
2122         (Location.SourceFiles): Change return type to `CompilationUnit[]'.
2123         (Location.Push): Add `CompilationUnit compile_unit' argument.
2124         (Location.CompilationUnit): New public property.
2125
2126         * statement.cs
2127         (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
2128
2129         * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
2130
2131         * driver.cs: `SourceFile' -> `CompilationUnit'.
2132
2133         * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
2134
2135         * namespace.cs: `SourceFile' -> `CompilationUnit'.
2136
2137         * cs-tokenizer.cs: Add support for `#pragma checksum' and
2138         `#line hidden'.
2139
2140         * symbolwriter.cs
2141         (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
2142         new symbol writer API to also pass the file.
2143
2144 2008-06-05  Marek Safar  <marek.safar@gmail.com>
2145
2146         * statement.cs: Emit catch variable assignment using variable expression.
2147         
2148 2008-06-05  Marek Safar  <marek.safar@gmail.com>
2149
2150         * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
2151         with other variable types.
2152
2153 2008-06-04  Marek Safar  <marek.safar@gmail.com>
2154
2155         * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
2156         GetLength method emit, it breaks resolve rules.
2157         
2158 2008-06-02  Atsushi Enomoto  <atsushi@ximian.com>
2159             Marek Safar  <marek.safar@gmail.com>
2160                         
2161         A fix for bug #395542
2162         * cs-parser.jay: The trailing comma is allowed in anonymous type member
2163         declaration.
2164         
2165 2008-06-02  Marek Safar  <marek.safar@gmail.com>
2166
2167         A fix for bug #395287
2168         * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
2169
2170 2008-05-31  Marek Safar  <marek.safar@gmail.com>
2171
2172         A fix for bug #395845
2173         * class.cs, nullable.cs: User unary operator is allowed to have nullable and
2174         non-nullable parameter type.
2175         
2176 2008-05-31  Marek Safar  <marek.safar@gmail.com>
2177
2178         * class.cs: Handle contructor initializer as a statement in top-level block.
2179
2180 2008-05-30  Marek Safar  <marek.safar@gmail.com>
2181
2182         * attribute.cs: Don't mix old and new corlib types when emitting corlib
2183         security attributes.
2184
2185 2008-05-24  Marek Safar  <marek.safar@gmail.com>
2186
2187         * ecore.cs, expression.cs: Small IVariable refactoring.
2188
2189 2008-05-22  Marek Safar  <marek.safar@gmail.com>
2190
2191         * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
2192
2193 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2194
2195         * cs-parser.jay: Removed redundant catch type check.
2196
2197 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2198
2199         A fix for bug #390372
2200         * nullable.cs: Set correct return type.
2201
2202 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2203
2204         A fix for bug #391062
2205         * typemanager.cs: Fixed crash when comparing null types.
2206
2207 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2208
2209         A fix for bug #391871
2210         * cs-parser.jay: Better error handling for invalid catch type.
2211
2212 2008-05-20  Marek Safar  <marek.safar@gmail.com>
2213
2214         A fix for bug #392155
2215         * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
2216
2217 2008-05-15  Marek Safar  <marek.safar@gmail.com>
2218
2219         A fix for bug #390666
2220         * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
2221         expressions.
2222
2223 2008-05-15  Marek Safar  <marek.safar@gmail.com>
2224
2225         * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
2226         in getter.
2227
2228 2008-05-13  Marek Safar  <marek.safar@gmail.com>
2229
2230         A fix for bug #389625
2231         * delegate.cs, generic.cs: Some progress on method group return type
2232         inference.
2233
2234 2008-05-13  Marek Safar  <marek.safar@gmail.com>
2235
2236         A fix for bug #378419
2237         * namespace.cs: Inspect also parent namespaces not only namespace entries.
2238
2239 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2240
2241         * class.cs (Constructor): Added IsCompilerGenerated.
2242
2243 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2244
2245         * expression.cs: Enum binary operators can accept non-enum operand only when
2246         is implicitly convertible to underlying type.
2247
2248 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2249
2250         A fix for bug #389272
2251         * support.cs: Workaround System.InvalidOperationException for enums.
2252
2253 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2254
2255         A fix for bug #389073
2256         * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
2257
2258 2008-05-10  Marek Safar  <marek.safar@gmail.com>
2259
2260         * driver.cs: Split Parse.
2261         
2262         * location.cs (LookupFile): Uses string.Empty.
2263
2264 2008-05-07  Marek Safar  <marek.safar@gmail.com>
2265
2266         * expression.cs, parameter.cs: Small ParameterReference clean up.
2267
2268 2008-05-07  Marek Safar  <marek.safar@gmail.com>
2269
2270         * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
2271         hack. Fixes #387502.
2272
2273 2008-05-06  Martin Baulig  <martin@ximian.com>
2274
2275         * class.cs (Constructor.Emit): Fix the logic whether to emit
2276         symbol information.
2277
2278 2008-05-06  Raja R Harinath  <harinath@hurrynot.org>
2279
2280         Fix #385503
2281         * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
2282         InvalidOperationException when the iterator is before the start or
2283         after the end.
2284
2285 2008-05-06  Marek Safar  <marek.safar@gmail.com>
2286
2287         * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
2288         when left is nullable type.
2289
2290 2008-05-06  Marek Safar  <marek.safar@gmail.com>
2291
2292         A fix for bug #386628
2293         * expression.cs (LocalVariableReference): Continue in resolving when
2294         variable is not assigned.
2295
2296 2008-05-05  Marek Safar  <marek.safar@gmail.com>
2297
2298         * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
2299         nullable operations.
2300
2301 2008-05-04  Marek Safar  <marek.safar@gmail.com>
2302
2303         * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
2304         it saves many redundant temporary variables for nullable operations.
2305
2306 2008-05-03  Marek Safar  <marek.safar@gmail.com>
2307
2308         * assign.cs: EventAddOrRemove is a statement and cannot have a type.
2309         
2310         * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
2311         method.
2312         
2313         * nullable.cs: Constant coalescing operator optimizations.
2314
2315 2008-05-03  Marek Safar  <marek.safar@gmail.com>
2316
2317         * constant.cs: Use unsigned conversion for values which are unsigned only.
2318
2319 2008-05-03  Marek Safar  <marek.safar@gmail.com>
2320
2321         * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null 
2322         coalescing operator as it should be.
2323
2324 2008-05-02  Marek Safar  <marek.safar@gmail.com>
2325
2326         A fix for bug #371016
2327         * expression.cs: All predefined delegate operators require implicit method
2328         group conversion.
2329         
2330 2008-05-02  Marek Safar  <marek.safar@gmail.com>
2331
2332         * constant.cs: Emit long constant as uint when fits the range.
2333         
2334         * convert.cs, expression.cs: Fixed few unsafe conversions.
2335
2336 2008-05-02  Marek Safar  <marek.safar@gmail.com>
2337
2338         * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
2339
2340 2008-05-02  Raja R Harinath  <harinath@hurrynot.org>
2341
2342         Fix #385758
2343         * convert.cs (ImplicitNumericConversion): Don't modify the type of
2344         'expr'.
2345         * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
2346
2347 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2348
2349         * constant.cs, literal.cs: IsLiteral property for error reporting.
2350         
2351         * ecore.cs, expression.cs: Implemented Property expression.
2352
2353 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2354
2355         * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
2356         
2357         * nullable.cs: Implemented nullable coalescing null operator.
2358
2359         * ecore.cs, expression.cs: Expression trees work.
2360
2361 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2362
2363         * ecore.cs: CreateExpressionTree is finally abstract.
2364
2365         * expression.cs, linq.cs: Updated.
2366
2367 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2368
2369         * expression.cs, ecore.cs: Block base access expression inside expression
2370         tree.
2371
2372 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2373
2374         A fix for bug #385058
2375         * expression.cs: User-defined operator implementations always take
2376         precedence over predefined operator implementations.
2377
2378 2008-04-30  Marek Safar  <marek.safar@gmail.com>
2379
2380         * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
2381         class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
2382         expression tree conversions.
2383         
2384 2008-04-30  Marek Safar  <marek.safar@gmail.com>
2385
2386         * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
2387         operators method details to Operator class.
2388
2389 2008-04-30  Marek Safar  <marek.safar@gmail.com>
2390
2391         * anonymous.cs: Pass unsafe flags to anonymous container.
2392         
2393         * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
2394         inside expression tree.
2395
2396 2008-04-29  Martin Baulig  <martin@ximian.com>
2397
2398         * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
2399         (Tokenizer.PopPosition): Also restore the `line'.
2400
2401 2008-04-29  Marek Safar  <marek.safar@gmail.com>
2402
2403         * delegate.cs: Implemented Invoke expression.
2404
2405 2008-04-29  Marek Safar  <marek.safar@gmail.com>
2406
2407         * expression.cs: Fixed equality reference comparison regression.
2408
2409 2008-04-29  Marek Safar  <marek.safar@gmail.com>
2410
2411         * ecore.cs: Clean up EmptyCast hack.
2412         
2413         * expression.cs, nullable.cs: Implemented enum binary and unary operations
2414         using correct conversion rules. Also fixes #383993.
2415
2416 2008-04-28  Martin Baulig  <martin@ximian.com>
2417
2418         * class.cs (Constructor.Emit): Don't emit debugging information
2419         for generated default .ctor's.
2420
2421 2008-04-28  Marek Safar  <marek.safar@gmail.com>
2422
2423         * convert.cs: Empty-cast ushort to int conversion.
2424
2425 2008-04-28  Marek Safar  <marek.safar@gmail.com>
2426
2427         A fix for bug #384191
2428         * ecore.cs, expression.cs: Fixed expression cloning.
2429
2430 2008-04-28  Marek Safar  <marek.safar@gmail.com>
2431
2432         * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
2433
2434 2008-04-28  Raja R Harinath  <harinath@hurrynot.org>
2435
2436         Fix #381559, test-638.cs, test-639.cs
2437         * assign.cs (CompoundAssign.Helper): New wrapper.
2438         (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
2439         access.
2440         * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
2441         Pass unconverted expressions to the params array creation expression.
2442         (FieldExpr.EmitAssign): Don't special-case StringConcat.
2443         (PropertyExpr.EmitAssign): Likewise.
2444         * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
2445         element if it is of kind CompoundAssign.Helper.
2446         (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
2447         first before anything else.
2448         (ArrayAccess.EmitAssign): Don't special-case StringConcat.
2449         (ArrayAccess.LoadArrayAndArguments): Simplify.
2450
2451 2008-04-27  Marek Safar  <marek.safar@gmail.com>
2452
2453         * expression.cs: Fixed cloning of typeof(void).
2454
2455 2008-04-27  Raja R Harinath  <harinath@hurrynot.org>
2456
2457         * assign.cs (Assign.DoResolve): Remove support for EventExprs.
2458         (Assign.Emit): Likewise.  Move it to ...
2459         (CompoundAssign.DoResolve): ... here and ...
2460         (CompoundAssign.Emit): ... here.
2461         (EventAddOrRemove): New helper to handle += and -= on events, and
2462         avoid the use of BinaryDelegates.
2463         * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
2464         (EventExpr.EmitAddOrRemove): Improve.
2465         * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
2466
2467         * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
2468         create VarExprs for 'foo.bar.var'.
2469         * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
2470         is a highly inappropriate name for its functionality.
2471
2472 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
2473
2474         Simplify handling of multiple assignments
2475         * assign.cs (Assign): Clear out all 'embedded assign' gunk.  Make
2476         inheritable-only.
2477         (SimpleAssign): New.  Class to be used for normal assignments.
2478         * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
2479         * expression.cs, parameter.cs, statement.cs: Likewise.
2480
2481 2008-04-25  Marek Safar  <marek.safar@gmail.com>
2482
2483         * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
2484         for incompatible underlying types, more to come, uff.
2485
2486 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
2487
2488         Fix gtest-388.cs
2489         * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
2490         Handle 'leave_copy'.
2491
2492 2008-04-25  Marek Safar  <marek.safar@gmail.com>
2493
2494         * expression.cs, nullable.cs: Implemented UnaryPlus expression.
2495
2496 2008-04-24  Raja R Harinath  <harinath@hurrynot.org>
2497
2498         Fix test-636.cs.  Sprinkle a few more 'EmitSideEffect's around
2499         * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
2500         * statement.cs (While, Do, For): Allow test to have side effects.
2501         (For.DoEmit): Always emit InitStatement.
2502
2503         Fix test-635.cs
2504         * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
2505         Always create SideEffectConstant.
2506         (Binary.EnumLiftUp): Don't assume that the enumeration constant is
2507         of type EnumConstant.
2508
2509         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
2510         Handle 'right' being SideEffectConstant of type 'bool'.
2511
2512         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
2513         Use left.EmitBranchable instead of open coding it, so as to
2514         improve optimization opportunities.
2515
2516         * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
2517
2518         * ecore.cs (Expression.EmitBranchable): Document some non-obvious
2519         assumptions.
2520         (Expression.EmitSideEffect): Document.
2521
2522 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2523
2524         * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
2525
2526 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2527
2528         * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
2529
2530 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2531
2532         * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
2533         conversion to expression tree.
2534
2535 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2536
2537         * ecore.cs: Removed unused expression.
2538
2539 2008-04-22  Marek Safar  <marek.safar@gmail.com>
2540
2541         * expression.cs: Implemented NegateChecked and New expressions.
2542
2543 2008-04-22  Marek Safar  <marek.safar@gmail.com>
2544
2545         * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
2546
2547 2008-04-22  Raja R Harinath  <harinath@hurrynot.org>
2548
2549         Fix #351102
2550         * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
2551         needing final 'ret' instruction.
2552
2553 2008-04-22  Marek Safar  <marek.safar@gmail.com>
2554
2555         * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
2556
2557 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2558
2559         * expression.cs: Emit ldnull and not null expression as an instance argument
2560          of static method expression calls.
2561
2562 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2563
2564         A fix for bug #378200
2565         * expression.cs: Fixed crash when creating parameterless expression tree
2566         method call.
2567
2568 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2569
2570         A fix for bug #375297
2571         * anonymous.cs: Fixed crash when inferring from null argument anonymous
2572         method.
2573
2574 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2575
2576         A fix for bug #377596
2577         * decl.cs, class.cs: Emit delegate type argument attributes.
2578
2579 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2580
2581         A fix for bug #365314
2582         * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
2583         
2584 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2585
2586         * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
2587         only.
2588
2589 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2590
2591         * generic.cs (TypeParameter): Removed redundant location.
2592
2593 2008-04-19  Marek Safar  <marek.safar@gmail.com>
2594
2595         * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
2596         delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
2597         FullNamedExpression in all declaration type expression, statements will come
2598         later.
2599
2600 2008-04-18  Marek Safar  <marek.safar@gmail.com>
2601
2602         * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
2603         nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
2604
2605 2008-04-18  Marek Safar  <marek.safar@gmail.com>
2606
2607         * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
2608         code.
2609
2610 2008-04-17  Marek Safar  <marek.safar@gmail.com>
2611
2612         * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
2613         constraints.
2614
2615 2008-04-17  Marek Safar  <marek.safar@gmail.com>
2616
2617         * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
2618         name expressions.
2619         Also fixes #340463.
2620
2621 2008-04-17  Raja R Harinath  <harinath@hurrynot.org>
2622
2623         Hook up 'EmitSideEffect'
2624         * constant.cs (Constant.EmitSideEffect): New.
2625         (SideEffectConstant.Emit): Simplify.  Use EmitSideEffect.
2626         (SideEffectConstant.EmitSideEffect): New.
2627         * ecore.cs (BoxedCast.EmitBranchable): Remove.  We can't use an
2628         unconditional branch in EmitBranchable.
2629         (FieldExpr.EmitBranchable): New.
2630         * expression.cs (Unary.EmitSideEffect): New.
2631         (Binary.EmitSideEffect): New.
2632         (VariableReference.EmitSideEffect): New.  Do nothing.
2633
2634 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
2635
2636         Introduce 'EmitSideEffect'
2637         * ecore.cs (Expression.EmitSideEffect): New.
2638         (TypeCast): Rename from EmptyCast.
2639         (EmptyCast): New.
2640         (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
2641         (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
2642         * convert.cs, nullable.cs: Update to changes.
2643
2644 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2645
2646         * class.cs, cs-parser.jay: Early check for base types expression.
2647
2648 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2649
2650         * decl.cs (MemberName): Declare PrettyName as obsolete.
2651
2652 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2653
2654         * namespace.cs: Use MemberName comparison.
2655
2656 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
2657
2658         Fix build break
2659         * decl.cs (MemberName.PrettyName): New.  Replaces the misnamed
2660         FullName.
2661         (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
2662         (MemberName.FullyQualifiedName): New.  Provides the functionality
2663         that users assume FullName would have.
2664         * ecore.cs, namespace.cs: Update to changes.
2665
2666         * statement.cs (Using.assign): Make into ExpressionStatement.
2667         (Using.EmitPreTryBody): Simplify.
2668
2669 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2670
2671         * report.cs: ColorFormat is protected.
2672         
2673         * rootcontext.cs: Unused fields clean-up.
2674         
2675         * namespace.cs: Made UsingEntry name private.
2676
2677 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2678
2679         * cs-tokenizer.cs, location.cs: Removed unused field.
2680
2681 2008-04-16  Jan Oravec <jan.oravec@6com.sk>
2682             Raja R Harinath  <harinath@hurrynot.org>
2683
2684         Fix #379822
2685         * constant.cs (SideEffectConstant.value): Rename from 'left'.
2686         (SideEffectConstant.side_effect): Rename from 'right'.
2687         (SideEffectConstant..ctor): Normalize 'side_effect'.
2688         (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
2689         value of this constant.
2690         * cfold.cs: Update to changes.
2691
2692 2008-04-15  Marek Safar  <marek.safar@gmail.com>
2693
2694         * cs-paser.jay: Removed unused variable.
2695         
2696         * driver.cs: Made Compile instance method.
2697
2698 2008-04-15  Raja R Harinath  <harinath@hurrynot.org>
2699
2700         * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
2701
2702 2008-04-15  Marek Safar  <marek.safar@gmail.com>
2703
2704         * cs-paser.jay, namespace.cs: Simplified handling of namespace imports. 
2705
2706 2008-04-13  Jb Evain  <jbevain@novell.com>
2707
2708         * namespace.cs: update the System.Core fullname for 2.1
2709         * driver.cs: update the list of required assemblies for 2.1.
2710         Merged from the Moonlight 2 branch.
2711
2712 2008-04-11  Marek Safar  <marek.safar@gmail.com>
2713
2714         * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
2715         types and user defined operators. User operators arguments has to be checked
2716         for null value before invocation, which also means no operator is called
2717         when any argument is not convertible to unwrapped nullable type.
2718         
2719 2008-04-09  Marek Safar  <marek.safar@gmail.com>
2720
2721         * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
2722         of Unary expressions to follow operator overloading rules precisely.
2723         Also fixes #321794, #323794
2724         
2725 2008-04-08  Marek Safar  <marek.safar@gmail.com>
2726
2727         * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
2728         expression.
2729         
2730 2008-04-08  Marek Safar  <marek.safar@gmail.com>
2731
2732         * expression.cs, ecore.cs: Implemented MemberInit expression.
2733         
2734 2008-04-08  Raja R Harinath  <harinath@hurrynot.org>
2735
2736         Fix mono/tests/exception4.cs
2737         * statement.cs (ExceptionStatement, TryCatch): Revert to using
2738         ec.NeedReturnLabel () rather emitting a 'nop'.
2739
2740         * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
2741         simple heuristic.
2742         (TryCatch.SomeCodeFollows): Likewise.
2743         * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
2744         for 'break', 'continue' and 'return' statements inside a try.
2745         We're fairly sure that the generated IL stream will have more
2746         instructions textually following the try.
2747         (FlowBranchingTryCatch): Likewise.
2748
2749         * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
2750         * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
2751         overrides.
2752
2753         * statement.cs (CollectionForeach.DisposableWrapper): Make a true
2754         wrapper -- forward everything to CollectionForeach.
2755         (CollectionForeach.NonDisposableWrapper): New.
2756         (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
2757         instead of a pop + branch to end.
2758
2759 2008-04-07  Marek Safar  <marek.safar@gmail.com>
2760
2761         A fix for bug #377485
2762         * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs: 
2763         Propagate location for extension method groups. Report conversion failure at
2764         right place.
2765
2766 2008-04-07  Marek Safar  <marek.safar@gmail.com>
2767
2768         * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
2769         ListInit and Field expressions.
2770
2771 2008-04-06  Raja R Harinath  <harinath@hurrynot.org>
2772
2773         * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
2774         Since $PC is always -1 inside the body of MoveNext, the fault
2775         handler is a no-op.
2776         * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
2777         * statement.cs (ExceptionStatement.emit_finally): Likewise.
2778         (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
2779
2780         The denouement!  Fix #324708
2781         * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
2782         (Iterator.EmitYieldBreak): We no longer need to reset $PC.
2783         * statement.cs (ExceptionStatement.DoEmit): Actually emit the
2784         'finally' inside the finally clause.
2785
2786         * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
2787         inside an iterator.  Don't emit the body of the 'finally' inside
2788         the finally clause yet.
2789
2790         Use the ResumableStatement infrastructure for MoveNext ()
2791         * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
2792         (Iterator.EmitMoveNext): Use 'resume_points'.  Get rid of
2793         'old_resume_points'.  Move dispatcher upfront.
2794         (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
2795         * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
2796         in an enumerator.  This encodes the main fix in this patch series
2797         -- we can only jump into the first instruction of a try from the
2798         outside, but we want to emit try/finally regions in iterators and
2799         resume in the middle of them.
2800
2801 2008-04-05  Raja R Harinath  <harinath@hurrynot.org>
2802
2803         * statement.cs (ExceptionStatement.ResolveFinally): Move setting
2804         of NeedReturnLabel here.
2805
2806         Introduce a common point for emitting try/finally to IL
2807         * statement.cs (ExceptionStatement.DoEmit): New.  Combines all the
2808         features of the various subclasses, which are now driven by ...
2809         (ExceptionStatement.EmitPreTryBody): ... this and ...
2810         (ExceptionStatement.EmitTryBody): ... this and the original
2811         EmitFinallyBody.
2812         (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
2813         Remove DoEmit and update to follow above protocol.
2814
2815         * statement.cs (ExceptionStatement.EmitForDispose): If all labels
2816         of the dispatcher are the same, skip emitting the 'switch'.
2817         * iterator.cs (Iterator.EmitDispose): Update to changes.
2818
2819         Clean up handling of 'using' statement
2820         * statement.cs (UsingTemporary): New.  Carved out of ...
2821         (Using): ... this.  Simplify drastically.  Handle exactly
2822         one variable.
2823         * cs-parser.jay (using_statement): Split.  Create UsingTemporary
2824         or Using as appropriate.  If there are multiple variable declared,
2825         create nested Using statements.
2826         (resource_acquisition): Kill.
2827
2828         * statement.cs (ExceptionStatement.EmitForDispose): Use
2829         EmitFinallyBody, not EmitFinally.
2830
2831         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
2832         * iterator.cs: Update to changes.
2833
2834         Start using the ResumableStatement infrastructure
2835         * statement.cs (ResumeableStatement.PrepareForDispose): New.
2836         (ResumableStatement.EmitForDispose): New.
2837         (ExceptionStatement): Override them.
2838         * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
2839         EmitForDispose to create the body of the Dispose method.  Don't
2840         use OldResumePoint.
2841
2842         * iterator.cs (Iterator.AddResumePoint): Move here from ...
2843         * statement.cs (Toplevel.AddResumePoint): ... here.
2844         (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
2845         * flowanalysis.cs (FlowBranchingIterator): New.
2846         * codegen.cs (EmitContext): Update to changes.
2847
2848         * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
2849         (Iterator.old_resume_points): Rename from 'resume_points'.
2850         (Iterator.MoveNextStatement): Remove unused class.
2851
2852         New infrastructure for try/finally in iterators (still unused)
2853         * flowanalysis.cs (FlowBranching.AddResumePoint): New.
2854         (FlowBranchingToplevel.AddResumePoint): Hook into
2855         ToplevelBlock.AddResumePoint.
2856         (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
2857         (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
2858         * statement.cs (ToplevelBlock.AddResumePoint): New.  Collect
2859         resume points and assign program-counter values.
2860         (ExceptionBlock.AddResumePoint): Collect resume points for
2861         de-muxer at the top of try block.
2862         * iterators.cs (Yield.CheckContext): Simplify.
2863         (Yield.Resolve): Use FlowBranching.AddResumePoint.
2864
2865 2008-04-04  Raja R Harinath  <harinath@hurrynot.org>
2866
2867         * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
2868         argument to an ExitStatement.
2869         (FlowBranchingException): Refactor saved origins code.
2870         * statement.cs (ExitStatement): Update to cahges.
2871         * iterator.cs (YieldBreak): Likewise.
2872
2873         * statement.cs (ResumableStatement): New.  Common base class for
2874         YieldReturn and ExceptionStatement.
2875         (ExitStatement): New.  Common base class for Return and YieldBreak.
2876         (Return): Update to changes.
2877         * iterator.cs (YieldBreak): Likewise.
2878         * lambda.cs (ContextualReturn): Likewise.
2879
2880         Fix #377028
2881         * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
2882         emit a meaningful error message.
2883
2884         Fix #324765, #319508
2885         * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
2886         (VariableInfo.SetAssigned): Set it.
2887         * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
2888         determine if CS0219 or CS0168 is appropriate.  Don't use
2889         flow-analysis information.
2890         (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
2891         * codegen.cs (EmitContext.DoEndFlowBranching): Kill.  Inline into ...
2892         (EmitContext.EndFlowBranching): ... this.
2893
2894 2008-04-03  Marek Safar  <marek.safar@gmail.com>
2895
2896         * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
2897
2898 2008-04-03  Marek Safar  <marek.safar@gmail.com>
2899
2900         A fix for bug #376508
2901         * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
2902         ImplicitConversionExists.
2903
2904 2008-04-03  Marek Safar  <marek.safar@gmail.com>
2905
2906         * expression.cs (Binary): Added remaining binary operators to expression
2907         tree builder.
2908
2909         * nullable.cs: Optimize shift with null argument.
2910
2911 2008-04-03  Raja R Harinath  <harinath@hurrynot.org>
2912
2913         Fix minor IL regression
2914         * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
2915         (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
2916         * cs-parser.jay (try_statement): Update to changes.
2917
2918         * statement.cs (TryFinally.need_exc_block): Delete.
2919         (TryFinally): Update to changes.
2920
2921         Now all ExceptionStatements are unconditional
2922         * statement.cs (CollectionForeach.DisposableWrapper): New.
2923         Extract out the try/finally code into a new wrapper.
2924         (CollectionForeach.Resolve): Use it to simplify the code.
2925
2926 2008-04-02  Raja R Harinath  <harinath@hurrynot.org>
2927
2928         Start at simplifying ExceptionStatement semantics a bit
2929         * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
2930         * cs-parser.jay (try_statement): Update to changes.
2931         (opt_catch_clauses): Remove.
2932         * flowanalysis.cs: Update to changes.
2933         (FlowBranching.BranchingType.TryCatch): New.
2934         (FlowBranchingTryCatch): New.
2935
2936         * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
2937         (FlowBranching.CreateBranching): Update to changes.
2938         (FlowBranchingBlock.AddSibling): Add sanity check.
2939         * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
2940         Update to changes.
2941
2942         * iterators.cs (Iterator.MarkFinally): Remove.
2943         * statement.cs (ExceptionStatement): Update to changes.
2944
2945         Add support for skipping over finally blocks at runtime.  First
2946         in a series to fix #324708
2947         * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
2948         (Iterator.EmitMoveNext): Initialize it.
2949         * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
2950         branch over the body of the 'finally' clause.
2951
2952 2008-03-31  Raja R Harinath  <harinath@hurrynot.org>
2953
2954         Avoid lopsided use of Foo/DoFoo names
2955         * statement.cs (ExpressionStatement.EmitFinallyBody):
2956         Rename from EmitFinally.
2957         (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
2958         * iterator.cs: Update to changes.
2959
2960 2008-04-02  Marek Safar  <marek.safar@gmail.com>
2961
2962         * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
2963         based on UserOperatorCall. More binary nullable operators clean up.
2964
2965 2008-04-02  Martin Baulig  <martin@ximian.com>
2966
2967         * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
2968
2969 2008-04-02  Marek Safar  <marek.safar@gmail.com>
2970
2971         * nullable.cs: Merge user and empty conversions when lifting expression
2972         trees.
2973         
2974         * expression.cs (StringConcat): Implemented expression tree representation.
2975
2976 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2977
2978         * nullable.cs: When lifting null literal and a user operator exists, no call 
2979         is made.
2980         
2981 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2982
2983         * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
2984         null.
2985
2986 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2987
2988         * nullable.cs, expression.cs: Use namespace instead heavily nested
2989         monster abstract class.
2990
2991 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2992
2993         * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
2994         lifting of null literal and user operators. Clean up of some temporary
2995         nullable hacks.
2996
2997 2008-03-30  Raja R Harinath  <harinath@hurrynot.org>
2998
2999         Fix #368224, test-629.cs
3000         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
3001         if it crossed an unwind-protect boundary.
3002         * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
3003         (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
3004         inside an unwind-protected region.
3005         (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
3006         (Iterator.MarkYield): Add 'unwind_protect' parameter.  Emit a
3007         'leave' instead of a 'br' if unwind-protected.
3008         (Iterator.EmitYieldBreak): Likewise.
3009
3010 2008-03-29  Gert Driesen  <drieseng@users.sourceforge.net>
3011
3012         * driver.cs: Only define versioninfo resources if no win32 resource
3013         file was specified.
3014
3015 2008-03-28  Marek Safar  <marek.safar@gmail.com>
3016
3017         A fix for bug #372375
3018         * convert.cs: Fixed boxing of nullable types.
3019
3020 2008-03-28  Marek Safar  <marek.safar@gmail.com>
3021
3022         * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
3023         type.
3024
3025 2008-03-28  Marek Safar  <marek.safar@gmail.com>
3026
3027         A fix for bug #374619
3028         * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
3029         
3030 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3031
3032         * lambda.cs: Check return type only for invocation.
3033         
3034 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3035
3036         A fix for bug #374214
3037         * ecore.cs: Correctly report argument type mismatch.
3038
3039 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3040
3041         * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
3042         and not rely on broken IsEnum.
3043
3044 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3045
3046         * nullable.cs: New file, extracted from generic.cs.
3047         
3048         * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
3049
3050 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3051
3052         * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
3053         predefined comparison operators and null literals.
3054         
3055         * report.cs: New warning ID.
3056         
3057 2008-03-25  Marek Safar  <marek.safar@gmail.com>
3058
3059         A fix for bug #370577
3060         * lambda.cs: Check return type too.
3061
3062 2008-03-25  Marek Safar  <marek.safar@gmail.com>
3063
3064         A fix for bug #372846
3065         * class.cs: Automatic properties can be declared as unsafe.
3066
3067 2008-03-20  Marek Safar  <marek.safar@gmail.com>
3068
3069         * location.cs: Use string based concatenation.
3070         
3071         * expression.cs: LiftedBinaryOperator is gmcs only.
3072         
3073 2008-03-20  Marek Safar  <marek.safar@gmail.com>
3074
3075         * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
3076         conversions rules and expression trees.
3077
3078 2008-03-19  Marek Safar  <marek.safar@gmail.com>
3079
3080         * delegate.cs: Use extension method source as delegate target.
3081
3082 2008-03-19  Marek Safar  <marek.safar@gmail.com>
3083
3084         * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
3085         binary operations to be purely based on binary operations and optimized
3086         emitted code (30% less in some cases). Introduced ReducedExpression for ETs
3087         and other ET refactoring.
3088         
3089         * typemanager.cs: Fixed warning.
3090         
3091 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3092
3093         * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
3094         
3095         * symbolwriter.cs: Fixed.
3096
3097 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3098
3099         * anonymous.cs, driver.cs: Reset anonymous types counters.
3100
3101 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3102
3103         * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
3104         
3105         * class.cs: Use fullname for all type member definitions.
3106         
3107 2008-02-19  Martin Baulig  <martin@ximian.com>
3108
3109         * class.cs
3110         (IMethodData.EmitExtraSymbolInfo): New interface method.
3111         (MethodData.Emit): Call method.EmitExtraSymbolInfo().
3112         (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
3113         interface method here as an empty public virtual method.
3114
3115         * anonymous.cs
3116         (AnonymousMethodMethod.ctor): Added `string real_name' argument.
3117         (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
3118         CodeGen.SymbolWriter.SetRealMethodName().       
3119
3120 2008-02-18  Martin Baulig  <martin@ximian.com>
3121
3122         * anonymous.cs
3123         (ScopeInfo.EmitType): Override this and emit debugging
3124         information for captured variables.
3125         (RootScopeInfo.EmitType): Override this and emit symbol
3126         information for a captured `this'.
3127
3128 2008-02-15  Martin Baulig  <martin@ximian.com>
3129
3130         * iterators.cs: Emit debugging info.
3131
3132         * codegen.cs
3133         (EmitContext.Flags): Add `OmitDebuggingInfo'.
3134         (EmitContext.OmitDebuggingInfo): New public property.
3135
3136         * statement.cs
3137         (While): Override Emit() and don't emit symbol info there; do it
3138         inside DoEmit() instead.
3139         (Block.Emit): Omit symbol information while emitting the scope
3140         initializers; don't ec.Mark() the `EndLocation'.  Fix the lexical
3141         block logic.
3142         (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
3143         (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
3144         .ctor to make `IsIterator' work.
3145
3146 2008-03-14  Martin Baulig  <martin@ximian.com>
3147
3148         * symbolwriter.cs: Added the new symbol writer function from the
3149         debugger's `terrania' branch; temporarily enclose them inside
3150         `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
3151         my vacations.
3152
3153 2008-03-14  Martin Baulig  <martin@ximian.com>
3154
3155         * symbolwriter.cs
3156         (SymbolWriter): Make this a public static class.
3157
3158         * codegen.cs
3159         (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
3160         class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
3161
3162 2008-03-14  Marek Safar  <marek.safar@gmail.com>
3163
3164         A fix for bug #370577
3165         * statement.cs, lambda.cs: Added extra limitations when dealing with void
3166         return type.
3167         
3168 2008-03-14  Marek Safar  <marek.safar@gmail.com>
3169
3170         * typemanager.cs (CSharpName): Made 250 times faster.
3171
3172 2008-03-13  Marek Safar  <marek.safar@gmail.com>
3173
3174         * ecore.cs, expression.cs: Emit conversion for ET shift argument.
3175         
3176 2008-03-12  Marek Safar  <marek.safar@gmail.com>
3177
3178         * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
3179         crash when predefined field does not exist.
3180         
3181 2008-03-12  Marek Safar  <marek.safar@gmail.com>
3182
3183         * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
3184         
3185 2008-03-12  Marek Safar  <marek.safar@gmail.com>
3186
3187         * class.cs (FixedField): Don't crash when contructors are missing.
3188
3189 2008-03-11  Marek Safar  <marek.safar@gmail.com>
3190
3191         * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
3192         convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
3193         check internal types accessibility for internal and external types.
3194         Replaced EnumToUnderlying by GetEnumUnderlyingType.
3195
3196 2008-03-11  Marek Safar  <marek.safar@gmail.com>
3197
3198         * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
3199         convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
3200         attribute.cs, statement: Use corect instance of predefined types (work
3201         related to #364674).
3202
3203 2008-03-07  Marek Safar  <marek.safar@gmail.com>
3204
3205         * expression.cs (TypeOfVoid): Fixed predefined method initialization.
3206         
3207 2008-03-07  Marek Safar  <marek.safar@gmail.com>
3208
3209         * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, 
3210         class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
3211         expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
3212         predefined types clean up, delayed predefined types members initialization
3213         (work related to #364674).
3214
3215 2008-03-05  Marek Safar  <marek.safar@gmail.com>
3216
3217         * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
3218         
3219 2008-03-05  Marek Safar  <marek.safar@gmail.com>
3220
3221         * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
3222         delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
3223         predefined types clean up (work related to #364674).
3224
3225 2008-03-04  Marek Safar  <marek.safar@gmail.com>
3226
3227         * ecore.cs: Print an error message instead of throwing exception.
3228         
3229 2008-03-04  Marek Safar  <marek.safar@gmail.com>
3230
3231         * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
3232         expression.cs, statement.cs: Unififed null literal representation.
3233
3234 2008-03-03  Marek Safar  <marek.safar@gmail.com>
3235
3236         * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
3237         expression.cs: Refactored binary operators resolve phase and improved speed.
3238         The nullable code is still missing and won't work correctly, more fixes
3239         required.
3240
3241         It also fixes #323726, #324312, #324248, and many other unreported issues.
3242
3243 2008-02-29  Zoltan Varga  <vargaz@gmail.com>
3244
3245         * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs' 
3246         instead of 'gmcs'.
3247
3248 2008-02-27  Marek Safar  <marek.safar@gmail.com>
3249
3250         * ecore.cs: Clean-up and split BetterConversion.
3251         
3252 2008-02-25  Raja R Harinath  <harinath@hurrynot.org>
3253
3254         Fix #363791
3255         * enum.cs (EnumMember.Value): Only access 'value' if
3256         ResolveValue says it's ok.
3257         (EnumMember.DoResolveValue): Don't set prev_member.value.
3258         (Enum.GetDefinition): Reverse arguments of Equals --
3259         EnumMember.Value can return 'null'.
3260
3261         * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
3262
3263 2008-02-22  Marek Safar  <marek.safar@gmail.com>
3264
3265         * generic.cs, expression.cs: More ongoing work on expression trees.
3266         
3267 2008-02-21  Marek Safar  <marek.safar@gmail.com>
3268
3269         * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
3270         handle missing matches when mutiple operators exist.
3271         
3272 2008-02-20  Marek Safar  <marek.safar@gmail.com>
3273
3274         A fix for bug #363218
3275         * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
3276         initializers.
3277         
3278 2008-02-20  Marek Safar  <marek.safar@gmail.com>
3279
3280         * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
3281         update. This time to deal correctly with SideEffectConstant expression used
3282         as an argument for another constant folding.
3283
3284 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
3285
3286         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
3287         MethodBuilder.
3288
3289 2008-02-19  Marek Safar  <marek.safar@gmail.com>
3290
3291         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
3292
3293 2008-02-19  Marek Safar  <marek.safar@gmail.com>
3294
3295         A fix for bug #328136
3296         * expression.cs: Do not fold immediately LogicalAnd operators when the left
3297         side is a false constant, because we still need to evaluate the right-hand
3298         side.
3299
3300         * statement.cs (If): Emit two types of boolean constants (simple constant,
3301         side-effect constant).
3302
3303 2008-02-19  Marek Safar  <marek.safar@gmail.com>
3304
3305         * constant.cs (SideEffectConstant): Don't emit boolean constant.
3306
3307         * expression.cs: Fold immediately LogicalAnd operators when both sides are
3308         constants.
3309
3310 2008-02-18  Marek Safar  <marek.safar@gmail.com>
3311
3312         A fix for bug #361457
3313         * ecore.cs (IsApplicable): Params methods have lower priority.
3314
3315         * support.cs: Return correct parameter modifier for params types.
3316
3317 2008-02-18  Marek Safar  <marek.safar@gmail.com>
3318
3319         * generic.cs (TypeParameter): Cache attribute target name.
3320
3321         * support.cs: Removed unused variable.
3322
3323         * typemanager.cs: Removed debugging leftover.
3324
3325         * ecore.cs: Use local type instead of a property;
3326
3327         * class.cs (VerifyMembers): Consider also parent to test whether type member
3328         is local or public.
3329
3330         * expression.cs (FullMethodDesc): Removed.
3331
3332         * attribute.cs (IsValidArgumentType): Made static.
3333
3334 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
3335
3336         Cleanup to be more readable.
3337         * Makefile (GMCS_PROFILE): Remove.
3338         (COMPILER_NAME): New helper.
3339
3340 2008-02-15  Miguel de Icaza  <miguel@novell.com>
3341
3342         * cs-tokenizer.cs: if a conditional expression happens inside a
3343         (...) this also means that we do not need to de-ambiguate between
3344         an parenthesized expression and a cast.
3345
3346         Fixes 346484.
3347
3348         * constant.cs (SideEffectConstant): a constant value that happens
3349         to have a side effect.
3350
3351         Fixes the build regressions introduced by the fix for #359789
3352
3353 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
3354
3355         * expression.cs (Conditional.Emit): when emitting the ternary
3356         operator, use local variables to generate code verifiable code.
3357
3358         The verifier cannot infer that the type on stack before the
3359         stloc.0 is executed is of type ParentB. This happens because the
3360         stack merge algorithm uses only parent types when deciding which
3361         is the common type.  This is described in Part III 1.8.1.3 of ECMA
3362         335.
3363
3364         This code compiled with mcs is not verifiable under MS. The MS
3365         verifier picks the first common interface of Foo and Bar, which is
3366         wrong, but doesn't use a full join type of the 2 interfaces.
3367
3368         CSC uses a clever hack to compile such code in a verifiable
3369         way. It stores the intermediate values in a local variable with
3370         the expected type.
3371
3372         Fixes: #358102
3373
3374 2008-02-14  Miguel de Icaza  <miguel@novell.com>
3375
3376         * expression.cs: Do not fold BitwiseAnd operators when the left
3377         side is a false constant, because we still need to evaluate the
3378         right-hand side.
3379
3380         Fixes #359789
3381
3382         * support.cs: Instead of throwing an InternalErrorException when
3383         the position of the stream is outside the boundary of our buffer,
3384         reset the state of the reader, and restart the reading from the
3385         beginning of the file.
3386
3387 2008-02-14  Marek Safar  <marek.safar@gmail.com>
3388
3389         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
3390
3391 2008-02-14  Marek Safar  <marek.safar@gmail.com>
3392
3393         A fix for bug #361686
3394         * decl.cs: A protected types used inside a private class which parents
3395         derives from the protected class are accessible.
3396
3397 2008-02-13  Marek Safar  <marek.safar@gmail.com>
3398
3399         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
3400         the parameterless constructor.
3401
3402 2008-02-13  Marek Safar  <marek.safar@gmail.com>
3403
3404         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
3405         lookup methods to use standard member cache when doing member lookup.
3406
3407 2008-02-12  Marek Safar  <marek.safar@gmail.com>
3408
3409         * driver.cs: Don't report full path for referenced module as assembly error.
3410
3411 2008-02-12  Marek Safar  <marek.safar@gmail.com>
3412
3413         * Makefile: Fixed `qh' target to work on all machines.
3414
3415         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
3416         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
3417         and HasElementType with TypeManager implementation.
3418
3419 2008-02-08  Marek Safar  <marek.safar@gmail.com>
3420
3421         A fix for bugs #325134, #359749
3422         * expression.cs, ecore.cs: Try to resolve an extension method even if the
3423         first binds point to non-method member expression.
3424
3425 2008-02-08  Marek Safar  <marek.safar@gmail.com>
3426
3427         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
3428
3429 2008-02-08  Marek Safar  <marek.safar@gmail.com>
3430
3431         A fix for bugs #321394, #323028
3432         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
3433         Reworked naive IsAccessibleAs implementation to handle nested types.
3434
3435 2008-02-05  Jb Evain  <jbevain@novell.com>
3436
3437         * class.cs: use generic type comparison for parameters
3438         as well.
3439
3440 2008-02-05  Marek Safar  <marek.safar@gmail.com>
3441
3442         A fix for bug #325372
3443         * class.cs: Use generic type comparison when testing method signatures.
3444
3445 2008-02-05  Marek Safar  <marek.safar@gmail.com>
3446
3447         A fix for bug #357047
3448         * ecore.cs: Applied C# 3.0 changes to better conversion.
3449
3450 2008-02-05  Marek Safar  <marek.safar@gmail.com>
3451
3452         A fix for bug #358374
3453         * cs-parser.jay: Correctly set modifiers for all constructor types.
3454
3455 2008-02-04  Marek Safar  <marek.safar@gmail.com>
3456
3457         A fix for bug #355251
3458         * generic.cs: Added base class constraint based type inference.
3459
3460 2008-02-01  Marek Safar  <marek.safar@gmail.com>
3461
3462         A fix for bug #357255
3463         * decl.cs: One more missing visibility check.
3464
3465 2008-02-01  Marek Safar  <marek.safar@gmail.com>
3466
3467         * support.cs: Fixed broken return.
3468
3469 2008-01-25  Marek Safar  <marek.safar@gmail.com>
3470
3471         * report.cs: Correctly reset warnings count after probing.
3472
3473 2008-01-25  Martin Baulig  <martin@ximian.com>
3474
3475         * namespace.cs
3476         (NamespaceEntry.SymbolFileID): Make this work again after
3477         MemberName.ToString() is gone.
3478
3479 2008-01-25  Marek Safar  <marek.safar@gmail.com>
3480
3481         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
3482         expressions.
3483
3484 2008-01-25  Marek Safar  <marek.safar@gmail.com>
3485
3486         * generic.cs: Use full implicit conversion for type inference fixing.
3487
3488 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3489
3490         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
3491         Fixed user operator conversions.
3492
3493 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3494
3495         * generic.cs: Do nullable type to null comparison optimization during
3496         resolve phase.
3497
3498 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3499
3500         A fix for bug #355163
3501         * generic.cs: Enabled l-value resolve on nullable expressions.
3502
3503 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3504
3505         A fix for bug #353986
3506         * class.cs: Ingore static ctors with parameters for any further checks.
3507
3508 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3509
3510         A fix for bug #354310
3511         * namespace.cs: Removed redundant check.
3512
3513 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3514
3515         A fix for bug #354928
3516         * expression.cs: ElementInitializers can be resolved only once.
3517
3518 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3519
3520         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
3521         Condition expressions.
3522
3523 2008-01-23  Marek Safar  <marek.safar@gmail.com>
3524
3525         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
3526
3527 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3528
3529         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
3530         not allowed.
3531
3532         * generic.cs: Implemented coalesce expression.
3533
3534 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3535
3536         A fix for bug #355145
3537         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
3538         expression tree type inference.
3539
3540 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
3541
3542         Fix #354663
3543         * expression.cs (Binary.IsUnsignedType): Fix typo.
3544
3545 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3546
3547         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
3548
3549 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3550
3551         A fix for bug #355161
3552         * ecore.cs, expression.cs: Wider range of extension method supported
3553         expressions.
3554
3555 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
3556
3557         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
3558         AssemblyBuilder to operate in compiler context. Fixes mcs part of
3559         bug #354970.
3560
3561 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3562
3563         A fix for bug #355148
3564         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
3565
3566 2008-01-22  Miguel de Icaza  <miguel@novell.com>
3567
3568         * expression.cs (CreateExpressionTree): Add support for or and
3569         logical or, and indent following the coding conventions.
3570
3571         * typemanager.cs (LinqExpression): renamed from
3572         ExpressionTreeManager, for a shorter name.
3573
3574         Use TypeManager.CoreLookupType to lookup types from our core
3575         assemblies and turn those into "Type" variables.
3576
3577         Consumers that previously used "Namespace" and "Type" from this
3578         class should instead use the TypeExpression which is a type that
3579         is fully resolved (without involving the regular C# resolution
3580         rules). 
3581
3582         This typically looks like this:
3583
3584         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
3585         new MemberAccess (texpr, name, type_arguments, loc)
3586
3587         This avoids the problem in: #355178
3588
3589 2008-01-21  Marek Safar  <marek.safar@gmail.com>
3590
3591         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
3592         feature in parser only as we do in other cases.
3593         
3594 2008-01-21  Marek Safar  <marek.safar@gmail.com>
3595
3596         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
3597         typemanager.cs: A refactoring of params arguments to reuse existing
3598         expressions (params -> array initializer) to emit params argument instead
3599         of specialized handling.
3600         It was required by expression tree implementation and it has other benefits
3601         as well, we now apply same optimization for params arguments as we do for
3602         array initializers.
3603         
3604 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3605
3606         A fix for bug #353526
3607         * generic.cs: A type inference of params arguments may not required any
3608         temporary array creation.
3609         
3610 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3611
3612         A fix for bug #353534
3613         * generic.cs, ecore.cs, expression.cs: A method group type inference is
3614         supported for delegates only.
3615         
3616 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3617
3618         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
3619         type for more than 1 candidates.
3620         
3621 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3622
3623         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
3624         expressions.
3625         
3626 2008-01-16  Marek Safar  <marek.safar@gmail.com>
3627
3628         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
3629         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
3630         operator) expressions. 
3631                 
3632 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
3633
3634         * statement.cs: Avoid declaring an IL variable for this_variable since it is
3635         not accessed from the generated IL.
3636
3637 2008-01-14  Marek Safar  <marek.safar@gmail.com>
3638
3639         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
3640         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
3641         statement.cs: The first expression tree implementation drop, mostly
3642         infrastructure work.
3643
3644 2008-01-14  Marek Safar  <marek.safar@gmail.com>
3645
3646         * ecore.cs (IsNestedChild): Refactored.
3647
3648 2008-01-11  Marek Safar  <marek.safar@gmail.com>
3649
3650         * lambda.cs: Don't use a cast on unknown expression statement.
3651
3652 2008-01-10  Geoff Norton  <gnorton@novell.com>
3653
3654         * cs-tokenizer.cs: One more token to distinguish between method and lambda
3655         arguments
3656
3657 2008-01-09  Marek Safar  <marek.safar@gmail.com>
3658
3659         * doc.cs: Report better /doc crash details.
3660         
3661 2008-01-09  Marek Safar  <marek.safar@gmail.com>
3662
3663         A fix for bug #352536
3664         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
3665
3666 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3667
3668         A fix for bug #352287
3669         * ecore.cs, expression.cs: Do `this' access checking in all member access
3670         expressions.
3671         
3672 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3673
3674         * rootcontext.cs, driver.cs: Switch to linq mode by default.
3675         
3676         * report.cs: Reset message stacks.
3677         
3678 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3679
3680         * generic.cs (InferInPhases): Correctly calculate params position.
3681         
3682 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3683
3684         * cs-tokenizer.cs: No need to parse full string when parsing lambda
3685         arguments.
3686
3687 2008-01-07  Marek Safar  <marek.safar@gmail.com>
3688
3689         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
3690         
3691         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
3692         
3693         * driver.cs: Updated --help option.
3694         
3695 2008-01-07  Marek Safar  <marek.safar@gmail.com>
3696
3697         * generic.cs (InferParamsTypeArguments): Removed.
3698         (InferInPhases): Add params type inference.
3699         (LowerBoundInference): Fixed scoring mechanism.
3700         
3701         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
3702         
3703 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
3704
3705         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
3706         byte array for unsigned "baked" assemblies.
3707
3708 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
3709
3710         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
3711         array for assemblies that are not strongnamed.
3712
3713 2008-01-04  Marek Safar  <marek.safar@gmail.com>
3714
3715         A fix for bug #351481
3716         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
3717         declaring type for nested generic types.
3718         
3719 2008-01-04  Marek Safar  <marek.safar@gmail.com>
3720
3721         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
3722         instead of ToString.
3723         
3724 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3725
3726         A fix for bug #351047
3727         * expression.cs (Binary.ResolveOperator): Allow equality operators between
3728         null and structs only when equality and inequality operators are defined
3729         either as an user-operators or predefined operators.
3730         
3731 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3732
3733         A fix for bug #351047
3734         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
3735         
3736 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3737
3738         A fix for bug #351257
3739         * cs-tokenizer.cs: Advance line number for '\r' correctly.
3740         
3741 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3742
3743         A fix for bug #351157
3744         * class.cs (Using): Fixed yet another broken cloning.
3745         
3746         (Block): Put back more sensible default value for statements.
3747         
3748 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
3749
3750         * codegen.cs: Allow AssemblyVersion with only major version component.
3751         Fixes bug #351055.
3752
3753 2007-12-29  Marek Safar  <marek.safar@gmail.com>
3754
3755         A fix for bug #324654
3756         * class.cs: Use FullName property as member name.
3757
3758 2007-12-28  Marek Safar  <marek.safar@gmail.com>
3759
3760         A fix for bug #342117
3761         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
3762         constructor constraint.
3763
3764 2007-12-28  Marek Safar  <marek.safar@gmail.com>
3765
3766         A fix for bug #338273
3767         * class.cs (ProbertyBase): Access modifier checks are required for overrides
3768         only.
3769
3770 2007-12-28  Marek Safar  <marek.safar@gmail.com>
3771
3772         A fix for bug #350839
3773         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
3774
3775 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
3776
3777         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3778         GHOP:
3779         
3780         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
3781
3782         * statement.cs: Changed some Hashtables to use HybridDictionaries
3783         instead. It was observed that some HashTables only contained a few
3784         items in the vast majority of cases. Since HybridDictionary is
3785         more efficient on small sets (<10 elements), "known_variables"
3786         from class ExplicitBlock as well as "labels" and "constants " from
3787         class Block were changed to HybridDictionaries. 
3788
3789         Atsai results: (56216kb->54987kb)
3790
3791         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
3792
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         * expression.cs: foreach loop to for loop, saved on allocation of
3802         enumerator (59333kb->59141kb)
3803
3804         * statement.cs. Changed foreach loops to for loops, saved on
3805         allocation of enumerator (59141kb->59006kb)
3806
3807         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
3808         when constructed with no specified capacity. This was causing a
3809         few ArrayLists to allocate more memory than they would potentially
3810         need in the Block class and MemberCache class. Setting the
3811         ArrayLists to construct with a capacity of 1 saves some
3812         memory. (56216kb->55585kb)
3813
3814 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3815
3816         A fix for bug #347189 (2nd issue)
3817         * expression.cs (MemberAccess): Nested type can be found in base non-generic
3818         type.
3819
3820 2007-12-27  Miguel de Icaza  <miguel@novell.com>
3821         
3822         * report.cs: Do not use colors if stdout and stderr are not a
3823         terminal.
3824
3825 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3826
3827         A fix for bug #346998
3828         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
3829         overloads.
3830
3831 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3832
3833         A fix for bug #343465
3834         * class.cs: Explicit method name for nested types uses dots only.
3835
3836 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3837
3838         A fix for bug #343707
3839         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
3840
3841 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3842
3843         * ecore.cs: Report type inference errors only when arguments count matches
3844         parameter count.
3845         
3846         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
3847         
3848         * expression.cs, report.cs: New warning.
3849         
3850         * typemanager.cs: Catch anonymous method type too.
3851
3852 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3853
3854         A fix for bug #346379
3855         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
3856
3857 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3858
3859         A fix for bug #347359
3860         * expression.cs (Invocation): Don't resolve already resolved expression.
3861
3862 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3863
3864         A fix for bug #347189
3865         * class.cs (FixedField): Use non-dependent code only in the define phase.
3866
3867 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3868
3869         A fix for bug #348076
3870         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
3871
3872 2007-12-22  Marek Safar  <marek.safar@gmail.com>
3873
3874         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
3875         discovered extension methods.
3876
3877 2007-12-22  Marek Safar  <marek.safar@gmail.com>
3878
3879         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
3880         method.
3881
3882 2007-12-21  Miguel de Icaza  <miguel@novell.com>
3883
3884         * report.cs (ErrorMessage): Add support for using colors on
3885         terminals that support it. 
3886
3887 2007-12-21  Marek Safar  <marek.safar@gmail.com>
3888
3889         * ecore.cs: Use information about expanded params for error reporting.
3890
3891 2007-12-21  Marek Safar  <marek.safar@gmail.com>
3892
3893         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
3894         and logic for params overloads.
3895         
3896 2007-12-15  Miguel de Icaza  <miguel@novell.com>
3897
3898         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
3899         as this is also created from the parser.  Fixes #349034
3900
3901 2007-12-12  Miguel de Icaza  <miguel@novell.com>
3902
3903         * statement.cs (Throw.CloneTo): it is valid to have empty
3904         expressions for throw. 
3905
3906 2007-12-03  Marek Safar  <marek.safar@gmail.com>
3907
3908         * cs-parser.jay: Set delegate constraint parsing region correctly.
3909
3910 2007-12-03  Marek Safar  <marek.safar@gmail.com>
3911
3912         A fix for bug #345467
3913         * typemanager.cs (IsEqual): Compare generic parameters position only.
3914         
3915 2007-11-28  Marek Safar  <marek.safar@gmail.com>
3916
3917         * expression.cs (BaseAccess): Type arguments can be null.
3918
3919 2007-11-27  Raja R Harinath  <harinath@gmail.com>
3920
3921         * statement.cs (Block.Resolve): Ensure flow-branching tree is
3922         consistent even when an error has occured.
3923         (Switch.Resolve): Likewise.
3924
3925 2007-11-22  Marek Safar  <marek.safar@gmail.com>
3926
3927         A fix for bug #334505
3928         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
3929         overrides.
3930         
3931 2007-11-22  Marek Safar  <marek.safar@gmail.com>
3932
3933         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
3934         refactorings required to resolve extension methods correctly when mixing
3935         generics and non-generics members.
3936         
3937 2007-11-20  Marek Safar  <marek.safar@gmail.com>
3938
3939         A fix for bug #342584
3940         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
3941         conversion.
3942         
3943 2007-11-19  Marek Safar  <marek.safar@gmail.com>
3944
3945         A fix for bug #342512
3946         * delegate.cs: Use delegate argument expression when is available. Don't
3947         emit virtual call when class is sealed.
3948         
3949 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3950
3951         A fix for bug #325423
3952         * assign.cs (FieldInitializer): Use resolved expression for emit.
3953         
3954         * class.cs: Print less confusing error message.
3955         
3956 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3957
3958         * cs-tokenizer.cs: Removed GMCS ifdefs.
3959         
3960         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
3961         mcs.
3962         
3963         * cs-parser.jay: Disabled nullable check.
3964         
3965         * generic-mcs: Copied more generic stuff.
3966                 
3967 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3968
3969         * gcs-parser.jay: Merged to cs-parser.jay.
3970         
3971         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
3972         * *.csproj, *.sources: Updated to use only jay parser file.
3973
3974 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3975
3976         * gcs-parser.jay: Added nullable and default expression feature checks.
3977         
3978 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3979
3980         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
3981         it fixes many TODOs and hidden bugs.
3982         
3983         * expression: Removed duplicate error check.
3984
3985 2007-11-15  Marek Safar  <marek.safar@gmail.com>
3986
3987         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
3988         implicitly type local variable only when it is used in a declaration.
3989
3990 2007-11-15  Marek Safar  <marek.safar@gmail.com>
3991
3992         * attribute.cs: Use CS0612 for empty strings.
3993
3994 2007-11-14  Marek Safar  <marek.safar@gmail.com>
3995
3996         * lambda.cs, statement.cs: Contextual return may act as a statement.
3997
3998 2007-11-14  Marek Safar  <marek.safar@gmail.com>
3999
4000         A fix for a regression cause by #324222
4001         * class.cs: Don't report unused even when it implements an interface.
4002         
4003 2007-11-13  Marek Safar  <marek.safar@gmail.com>
4004
4005         A fix for bug #341205
4006         * ecore.cs, expression.cs: Method group expression cannot do static
4007         method access with an instance reference check before overloading takes
4008         a place.
4009         
4010 2007-11-13  Marek Safar  <marek.safar@gmail.com>
4011
4012         A fix for bug #325359
4013         * class.cs: Use predictable name for automatically generated property.
4014         
4015 2007-11-12  Marek Safar  <marek.safar@gmail.com>
4016
4017         A fix for bug #324996
4018         * expression.cs (Is): Handle case where D is nullable and T is not
4019         correctly.
4020         
4021         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
4022         
4023 2007-11-12  Marek Safar  <marek.safar@gmail.com>
4024
4025         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
4026         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
4027         Flush small error reporting changes.
4028         
4029 2007-11-09  Marek Safar  <marek.safar@gmail.com>
4030
4031         A fix for bug #324996
4032         * expression.cs: Rewrote Is expression implementation to work with
4033         generics, nullable types, anonymous method. A const result expression 
4034         uses existing infrastructure instead of custom not fully-featured one.
4035         
4036 2007-11-08  Marek Safar  <marek.safar@gmail.com>
4037
4038         A fix for bug #340202
4039         * class.cs: Consider generics for volatile field.
4040
4041 2007-11-08  Marek Safar  <marek.safar@gmail.com>
4042
4043         A fix for bug #335594
4044         * expression.cs: Use conversion rules when handling string addition.
4045         
4046 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4047
4048         A fix for bug #336651
4049         * expression.cs: Fixed a crash when probing is on.
4050         
4051 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4052
4053         A fix for bug #324242
4054         * covert.cs: Added a conversion from any nullable-type with an 
4055         underlying enum-type to the type System.Enum.
4056         
4057 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4058
4059         A fix for bug #324222
4060         * class.cs: Report all non-used event fields.
4061         
4062 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4063
4064         A fix for bug #325161
4065         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
4066         qualifier for generic types.
4067         
4068 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4069
4070         A fix for bug #322971
4071         * expression.cs, ecore.cs: Added intermediate result value check for
4072         indexers. 
4073         
4074 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4075
4076         A fix for bug #324754
4077         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
4078         when it was requested.
4079
4080 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4081
4082         A fix for bug #325101
4083         * expression.cs: Do type not value comparison for `is' expression.
4084
4085 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4086
4087         A fix for bug #320236
4088         * convert.cs: Don't apply user conversion on underlying target type.
4089
4090 2007-11-06  Marek Safar  <marek.safar@gmail.com>
4091
4092         * expression.cs: Don't use unresolved expression for error reporting.
4093  
4094 2007-11-06  Marek Safar  <marek.safar@gmail.com>
4095
4096         A fix for bugs #337712, #324490
4097         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
4098         overloading resolution too.
4099         
4100         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
4101         the process consistent and more robust.
4102         
4103         * expression.cs, linq.cs, report.cs: Update.
4104
4105 2007-11-02  Marek Safar  <marek.safar@gmail.com>
4106
4107         A fix for bug #332909
4108         * attribute.cs: Resolve attributes in correct context using error
4109         handling procedure.
4110         
4111         * rootcontext.cs: Define Obsolete attribute members as core members.
4112         
4113 2007-11-02  Marek Safar  <marek.safar@gmail.com>
4114
4115         * statement.cs: Removed unused methods.
4116         
4117 2007-10-31  Wade Berrier  <wberrier@novell.com>
4118
4119         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
4120         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
4121         during 'make dist')
4122
4123 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4124
4125         A fix for bug #338102
4126         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
4127         methods registered as non-generics.
4128         
4129 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4130
4131         A fix for bugs #337712, #324490
4132         * delegate.cs: Delegate covariance and contravariance is not allowed for
4133         value types.
4134         
4135 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4136
4137         A fix for bug #337719 
4138         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
4139         `from' keyword.
4140         
4141 2007-10-30  Marek Safar  <marek.safar@gmail.com>
4142  
4143         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
4144
4145 2007-10-29  Marek Safar  <marek.safar@gmail.com>
4146  
4147         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
4148         query expressions.
4149
4150 2007-10-29  Raja R Harinath  <rharinath@novell.com>
4151
4152         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
4153
4154 2007-10-29  Marek Safar  <marek.safar@gmail.com>
4155  
4156         A fix for bug #334652
4157         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
4158         extension methods when we have not found the best candidate in normal
4159         container.
4160
4161 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4162
4163         * AssemblyInfo.cs: Keep up-to-date.
4164
4165 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4166
4167         * Makefile: Fixed generics compiler name.
4168         
4169 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4170
4171         * lambda.test: removed, lambda parsing is done differently.
4172         
4173         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
4174
4175 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
4176
4177         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
4178
4179 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4180
4181         * Makefile, *.sources : All C# compilers are in mcs folder.
4182         
4183         * *.cs: Use existing 2_1 define for smcs.
4184
4185 2007-10-26  Marek Safar  <marek.safar@gmail.com>
4186
4187         A fix for bug #335847
4188         * assign.cs, expression.cs: Couple of changes to avoid creating a
4189         temporary variable for each object initializer assignment statement. It
4190         simplifies struct initialization too, otherwise two temporary variables
4191         would be required.
4192         Implemented optimization of redundant default element initializers.
4193         
4194 2007-10-25  Marek Safar  <marek.safar@gmail.com>
4195
4196         A fix for bug #336766
4197         * expression.cs (Class.CheckBase): Use generic name when method is
4198         generic.
4199         
4200 2007-10-25  Marek Safar  <marek.safar@gmail.com>
4201
4202         A fix for bug #334737
4203         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
4204         variable and not variable argument for prepared copies.
4205
4206 2007-10-24  Marek Safar  <marek.safar@gmail.com>
4207
4208         A fix for bug #325110
4209         * class.cs, expression.cs, attribute.cs: Use open generic method when
4210         checking conditional attribute.
4211         
4212 2007-10-24  Marek Safar  <marek.safar@gmail.com>
4213
4214         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
4215         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
4216         FeatureIsNotAvailable.
4217
4218 2007-10-24  Marek Safar  <marek.safar@gmail.com>
4219
4220         ** C# 3.0 Partial methods
4221         
4222         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
4223         methods support. Because of member cache issue with generics only
4224         non-generics partial methods are fully supported.
4225         
4226 2007-10-23  Marek Safar  <marek.safar@gmail.com>
4227         
4228         * class.cs, decl.cs: Rewrote member overloads check to cope with 
4229         generics and to use member cache for member checking. It also improves
4230         performance and fixes remaining overloads issues.
4231         
4232 2007-10-20  Marek Safar  <marek.safar@gmail.com>
4233         
4234         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
4235         roottypes.cs, typemanager.cs:
4236                 
4237         A member cache creation logic changed to add members immediately and
4238         not rely on fallback. The member cache is now only prefered way
4239         how to access and find type declaration members. It saves 5 MB of memory
4240         during MWF compilation and makes code ready for more optimizations and
4241         clean-ups, it's also a pre-requirement for partial methods.
4242         
4243 2007-10-18  Raja R Harinath  <harinath@gmail.com>
4244
4245         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
4246         handling for generic parameters.
4247
4248 2007-10-15  Marek Safar  <marek.safar@gmail.com>
4249         
4250         * class.cs (FixedField): Removed redundant volatile check.
4251         
4252 2007-10-15  Marek Safar  <marek.safar@gmail.com>
4253         
4254         * class.cs, decl.cs: Fixed overload members verification to do only one
4255         check per possible collision.
4256         
4257 2007-10-13  Marek Safar  <marek.safar@gmail.com>
4258         
4259         A fix for bug #325478
4260         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
4261         and create only one disposable flags container.
4262         
4263 2007-10-12  Marek Safar  <marek.safar@gmail.com>
4264         
4265         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
4266         * statement.cs (Fixed): Fixed variables cloning.
4267         
4268 2007-10-12  Marek Safar  <marek.safar@gmail.com>
4269         
4270         A fix for bug #333342
4271         * class.cs (EventField): Don't mark value type event as synchronized. 
4272         
4273 2007-10-12  Marek Safar  <marek.safar@gmail.com>
4274         
4275         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
4276         inference to identify best candidate method correctly.
4277         (ProperyExpr): A range variable is read only and cannot be modified.
4278         
4279 2007-10-11  Marek Safar  <marek.safar@gmail.com>
4280         
4281         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
4282         logic to identify best candidate method correctly.
4283         
4284 2007-10-11  Marek Safar  <marek.safar@gmail.com>
4285         
4286         * location.cs (Equals, GetHashCode): Removed.
4287         
4288 2007-10-11  Marek Safar  <marek.safar@gmail.com>
4289         
4290         * report.cs: Implemented message recorder. It is used mainly for lambda
4291         expressions to capture otherwise swallowed error messages.
4292         
4293         * anonymous.cs, lambda.cs.cs: Do full parameters check.
4294
4295         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
4296         and not at the top.
4297         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
4298                 
4299         * expression.cs (MemberAccess): Always report lookup failure.
4300         
4301         * location.cs: Implemented Equals, GetHashCode.
4302         
4303         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
4304         
4305 2007-10-10  Jb Evain  <jbevain@novell.com>
4306
4307         * codegen.cs: re-enable assembly version check.
4308
4309 2007-10-09  Marek Safar  <marek.safar@gmail.com>
4310         
4311         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
4312         checks.
4313         
4314         * namespace.cs (UsingAlias): Do correct version check.
4315         
4316 2007-10-08  Marek Safar  <marek.safar@gmail.com>
4317         
4318         * expresison.cs, ecore.cs: Issue extension method error message when
4319         appropriate.
4320         
4321         * rootcontext.cs: Added ISO_2 compiler mode option.
4322
4323 2007-10-08  Marek Safar  <marek.safar@gmail.com>
4324         
4325         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
4326          message.
4327         
4328 2007-10-08  Marek Safar  <marek.safar@gmail.com>
4329         
4330         * attribute.cs (GetString, GetBoolean): Work with both literal and
4331         constant.
4332         
4333         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
4334         Moved method overload specific methods to MethodGroupExpr.
4335         
4336         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
4337         it should be less memory consuming.
4338         
4339 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
4340
4341         * codegen.cs: remove the assembly version check until the buildbot is
4342         fixed.
4343
4344 2007-10-07  Jb Evain  <jbevain@novell.com>
4345
4346         * attribute.cs (Attribute.GetString): if the value
4347         expression is a StringConstant, return its string value.
4348
4349 2007-10-07  Jb Evain  <jbevain@novell.com>
4350
4351         * typemanager.cs: add `assembly_version_attribute_type`.
4352         * codegen.cs: on attribute emission, check that the
4353         AssemblyVersionAttribute doesn't overflow.
4354
4355 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4356         
4357         A fix for bug #324677
4358         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
4359         parent container of a scope container with currently resolved one. 
4360         
4361 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4362         
4363         A fix for bug #325534
4364         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
4365         only.
4366         
4367 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4368         
4369         A fix for bug #327504
4370         * class.cs (Operator.Define): Refactored implicit and explicit user
4371         operator conversion rules.
4372         
4373 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4374         
4375         A fix for bug #327520
4376         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
4377         
4378 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4379         
4380         A fix for bug #328022
4381         * class.cs (MethodData.Define): Use correct method to check whether
4382         a method implementents an accessor.
4383         
4384 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4385         
4386         A fix for bug #330069
4387         * statement.cs (Fixed.Resolve): Read the first array element only when
4388         an array is instantiated. 
4389         
4390 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4391         
4392         * expression.cs, assign.cs, generics.cs: Print correct operator when
4393         compound assignment is used.
4394         
4395 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4396         
4397         A fix for bug #325841
4398         * expression.cs (ArrayAccess): Use full argument cloning only for
4399         string compound concatenation.
4400         
4401 2007-10-03  Marek Safar  <marek.safar@gmail.com>
4402         
4403         A fix for bug #328774
4404         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
4405         assignment.
4406         (PropertyExpr.EmitAssign): Fixed string concatenation compound
4407         assignment.
4408
4409 2007-10-03  Raja R Harinath  <rharinath@novell.com>
4410
4411         Fix #328490
4412         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
4413         Event accessibility checks here.  Remove some bogus code that
4414         accidently made GenericMethods work.
4415         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
4416
4417 2007-09-25  Marek Safar  <marek.safar@gmail.com>
4418         
4419         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
4420         
4421         * statement.cs (Block): Refactored AddVariable to allow error handling
4422         customization.
4423         
4424         * generic.cs: New stub.
4425         
4426 2007-09-23  Marek Safar  <marek.safar@gmail.com>
4427         
4428         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
4429         flag.
4430         
4431 2007-09-17  Marek Safar  <marek.safar@gmail.com>
4432
4433         * class.cs: Use partial container to record whether any partial part
4434         contains static field initializer and therefore default contructor has
4435         to be defined.
4436         
4437 2007-09-14  Marek Safar  <marek.safar@gmail.com>
4438
4439         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
4440         mono-list when only one of two partial parts has defined accessibility
4441         modifier.
4442         
4443 2007-09-14  Marek Safar  <marek.safar@gmail.com>
4444
4445         A fix for bug #82845
4446         
4447         * class.cs (TypeContainer): Set correct resolve context for all field
4448         initializers.
4449         
4450 2007-09-13  Marek Safar  <marek.safar@gmail.com>
4451
4452         * assign.cs: Fixed a crash when field is resolved twice with an error.
4453         
4454         * codegen.cs: Changed InFieldInitializer to be flag.
4455         
4456         * anonymous.cs, ecore.cs, expression.cs: Update after
4457         IsInFieldInitializer rename.
4458         
4459         * const.cs: Removed unused parameter.
4460         
4461         * class.cs: Changed the way how we resolve and emit field initializers.
4462         The field initilizers have to have access to contructor block to emit
4463         compiler generated code.
4464
4465 2007-09-13  Marek Safar  <marek.safar@gmail.com>
4466
4467         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
4468         generics use TypeContainer instead.
4469         
4470 2007-09-12  Marek Safar  <marek.safar@gmail.com>
4471         
4472         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
4473
4474         * lambda.cs (ResolveParameters): Use more powerful
4475         InflateGenericArgument.
4476         
4477         * parameters.cs: Better exception message.
4478                 
4479 2007-09-10  Marek Safar  <marek.safar@gmail.com>
4480
4481         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
4482         correct expression block type. 
4483         
4484         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
4485         
4486         * expression.cs (Invocation): Extracted method group resolve to
4487         DoResolveOverload.
4488         
4489 2007-09-07  Marek Safar  <marek.safar@gmail.com>
4490
4491         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
4492         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
4493         
4494         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
4495         generic extension methods.
4496
4497 2007-09-06  Marek Safar  <marek.safar@gmail.com>
4498
4499         A fix for bug #82676 (Do I get it right now?)
4500         * convert.cs (Binary.ResolveOperator): An interface is converted to the
4501         object before a standard conversion is applied.
4502         
4503 2007-09-06  Marek Safar  <marek.safar@gmail.com>
4504
4505         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
4506         #82676.
4507         
4508 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4509
4510         A fix for bug #82676
4511         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
4512         non-generic interface types.
4513         
4514 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4515
4516         A fix for bug #82690
4517         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
4518         
4519 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4520
4521         A fix for bug #82571
4522         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
4523         modifier for container based methods.
4524         
4525 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4526
4527         A fix for bug #82676
4528         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
4529         any interface-type T means to any of interface type T.
4530
4531 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4532
4533         * namespace.cs: We have 2 versions of System.Core assembly.
4534
4535 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4536
4537         A fix for bug #82652
4538         * class.cs (Class.GetClassBases): Compare types and not expressions.
4539
4540 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4541
4542         A fix for bug #82620
4543         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
4544         actually never worked before.
4545         (IndexerAccess): Emit prepared arguments before they are modified.
4546         
4547 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4548
4549         A fix for bug #82563
4550         * assign.cs: Revert wrong fix.
4551         
4552         * expression.cs (VariableReference.EmitAssign): Handle ref reference
4553         correctly.
4554         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
4555         Instead of ldelema/stdind we have to use temporary variables to handle
4556         cases like String.Concat (params string[]).
4557         
4558 2007-08-31  Marek Safar  <marek.safar@gmail.com>
4559
4560         * class.cs: EmitAttributes to Emit rename.
4561         
4562         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
4563         null.
4564         (MemberCore.HasClsCompliantAttribute): Don't depend on 
4565         GetClsCompliantAttributeValue execution.
4566         
4567 2007-08-31  Marek Safar  <marek.safar@gmail.com>
4568
4569         * anonymous.cs: Use shorter type prefix.
4570         
4571         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
4572         when exist.
4573         
4574         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
4575         variables when probing is on.
4576         
4577         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
4578         unresolved variables.
4579         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
4580         handle transparent identifiers.
4581         
4582 2007-08-26  Marek Safar  <marek.safar@gmail.com>
4583
4584         * attribute.cs (IsClsCompliant): Add nullable types test.
4585         
4586 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
4587
4588         * doc.cs : catch other types of exception than XmlException to
4589           report CS1570. Fixed bug #82565.
4590
4591 2007-08-23  Marek Safar  <marek.safar@gmail.com>
4592
4593         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
4594         The number of delegate parameters has to match.
4595         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
4596         arrays.
4597
4598 2007-08-21  Marek Safar  <marek.safar@gmail.com>
4599
4600         * anonymous.cs (AnonymousMethod): Generate private anonymous method
4601         to fix problem with private arguments.
4602
4603 2007-08-20  Marek Safar  <marek.safar@gmail.com>
4604
4605         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
4606         
4607         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
4608         
4609         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
4610         empty. Add cloning suport.
4611         
4612         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
4613
4614 2007-08-20  Marek Safar  <marek.safar@gmail.com>
4615
4616         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
4617         to create EmptyCast. It handles EmptyConstantCast specialization for
4618         constants.
4619         
4620 2007-08-18  Marek Safar  <marek.safar@gmail.com>
4621
4622         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
4623         (EmitArrayArgument): One routine for array arguments.
4624         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
4625         
4626 2007-08-17  Marek Safar  <marek.safar@gmail.com>
4627
4628         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
4629
4630 2007-08-17  Marek Safar  <marek.safar@gmail.com>
4631
4632         * anonymous.cs: MemberLookupFinal update.
4633
4634         * class.cs (ConstructorInitializer): Is expression based.
4635         
4636         * delegate.cs: MethodGroupExpr update.
4637         
4638         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
4639         messages.
4640         (Error_MemberLookupFailed): Customizable error override.
4641         (MethodGroupExpr): Keep queried type for later usage.
4642         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
4643         resolve.
4644         
4645         * expression.cs: Error_MemberLookupFailed refactoring.
4646         (New.DoResolve): Resolve as much as possible.
4647         (ElementInitializer.Error_MemberLookupFailed): Object initializer
4648         customization for invalid member types.
4649
4650         * statement.cs: MethodGroupExpr update.
4651         
4652 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4653
4654         * modifier.cs (Check): Check all modifiers and not only accessibility
4655         ones.
4656
4657 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4658
4659         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
4660         type and not an expression.
4661
4662 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4663
4664         * statement.cs (Catch.Clone): Type and variable can be null.
4665
4666 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4667
4668         A fix for bug #81979
4669         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
4670         I am really not sure whether this is the best fix.
4671         
4672         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
4673         only once.
4674         
4675 2007-08-14  Marek Safar  <marek.safar@gmail.com>
4676
4677         ** C# 3.0 Object and collection initializers (major re-write)
4678         
4679         * assign.cs (DoResolve): Initializers are not assign related.
4680         
4681         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
4682         used during collection or object initialization.
4683         
4684         * expression.cs (Error_InvalidArguments): Add initializers specific
4685         messages. More will come later because it requires some general
4686         refactoring.
4687         (New.DoResolve): Better error handling for unsafe types.
4688         (EmptyExpressionStatement): New class.
4689         (ElementInitializer): An object initializer expression.
4690         (CollectionElementInitializer): A collection initializer expression.
4691         (CollectionOrObjectInitializers): A block of object or collection
4692         initializers.
4693         (NewInitialize): New expression with element/object initializers.
4694         
4695         * statement.cs: Reverted object/collection initializer hacks.
4696         
4697         * typemanager.cs (CSharpName): Filter __arglist type.
4698         
4699 2007-08-09  Marek Safar  <marek.safar@gmail.com>
4700
4701         ** C# 3.0 Anonymous Types (update to the latest standard)
4702         
4703         * expression.cs (Binary.ResolveOperator): Threat all null based types
4704         same.
4705         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
4706         (AnonymousTypeParameter): Updated.
4707         
4708         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
4709         (AnonymousTypeClass): New anonymous type container.
4710         
4711         * class.cs (AddField): Return operation result.
4712         
4713         * generic.cs: Another empty TypeArguments overload.
4714         
4715         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
4716         are stored at top of normal hierarchy.
4717         
4718         * typemanager.cs (CSharpName): Filter anonymous types.
4719         
4720 2007-08-09  Marek Safar  <marek.safar@gmail.com>
4721
4722         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
4723         as single Concat call. How could we miss that :-(
4724         
4725 2007-08-08  Marek Safar  <marek.safar@gmail.com>
4726
4727         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
4728         
4729 2007-08-07  Miguel de Icaza  <miguel@novell.com>
4730
4731         * expression.cs: Fix the previous commit, the creation of the
4732         arguments array list needs also to be conditional on the arguments
4733         not being null.
4734
4735         * class.cs: Add a little bit of help to help narrow down problems.
4736
4737         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
4738         not try to copy in that case. 
4739
4740         * driver.cs: When building SMCS, include a new different set of
4741         default assemblies here.   Do this here so we can control whether
4742         to include the default assemblies with /noconfig.
4743
4744 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4745
4746         A fix for bug #81979
4747         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
4748         only.
4749
4750 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4751
4752         A fix for bug #82300
4753
4754         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
4755         we are in probing scope.
4756
4757 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4758
4759         A fix for bug #82301
4760
4761         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
4762         (Statement.CloneTo): Clone and not map children blocks.
4763
4764 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4765
4766         A fix for bug #82299
4767
4768         * expression.cs (LocalVariableReference.CloneTo): Remap local info
4769         variable too.
4770         
4771         * statement.cs (Statement.CloneTo): Clone variables before statements
4772         to allow remaping of local variables.
4773
4774 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4775
4776         A fix for bug #82296
4777
4778         * anonymous.cs,
4779         * report.cs: Log crash details for future clone problems.
4780         
4781         * statement.cs (Return.Clone): Don't clone non-existent expression.
4782
4783 2007-08-03  Raja R Harinath  <harinath@gmail.com>
4784
4785         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
4786         (Class.AddBasesForPart): Move CS0537 check here from ...
4787         * cs-parser.jay (class_declaration): ... here.  Move calling of
4788         'AddBasesForPart' to ...
4789         (class_bases): ... here.
4790         (struct_declaration, interface_declaration): Update to changes.
4791
4792 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4793
4794         A fix for bug #81923
4795
4796         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
4797         conversion is allowed.
4798
4799 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4800
4801         A fix for bug #81564
4802
4803         * ecore.cs (EventExpr): Add IsBase handling.
4804
4805         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
4806         too.    
4807         
4808 2007-08-02  Raja R Harinath  <harinath@gmail.com>
4809
4810         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
4811         * cs-parser.jay: Some whitespace cleanups.
4812         (current_delegate): New.
4813         (type_name): New.
4814         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
4815         a dummy code block, and use 'type_name' instead of 'member_name'.
4816         (interface_declaration, class_declaration): Likewise.
4817         (delegate_declaration): Likewise.  Rearrange slightly and use
4818         'current_delegate'.
4819         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
4820         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
4821
4822 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4823
4824         A fix for bug #82039
4825
4826         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
4827         available.
4828
4829         * typemanager.cs (CSharpName): Split to string overload.
4830
4831 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4832
4833         * expression.cs,
4834         * report.cs: Updated warning CS0472.
4835
4836 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4837
4838         A fix for bug #82181
4839         * cs-parser.jay,
4840         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
4841
4842 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4843
4844         A fix for bug #82277
4845         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
4846
4847 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4848
4849         ** C# 3.0 Type Inference (major bits are working)
4850         
4851         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
4852         (.ImplicitStandardConversionExists): Uses compatible.
4853         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
4854         (.InferReturnType): New method.
4855         (.Compatible): Refactored.
4856         (.ResolveParameters): Uses factory to create resolved parameters.
4857         (.CompatibleMethod): Add probing mode support.
4858         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
4859         clearly distinguish between 2 different operations.
4860         (LambdaMethod): Moved to lambda.cs.
4861         (AnonymousMethod): Removed unused fields and methods.
4862         (AnonymousDelegate): Simplified.
4863         
4864         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
4865         
4866         * convert. cs (ImplicitConversionStandard): Compatible works differently.
4867         
4868         * delegate.cs (Delegate): New mehods to reduce code duplication.
4869         (.GetConstructor): New method.
4870         (.GetInvokeMethod): New method.
4871         (DelegateCreation): Updated.
4872         
4873         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
4874         does not exist.
4875         (OverloadResolve): Made probing little bit faster.
4876         
4877         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
4878         when probing is on.
4879         
4880         * generic.cs (TypeInferenceContext): Dummy implementation.
4881         
4882         * iterators.cs: Updated after Resolve/Define rename.
4883         
4884         * lambda.cs (LambdaExpression)
4885         (.ResolveParameters): Handles both type of arguments and type inference too.
4886         
4887         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
4888         (InflateTypes): Updated.
4889         
4890         * support.cs (InflateTypes): Changed signature and updated.
4891         
4892         * typemanager.cs (LookupMemberCache): Better dynamic type check.
4893         (MemberLookup_FindMembers): More MS tricks.
4894         (GetParameterData): Ditto.
4895         (GetDelegateParameters): Uses quick path for dynamic types.
4896         
4897 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4898
4899         * class.cs (MethodData.Define): EmitContext is required for generic stuff
4900         only.
4901
4902 2007-07-31  Marek Safar  <marek.safar@gmail.com>
4903
4904         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
4905         syntax.
4906         
4907 2007-07-26  Jb Evain  <jbevain@novell.com>
4908
4909         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
4910         which takes a boolean 'report_errors', similar to the GetMethod.
4911         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
4912         in .net 2.1, do not report errors here.
4913
4914         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
4915         System.Runtime.CompilerServices.RequiredAttributeAttribute and
4916         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
4917         in .net 2.1.
4918
4919         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
4920         of the type InternalsVisibleToAttribute before the first call
4921         to CoreLookupType which is allowed to fail (third boolean parameter
4922         to true). Because, during the resolution for a type that is not
4923         immediately found, we try to check if the type is not defined in
4924         a friend assembly, and to do so, we need the
4925         InternalVisibleToAttribute.
4926
4927 2007-07-23  Miguel de Icaza  <miguel@novell.com>
4928
4929         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
4930         feature that allows structs to be compared against null and inline
4931         the result as true or false.
4932
4933         Notice that the same code is not permitted inside a generic block
4934         of code that would do:
4935
4936         class Foo<T> where T : struct {
4937             bool Eval (T x)
4938             {
4939                  return x == null;
4940             }
4941         }
4942
4943         It is only allowed if the type of T is not bound (no where
4944         clause).   In my opinion, this CSC 2 behavior is broken but people
4945         seem to be using it (IronRuby does, a few bug reports on bugzilla
4946         have it and some people have complained about it).
4947
4948         All of the users that depend on this behavior have code that is
4949         very likely broken. 
4950         
4951         * report.cs (Warning, Error): make these take object arguments,
4952         not strings, as that allows us to take advantage of Format.
4953
4954 2007-07-20  William Holmes  <billholmes54@gmail.com>
4955
4956         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
4957           Left member variable for the Count.
4958         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
4959           MemberName.CountTypeArguments to avoid a NRE. 
4960
4961         This code is contributed under the MIT X11 license
4962
4963 2007-07-18  Marek Safar  <marek.safar@gmail.com>
4964
4965         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
4966
4967 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
4968
4969         * doc.cs : generic method arguments are written as ``x while generic
4970           type arguments are `x. Combined with the previous change, fixed bug
4971           #79706.
4972
4973 2007-07-18  Raja R Harinath  <rharinath@novell.com>
4974
4975         Fix #82120
4976         * expression.cs (Binary.ResolveOperator): When converting
4977         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
4978
4979 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
4980
4981         * doc.cs : when T: or whatever x: is specified, it does not really
4982           check the doc comment's syntax correctness. Fixed bug #82006.
4983
4984 2007-07-18  Marek Safar  <marek.safar@gmail.com>
4985
4986         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
4987         LambdaExpression better.
4988         
4989         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
4990         
4991         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
4992         
4993         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
4994         as it can be generated.
4995         
4996         * expression.cs (Invocation.Error_InvalidArguments): Show correct
4997         modifiers.
4998         
4999         * lambda.cs (LambdaExpression): Refactored to share same code with
5000         AnonymousMethodExpression.
5001         
5002 2007-07-17  Marek Safar  <marek.safar@gmail.com>
5003
5004         * anonymous.cs (MakeName): Include host name for easier debugging.
5005         (LambdaMethod): New class for lambda spcecific stuff.
5006         
5007         * attribute.cs: Set EmitContext return type.
5008
5009         * class.cs: Set EmitContext return type.
5010         
5011         * codegen.cs (EmitContext): Return type cannot be null to stop messing
5012         with null/void meaning.
5013         
5014         * iterators.cs (ContainerType): Implemented.
5015         
5016         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
5017         
5018         * statement.cs (Return): Updated to lambda expressions.
5019         (Block.CloneTo): Parent can be null.
5020                 
5021 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5022
5023         A fix for bug #81917
5024         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
5025         
5026         * class.cs (FixedField): Check whether field is in unsafe scope.
5027
5028         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
5029         (FieldExpr.Emit): Fixed buffers cannot be volatile.
5030
5031         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
5032         FieldExpr.
5033         
5034         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
5035                 
5036 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5037
5038         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
5039         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
5040         from Report class.
5041
5042 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5043
5044         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
5045         
5046 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5047
5048         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
5049         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
5050         
5051         * codegen.cs(EmitContext): Add ProbingMode flag.
5052         
5053         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
5054         
5055         * driver.cs: For now set both warning values.
5056         
5057         * ecore.cs (SimpleName): Name is readonly.
5058         (MethodGroup.OverloadResolve): One quick path for probing.
5059         
5060         * expression.cs (Unary): Set Oper r/o.
5061         (Binary): Set Oper r/o.
5062         (ParameterReference): Set few instance variables as r/o.
5063         (ParameterReference.DoResolveBase): Don't capture aruments when 
5064         the probing is on.
5065         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
5066         (Arglist): arguments are private.
5067         (SizeOf): type is private and r/o.
5068         (MemberAccess): arguments are private.
5069
5070         * report.cs: Enhanced reporting on/off capabilities.
5071         
5072         * lambda.cs: Uses ec.IsInProbingMode.
5073         (ContextualReturn): Derives from return.
5074         
5075         * rootcontext.cs: For now set both warning values.
5076         
5077         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
5078         copy if one exists.
5079         (Return.Resolve): Don't die immediately.
5080         (Block.Resolve): Speed-up probing.
5081         (Block.CloneTo): Clone only child blocks.
5082
5083 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
5084
5085         * iterators.cs: reverted Miguel's latest change (r81925) as it
5086         breaks the build in System.
5087
5088 2007-07-13  Miguel de Icaza  <miguel@novell.com>
5089
5090         * iterators.cs (Yield.CheckContext): Check for the iterator type
5091         also here as we can call into Yield even in codepaths that are not
5092         directly checked by
5093         (MethodOrOperator is the only path that was checked).
5094
5095         In addition to the standard check, use a more specific check for
5096         constructors to report a more verbose error. 
5097
5098 2007-07-12  Miguel de Icaza  <miguel@novell.com>
5099
5100         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
5101         report the warning and continue 
5102
5103         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
5104         values on the stack on the call to Emit.   Use EmitStatement if
5105         possible, or using Emit + Pop if not possible.   Fixes #82064
5106
5107 2007-07-12  Raja R Harinath  <rharinath@novell.com>
5108
5109         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
5110         avoid try...finally in some cases.
5111
5112 2007-07-10  Marek Safar  <marek.safar@gmail.com>
5113
5114         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
5115         
5116         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
5117         instead of method. Re-use standard error handling.
5118         (ConstructorInitializer.Emit): Simplified.
5119         
5120         * delegate.cs: Updated after Invocation.EmitCall change.
5121         
5122         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
5123         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
5124         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
5125         method and don't permanently changing input arguments.
5126         (MethodGroupExpr): Introduced resolved best_candidate, when method group
5127         is resolved it has one of the candidates is the best one which is later
5128         used to emit. Removed a few unused method.
5129         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
5130
5131         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
5132         (Binary.ResolveOperator): Ditto.
5133         (ConditionalLogicalOperator.DoResolve): Ditto.
5134         (Invocation): Uses method group.
5135         (Invocation.DoResolve): Simplified.
5136         (Invocation.EmitCall): Removed useless is_static.
5137         (Invocation.Emit): Delegate to method group.
5138         (Invocation.EmitStatement): Simplified.
5139         (New): Uses method group.
5140         (MemberAccess.DoResolve): Don't destroy original expression.
5141         
5142         * statement.cs (ForEach.Resolve): Use null for no method arguments.
5143         
5144 2007-07-04  Marek Safar  <marek.safar@gmail.com>
5145
5146         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
5147         
5148         * anonymous.cs,
5149         * lambda.cs: Add custom error message type.
5150
5151 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5152
5153         * lambda.cs: Simplified little bit.
5154         
5155         * parameter.cs: Introduced ImplicitLambdaParameter.
5156         (Parameters.CreateFullyResolved): New factory instead of ctor.
5157         
5158         * anonymous.cs,
5159         * class.cs,
5160         * delegate.cs: Updated parameter creation.
5161         
5162 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5163
5164         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
5165         arguments.
5166         
5167         * generic.cs: Synchronized with gmcs.
5168         
5169 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5170
5171         * class.cs (Indexer): Check return type as soon as possible.
5172         
5173         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
5174         members too.
5175         
5176         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
5177         
5178         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
5179         
5180         * parameter.cs (Parameter): Use expression type when it is available.
5181         
5182         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
5183         method modifier for the first parameter only.
5184
5185 2007-06-24  Marek Safar  <marek.safar@gmail.com>
5186
5187         A fix for bug #81938
5188         * typemanager.cs (ChangeType): Fixed couple of char conversions.
5189         
5190         * constant.cs: Tide up an exception message.
5191
5192 2007-06-22  Marek Safar  <marek.safar@gmail.com>
5193
5194         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
5195         an uninitialized variable is used.
5196         
5197         * expression.cs (LocalVariableReference.DoResolve): Ditto.
5198
5199 2007-06-22  Marek Safar  <marek.safar@gmail.com>
5200
5201         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
5202         not found error handling.
5203
5204         * expression.cs (ArrayCreation): Removed redundant fields and little bit
5205         simplified.
5206         (ArrayCreation.ResolveArrayElement): To be ready to customization.
5207         (ArrayCreation.DoResolve): Simplified.
5208         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
5209         its own resolve process.
5210         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
5211
5212 2007-06-20  Marek Safar  <marek.safar@gmail.com>
5213
5214         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
5215         more error details.
5216         
5217 2007-06-20  Marek Safar  <marek.safar@gmail.com>
5218
5219         * cs-tokenizer.cs: Removed var related stuff.
5220         
5221         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
5222         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
5223         a type and a keyword at same time.
5224         
5225         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
5226         matches to "var".
5227         
5228         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
5229         implicitly typed arrays, more changes will follow.
5230         
5231         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
5232         
5233 2007-06-19  Marek Safar  <marek.safar@gmail.com>
5234
5235         * ecore.cs (VarExpr): Removed Handled field.
5236         
5237         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
5238         build-in assign functionality.
5239         (ForEach.Resolve): Removed all implicitly typed local variable code and
5240         simplified.
5241         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
5242         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
5243
5244 2007-06-18  Marek Safar  <marek.safar@gmail.com>
5245
5246         * assign.cs: Removed implicitly typed local variable check.
5247         
5248         * expression.cs (LocalVariableReference.DoResolve): Add check for self
5249         referencing implicitly typed local variable.
5250         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
5251         variable here.
5252         
5253         * statement.cs (Fixed): Removed unsupported implicitly typed local
5254         variable code.
5255
5256 2007-06-15  Marek Safar  <marek.safar@gmail.com>
5257
5258         * decl.cs (MemberName): Moved all Unbound stuff to parser.
5259
5260 2007-06-14  Marek Safar  <marek.safar@gmail.com>
5261
5262         A fix for bugs #81855 and #76274
5263         * attribute.cs (AttachTo): Always set owner for global attributes to
5264         prefined owner.
5265         
5266         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
5267         usefull too.
5268         
5269         * cs-parser.jay: Assembly and module attributes must precede all other
5270         elements except using clauses and extern alias declarations.
5271
5272 2007-06-13  Marek Safar  <marek.safar@gmail.com>
5273
5274         A fix for bug #81748
5275         * cs-tokenizer.cs,
5276         * expression.cs: More checks for non ISO-1 features.
5277
5278 2007-06-12  Marek Safar  <marek.safar@gmail.com>
5279
5280         A fix for bug #81807
5281         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
5282         present inside switch statement and it is required by nullable check.
5283
5284 2007-06-12  Marek Safar  <marek.safar@gmail.com>
5285
5286         A fix for bug #81840
5287         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
5288         when type matching fails.
5289         
5290         * namespace.cs: Tiny error message change.
5291
5292 2007-06-12  Marek Safar  <marek.safar@gmail.com>
5293
5294         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
5295         reporting. Added automatic property check.
5296         
5297         * class.cs: Updated after CheckAbstractAndExtern relocation.
5298         (AEventPropertyAccessor.GetSignatureForError): Customized.
5299         
5300 2007-06-11  Marek Safar  <marek.safar@gmail.com>
5301
5302         * class.cs (DefineBaseTypes): Base type can be undefined.
5303         
5304         * ecore.cs (TypeLookup): Minor refactoring.
5305         (DoResolveAsTypeStep): Removed redundant check.
5306
5307         * namespace.cs (Lookup): Removed redundant check.
5308                 
5309         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
5310         ResolveAsTypeTerminal step.
5311         (BootstrapCorlib_*): Simplified.
5312         (PopulateCoreType): Core types can be now external.
5313
5314 2007-06-07  Marek Safar  <marek.safar@gmail.com>
5315
5316         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
5317          verification only.
5318          (InferTypeArguments): Infers anonymous expression type arguments.
5319          (Compatible): Split to Compatible and InferTypeArguments. 
5320         
5321         * lambda.cs: Updated.
5322
5323 2007-06-08  Marek Safar  <marek.safar@gmail.com>
5324
5325         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
5326
5327 2007-06-07  Raja R Harinath  <harinath@gmail.com>
5328
5329         Fix #80477, cs0135-2.cs, cs0135-3.cs
5330         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
5331         names to the "known" variables list.
5332         (Block.CheckInvariantMeaningInBlock): Handle the fact the
5333         parameter names are also "known".
5334         (Block.CheckError136): Remove.
5335         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
5336         null.
5337
5338 2007-06-07  Marek Safar  <marek.safar@gmail.com>
5339
5340         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
5341
5342 2007-06-06  Marek Safar  <marek.safar@gmail.com>
5343
5344         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
5345         internal error not an user error.
5346          
5347         * expression.cs (IsApplicable): Refactored to make debugging easier.
5348
5349         * support.cs: More tricks for non-mono runtimes.
5350         
5351         * typemanager.cs (CoreLookupType): Made public.
5352         (InitSystemCore): All linq specific stuff moved to linq.cs
5353
5354 2007-06-05  Marek Safar  <marek.safar@gmail.com>
5355
5356         * typemanager.cs (CSharpSignature): One more missing build-in types
5357         replacement.
5358         More tricks for non-mono runtime.
5359
5360 2007-06-05  Raja R Harinath  <harinath@gmail.com>
5361
5362         * statement.cs (Block.CheckError136_InParents): Remove.
5363         (Block.AddVariable): Use GetParameterInfo instead.
5364         (ToplevelBlock.ProcessArguments): Likewise.
5365
5366 2007-06-04  Raja R Harinath  <rharinath@novell.com>
5367
5368         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
5369         information too.
5370         (ToplevelBlock.GetParameterInfo): Split out of ...
5371         (ToplevelBlock.GetParameterRefernce): ... this.
5372         (ToplevelBlock.ParameterMap): Remove.
5373         * expression.cs (ParameterReference): Update to use
5374         ToplevelParameterInfo.
5375
5376         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
5377         regression.
5378
5379         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
5380         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
5381
5382         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
5383         (ToplevelBlock.ProcessParameters) ... here.
5384         (ToplevelBlock..ctor): Invoke it.
5385
5386         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
5387         new parameters.
5388
5389         * statement.cs (IKnownVariable): New interface.
5390         (LocalInfo): Implement it.
5391         (ToplevelParameterInfo): New class.
5392         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
5393         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
5394         GetKnownVariableInfo.
5395
5396 2007-06-03  Raja R Harinath  <harinath@gmail.com>
5397
5398         Partly speed up CS0136 error checks.
5399         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
5400         'recurse' parameter.
5401         (Block.DoCheckError136): Only check errors in parameters.  Move
5402         local variable checks ...
5403         (Block.AddVariable): ... here, and ...
5404         (ToplevelBlock.ResolveMeta): ... here.
5405
5406 2007-06-02  Raja R Harinath  <harinath@gmail.com>
5407
5408         * statement.cs (Block.IsChildOf): Remove.
5409
5410         * statement.cs (Statement.Clone): Move special case code ...
5411         (Block.CloneTo): ... here.
5412
5413 2007-05-29  Raja R Harinath  <rharinath@novell.com>
5414
5415         * statement.cs (ToplevelBlock.container): Remove field.  It's
5416         redundant with 'Parent'.
5417         (ToplevelBlock.ContainerBlock): Remove accessor.
5418         (ToplevelBlock..ctor): Update to changes.  Register anonymous
5419         child with parent here, ...
5420         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
5421         current_block.
5422         (start_anonymous): Don't save current_block.
5423         (top_current_block): Remove.
5424
5425         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
5426         (Block.Resolve): Update to changes.
5427         (Block..ctor): Move setting of "correct" 'Toplevel'
5428         and 'Explicit' fields to ...
5429         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
5430
5431 2007-05-27  Raja R Harinath  <harinath@gmail.com>
5432
5433         Kill Block.Implicit
5434         * statement.cs (Block.Implicit): Remove.
5435         (Block): Update to changes.
5436         * flowanalysis.cs: Likewise.
5437
5438         Mildly speed up CheckInvariantMeaningInBlock
5439         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
5440         Recursively call AddKnownVariable to all enclosing blocks.
5441         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
5442         Remove recursive calls.
5443         (Block): Update to changes.
5444
5445         New ExplicitBlock invariants
5446         * statement.cs (Block.Explicit): New field.  It points to the
5447         immediately enclosing non-implicit block.
5448         (Block..ctor): Maintain the invariant.
5449         * cs-parser.jay: Take advantage of invariant.
5450
5451         Introduce ExplicitBlock
5452         * statement.cs (ExplicitBlock): New.
5453         (ToplevelBlock): Derive from it.
5454         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
5455         sense of flag.
5456         (Block.Implicit): Update to changes.
5457         * cs-parser.jay: Update to changes.
5458
5459         Remove unused field
5460         * codegen.cs (EmitContext.IsLastStatement): Remove.
5461         * statement.cs (Block.DoEmit): Update to changes.
5462
5463 2007-05-25  Raja R Harinath  <rharinath@novell.com>
5464
5465         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
5466         modifying current_block directly.
5467
5468 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
5469         
5470         * class.cs: Implemented automatic properties (C# 3.0)
5471           Thanks to Marek for the help.
5472
5473 2007-05-23  Raja R Harinath  <rharinath@novell.com>
5474
5475         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
5476         variable as assigned, note also that all its components are
5477         assigned too.
5478         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
5479
5480 2007-05-19  Marek Safar  <marek.safar@gmail.com>
5481
5482         * anonymous.cs, class.cs: Emit Compiler generated attribute when
5483         member is marked as compiler generated.
5484         
5485         * decl.cs (MemberCore): Refactored ModFlags into property.
5486
5487         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
5488         (Check): Check only accessibility modifiers.
5489
5490 2007-05-18  Raja R Harinath  <rharinath@novell.com>
5491
5492         Track all assignable slots in one bit array
5493         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
5494         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
5495         logic from VariableMap constructor here.  Use the same 'offset'
5496         variable that's later used for computing offsets of local
5497         variables.
5498         * flowanalysis.cs (UsageVector.parameters): Remove.
5499         (UsageVector): Update to changes.
5500         (VariableMap): Remove.
5501
5502         Avoid creating ParameterMap in every block
5503         * statement.cs (Block.ParameterMap): Move ...
5504         (ToplevelBlock.ParameterMap): ... here.
5505         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
5506         only once.
5507         * flowanalysis.cs (FlowBranching.param_map): Remove.
5508         (FlowBranching.UsageVector): Update to changes.
5509         (FlowBranchingToplevel.CheckOutParameters): Likewise.
5510
5511         * statement.cs (Block.CloneTo): Clone Toplevel field too.
5512
5513         * expression.cs (ParameterReference): Distinguish between block
5514         where parameter was referenced and declared.
5515
5516 2007-05-18  Marek Safar  <marek.safar@gmail.com>
5517
5518         * flowanalysis.cs, statement.cs: Put back improved error handling.
5519
5520 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
5521         
5522         * assign.cs:
5523         * expression.cs:
5524           Imporved object and collection initialization (C# 3.0).
5525
5526 2007-05-15  Marek Safar  <marek.safar@gmail.com>
5527
5528         A fix for bug #81380
5529         * expression.cs (Is.DoResolve): Only value types have constant `is'
5530         behaviour.
5531
5532 2007-05-15  Raja R Harinath  <rharinath@novell.com>
5533
5534         * statement.cs (ToplevelBlock.child): Remove.
5535
5536 2007-05-15  Raja R Harinath  <harinath@gmail.com>
5537
5538         Rationalize ResolveMeta: refactoring
5539         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
5540         out constant handling code into ...
5541         (Block.DoResolveConstants): ... this.
5542
5543         Rationalize ResolveMeta: kill local_map
5544         * statement.cs (Block.local_map, Block.LocalMap): Remove.
5545         (Block.AssignableSlots): New.
5546         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
5547         for locals -- move code from VariableMap here.  Avoid unnecessary
5548         allocations.
5549         * flowanalysis.cs (FlowBranching.local_map): Remove.
5550         (FlowBranching..ctor): Use Block.AssignableSlots.
5551         (VariableMap): Remove unused constructors.
5552
5553 2007-05-11  Raja R Harinath  <rharinath@novell.com>
5554
5555         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
5556
5557 2007-05-11  Marek Safar  <marek.safar@gmail.com>
5558
5559         * typemanager.cs (IsFriendAssembly): Should not be called for building
5560         assembly.
5561
5562 2007-05-09  Marek Safar  <marek.safar@gmail.com>
5563
5564         * literal.cs (NullConstant): Print null in all cases.
5565         
5566         * expression.cs (Binary.ResolveOperator): Implemented delegate
5567          comparison based on C# 2.0 changes.
5568
5569 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
5570
5571         This code is contributed under the MIT X11 license
5572         
5573         The following enables support for several C# 3.0 language features:
5574         
5575         * cs-tokenizer.cs: Added support for the "var" keyword.
5576         
5577         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
5578           Added VarExpr class to facilitate type inferencing.
5579         
5580         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
5581           to support anonymous types.
5582         
5583         * assign.cs: Added support for type inferencing and initialization.
5584         
5585         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
5586         
5587         * expression.cs: Added implicit array support to ArrayCreation.
5588           Added 5 types and 1 interface:
5589           
5590           IInitializable                Implementing classes can inject initializing
5591                                         statements after object instantiation.
5592           
5593           Initializer                   Stores data for object initialization.
5594           
5595           AnonymousType                 An expression for anonymous types.
5596           
5597           AnonymousTypeParameter        Stores data about an anonymous type's field.
5598           
5599           NewInitialize                 An expression for object initialization.
5600           
5601           CollectionInitialize          An expression for collection initialization.
5602         
5603         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
5604           statements.
5605
5606 2007-05-06  Marek Safar  <marek.safar@gmail.com>
5607
5608         A fix for bug #81500
5609         * cs-tokenizer.cs: Add special handling for coalescing operator.
5610
5611 2007-05-06  Marek Safar  <marek.safar@gmail.com>
5612
5613         A fix for bug #81529
5614         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
5615         its value from base class until it is redefined.
5616
5617 2007-05-02  Raja R Harinath  <rharinath@novell.com>
5618
5619         Fix regression in cs0631-3.cs
5620         * cs-parser.jay (operator_declarator): Add opt_attributes to error
5621         fallback.  Make error fallback catch more cases.
5622
5623 2007-05-01  Miguel de Icaza  <miguel@novell.com>
5624
5625         * cs-parser.jay: Allow parameters in operator declarations to have
5626         attributes. 
5627
5628 2007-04-27  Miguel de Icaza  <miguel@novell.com>
5629
5630         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
5631         exists. 
5632
5633         * lambda.cs (ContextualReturn.Resolve): An expression is valid
5634         inside the ContextualReturn, it does not have to be an
5635         ExpressionStatement. 
5636
5637 2007-04-24  Miguel de Icaza  <miguel@novell.com>
5638
5639         * lambda.cs (ContextualReturn.Resolve): if the return type is not
5640         set, set it.
5641
5642 2007-04-23  Miguel de Icaza  <miguel@novell.com>
5643
5644         * anonymous.cs (AnonymousContainer): split the virtual Resolve
5645         method in two methods: ResolveNoDefine and Resolve.
5646
5647         ResolveNoDefine will stop just after ResolveTopBlock has been
5648         called.   
5649
5650         Resolve will then continue by creating a method and issuing the
5651         call to method.Define ().
5652
5653         (AnonymousMethod): Split and implement the new Resolve and
5654         ResolveNoDefine as well.
5655
5656         * lambda.cs (LambdaExpression): Split the anonymous method
5657         resolution code into a separate routine (CoreCompatibilityTest)
5658         from DoCompatibleTest.
5659
5660         (LambdaExpression.TryBuild): New method, this method tries to
5661         build the LambdaExpression with the given set of types to be used
5662         as the types for the various parameters of the lambda expression. 
5663
5664         If the compilation succeed with the given types, the infered type
5665         of the Anonymous method is returned, otherwise null is returned.
5666
5667 2007-04-23  Marek Safar  <marek.safar@gmail.com>
5668
5669         A fix for bug #81414
5670         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
5671
5672 2007-04-22  Miguel de Icaza  <miguel@novell.com>
5673
5674         * cs-tokenizer.cs: Change various identifiers here from the
5675         camelCasing to the recommended Linux-like style for instance
5676         variables from the Coding Guidelines. 
5677
5678 2007-04-19  Martin Baulig  <martin@ximian.com>
5679
5680         * convert.cs
5681         (Convert.ImplicitReferenceConversionCore): Allow conversions from
5682         System.Enum to System.ValueType.
5683
5684 2007-04-13  Martin Baulig  <martin@ximian.com>
5685
5686         Rewrote implicit reference conversions.  We need to distinguish
5687         between implicit reference conversions (13.1.4) and implicit
5688         boxing conversions (13.1.5).
5689
5690         According to the spec, there's an an implicit conversion
5691         "From a one-dimensional array-type S[] to IList<T> and base
5692         interfaces of this interface, provided there is an implicit
5693         reference conversion from S to T."  Note that this does not
5694         include boxing conversions.
5695
5696         * convert.cs
5697         (Convert.ImplicitTypeParameterBoxingConversion): New method.
5698         (Convert.ImplicitReferenceConversion): Split into
5699         ImplicitReferenceConversionCore() and
5700         ImplicitBoxingConversionExist().
5701         (Convert.ImplicitReferenceConversionExists): Use the new
5702         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
5703
5704 2007-04-12  Martin Baulig  <martin@ximian.com>
5705
5706         * convert.cs (Convert.ImplicitReferenceConversion): Move the
5707         `TypeManager.null_type' checks up to the top of the method.
5708
5709 2007-04-11  Marek Safar  <marek.safar@gmail.com>
5710
5711         A fix for bug #81350
5712         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
5713         extension methods.
5714
5715 2007-04-11  Martin Baulig  <martin@ximian.com>
5716
5717         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
5718         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
5719         to make this work for generic classes; fixes #79561.
5720
5721 2007-04-11  Martin Baulig  <martin@ximian.com>
5722
5723         * expression.cs (As): Add support for nullable types; fixes #79371.
5724
5725 2007-04-11  Martin Baulig  <martin@ximian.com>
5726
5727         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
5728         `type.FullName' is null; fixes #80243.
5729
5730 2007-04-11  Martin Baulig  <martin@ximian.com>
5731
5732         * expression.cs (Invocation.IsApplicable): Don't modify the method
5733         if type inference succeeded, but the method was not applicable.
5734         Fixes #81250.
5735
5736 2007-04-10  Marek Safar  <marek.safar@gmail.com>
5737
5738         A fix for bug #81324
5739         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
5740         internal and external namespaces containers.
5741
5742 2007-04-10  Martin Baulig  <martin@ximian.com>
5743
5744         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
5745         TypeManager.DropGenericMethodArguments() so we also call
5746         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
5747
5748 2007-04-10  Martin Baulig  <martin@ximian.com>
5749
5750         * iterators.cs (Iterator.CreateIterator): Don't crash if
5751         `method.ReturnType' is null.  This happens if something went wrong
5752         while resolving that typ (we already reported an error in this case).
5753
5754 2007-04-10  Martin Baulig  <martin@ximian.com>
5755
5756         * expression.cs (New.DoResolve): Don't call CheckComImport() on
5757         generic interfaces; report the CS0144 directly.
5758
5759 2007-04-10  Martin Baulig  <martin@ximian.com>
5760
5761         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
5762         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
5763
5764 2007-04-10  Martin Baulig  <martin@ximian.com>
5765
5766         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
5767
5768 2007-04-09  Raja R Harinath  <rharinath@novell.com>
5769
5770         A better fix
5771         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
5772         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
5773
5774         Fix #81338
5775         * statement.cs (For.Resolve): If resolution fails, use
5776         KillFlowBranching.
5777
5778 2007-04-08  Marek Safar  <marek.safar@gmail.com>
5779
5780         * anonymous.cs (MakeName): Make faster and zero-based.
5781         (VerifyExplicitParameterCompatibility): Back to mode where generic
5782         parameter is ignored.
5783         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
5784
5785         * class.cs (EmitType): Method can emit another new method.
5786
5787         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
5788
5789         * driver.cs: Updated.
5790
5791         * lambda.cs: Reuse predefined empty parameters.
5792
5793         * parameter.cs: Updated
5794
5795         * support.cs: Implemented InflateTypes.
5796
5797         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
5798         (InitSystemCore): Introduced to isolate 3.0 dependencies.
5799
5800 2007-04-03  Martin Baulig  <martin@ximian.com>
5801
5802         Fix #80632.
5803
5804         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
5805         version of TypeManager.IsOverride() which also works with generic
5806         types.  
5807
5808 2007-04-03  Martin Baulig  <martin@ximian.com>
5809
5810         Fix #81044.
5811
5812         * convert.cs
5813         (Convert.ExplicitReferenceConversion): We need to cast when
5814         converting from IList<T> to S[].
5815
5816 2007-04-01  Marek Safar  <marek.safar@gmail.com>
5817
5818         * decl.cs (FindExtensionMethods): Consider all candidates with same name
5819         at this level.
5820         
5821         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
5822
5823 2007-03-31  Marek Safar  <marek.safar@gmail.com>
5824
5825         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
5826         argument and return type inferring.
5827
5828         * codegen.cs (InferReturnType): Flag whether return can be inferred.
5829         (ReturnType): Turned to property.
5830
5831         * statement.cs (Return): Implemented return type inferring.
5832
5833         * support.cs (ReflectionParameters): Use local types if possible.
5834
5835 2007-03-30  Raja R Harinath  <rharinath@novell.com>
5836
5837         * flowanalysis.cs (FlowBranching.Reachability): Remove.
5838         (FlowBranching.UsageVector): Update to changes.
5839
5840         Prepare to kill 'Reachability'
5841         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
5842         argument of constructor.
5843
5844 2007-03-29  Raja R Harinath  <rharinath@novell.com>
5845
5846         Prepare to kill 'Reachability'
5847         * flowanalysis.cs (UsageVector.is_unreachable): New.
5848         (UsageVector): Update to maintain 'is_unreachable' in parallel to
5849         'reachability', and verify they're consistent.
5850
5851         Fix #81121
5852         * expression.cs (New.EmitStatement): Handle type parameters here too.
5853
5854 2007-03-29  Martin Baulig  <martin@ximian.com>
5855
5856         Fix #79148.
5857
5858         * anonymous.cs
5859         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
5860         CompilerGeneratedClass.
5861         (ScopeInfo.EmitScopeInstance): Make this protected.
5862         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
5863         `ec.CurrentAnonymousMethod.Scope == Scope'.
5864
5865         * statement.cs (Block.ScopeInfo): Make this a property.
5866
5867 2007-03-27  Raja R Harinath  <harinath@gmail.com>
5868
5869         Prepare to kill 'Reachability'
5870         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
5871         (FlowBranching.UsageVector.Reachability): Remove property.
5872         (FlowBranching.UsageVector.IsUnreachable): New property.
5873         (FlowBranching.UsageVector.ResetBarrier): New.
5874         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
5875         * codegen.cs, statement.cs: Update to changes.
5876
5877 2007-03-27  Martin Baulig  <martin@ximian.com>
5878
5879         Fix #81209.
5880
5881         * decl.cs
5882         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
5883         generic types.
5884
5885 2007-03-26  Raja R Harinath  <rharinath@novell.com>
5886
5887         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
5888         instead of TriState.  Remove all mention of TriState.
5889
5890         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
5891         replaced by a boolean.  Add boolean 'is_unreachable' field, check
5892         and maintain invariants.
5893
5894 2007-03-25  Marek Safar  <marek.safar@gmail.com>
5895
5896         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
5897
5898 2007-03-25  Marek Safar  <marek.safar@gmail.com>
5899
5900         * expression.cs: Stop using obsolete 2.0 opcodes.
5901
5902 2007-03-25  Marek Safar  <marek.safar@gmail.com>
5903
5904         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
5905         one of the latests Martin's fixes.
5906
5907 2007-03-23  Miguel de Icaza  <miguel@novell.com>
5908
5909         * expression.cs: On BigEndian systems, swap the bytes, temporary
5910         solution until we get a new bitconverter class.
5911
5912 2007-03-23  Martin Baulig  <martin@ximian.com>
5913
5914         Fix #81158.
5915
5916         * decl.cs (MemberCache.AddMembers): Add generic methods both as
5917         "Method" and "Method`1".  Normally, a cache lookup is done on the
5918         "Method" form (ie. without the generic arity), but this one makes
5919         lookups on the full form work as well.
5920
5921 2007-03-22  Raja R Harinath  <rharinath@novell.com>
5922
5923         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
5924         unused properties.
5925
5926 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
5927         * class.cs: 
5928         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
5929         ordered_member_list, to TypeBuilder to store members to be defined
5930         in the order they were parsed in.
5931         - ordered_explicit_member_list contains all properties indexers
5932           and methods that are defined as explicit implementation of an
5933           interface or base class.
5934         - ordered_member_list contains all properties indexers and methods
5935           that are not defined as explicit implementation of an interface
5936           or base class.
5937
5938         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
5939         functionality in these removed classes has been replaced with 
5940         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
5941         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
5942
5943         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
5944         to CheckForDuplications inside GetMethod and SetMethod Define Method
5945         to handle method property and indexer name conflicts.
5946
5947         Fixes #79434
5948
5949         All code is contributed under the MIT/X11 license.
5950
5951 2007-03-20  Martin Baulig  <martin@ximian.com>
5952
5953         * class.cs (TypeContainer.Interfaces): Removed; they're now
5954         included in `TypeContainer.Types'.
5955
5956 2007-03-20  Martin Baulig  <martin@ximian.com>
5957
5958         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
5959
5960         * class.cs (TypeContainer.CreateType): New public method.  This is
5961         now called before DefineType() to create the TypeBuilders.
5962         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
5963         has already been created by CreateType().
5964         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
5965         don't resolve our base classes here; this has been moved into
5966         DefineBaseTypes().  We're now called from CreateType().
5967         (TypeContainer.DefineBaseTypes): New private method; resolve our
5968         base classes here.  We're now called from DefineType().
5969
5970         * rootcontext.cs
5971         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
5972         our types first to create all the TypeBuilders.  After that, call
5973         TypeContainer.DefineType() on all the types which'll resolve their
5974         base classes and setup the resolve order.
5975
5976 2007-03-20  Martin Baulig  <martin@ximian.com>
5977
5978         * class.cs (TypeContainer.Enums): Removed; they're now included in
5979         `TypeContainer.Types'.  
5980
5981 2007-03-20  Martin Baulig  <martin@ximian.com>
5982
5983         * class.cs
5984         (TypeContainer.DefineType): Don't call ResolveMembers() here.
5985         (TypeContainer.DoResolveMembers): Call DefineType() on our
5986         `compiler_generated' classes; moved here from DefineNestedTypes().
5987
5988         * rootcontext.cs
5989         (RootContext.ResolveTree): Call ResolveMembers() on all
5990         TypeContainer's in the `type_container_resolve_order'.
5991
5992 2007-03-19  Marek Safar  <marek.safar@gmail.com>
5993
5994         * class.cs: Use corlib to handle InternalMethodImplAttribute.
5995
5996 2007-03-17  Marek Safar  <marek.safar@gmail.com>
5997
5998         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
5999         implementation flags.
6000
6001 2007-03-17  Marek Safar  <marek.safar@gmail.com>
6002
6003         * class.cs: More optimizations for type parameters.
6004
6005 2007-03-15  Marek Safar  <marek.safar@gmail.com>
6006
6007         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
6008
6009         * ecore.cs, parameter.cs: More common code for both corlibs.
6010
6011         * typemanager.cs (IsGenericMethod): Simplified.
6012
6013 2007-03-15  Raja R Harinath  <rharinath@novell.com>
6014
6015         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6016         'returns'.
6017         * statement.cs, iterators.cs, lambda.cs: Update to changes.
6018
6019         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
6020         unconditionally.  Simplify explanation.
6021         (Try.Resolve, Using.Resolve): Likewise.
6022
6023 2007-03-15  Martin Baulig  <martin@ximian.com>
6024
6025         Fix #80731.
6026
6027         * decl.cs (DeclSpace): If we're a partial class, use our
6028         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
6029
6030 2007-03-15  Raja R Harinath  <rharinath@novell.com>
6031
6032         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6033         'throws'.
6034         (FlowBranching.UsageVector): Update to changes.
6035         (FlowBranching.MergeSiblings): Likewise.
6036         * statement.cs: Likewise.
6037
6038 2007-03-15  Martin Baulig  <martin@ximian.com>
6039
6040         Fix #79302.
6041
6042         * decl.cs
6043         (MemberCache): Added a special .ctor for type parameters.
6044
6045         * typemanager.cs
6046         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
6047         `MemberCache'.  
6048
6049 2007-03-09  Martin Baulig  <martin@ximian.com>
6050
6051         * enum.cs (Enum): Make this a TypeContainer.
6052         (EnumMember): Derive from `Const'.
6053
6054         * const.cs
6055         (Const.DoResolveValue): New protected virtual method; move most of
6056         the functionality of ResolveValue() here so we can override it in
6057         `EnumMember'.
6058         (Const.CreateConstantReference): Make this virtual.
6059
6060         * class.cs (Kind): Add `Kind.Enum'.
6061         (TypeContainer.Emit): Don't emit the enums here; they're already
6062         in the `RootContext.typecontainer_resolve_order'.
6063
6064         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
6065         here; they're already in the `typecontainer_resolve_order'.
6066
6067         * ecore.cs (EnumConstant.ConvertImplicitly): Add
6068         TypeManager.DropGenericTypeArguments().
6069
6070         * typemanager.cs
6071         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
6072         (TypeManager.IsEnumType): Likewise.
6073         (TypeManager.EnumToUnderlying): Likewise.
6074         (TypeManager.IsEqual): Add support for enums.
6075
6076 2007-03-12  Raja R Harinath  <rharinath@novell.com>
6077
6078         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
6079         DefaultParameterValueAttribute to be undefined, say if System.dll
6080         is not referenced.
6081
6082 2007-03-11  Marek Safar  <marek.safar@gmail.com>
6083
6084         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
6085         any mscorlib.
6086
6087 2007-03-10  Marek Safar  <marek.safar@gmail.com>
6088
6089         * class.cs, parameter.cs: Unified parameters verification.
6090
6091 2007-03-08  Martin Baulig  <martin@ximian.com>
6092
6093         * cs-parser.jay (constructor_header): Pass the location to the
6094         newly created TopLevelBlock.
6095
6096 2007-03-07  Martin Baulig  <martin@ximian.com>
6097
6098         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
6099
6100 2007-03-06  Miguel de Icaza  <miguel@novell.com>
6101
6102         * convert.cs (ExplicitReferenceConversionExists): Sync this method
6103         with the changes from David, fixes the build.
6104
6105 2007-03-05  David Mitchell  <dmitchell@logos.com>
6106
6107         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
6108         and its base interfaces to a one-dimensional array type S[],
6109         provided there is an implicit or explicit reference conversion
6110         from S to T.
6111
6112 2007-03-03  Marek Safar  <marek.safar@gmail.com>
6113
6114         * cs-tokenizer.cs: Implemented basic linq grammar.
6115
6116         * driver.cs: Set linq lang version on demand.
6117
6118 2007-02-26  Marek Safar  <marek.safar@gmail.com>
6119
6120         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
6121
6122 2007-02-25  Marek Safar  <marek.safar@gmail.com>
6123
6124         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
6125         (Fixes #80455)
6126
6127         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
6128         here.
6129         Check property and event extern attributes.
6130
6131         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
6132         charset.
6133
6134 2007-02-24  Marek Safar  <marek.safar@gmail.com>
6135
6136         A fix for bug #80407
6137         * ecore.cs: Don't report ambiguity error when methods have same parent.
6138
6139 2007-02-23  Marek Safar  <marek.safar@gmail.com>
6140
6141         A fix for bug #80878
6142         * class.cs, cs-parser.jay: Event property can host anonymous methods.
6143
6144 2007-02-22  Marek Safar  <marek.safar@gmail.com>
6145
6146         * attribute.cs: Enable ExtensionAttribute presence test.
6147
6148 2007-02-22  Marek Safar  <marek.safar@gmail.com>
6149
6150         * class.cs: Warn about missing GetHashCode only when Equals is override.
6151
6152         * decl.cs: Check accessibility of type arguments.
6153
6154         * typemanager.cs: Correctly report nullable array.
6155
6156 2007-02-20  Marek Safar  <marek.safar@gmail.com>
6157
6158         * class.cs, report.cs: Capture more details when things go wrong.
6159
6160 2007-02-20  Marek Safar  <marek.safar@gmail.com>
6161
6162         A fix for bug #80650
6163         * cs-parser.jay: Anonymous container starts at constructor declaration
6164         and not at block beginning because it has to be usable in constructor
6165         initializer.
6166
6167         * statement.cs: Use context location and not block one for error reporting.
6168
6169 2007-02-18  Marek Safar  <marek.safar@gmail.com>
6170
6171         A fix for bug #78712
6172         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
6173         too.
6174
6175 2007-02-18  Marek Safar  <marek.safar@gmail.com>
6176
6177         A fix for bug #80493 by Atsushi Enomoto
6178         * cs-parser.jay: Ignore invalid attribute target.
6179
6180 2007-02-18  Marek Safar  <marek.safar@gmail.com>
6181  
6182         * cs-tokenizer.cs: Ignore '\0' as white space character.
6183
6184 2007-02-17  Miguel de Icaza  <miguel@novell.com>
6185
6186         * cs-parser.jay: Add support for lambda expressions to the mcs
6187         compiler as well.
6188
6189         * lambda.cs: Only clone when we are probing, not on the final call
6190         (Compatible is the final call). 
6191
6192         * statement.cs (CloneContext): Introduce class to provide block
6193         remapping during clone.
6194
6195         All statements Clone themselves now.
6196
6197         (Clone): special handling for blocks, when we clone a block, we
6198         register the block inside this routine, as children of the block
6199         might trigger a lookup. 
6200         
6201         * expression.cs: Add support for CloneContext in all expressions. 
6202         
6203 2007-02-17  Marek Safar  <marek.safar@gmail.com>
6204  
6205         A fix for bug #80493
6206         * statement.cs: Report ambiguous warning when interfaces are not related.
6207
6208 2007-02-15  Marek Safar  <marek.safar@gmail.com>
6209
6210         C# 3.0 extension methods.
6211
6212         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
6213         cannot be used directly.
6214
6215         * class.cs (Class.Emit): Emit extension attribute if any class method
6216         is extension method.
6217         (Method.Define): Add basic extension method validation conditions.
6218         (Method.Emit): Emit extension attribute for method.
6219
6220         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
6221         extension method exists. Currently we follow same approach as Microsoft
6222         does, emit even if a method or a class are private but this can change
6223         later.
6224
6225         * cs-parser.jay: Add handling of `this' keyword in method parameters
6226         context.
6227
6228         * decl.cs (DeclSpace.IsStaticClass): New property.
6229         (MemberCache.FindExtensionMethods): Looks for extension methods with
6230         defined name and extension type.
6231
6232         * doc.cs: Updated after OverloadResolve changes.
6233
6234         * driver.cs: Add new soft reference to System.Core.dll.
6235
6236         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
6237         (ExtensionMethodGroupExpr): Represents group of extension methods.
6238
6239         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
6240         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
6241         to MethodGroupExpr and made non-static for easier customization.
6242         (Invocation.DoResolve): Add extension method lookup when no standard
6243         method was found.
6244         (MemberAccess.DoResolve): Try extension methods if no member exists.
6245
6246         * modifiers.cs: Add METHOD_EXTENSION modifier.
6247
6248         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
6249         as well as candidate extension type.
6250         (ComputeNamespaces): When assembly constains extension methods registers
6251         them.
6252         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
6253         extension method lookup.
6254         (Namespace.LookupExtensionMethod): Looks for extension method in this
6255         namespace.
6256         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
6257         find a method which matches name and extensionType.
6258
6259         * parameter.cs (Parameter): Add This modifer.
6260         (HasExtensionMethodModifier): New property.
6261         (Resolve): Add extension parameter check.
6262         (ModFlags): turned to property to exclude this modifier as it is not real
6263         parameter modifier.
6264         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
6265
6266         * support.cs (ParameterData): Add ExtensionMethodType.
6267         (ReflectionParameters): Implemented ExtensionMethodType interface property.
6268
6269         * typemanager.cs: Add type and ctor extension attribute type.
6270
6271 2007-02-15  Miguel de Icaza  <miguel@novell.com>
6272
6273         * report.cs (DisableErrors, EnableErrors): used to prevent error
6274         output when we are "trying" to compile various methods with
6275         different types. 
6276
6277         * ecore.cs (Expression): Add Clone method that calls the virtual
6278         CloneTo method.  The current CloneTo method in Expression throws
6279         an exception so we can track down all the places where this must
6280         be implemented (not using abstract, because that would be a lot of
6281         up-front-work before we can start testing the implementation
6282         idea). 
6283
6284         Important: we only need Clone capabilities for expressions created
6285         by the parser, as the expressions we will be cloning are
6286         expressions in the pre-resolved state.   This vastly simplifies
6287         the work required. 
6288         
6289         (SimpleName): Add CloneTo that does nothing.
6290         (EmptyCast): Add CloneTo.
6291         
6292         * expression.cs (Binary): Implement CloneTo.
6293         (Invocation.IsApplicable): Store the current ec in
6294         EmitContext.TempEc and restore it on return.  This is used so we
6295         do not have to sprinkle hundres of methods with an extra
6296         EmitContext, we know that the only user is the lambda expression
6297         ImplicitConversionExists code. 
6298         
6299         (Argument): Add Cloning capabilities.
6300         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
6301         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
6302         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
6303         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
6304         IndexerAccess): Add Clone capability.
6305
6306         (LocalVariableReference, This): TODO: needs cloned Block mapping.
6307
6308         (Argument): Add cloning capability.
6309
6310         * assign.cs (Assign): Implement CloneTo.
6311
6312         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
6313         
6314         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
6315         version by calling Convert with the EmitContext (that we are
6316         currently storing in ec, this is not great, but will do for now,
6317         to avoid passing EmitContext parameters to hundreds of functions
6318         that do not need them now).
6319
6320         (SetExpression): Remove, it is not needed.
6321         
6322         (ContextualReturn): Implement CloneTo.
6323
6324         * statement.cs (Statement): Implement cloning infrastructure,
6325         similar to expressions.
6326
6327         (Block): Partial implementation of Clone for statements.
6328
6329         (Return): Implement clone.
6330         
6331         * constant.cs (Constant.CloneTo): New method, does nothing.
6332
6333         * codegen.cs (TempEc): Add a static EmitContext as a temporary
6334         solution, until we decide how to exactly do this.  
6335         
6336 2007-02-14  Marek Safar  <marek.safar@gmail.com>
6337  
6338         A fix for bug #80493
6339         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
6340         a property is override we need to use second accessor.
6341
6342 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6343  
6344         A fix for bug #80418
6345         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
6346         methods.
6347
6348 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6349
6350         Another fix for bug #80749
6351         * pending.cs: Abstract class has priority over interfaces.
6352
6353 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6354
6355         Another fix for bug #80749
6356         * pending.cs: Abstract class has priority over interfaces.
6357
6358 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6359
6360         Another fix for bug #80749
6361         * pending.cs: Abstract class has priority over interfaces.
6362
6363 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6364
6365         Another fix for bug #80749
6366         * pending.cs: Abstract class has priority over interfaces.
6367
6368 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6369
6370         * class.cs Better error message.
6371
6372         * driver.cs: Add shorter versions of -optimize option.
6373
6374 2007-02-13  Martin Baulig  <martin@ximian.com>
6375
6376         * class.cs (Constructor.Emit): Check the return value of
6377         ec.ResolveTopBlock() and return on error.
6378
6379 2007-02-13  Raja R Harinath  <rharinath@novell.com>
6380
6381         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
6382         message to fix error message regression.
6383
6384 2007-02-12  Marek Safar  <marek.safar@gmail.com>
6385
6386         * delegate.cs: Delegate creation expression cannot be of Nullable type.
6387
6388 2007-02-12  Marek Safar  <marek.safar@gmail.com>
6389
6390         A fix for bug #80749
6391         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
6392         its parent container.
6393
6394         * class.cs (DefineFieldInitializers): Each initializer can has different
6395         resolve context.
6396
6397         * const.cs: Updated.
6398
6399 2007-02-11  Miguel de Icaza  <miguel@novell.com>
6400
6401         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
6402         now all the heavy lifting to check that embedded statements or
6403         expressions have the right form is done in the ContextualReturn.
6404
6405         (ContextualReturn): New class.  
6406
6407         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
6408         method that can be invoked to report 201, so we do not replicate
6409         this everywhere.
6410
6411         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
6412         
6413         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
6414         treating tabs as spaces. 
6415
6416 2007-02-09  Marek Safar  <marek.safar@gmail.com>
6417
6418         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
6419         * assign.cs: Use full implicit conversion for right side check.
6420
6421 2007-02-09  Marek Safar  <marek.safar@gmail.com>
6422
6423         * statement.cs (Switch): Switch over boolean type is not standardized.
6424
6425 2007-02-08  Marek Safar  <marek.safar@gmail.com>
6426
6427         A fix for bug #80755
6428         * decl.cs (FindBaseEvent): Don't use method cache for events.
6429
6430 2007-02-07  Marek Safar  <marek.safar@gmail.com>
6431
6432         * cs-parser.jay: Better syntax error handling.
6433
6434         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
6435         instead of underlying type value.
6436
6437 2007-02-06  Marek Safar  <marek.safar@gmail.com>
6438
6439         * driver.cs: Check define identifier before is registered.
6440
6441         * namespace.cs: Use existing error message.
6442
6443         * report.cs: New warning.
6444
6445 2007-02-06  Marek Safar  <marek.safar@gmail.com>
6446
6447         A fix for bug #80742
6448         * expression.cs: Delegate Invoke method can be called directly.
6449
6450 2007-02-06  Marek Safar  <marek.safar@gmail.com>
6451
6452         A fix for bug #80676
6453         * class.cs (IsEntryPoint): The Main method can have params modifier.
6454
6455 2007-02-04  Miguel de Icaza  <miguel@novell.com>
6456
6457         * parameter.cs (Parameter, Parameters): Add Clone method.
6458
6459         * anonymous.cs (Compatible): Turn method into virtual method, so
6460         LambdaExpression can implement a different behavior.
6461
6462         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
6463         out the basic checking here, so it can be used by
6464         LambdaExpressions.
6465         
6466         * lambda.cs: Introduce "Compatible" function that will do the
6467         heavy lifting.
6468
6469 2007-02-02  Marek Safar  <marek.safar@gmail.com>
6470
6471         * attribute.cs: Unified one error message.
6472
6473         * class.cs (Class): Use type attributes and not properties to test static
6474         class.
6475         (IsEntryPoint): Don's pass local variable.
6476
6477         * convert.cs: Removed duplicate check.
6478
6479         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
6480
6481         * driver.cs: Don't crash when soft reference does not exist.
6482
6483         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
6484         (UsingEntry): Removed redundant allocation.
6485
6486         * parameter.cs: Add fast path for type parameters.
6487
6488         * support.cs: Don't allocate attribute when it's not used.
6489
6490 2007-01-30  Miguel de Icaza  <miguel@novell.com>
6491
6492         * anonymous.cs
6493         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
6494         this into a virtual method, so we can override it in LambdaExpression.
6495
6496         * driver.cs: Improve diagnostics in case of failure. 
6497
6498         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
6499         write a function that is slightly more complex and that parses:
6500
6501         type identifier [, type identifier]* )
6502
6503         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
6504         this expression:
6505
6506                 (canEmpty ? i >= 0 : i > 0)
6507
6508 2007-01-30  Raja R Harinath  <rharinath@novell.com>
6509
6510         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
6511         exception on possibly valid code.
6512
6513 2007-01-29  Raja R Harinath  <rharinath@novell.com>
6514
6515         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
6516         Push/PopPosition.
6517         (parse_opt_type_arguments): Remove.  It's almost the same as
6518         parse_less_than.
6519         (parse_namespace_or_typename): Use parse_less_than.
6520
6521 2007-01-28  Miguel de Icaza  <miguel@novell.com>
6522
6523         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
6524         this bug took a few hours to find, because the state saved and
6525         restored by PushPosition and PopPosition was ignoring the state of
6526         parse_generic_less_than.
6527
6528         I can also now remove the handling of OP_LT and OP_GT, this solves
6529         the big mistery.
6530         
6531         * cs-tokenizer.cs: store the location for the ARROW token, we use
6532         that in the parser.
6533
6534         (PushPosition, PopPosition): save/restore also `current_token',
6535         restore `parse_generic_less_than' (was missing).
6536
6537         (parse_opt_type_arguments): use parse_type, not
6538         parse_namespace_or_typename to parse types.
6539
6540         * lambda.cs: Empty new file, will eventually have the lambda
6541         expression implementation.
6542
6543         * lambda.test: used to test the internal tokenizer. 
6544
6545         * report.cs (FeatureIsNotISO1): Rename from
6546         FeatureIsNotStandardized, because it was about the language level
6547         (1 vs 2) it was not about standarization.
6548
6549         (FeatureRequiresLINQ): New.
6550
6551         * support.cs (SeekableStreamReader): Only require that the reader
6552         is a TextReader, not a StreamReader, so we can plug StringReader. 
6553
6554         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
6555         given position in the input stream the following tokens can be
6556         parsed as a type followed by an identifier.
6557
6558         (is_punct): after a '(' if parse_type_and_parameter returns true,
6559         then return a special token OPEN_PARENS_LAMBDA which is used to
6560         avoid reduce/reduce errors in the grammar for the
6561         lambda_expression rules.
6562
6563         (parse_type): implement a type parser inside the
6564         tokenizer, the parser only returns true or false depending on
6565         whether the input at a given position can be parsed as a type.
6566
6567         (peek_token): new method used during type parsing.
6568
6569 2007-01-28  Raja R Harinath  <rharinath@novell.com>
6570
6571         Fix #80531
6572         * anonymous.cs (ScopeInfo.InflateParameters): New.
6573         (AnonymousContainer.Resolve): Use it to redirect types of
6574         delegate parameters.
6575
6576 2007-01-27  Raja R Harinath  <rharinath@novell.com>
6577
6578         Fix #80530
6579         * expression.cs (Error_InvalidArguments): Don't use two different
6580         messages for CS1503.  Use ExtraInformation and
6581         SymbolRelatedToPreviousError instead.
6582
6583         Fix #80358
6584         * decl.cs (DeclSpace.initialize_type_params): Don't access
6585         'type_params' of a partial class directly.
6586
6587 2007-01-26  Miguel de Icaza  <miguel@novell.com>
6588
6589         * constant.cs: Removed a handful of out-of-range checks that were
6590         not necessary. 
6591
6592 2007-01-25  Marek Safar  <marek.safar@gmail.com>
6593
6594         * expression.cs (CheckUselessComparison): Add additional check for char
6595         constants.
6596
6597         * namespace.cs: Fixed typo.
6598
6599 2007-01-23  Miguel de Icaza  <miguel@novell.com>
6600
6601         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
6602         gone, instead we inline the test, preventing the needless casts to
6603         longs, ulongs and doubles for the parameters, avoiding calls to
6604         methods that overchecked stuff, and instead inlined things
6605         nicely. 
6606
6607 2007-01-20  Marek Safar  <marek.safar@gmail.com>
6608
6609         * cs-parser.jay: Better parameter error handling.
6610
6611 2007-01-17  Marek Safar  <marek.safar@gmail.com>
6612
6613         A fix for bug #80368, #80522
6614         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
6615         whether array initializer contains constants only.
6616         (ArrayCreation.Emit): Use better formula to decide when
6617         are array initializers for static initialization.
6618         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
6619         have to emit even constants otherwise they are pre-initialized.
6620
6621 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
6622             Raja R Harinath  <rharinath@novell.com>
6623
6624         Fix emit order of 'get' vs. 'set'.
6625         * support.cs (Accessors): New.
6626         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
6627         Note the order in which accessors are declared in the source.
6628         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
6629         Refactored from Property.Define and Indexer.Define.
6630         (PropertyBase.DefineAccessors): New helper that calls the above in
6631         appropriate order as noted by the parser.
6632         (Property.Define, Indexer.Define): Update to changes.
6633         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
6634
6635 2007-01-17  Raja R Harinath  <rharinath@novell.com>
6636
6637         Fix cs0029-6.cs and gcs0029-2.cs (regression)
6638         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
6639         there's an implicit conversion from the current type to the target
6640         type before converting the underlying constant.
6641
6642 2007-01-16  Marek Safar  <marek.safar@gmail.com>
6643
6644         * const.cs (ResolveValue): Updated after constant conversion was made more
6645         generic.
6646
6647         * constant.cs (GetAttributableValue): constant to object conversion is
6648         used for attributes only.
6649         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
6650         constant conversions.
6651         (LongConstant.ConvertImplicitly): Ditto.
6652
6653         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
6654         (ImplicitConversionStandard): Handle constant conversion as extra step.
6655         It solves the issue when constant conversion was called indirectly like
6656         inside array initializer and constant folding was skipped.
6657
6658         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
6659         this change.
6660
6661         * statement.cs(ImplicitConversionStandard): Updated after constant
6662         conversion was made more generic.
6663
6664 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
6665
6666         * expression.cs (As.DoResolve): Use GenericConstraints instead of
6667         Constraints, solves the problem where the compiler incorrectly
6668         reported that a type parameter was not constrained to a class (Bug
6669         80518)
6670
6671 2007-01-14  Marek Habersack  <grendello@gmail.com>
6672
6673         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
6674
6675 2007-01-14  Marek Safar  <marek.safar@gmail.com>
6676
6677         A fix for bug #80368
6678         * assign.cs (FieldInitializer): New class implements field
6679         initializer statement.
6680
6681         * attribute.cs: Update after FieldMember rename.
6682
6683         * class.cs (PropertyBasedMember): New common class for property based
6684         types.
6685         (InterfaceMemberBase): New base class for all members which can be used as
6686         an interface members.
6687         (MethodCore): Moved really common code to InterfaceMemberBase.
6688         (Method.Define): Equal and GetHasCode detection is relevant for methods
6689         only.
6690         (MethodData.Define): Don't assume that public event implements an
6691         interface automatically.
6692         (MethodData.DefineMethodBuilder): Issue an error even if only extern
6693         modifier is used.
6694         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
6695         (FieldMember): Merged with FieldBase.
6696         (EventProperty.AEventPropertyAccessor): New specialization to check whether
6697         event extern modifier can be used.
6698         (EventField.EventFieldAccessor): Moved event field specific code here.
6699         (Event.AllowedModifiers): Even event can be extern.
6700         (Event.FindOutBaseMethod): New override specific to events.
6701         (Indexer.parameters): Reintroduce parameters because base class holds
6702         only properties common data.
6703         (Indexer.CheckForDuplications): Indexers are threated as methods so we
6704         need do extra parameters check.
6705
6706         * const.cs: Update after FieldMember rename.
6707
6708         * decl.cs (MemberCache.FindBaseEvent): New method.
6709
6710         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
6711         to reflect that indexer is now derived from PropertyBased.
6712
6713         * ecore.cs (GetMemberType): Made public.
6714         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
6715         obsolete event.
6716
6717         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
6718         
6719         * typemanager.cs (CSharpSignature): Correctly print event accessors.
6720         (RegisterEvent): Removed.
6721         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
6722         (GetPrivateFieldOfEvent): Renamed to GetEventField.
6723
6724 2007-01-11  Raja R Harinath  <rharinath@novell.com>
6725
6726         Fix #80249
6727         * statement.cs (CollectionForeach.TryType): Prefer generic
6728         GetEnumerator over non-generic variant.  Fix code to follow comments.
6729
6730 2007-01-09  Raja R Harinath  <rharinath@novell.com>
6731
6732         Fix #80446
6733         * support.cs (ReflectionParameter): Don't use an invalid index on
6734         the generic parameter data.
6735
6736 2007-01-08  Miguel de Icaza  <miguel@novell.com>
6737
6738         * driver.cs: Just add a tiny bit of infrastructure.
6739
6740 2007-01-02  Marek Safar  <marek.safar@gmail.com>
6741
6742         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
6743         where field type is struct from current assembly.
6744         
6745         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
6746         it is possible.
6747
6748 2007-01-02  Marek Safar  <marek.safar@gmail.com>
6749
6750         A fix for bug #80381
6751         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
6752         the core types.
6753
6754         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
6755         messages.
6756         (Namespace.LookupType): Always use core types from corlib when speficied.
6757
6758         * report.cs: A new warning.
6759
6760         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
6761         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
6762         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
6763
6764         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
6765         (InitCoreTypes): Set expression type of object_type and value_type
6766         immediately after lookup.
6767
6768 2007-01-01  Miguel de Icaza  <miguel@novell.com>
6769
6770         * cs-tokenizer.cs: Accept Pc class characters (Connector
6771         Punctuation) as valid identifiers.  Fixes #78259
6772
6773         * expression.cs (Invocation.DoResolve): Moved the check for the
6774         use of `this' for doing method calls to the Invocation resolution
6775         step, after overload resolution has taken place instead of doing
6776         the check at the low-level `This.DoResolve' level.
6777
6778         The `This.DoResolve'(appens before overload resolution, so it has
6779         no way of knowing if the method that will be called will be
6780         instace or static, triggering an erroneous report for cs0188 (Bug
6781         78113).
6782
6783         We now do the check for instance method invocations after we know
6784         what method will be called.
6785
6786         (This.CheckThisUsage): Move the actual use of this structure
6787         checking into its own method and expose it. 
6788
6789         * Everywhere that called Error_ValueCannotBeConverted: pass a new
6790         EmitContext.
6791
6792         Exceptions: Null.ConvertImplicitly,
6793         Constant.ImplicitConversionRequired as there are too many call
6794         sites for passing the ec. 
6795
6796         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
6797         EmitContext, if the value is null, then we do not try to provide
6798         the extra information from the error (If a userdefined conversion
6799         exists, as UserDefinedConversion requires a non null-EmitContext).
6800
6801         Fixes: #80347
6802
6803 2006-12-30  Raja R Harinath  <rharinath@novell.com>
6804
6805         * flowanalysis.cs (MyBitVector): Document some invariants.
6806         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
6807         introduced below, and add a couple of others, 
6808
6809 2006-12-30  Marek Safar  <marek.safar@gmail.com>
6810
6811         * attribute.cs (GetMethodObsoleteAttribute): Uses new
6812         GetPropertyFromAccessor and GetEventFromAccessor.
6813         
6814         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
6815         overrides non-obsolete one.
6816         (Indexer.Define): Error message has been moved to the parser.
6817
6818         * cs-parser.jay: Better syntax errors handling.
6819
6820         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
6821         when an invocation has no arguments.
6822
6823         * ecore.cs: Removed not used caching.
6824
6825         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
6826         implementation.
6827
6828         * report.cs: Add a new warning.
6829
6830         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
6831
6832         * typemanager.cs (enumeration_type): Removed.
6833         (CSharpSignature): Reuses IsSpecialMethod.
6834         (IsEqual): Hack for MS BCL.
6835         (GetPropertyFromAccessor): New method.
6836         (GetEventFromAccessor): New method.
6837         (IsSpecialMethod): Fixed to handle more cases.
6838
6839 2006-12-30  Marek Safar  <marek.safar@gmail.com>
6840
6841         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
6842         Made white spaces array static.
6843
6844         * ecore.cs (RemoveGenericArity): Optimized.
6845
6846         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
6847         10 times faster).
6848         (MyBitVector.initialize_vector): Simplified.
6849
6850 2006-12-22  Miguel de Icaza  <miguel@novell.com>
6851
6852         * ecore.cs: Am not entirely happy with this hack, but it seems to
6853         address the issue in 80257 (a small test case for
6854         CreativeDocs.NET). 
6855
6856         I set the MethodGroupExpr.Type to an internal compiler type
6857         (itself in this case) to force the resolution to take place.   Why
6858         it does not take place with a null is beyond me.
6859
6860 2006-12-20  Marek Safar  <marek.safar@gmail.com>
6861
6862         A fix for bug #80288
6863         * expression.cs (ResolveOperator): Consider user defined conversion for
6864         logical and operator too.
6865         (EmitBranchable): Optimization for logical and when full constant folding
6866         could not be applied but one operand is constant.
6867
6868 2006-12-19  Marek Safar  <marek.safar@gmail.com>
6869
6870         * class.cs (GetClassBases): Write 5 times every day, will never use
6871         FullName for error reporting.
6872
6873         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
6874
6875 2006-12-19  Martin Baulig  <martin@ximian.com>
6876
6877         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
6878         the symbol file info here.
6879
6880 2006-12-18  Marek Safar  <marek.safar@gmail.com>
6881
6882         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
6883         of `elseif' is taking then following sections are not taking.
6884         Fixes an issue reported on mono mailing list.
6885
6886 2006-12-18  Marek Safar  <marek.safar@gmail.com>
6887
6888         A fix for bug #80300
6889         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
6890         a caller is not taking.
6891
6892 2006-12-18  Raja R Harinath  <rharinath@novell.com>
6893
6894         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
6895         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
6896         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
6897         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
6898         * class.cs: Update to changes.
6899
6900 2006-12-17  Marek Safar  <marek.safar@gmail.com>
6901
6902         A fix for bug #79934
6903         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
6904         partial container.
6905
6906         * class.cs (ResolveMembers): Register an iterator in current container and
6907         not in shared one.
6908
6909 2006-12-16  Raja R Harinath  <rharinath@novell.com>
6910
6911         Fix test-543.cs
6912         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
6913         satisfy a params annotated parameter.
6914
6915 2006-12-16  Marek Safar  <marek.safar@gmail.com>
6916
6917         A fix for bug #77014
6918         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
6919         paramters correctly and not rely on hacks in Parameters class.
6920         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
6921         at any possition.
6922         (Invocation.VerifyArgumentsCompat): Ditto.
6923         (Invocation.EmitArguments): Changed to correctly emit params arguments at
6924         any possition.
6925
6926         * parameter.cs (HasParams): Don't assume that params is the last one.
6927
6928         * support.cs (ReflectionParameters.ctor): Look for params attribute
6929         correctly.
6930         (ReflectionParameters.ParameterType): Removed hack when we returned last
6931         parameter for out of range parameters.
6932         (ParameterName, ParameterModifier): Ditto.
6933
6934 2006-12-14  Marek Safar  <marek.safar@gmail.com>
6935
6936         A fix for bug #79987
6937         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
6938         when assembly is not CLS compliant but type is. I have no idea why is this
6939         allowed.
6940
6941         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
6942
6943 2006-12-13  Miguel de Icaza  <miguel@novell.com>
6944
6945         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
6946         in struct constructors, they are basically no-ops.
6947
6948 2006-12-12  Marek Safar  <marek.safar@gmail.com>
6949
6950         * cs-tokenizer.cs (Position): Save preprocessor status too.
6951
6952 2006-12-12  Marek Safar  <marek.safar@gmail.com>
6953
6954         A fix for bug #77794
6955         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
6956
6957 2006-12-12  Marek Safar  <marek.safar@gmail.com>
6958
6959         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
6960         Fixes #69299.
6961         (pp_expr): Report error for an invalid expression.
6962         (handle_preprocessing_directive): Simplified; add more error checking.
6963
6964 2006-12-11  Marek Safar  <marek.safar@gmail.com>
6965
6966         A fix for bug #74939
6967         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
6968         directives handling.
6969
6970 2006-12-10  Marek Safar  <marek.safar@gmail.com>
6971
6972         A fix for bugs #80093, and #75984
6973         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
6974         logic, it seems to me as it worked before "by coincidence".
6975         (xtoken): Simplified to use reworked handle_preprocessing_directive.
6976         (cleanup): Enabled endif check.
6977
6978 2006-12-09  Marek Safar  <marek.safar@gmail.com>
6979
6980         A fix for bug #80162
6981         * statement.cs (CollectionForeach.TryType): Generics and non-generics
6982         enumerators are never ambiguous.
6983
6984 2006-12-08  Raja R Harinath  <rharinath@novell.com>
6985
6986         Fix #80060
6987         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
6988
6989 2006-12-06  Marek Safar  <marek.safar@gmail.com>
6990
6991         A fix for bug #80144
6992         * class.cs (EventProperty.Define): Explicit implementation means
6993         that an even is used.
6994
6995 2006-12-06  Marek Safar  <marek.safar@gmail.com>
6996
6997         Fixes the operators implementation (part II)
6998
6999         * cfold.cs (DoConstantNumericPromotions): Renamed to
7000         DoBinaryNumericPromotions and simplified.
7001         (BinaryFold): Couple of conversion fixes; simplified.
7002
7003         * constant.cs, ecore.cs, literal.cs
7004         (ToType): Renamed to ConvertImplicitly.
7005         (Reduce): Renamed to ConvertExplicitly.
7006
7007         * class.cs, convert.cs: Updated.
7008
7009         * expression.cs: TryReduce doesn't throw an exception.
7010
7011 2006-12-01  Marek Safar  <marek.safar@gmail.com>
7012
7013         A fix for bug #80108
7014         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
7015         compatible.
7016
7017 2006-11-30  Marek Safar  <marek.safar@gmail.com>
7018
7019         Fixes unary operators implementation (part I)
7020         Also fixes #80026
7021
7022         * cfold.cs (Error_CompileTimeOverflow): Made internal
7023
7024         * const.cs (IConstant): Changed to use reference to constant and
7025         not constant itself.
7026         Updated IConstant implementations.
7027
7028         * constant.cs (CreateConstant): New factory method.
7029         Updated IConstant implementation.
7030
7031         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
7032
7033         * ecore.cs: Updated to use CreateConstantReference.
7034
7035         * enum.cs: Reflects IConstant changes.
7036
7037         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
7038
7039         * literal.cs (NullConstant): Change to be independently usable.
7040
7041 2006-11-29  Martin Baulig  <martin@ximian.com>
7042
7043         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
7044         we need to emit the scope initializer before calling the base .ctor.
7045
7046         * anonymous.cs: Merged back from the new anonymous methods branch.
7047         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
7048
7049         * expression.cs (ParameterReference.DoResolveBase): Create a
7050         "normal" ScopeInfo when capturing parameters rather than using the
7051         root scope; this makes things work with anonymous methods having
7052         parameters.
7053
7054         * statement.cs
7055         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
7056
7057 2006-11-22  Marek Safar  <marek.safar@gmail.com>
7058
7059         A fix for bug #79987
7060         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
7061         check to a base class.
7062         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
7063         only when assembly has missing attribute.
7064         * report.cs: Update.
7065
7066 2006-11-21  Marek Safar  <marek.safar@gmail.com>
7067
7068         * cs-tokenizer.cs: Merged with gmcs version.
7069
7070 2006-11-20  Marek Safar  <marek.safar@gmail.com>
7071
7072         * cs-tokenizer.cs,
7073         * cs-parser.jay: Better error message when partial keyword is misplaced.
7074
7075 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
7076
7077         A fix for bug #79810
7078         report.cs: CS1058 only applies to 2.0 profile (gmcs).
7079         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
7080         a RuntimeWrappedException by default.
7081
7082 2006-11-18  Marek Safar  <marek.safar@gmail.com>
7083
7084         A fix for bug #79843
7085         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
7086         implementation.
7087         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
7088
7089 2006-11-18  Marek Safar  <marek.safar@gmail.com>
7090
7091         * driver.cs, namespace.cs: Uses faster IndexOf version.
7092
7093 2006-11-17  Marek Safar  <marek.safar@gmail.com>
7094
7095         A fix for bug #79941
7096         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
7097         operators.
7098         (Operator.Define): Implicit/Explicit operator of same type is duplicate
7099         even if internal name is different.
7100         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
7101         (UserDefinedConversion): Simplified as the operators cannot be internal.
7102         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
7103         conversions.
7104         (MethodLookup): Replaced EmitContext with parentType.
7105         * expression.cs: Updated.
7106
7107 2006-11-09  Raja R Harinath  <rharinath@novell.com>
7108
7109         * driver.cs (BadAssembly): Handle all the ugliness of
7110         DefineDynamicAssembly.
7111
7112 2006-11-08  Raja R Harinath  <rharinath@novell.com>
7113
7114         Address parts of #58244 -- most of what's left is in the runtime
7115         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
7116         CS1509 error checks, and handle them for all assembly loads, not
7117         just the first invocation.
7118         (LoadModule): Likewise.  Move handling of 'adder_method' ...
7119         * codegen.cs (AssemblyClass.AddModule): ... here.
7120
7121 2006-11-02  Marek Safar  <marek.safar@gmail.com>
7122
7123         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
7124         IEnumerable<T> is ambiguous.
7125
7126 2006-10-31  Marek Safar  <marek.safar@gmail.com>
7127
7128         A fix for bug #67689
7129         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
7130         GetEnumerator is ambiguous.
7131
7132         * report.cs: Add new warning.
7133
7134 2006-10-29  Marek Safar  <marek.safar@gmail.com>
7135
7136         A fix for bug #78602
7137         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7138         to protected member can be nested type.
7139
7140 2006-10-28  Marek Safar  <marek.safar@gmail.com>
7141
7142         A fix for bug #78965
7143         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7144         to protected member must derive from current type.
7145
7146 2006-10-27  Marek Safar  <marek.safar@gmail.com>
7147
7148         assign.cs: Reuses error method.
7149
7150         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
7151         instead of type for constants.
7152         (Expression.Error_ValueAssignment): Common error method.
7153
7154         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
7155         for any assignment.
7156
7157 2006-10-27  Marek Safar  <marek.safar@gmail.com>
7158
7159         A fix for bug #79081
7160         * expression.cs (MemberAccess.DoResolve): Check nested type
7161         accessibility.
7162
7163 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
7164
7165         * doc.cs : nested delegates were not handled. Fixed bug #79754.
7166
7167 2006-10-26  Marek Safar  <marek.safar@gmail.com>
7168
7169         A fix for bug #76591
7170         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
7171
7172 2006-10-26  Marek Safar  <marek.safar@gmail.com>
7173
7174         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
7175         type forwarder of the same type multiple times.
7176
7177 2006-10-26  Raja R Harinath  <rharinath@novell.com>
7178
7179         Fix #78820
7180         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
7181         instance as an rvalue, even when we later resolve as an lvalue.
7182
7183 2006-10-25  Martin Baulig  <martin@ximian.com>
7184
7185         * anonymous.cs: Fix #79673.
7186
7187 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
7188
7189         A fix for bug #79666
7190         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
7191         ignored when is optimized (= default value) as its value is already set.
7192
7193 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
7194
7195         A fix for bug #79724
7196         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
7197         TypeContainer for type lookup.
7198
7199 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
7200
7201         A fix for bug #79231
7202         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
7203         * expression.cs (OverloadResolve): Always convert type name for
7204         an error message.
7205         (ResolveNamespaceOrType): Don't confuse a nested type with any 
7206         other member.
7207
7208 2006-10-18  Martin Baulig <martin@ximian.com>
7209
7210         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
7211
7212 2006-10-17  Miguel de Icaza  <miguel@novell.com>
7213
7214         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
7215         an int32, but requesting an int64 from the conversion
7216
7217 2006-10-12  Martin Baulig  <martin@ximian.com>
7218
7219         * anonymous.cs
7220         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
7221         
7222 2006-10-12  Martin Baulig  <martin@ximian.com>
7223
7224         * statement.cs
7225         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
7226
7227 2006-10-11  Miguel de Icaza  <miguel@novell.com>
7228
7229         * convert.cs: Remove broken code: I was doing the "Existance"
7230         tests for Implicit conversions.
7231
7232 2006-10-10  Miguel de Icaza  <miguel@novell.com>
7233
7234         * convert.cs: Added one missing case in
7235         ImplicitStandardConversionExists uint64 to intptr.
7236
7237         Fixes #59800
7238         
7239         * typemanager.cs (uintptr_type): another core known type.   
7240
7241         * ecore.cs (OperatorCast): routine used to do cast operations that
7242         depend on op_Explicit.  We could change some of the Decimal
7243         conversions to use this.
7244
7245         This one has a probe mechanism that checks both types for an op_
7246         which it coudl be used to eliminate two classes: CastToDecimal
7247         and CastFromDecimal.
7248
7249         * convert.cs: Implement the conversions documented in #59800
7250         
7251 2006-10-10  Martin Baulig  <martin@ximian.com>
7252
7253         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
7254         before RootScope.ResolveMembers().
7255
7256         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
7257         `CurrentType' if appropriate.
7258
7259 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
7260
7261         A fix for bug #78568
7262         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
7263         when contains binary operators.
7264         * cs-parser.jay: Updated.
7265
7266 2006-10-09  Martin Baulig  <martin@ximian.com>
7267
7268         * delegate.cs
7269         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
7270         moved that into Define() and also do the other type parameter
7271         checks there.  Fixes #79094.  Added gtest-292.cs.
7272
7273         * expression.cs
7274         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
7275         since that doesn't include type parameters; don't use `Ldelema'
7276         for type parameters.  Fixes #78980.  Added gtest-293.cs.
7277
7278 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
7279
7280         A fix for #77796
7281         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
7282         conversion is allowed.
7283
7284 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
7285
7286         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
7287         error reporting when no error occurs.
7288
7289 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
7290
7291         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
7292         does not exist.
7293
7294 2006-10-06  Raja R Harinath  <rharinath@novell.com>
7295
7296         Fix #79584
7297         * class.cs (DefineTypeBuilder): Check circular dependencies before
7298         setting the parent of the TypeBuilder.
7299         (CheckRecursiveDefinition): Don't use 'BaseType', since
7300         it may not be valid until after DefineTypeBuilder.  Use
7301         'base_type' instead.
7302
7303 2006-10-04  Martin Baulig  <martin@ximian.com>
7304
7305         Merged the Anonymous Methods patch.
7306
7307         * anonymous.cs, iterators.cs: The new anonymous methods code.
7308
7309         * statement.cs (Variable): New public abstract class.
7310         (LocalInfo.Variable): New public property.
7311         (LocalInfo.ResolveVariable): New public method.
7312         (Block.Flags): Add `IsIterator'.
7313         (Block.AddVariable): Improved the CS0136 check.
7314         (Block.AnonymousChildren): New public property.
7315         (Block.AddAnonymousChild): New public method.
7316         (ToplevelBlock): Update to use the new anonymous method framework.
7317         (ToplevelBlock.ctor): `container' is now a `Block' and not a
7318         `ToplevelBlock'; this is required to correctly implement the
7319         CS0136 check.
7320         (Fixed, Using): Use `TemporaryVariable' instead of directly
7321         creating the `LocalBuilder'.
7322
7323         * parameter.cs (Parameter.ResolveVariable): New public method.
7324         (Parameters.ResolveVariable): Likewise.
7325
7326         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
7327
7328         * class.cs (TypeContainer): Replaced the `iterators' list and
7329         corresponding methods with a list of `CompilerGeneratedClass'es.
7330         (TypeContainer.ResolveMembers): New public method.
7331         (Method): `IIteratorContainer' has been replaced by
7332         `IAnonymousHost'.
7333
7334         * expression.cs (VariableReference): New public abstract base
7335         class for `LocalVariableReference', `ParameterReference' and
7336         `This'.
7337
7338         * codegen.cs (EmitContext): Removed `capture_context',
7339         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
7340         (EmitContext.EmitThis): Removed.
7341
7342         * cs-parser.jay: Replace `iterator_container' with
7343         `anonymous_host'.       
7344
7345 2006-10-04  Martin Baulig  <martin@ximian.com>
7346
7347         * generic.cs (GenericMethod): Don't make this abstract.
7348         (Constraints.Clone): Added dummy implementation.
7349
7350 2006-10-04  Raja R Harinath  <harinath@gmail.com>
7351
7352         Fix #79577
7353         * namespace.cs (LookForAnyGenericType): Avoid nullref on
7354         'declspaces'.  Avoid allocating arrays willy-nilly.
7355
7356         Fix #79553
7357         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
7358         cases out of the switch.
7359
7360 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
7361
7362         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
7363         message when non-generic type is used with the type arguments.
7364         * expression.cs: Updated.
7365
7366 2006-09-28  Raja R Harinath  <rharinath@novell.com>
7367
7368         Fix #79013
7369         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
7370         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
7371         Change semantics slightly.  Don't insist on having only one
7372         temporary EmptyExpression -- just throttle the creation of new ones.
7373
7374         Fix #79451
7375         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
7376         non-interfaces too.  If no methods are found, don't try to create
7377         a MethodGroupExpr.
7378
7379 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
7380
7381         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
7382         generic type.
7383
7384         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
7385         us produce better error message.
7386
7387 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
7388
7389         * expression.cs (Binary.ResolveOperator): Warn about a side effect
7390         of the `|' operator.
7391
7392         * report.cs: A new warning added.
7393
7394 2006-09-27  Martin Baulig  <martin@ximian.com>
7395
7396         * generic.cs (GenericMethod): Don't make this abstract.
7397
7398 2006-09-27  Martin Baulig  <martin@ximian.com>
7399
7400         * report.cs
7401         (InternalErrorException): Added overloaded ctor taking a params array.
7402
7403 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
7404
7405         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
7406         Fixed the cases when same error was reported twice.
7407
7408         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
7409         now report symbol information.
7410
7411 2006-09-25  Martin Baulig  <martin@ximian.com>
7412
7413         * class.cs: Completely unified with the gmcs version.
7414
7415 2006-09-25  Martin Baulig  <martin@ximian.com>
7416
7417         * typemanager.cs (TypeManager.IsNullableType): New public function.
7418         (TypeManager.IsNullableTypeOf): Likewise.
7419         (TypeManager.IsNullableValueType): Likewise.
7420
7421         * class.cs (MethodCore): Added the `GenericMethod' argument from
7422         gmcs and also unified all classes derived from `MethodCore' with gmcs.
7423
7424 2006-09-24  Raja R Harinath  <harinath@gmail.com>
7425
7426         * convert.cs: Unify with gmcs version.
7427
7428 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
7429
7430         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
7431         verify them as well.
7432
7433         * report.cs: New warning.
7434
7435 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
7436
7437         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
7438         for anonymous block with out argument.
7439
7440 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
7441
7442         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
7443         not used private events only.
7444
7445 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
7446
7447         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
7448
7449         * const.cs (Const.Define): Check for constant type.
7450         (Const.IsConstantTypeValid): Looks for valid constant types.
7451
7452         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
7453
7454         * ecore.cs (EmptyConstantCast): New common class for all constant based
7455         EmptyCast(s).
7456
7457         * expression.cs (Is.DoResolve): Handle null constant especially.
7458         (New.DoResolve): Check for new void().
7459         (MemberAccess.DoResolve): Cope with all kind of nulls.
7460
7461         * literal.cs (NullConstant): Uses EmptyConstantCast.
7462         (NullDefault): Based on EmptyConstantCast.
7463         (NullLiteral): Uses EmptyConstantCast.
7464
7465         * statement.cs (Block.ResolveMeta): Check for constant type.
7466
7467 2006-09-22  Martin Baulig  <martin@ximian.com>
7468
7469         * delegate.cs, attribute.cs: Merged with the gmcs versions.
7470
7471 2006-09-22  Raja R Harinath  <rharinath@novell.com>
7472
7473         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
7474         not the null type.
7475
7476         Fix part of #79451
7477         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
7478         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
7479         code slightly.
7480
7481 2006-09-22  Martin Baulig  <martin@ximian.com>
7482
7483         * ecore.cs: Merged with the gmcs version.
7484
7485         * generic.cs (ConstructedType): New dummy class.
7486         (TypeArguments): Don't make this abstract.
7487
7488         * typemanager.cs
7489         (TypeManager.IsGenericTypeDefinition): New method.
7490         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
7491
7492 2006-09-22  Raja R Harinath  <rharinath@novell.com>
7493
7494         * expression.cs (ComposedCast): Check for arrays of TypedReference
7495         before creating the type, not after.
7496
7497 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
7498
7499         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
7500         after ToType change.
7501
7502         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
7503         when constant must be implicitly convertible.
7504
7505         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
7506
7507         * ecore.cs (NullCast): Derives from NullConstant.
7508
7509         * expression.cs (Is.DoResolve): Removed useless variables.
7510         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
7511         (New.Constantify): Add enum support.
7512         (MemberAccess.DoResolve): Add warning when accessing null constant or
7513         variable.
7514
7515         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
7516         property.
7517
7518         * literal.cs (NullConstant): New abstract class with common
7519         functionality for all null specializations.
7520         (NullDefault): Represents default(X) when result can be
7521         reduced to null.
7522         (NullLiteral): Updated.
7523
7524         * report.cs: Add new warning.
7525
7526 2006-09-21  Martin Baulig  <martin@ximian.com>
7527
7528         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
7529
7530 2006-09-21  Martin Baulig  <martin@ximian.com>
7531
7532         * generic.cs (GenericConstraints): New dummy class.
7533         (Constraints): Likewise.
7534         (TypeParameter): Likewise.
7535         (TypeParameterName): Likewise.
7536         (GenericMethod): Likewise.
7537
7538         * typemanager.cs (TypeManager.GetGenericArguments): New method.
7539
7540         * decl.cs: Merged with the gmcs version.
7541
7542 2006-09-21  Raja R Harinath  <rharinath@novell.com>
7543
7544         * generic.cs (TypeParameter): Implement IMemberContainer.
7545         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
7546
7547         * rootcontext.cs: Unify with gmcs version.
7548
7549         * report.cs: Unify with gmcs version.
7550         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
7551         from gmcs/generics.cs.
7552         * generics.cs (TypeParameter): New dummy class.
7553
7554         * support.cs: Unify with gmcs version.
7555
7556 2006-09-20  Raja R Harinath  <rharinath@novell.com>
7557
7558         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
7559         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
7560
7561         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
7562         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
7563         * mcs.exe.sources: Add generic.cs.
7564
7565         * codegen.cs: Unify with gmcs version.
7566
7567         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
7568         (EmitContext): Add GenericDeclContainer implementation.
7569         * decl.cs (MemberCore, DeclSpace): Likewise.
7570         * namespace.cs: Remove #ifdef GMCS_SOURCE.
7571
7572         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
7573         MCS TypeManager has a corresponding dummy method.
7574
7575 2006-09-19  Martin Baulig  <martin@ximian.com>
7576
7577         * expression.cs: Completely merged with the gmcs version.
7578
7579 2006-09-19  Martin Baulig  <martin@ximian.com>
7580
7581         * expression.cs (Invocation): Merged with the gmcs version.
7582         (ArrayAccess.GetStoreOpcode): Likewise.
7583
7584 2006-09-19  Martin Baulig  <martin@ximian.com>
7585
7586         * typemanager.cs
7587         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
7588         (TypeManager.IsGenericMethodDefinition): Likewise.
7589
7590 2006-09-19  Martin Baulig  <martin@ximian.com>
7591
7592         * typemanager.cs
7593         (TypeManager.IsEqual): Moved the gmcs implementation here.
7594         (TypeManager.DropGenericTypeArguments): Likewise.
7595         (TypeManager.DropGenericMethodArguments): Likewise.
7596         (TypeManager.GetTypeArguments): Moved here from gmcs.
7597         (TypeManager.HasGenericArguments): Likewise.
7598
7599 2006-09-19  Martin Baulig  <martin@ximian.com>
7600
7601         * expression.cs (Binary): Merged with the gmcs version.
7602
7603 2006-09-19  Martin Baulig  <martin@ximian.com>
7604
7605         * expression.cs (Probe, As, Is): Merged with the gmcs version.
7606
7607 2006-09-19  Martin Baulig  <martin@ximian.com>
7608
7609         * typemanager.cs: Merged with the gmcs version.
7610
7611 2006-09-16  Raja R Harinath  <rharinath@novell.com>
7612
7613         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
7614         * driver.cs: Likewise.
7615
7616 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
7617
7618         A fix for #79401
7619         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
7620         only if parent type is class.
7621         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
7622         update.
7623
7624 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
7625
7626         * cs-parser.jay,
7627         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
7628         keywords are used.
7629         * typemanager.cs(CSharpName): Converts NullType to null.
7630
7631 2006-09-15  Martin Baulig  <martin@ximian.com>
7632
7633         * typemanager.cs
7634         (TypeManager.GetMethodName): Added mcs implementation.
7635         (TypeManager.IsEqual): Likewise.
7636
7637         * ecore.cs
7638         (SimpleName.RemoveGenericArity): Added dummy implementation.
7639
7640         * pending.cs: Merged with the gmcs version.     
7641
7642 2006-09-15  Martin Baulig  <martin@ximian.com>
7643
7644         * statement.cs: Merge with the gmcs version.
7645
7646 2006-09-15  Martin Baulig  <martin@ximian.com>
7647
7648         * statement.cs (Switch): Merge with the gmcs implementation
7649         (without nullables), which is newer.
7650
7651 2006-09-15  Martin Baulig  <martin@ximian.com>
7652
7653         * statement.cs (Block.Variables): Make this public.
7654         (ToplevelBlock.Parameters): Make this a property.
7655         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
7656
7657 2006-09-15  Martin Baulig  <martin@ximian.com>
7658
7659         * namespace.cs: Merge with the gmcs version.
7660
7661 2006-09-15  Martin Baulig  <martin@ximian.com>
7662
7663         * decl.cs (MemberName): Minor code cleanups.
7664
7665 2006-09-15  Martin Baulig  <martin@ximian.com>
7666
7667         * parameter.cs: Merge with the gmcs version.
7668
7669 2006-09-15  Martin Baulig  <martin@ximian.com>
7670
7671         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
7672         and an error in mcs.
7673
7674 2006-09-15  Martin Baulig  <martin@ximian.com>
7675
7676         * flowanalysis.cs: Merged from GMCS; added the generics code into
7677         a `GMCS_SOURCE' conditional so we can share this file.
7678
7679 2006-09-08  Martin Baulig  <martin@ximian.com>
7680
7681         * typemanager.cs (TypeManager.interlocked_type): New public field.
7682         (TypeManager.int_interlocked_compare-exchange): New public field.
7683         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
7684         enumerator types here and call InitGenericCoreTypes().
7685         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
7686         after calling InitEnumUnderlyingTypes().
7687
7688         * rootcontext.cs
7689         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
7690         `classes_second_stage'. 
7691
7692 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
7693
7694         * assign.cs, ecore.cs, expression.cs: Share error message text.
7695         * class.cs (FieldMember.Define): Check for varible of static type.
7696         * driver.cs (LoadAssembly): Uses error output for errors.
7697         * statement.cs: Updated.
7698
7699 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
7700
7701         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
7702         type instance.
7703
7704 2006-09-07  Martin Baulig  <martin@ximian.com>
7705
7706         * driver.cs
7707         (MainDriver): Revert r62663 from Marek; see #70506 for details.
7708
7709 2006-08-29  Miguel de Icaza  <miguel@novell.com>
7710
7711         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
7712         
7713 2006-08-17  Miguel de Icaza  <miguel@novell.com>
7714
7715         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
7716         #52019 and #79064, the use of the \uXXXX sequence in source code
7717         to represent unicode characters.
7718
7719 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
7720
7721         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
7722         support.
7723         * class.cs, ecore.cs, statement.cs: Merged to one error message.
7724
7725 2006-08-13  Miguel de Icaza  <miguel@novell.com>
7726
7727         * assign.cs: Catch attempts to assign to a method groups in += and
7728         report as 1656
7729
7730 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
7731
7732         A fix for #79056
7733         * cs-parser.jay: Don't destroy current array type by typeof of array's.
7734
7735 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
7736
7737         * class.cs (Method.Define): Issue a warning when generic method looks like
7738         an entry point.
7739         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
7740         as well.
7741
7742 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
7743  
7744         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
7745         looking for ctor.
7746         * decl.cs (MemberCache.FindMembers): When container is interface we need to
7747         search all base interfaces as a member can be ambiguous.
7748         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
7749         Constructor member type filter. 
7750         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
7751         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
7752         reporting for returned memberinfos.
7753         * report.cs: Updated.
7754         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
7755         version to work on all runtimes.
7756         (TypeManager.RealMemberLookup): Removed members filtering.
7757
7758 2006-08-08  Raja R Harinath  <rharinath@novell.com>
7759
7760         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
7761         (PropertyExpr.EmitAssign): Likewise.
7762         * expression.cs (Indirection.EmitAssign): Likewise.
7763         (LocalVariableReference.EmitAssign): Likewise.
7764         (ParameterReference.EmitAssign): Likewise.
7765         (Invocation.EmitArguments): Likewise.
7766         (ArrayAccess.EmitAssign): Likewise.
7767         (IndexerAccess.EmitAssign): Likewise.
7768         (This.EmitAssign): Likewise.
7769         (ConditionalLogicalOperator.Emit): Likewise.
7770
7771         Fix #79026
7772         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
7773         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
7774         leave it in after returning it.
7775         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
7776
7777 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
7778
7779         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
7780         message.
7781
7782 2006-08-03  Raja R Harinath  <rharinath@novell.com>
7783
7784         Fix cs0146-3.cs and cs0146-4.cs.
7785         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
7786         enclosing types don't depend on the current type.
7787
7788 2006-08-02  Raja R Harinath  <rharinath@novell.com>
7789
7790         Fix #77963
7791         * class.cs (TypeContainer.DoDefineMembers): Use
7792         FindBaseMemberWithSameName on Parent, since we're interested in
7793         whether we hide inherited members or not.
7794         (FindBaseMemberWithSameName): Make slightly more robust.
7795
7796         Fix the non-generic testcase from #77396
7797         * decl.cs (DeclSpace.DeclContainer): Remove override.
7798
7799         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
7800         declspaces for doppelgangers too.
7801         (UsingEntry): Implement IResolveContext.
7802         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
7803         'this' as the resolve context.
7804         (LocalAliasEntry): Likewise.
7805
7806         Implement parts of #77403
7807         * roottypes.cs (RootDeclSpace): New.  Used to represent the
7808         toplevel declaration space.  Each namespace declaration introduces
7809         a "partial" root declaretion space.
7810         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
7811         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
7812         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
7813         from 'current_namespace.SlaveDeclSpace'.
7814         (namespace_declaration): Likewise.
7815         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
7816         check.  It can't happen now.
7817         * decl.cs (DeclSpace.LookupType): Likewise.
7818         * driver.cs (MainDriver): Sanity check.
7819
7820 2006-08-01  Raja R Harinath  <rharinath@novell.com>
7821
7822         * decl.cs (DeclSpace.FindNestedType): Remove.
7823         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
7824         LookupTypeContainer to get the container of the nested type.
7825         * class.cs (TypeContainer.FindNestedType): Make non-override.
7826
7827 2006-07-31  Raja R Harinath  <rharinath@novell.com>
7828
7829         * decl.cs (DeclSpace.PartialContainer): Move field from ...
7830         * class.cs (TypeContainer.PartialContainer): ... here.
7831         (TypeContainer.AddBasesForPart): New helper.
7832         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
7833         instead.
7834         * cs-parser.jay (current_class): Convert to DeclSpace.
7835         (struct_declaration, interface_declaration, class_declaration):
7836         Use AddBasesForPart instead of .Bases directly.
7837         * const.cs, iterators.cs: Update to changes.
7838
7839 2006-07-28  Raja R Harinath  <rharinath@novell.com>
7840
7841         * class.cs (TypeContainer.AddMemberType): Rename from
7842         AddToTypeContainer.
7843         (TypeContainer.AddMember): Rename from AddToMemberContainer.
7844         (AddTypeContainer): New.  Combine AddClassOrStruct and
7845         AddInterface.
7846         (AddPartial): Update.  Add 'is_partial' argument.
7847         * roottypes.cs: Update to changes.
7848         * cs-parser.jay (push_current_class): New helper for handling
7849         current_container and current_class.
7850         (struct_declaration, interface_declaration, class_declaration):
7851         Use it.
7852
7853 2006-07-26  Raja R Harinath  <rharinath@novell.com>
7854
7855         * roottypes.cs: Rename from tree.cs.
7856
7857         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
7858         * tree.cs (Tree, ITreeDump): Remove types.
7859         * rootcontext.cs (tree, Tree): Remove fields.
7860         (root, ToplevelTypes): New.
7861         * *.cs: Update to rename.
7862
7863         * tree.cs (Tree.RecordDecl): Remove.
7864         (RootTypes.AddToTypeContainer): Record the toplevel type in its
7865         namespace here.
7866         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
7867
7868 2006-07-23  Raja R Harinath  <harinath@gmail.com>
7869
7870         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
7871         DoFlowAnalysis and OmitStructFlowAnalysis here.
7872         (ec.With): Rename from WithUnsafe and generalize.
7873         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
7874         (ec.WithFlowAnalyis): New.
7875         * ecore.cs, expression.cs, statement.cs: Update.
7876
7877 2006-07-22  Raja R Harinath  <harinath@gmail.com>
7878
7879         * statement.cs (Block.ResolveMeta): Simplify slightly.
7880
7881         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
7882         multiple boolean fields.  Convert InUnsafe, constant_check_state,
7883         check_state to flags.
7884         (CheckState, ConstantCheckState): Update.
7885         (InUnsafe): New read-only property.
7886         (FlagsHandle): Rename from CheckStateHandle and convert to handle
7887         arbitrary flags.
7888         (WithUnsafe): New helper similar to WithCheckState.
7889         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
7890         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
7891
7892 2006-07-21  Raja R Harinath  <rharinath@novell.com>
7893
7894         Make comparisons use the same IL irrespective of whether they're
7895         in a 'checked' or 'unchecked' context: one of the issues in #78899
7896         * codegen.cs (EmitContext.CheckState): Make read-only property.
7897         (EmitContext.ConstantCheckState): Likewise.
7898         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
7899         helper that implement a save/restore stack for CheckState
7900         values.  This is the only way to change check-state.
7901         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
7902         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
7903         (CheckedExpr.EmitBranchable): New forwarding method.
7904         (UnCheckedExpr): Likewise.
7905         * statement.cs (Block.ResolveMeta): Use WithCheckState.
7906         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
7907         (Checked.Resolve, checked.DoEmit): Likewise.
7908
7909 2006-07-20  Miguel de Icaza  <miguel@novell.com>
7910
7911         * anonymous.cs: Cache the resolved anonymous delegate, and return
7912         this so that the ResolveTopBlock is only triggered once, not
7913         twice.
7914
7915         Currently we trigger ResolvetopBlock twice due to a first pass of
7916         argument check compatibility, and a second pass that does the
7917         actual resolution.   
7918         
7919 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
7920
7921         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
7922         modifiers.
7923         * rootcontext.cs (Reset): Add helper_classes.
7924
7925 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
7926
7927         A fix for #78860
7928         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
7929         correctly.
7930
7931 2006-07-13  Miguel de Icaza  <miguel@novell.com>
7932
7933         * statement.cs (Lock): Handle expressions of type
7934         TypeManager.null_type specially.  Fixes #78770
7935
7936 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
7937
7938         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
7939         to an event.
7940
7941 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
7942
7943         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
7944         for accessors as well.
7945         * ecore.cs (EventExpr): Add AccessorTable.
7946
7947 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
7948
7949         A fix for #78738
7950         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
7951         for CS0122 where appropriate.
7952         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
7953         level attributes.
7954         (Filter): Assembly can be null in the case of top level attributes.
7955
7956 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
7957
7958         A fix for #78690
7959
7960         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
7961         is done at global level.
7962
7963 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
7964
7965         A fix for #77002, Implemented TypeForwarder support.
7966
7967         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
7968         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
7969         * typemanager.cs (): Add type_forwarder_attr_type.
7970
7971 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
7972
7973         * report.cs: Add CS0469 warning.
7974
7975 2006-06-21  Martin Baulig  <martin@ximian.com>
7976
7977         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
7978         the `try'-block, so we also report CS0016 etc. there.
7979
7980 2006-06-21  Martin Baulig  <martin@ximian.com>
7981
7982         * delegate.cs
7983         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
7984
7985 2006-06-21  Martin Baulig  <martin@ximian.com>
7986
7987         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
7988         also report CS1686 for parameters.
7989
7990 2006-06-21  Martin Baulig  <martin@ximian.com>
7991
7992         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
7993         instead of an error if the value is not implicitly convertible to
7994         the switch types; fixes #77964.
7995
7996 2006-06-21  Raja R Harinath  <rharinath@novell.com>
7997
7998         Fix #78673
7999         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
8000         FieldBuilder is null.
8001
8002         Fix #78662
8003         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
8004         'left' and 'right' before error-checking.
8005
8006 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
8007
8008         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
8009         Fixed bug #78601.
8010         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
8011         (FieldExpr.DoResolve): likewise.
8012         (PropertyExpr.InstanceResolve): likewise.
8013         (EventExpr.InstanceResolve): likewise. 
8014
8015 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
8016
8017         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
8018         attribute applicable tests for attribute argument.
8019
8020 2006-06-02  Raja R Harinath  <rharinath@novell.com>
8021
8022         Fix #78079
8023         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
8024         (Binary.OverloadResolve_PredefinedIntegral): New.
8025         (Binary.OverloadResolve_PredefinedFloating): New.
8026         (Binary.OverloadResolve_PredefinedString): New.
8027         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
8028         Follow the standard more closely, and treat numeric promotions in
8029         terms of overload resolution.
8030         (Binary.CheckShiftArguments): Simplify.
8031
8032 2006-06-01  Raja R Harinath  <rharinath@novell.com>
8033
8034         * flowanalysis.cs (MyBitVector): Simplify representation.
8035         (MyBitVector.Clone): Avoid allocating BitArray.
8036         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
8037         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
8038         (*): Update.  Change all references to MyBitVector.And and
8039         MyBitVector.Or to &= and |=.
8040
8041 2006-05-29  Raja R Harinath  <rharinath@novell.com>
8042
8043         Fix cs0231-[34].cs.
8044         * cs-parser.jay (formal_parameter_list): Extend the pattern below
8045         to param arguments too.
8046
8047 2006-05-26  Miguel de Icaza  <miguel@novell.com>
8048
8049         * cs-parser.jay: Catch another parsing form for arglist being
8050         followed by other arguments.  Fixes #78313.
8051
8052 2006-05-24  Raja R Harinath  <rharinath@novell.com>
8053
8054         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
8055         checking of out parameters to ...
8056         (FlowBranchingToplevel.Merge): ... here.
8057         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
8058         set, propagate the origin upward, and only complain if there was
8059         no other error.
8060         (FlowBranchingException.AddContinueOrigin): Likewise.
8061         (FlowBranchingException.AddReturnOrigin): Likewise.
8062         (FlowBranchingException.AddGotoOrigin): Likewise.       
8063
8064 2006-05-23  Raja R Harinath  <rharinath@novell.com>
8065
8066         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
8067         unreachable, skip it.
8068         (FlowBranchingException.Merge): Always propagate jumps, even if
8069         the finally block renders subsequent code unreachable.
8070
8071 2006-05-18  Raja R Harinath  <rharinath@novell.com>
8072
8073         Fix #77601
8074         * statement.cs (Goto.Resolve): Move responsibility for resolving
8075         'goto' to FlowBranching.AddGotoOrigin.
8076         (Goto.SetResolvedTarget): New.  Callback to set the
8077         LabeledStatement that's the target of the goto.
8078         (Goto.DoEmit): Use Leave instead of Br when crossing an
8079         unwind-protect boundary.
8080         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
8081         LookupLabel and adjust to new semantics.
8082         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
8083         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
8084         Goto.SetResolvedTarget to update target.
8085         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
8086         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
8087         AddBreakOrigin & co.  Delay propagation until ...
8088         (FlowBranchingException.Merge): ... this.
8089
8090         * statement.cs (Block.Resolve): Always depend on flow-branching to
8091         determine unreachability.  Kill workaround that originally emitted
8092         only one statement after an "unreachable" label (see infloop in
8093         test-515.cs).
8094
8095         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
8096         This is still "wrong", but anything better would probably need a
8097         multi-pass algorithm.
8098         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
8099         usage vector.  Force current usage vector to be reachable, to
8100         optimistically signify backward jumps.
8101         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
8102         detected.
8103         (FlowBranchingLabeled.Merge): New.  If no backward jump was
8104         detected, return the original salted-away usage vector instead,
8105         updated with appropriate changes.  Print unreachable warning if
8106         necessary.
8107         * statement.cs (Block.Resolve): Don't print unreachable warning on
8108         a labeled statement.
8109
8110 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
8111
8112         * driver.cs: Pass filename without path to AssemblyBuilder's 
8113         AddResourceFile. Fixes bug #78407.
8114
8115 2006-05-17  Raja R Harinath  <rharinath@novell.com>
8116
8117         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
8118         * flowanalysis.cs (FlowBranchingLabeled): ... here.
8119         (FlowBranching.MergeChild): Overwrite
8120         reachability information from Labeled branchings too.
8121
8122 2006-05-16  Raja R Harinath  <rharinath@novell.com>
8123
8124         * statement.cs (Goto.Resolve): Merge jump origins here ...
8125         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
8126
8127         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
8128         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
8129         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
8130         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
8131         here, ...
8132         * statement.cs (Goto.Resolve): ... not here.
8133         (Goto.Emit): Remove CS1632 check.
8134
8135 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
8136
8137         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
8138         error message.
8139
8140 2006-05-11  Raja R Harinath  <rharinath@novell.com>
8141
8142         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
8143         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
8144         (FlowBranchingException.Label): Likewise.
8145
8146         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
8147         given value.
8148         (MyBitVector.Or): Use it to avoid losing information (Count).
8149         (FlowBranching.MergeOrigins): Likewise.
8150
8151         * flowanalysis.cs (UsageVector.IsDirty): Remove.
8152         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
8153         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
8154         (UsageVector.ToString): Simplify.
8155         (UsageVector.MergeSiblings): Move here from ...
8156         (FlowBranching.Merge): ... here.
8157         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
8158         not a MyBitVector.
8159
8160 2006-05-10  Raja R Harinath  <rharinath@novell.com>
8161
8162         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
8163         null bitvector is treated as all-true.
8164
8165         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
8166         (MyBitVector): Rationalize invariants.  'vector != null' implies
8167         that we have our own copy of the bitvector.  Otherwise,
8168         'InheritsFrom == null' implies all inherited bits are true.
8169
8170 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
8171
8172         * statement.cs (LocalInfo): Add IsConstant.
8173         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
8174         local variable for constants.
8175
8176 2006-05-09  Raja R Harinath  <rharinath@novell.com>
8177
8178         * flowanalysis.cs (MyBitVector.Empty): New.
8179         (MyBitVector): Don't allow InheritedFrom to be null.
8180         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
8181         (UsageVector, FlowBranching): Update to changes.
8182
8183         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
8184         recursion.  The 'Parent == null' condition isn't sufficient for
8185         anonymous methods.
8186         (FlowBranching.AddBreakOrigin): Likewise.
8187         (FlowBranching.AddContinueOrigin): Likewise.
8188         (FlowBranching.AddReturnOrigin): Likewise.
8189         (FlowBranching.StealFinallyClauses): Likewise.
8190         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
8191         (FlowBranching.CheckOutParameters): Likewise.
8192         (FlowBranchingToplevel): Terminate all the above recursions here.
8193         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
8194         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
8195
8196         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
8197         toplevel block.
8198         (FlowBranchingToplevel): New.  Empty for now.
8199         (FlowBranching.MergeTopBlock): Update.
8200         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
8201         branching for the anonymous delegate.
8202         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
8203
8204         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
8205         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
8206         information at the start of the merge.  Reorganize.
8207
8208 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
8209
8210         * class.cs (MethodData.Define): Method cannot implement interface accessor.
8211
8212 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
8213
8214         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
8215         to newly introduced ctor.
8216
8217         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
8218         message to one place.
8219         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
8220         global namespace.
8221
8222 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
8223
8224         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
8225
8226         * ecore.cs (Expression.ResolveAsConstant): Updated.
8227
8228         * statement.cs (ResolveMeta): Updated.
8229
8230 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
8231
8232         * cs-parser.jay: __arglist cannot be used in initializer.
8233
8234 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
8235
8236         A fix for #77879
8237         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
8238         private types.
8239
8240 2006-05-05  Raja R Harinath  <rharinath@novell.com>
8241
8242         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
8243         (LabeledStatement): Add 'name' parameter.
8244         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
8245         (Block.AddLabel): Update to changes.
8246         * cs-parser.jay (labeled_statement): Likewise.
8247
8248         * flowanalysis.cs (BranchingType.Labeled): New.
8249         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
8250         (FlowBranchingLabeled): New.  Does nothing for now, but will
8251         eventually handle 'goto' flows.
8252         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
8253         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
8254         that's terminated ...
8255         (Block.Resolve): ... here.
8256
8257         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
8258         (UsageVector.MergeFinallyOrigins): Likewise.
8259         (FlowBranching.InTryOrCatch): Likewise.
8260         (FlowBranching.AddFinallyVector): Likewise.
8261         (FlowBranchingException): Update to changes.
8262
8263         Fix #78290
8264         * statement.cs (Return.Resolve): Move error checking to ...
8265         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
8266         (FlowBranchingException): Handle return origins like break and
8267         continue origins.
8268         (FlowBranching.UsageVector.CheckOutParameters): Remove.
8269
8270 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
8271
8272         A fix for #76122
8273         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
8274         filter.
8275
8276 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
8277
8278         A fix for #77543
8279         * class.cs (MethodData.Define): Do public accessor check only when method
8280         implements an interface.
8281
8282 2006-05-04  Raja R Harinath  <rharinath@novell.com>
8283
8284         Remove special handling of 'break'
8285         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
8286         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
8287         (UsageVector.Break): Remove.
8288         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
8289         reachability.
8290         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
8291
8292         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
8293         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
8294
8295 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
8296
8297         A fix for #75726
8298         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
8299         be the interface member.
8300
8301 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
8302
8303         A fix for #60069
8304         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
8305         for emitting small (int) values.
8306
8307 2006-05-03  Raja R Harinath  <rharinath@novell.com>
8308
8309         Fix #59427
8310         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
8311         control-flow passes through the 'finally' after merging-in all the
8312         control-flows from 'try' and the 'catch' clauses.
8313
8314         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
8315         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
8316         always true at the only non-recursive entry point.
8317         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
8318         FlowBranchingBreakable.
8319         (FlowBranchingLoop): Remove.
8320         * statement.cs (Return.DoResolve): Update to changes.
8321
8322         Fix #76471, #76665
8323         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
8324         (FlowBranching.CreateBranching): Handle it: create a
8325         FlowBranchingContinuable.
8326         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
8327         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
8328         except that it handles the 'continue' command.
8329         (FlowBranching.UsageVector.MergeOrigins): Rename from
8330         MergeBreakOrigins.
8331         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
8332         except that it overrides AddContinueOrigin.
8333         (FlowBranchingException): Override AddContinueOrigin, similar to
8334         AddBreakOrigin.
8335         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
8336         Create a new branching around the embedded statement.
8337         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
8338         control flow after the embedded statement.
8339         (Continue.Resolve): Move all error checking to AddContinueOrigin.
8340
8341         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
8342         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
8343         FlowBranchingBreakable.
8344         (FlowBranchingSwitch): Remove.
8345
8346         Fix test-503.cs
8347         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
8348         error reporting to ...
8349         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
8350         Rename from 'AddBreakVector'.  Add new location argument.  Return
8351         a bool indicating whether the 'break' crosses an unwind-protect.
8352         (FlowBranchingException.AddBreakOrigin): Add.
8353         (FlowBranchingException.Merge): Propagate 'break's to surrounding
8354         flowbranching after updating with the effects of the 'finally'
8355         clause.
8356         (FlowBranchingBreakable): New common base class for
8357         FlowBranchingLoop and FlowBranchingSwitch.
8358
8359         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
8360         embedded statement.
8361         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
8362
8363 2006-05-02  Raja R Harinath  <rharinath@novell.com>
8364
8365         * statement.cs (Do.Resolve): If the loop is infinite, set the
8366         barrier.
8367         (While.Resolve, For.Resolve): Set a barrier after the embedded
8368         statement.  There's no direct control flow that goes from the end
8369         of the embedded statement to the end of the loop.
8370         * flowanalysis.cs (FlowBranching.Infinite): Remove.
8371         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
8372         above ensure that the reachability is correctly computed.
8373
8374         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
8375         (UsageVector.MergeBreakOrigins): If the current path is
8376         unreachable, treat it as if all parameters/locals are initialized.
8377         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
8378         infinite loops before merging-in break origins.
8379
8380         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
8381         (Reachability.Reachable): Split part into ...
8382         (Reachability.Unreachable): ... this.  Simplify.
8383         (Reachability.IsUnreachable): Use 'Unreachable' instead.
8384
8385         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
8386         (Reachability.SetThrowsSometimes): Likewise.
8387         (FlowBranchingBlock.MergeTopBlock): Don't compare against
8388         TriState.Always, use corresponding property.
8389         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
8390         (Block.Resolve): Likewise.  Remove some redundant checks.
8391
8392 2006-05-02  Raja R Harinath  <harinath@gmail.com>
8393
8394         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
8395         (Reachability.Meet): Don't bother checking AlwaysThrows --
8396         barrier is always set.
8397         (FlowBranchingBlock.Merge): Likewise.
8398
8399 2006-05-01  Raja R Harinath  <harinath@gmail.com>
8400
8401         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
8402         checks for unreachable.
8403
8404 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
8405
8406         A fix for #77980
8407         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
8408
8409         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
8410         whether field is really assigned.
8411
8412 2006-04-30  Raja R Harinath  <harinath@gmail.com>
8413
8414         * flowanalysis.cs (Reachability): Make 4-argument constructor
8415         private.
8416         (Reachability.Meet): Rename from 'And'.  Remove static variant.
8417         (Reachability.Always): Rename from the highly misleading
8418         'Reachability.Never'.
8419         (FlowBranching.Merge): Update to changes.  Mark an impossible
8420         situation with a 'throw'.
8421         (*): Update to changes.
8422
8423 2006-04-29  Raja R Harinath  <harinath@gmail.com>
8424
8425         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
8426         Remove 'Undefined'.
8427         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
8428         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
8429         (*): Update to changes.
8430         * statement.cs: Update to changes.
8431
8432 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
8433
8434         A fix for #78049
8435         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
8436
8437 2006-04-28  Raja R Harinath  <harinath@gmail.com>
8438
8439         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
8440         dummy UsageVector.
8441
8442         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
8443         argument to two arguments: an usage-vector and a bool.  Move call
8444         to FlowBranching.Merge () ...
8445         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
8446
8447         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
8448         handling of loop and switch reachability to ...
8449         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
8450
8451 2006-04-27  Raja R Harinath  <harinath@gmail.com>
8452
8453         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
8454         handling to FlowBranchingLoop.InLoop.
8455         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
8456
8457 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
8458
8459         A fix for #78115
8460         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
8461         anonymous method is allowed from AnonymousContainer here.
8462
8463         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
8464
8465 2006-04-24  Raja R Harinath  <rharinath@novell.com>
8466
8467         Fix #78156
8468         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
8469
8470 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
8471
8472         A fix for #49011.
8473         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
8474         (DoubleConstant.Reduce): Ditto.
8475
8476 2006-04-23  Raja R Harinath  <rharinath@novell.com>
8477
8478         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
8479         Remove 'lvalue_right_side' argument.  Move parts to ...
8480         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
8481         (LocalVariable.DoResolveLValue): ... these.
8482
8483 2006-04-21  Raja R Harinath  <rharinath@novell.com>
8484
8485         Fix cs1655.cs
8486         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
8487         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
8488         (LocalVariableReference.DoResolveBase): Use it to implement new
8489         CS1655 check.
8490         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
8491         (Argument.Resolve): Simplify.  Move CS1510 check ...
8492         * ecore.cs (Expression.ResolveLValue): ... here.
8493         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
8494         (PropertyExpr.DoResolveLValue): Likewise.
8495         (FieldExpr.Report_AssignToReadonly): Likewise.
8496         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
8497         LValueMemberAccess or LValueMemberOutAccess on instance depending
8498         on it.
8499         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
8500         DoResolve as appropriate.
8501
8502 2006-04-20  Raja R Harinath  <rharinath@novell.com>
8503
8504         Fix #75800
8505         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
8506         implicit conversions on 'out' and 'ref' arguments.
8507
8508         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
8509         improve clarity.  Remove dead code.
8510
8511         Fix #66031
8512         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
8513         (Catch.Resolve): Resolve VarBlock if it exists.
8514
8515 2006-04-19  Miguel de Icaza  <miguel@novell.com>
8516
8517         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
8518         twice, this was some residual code, the enumerator was emitted
8519         properly in the two branche of if later.
8520
8521 2006-04-19  Raja R Harinath  <rharinath@novell.com>
8522
8523         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
8524         cast is never an lvalue.
8525         (Cast.DoResolve, Cast.ResolveRest): Combine.
8526         (Argument.Emit): Simplify slightly.  Move 'Expr is
8527         IMemoryLocation' check ...
8528         (Argument.Resolve): ... here.
8529         (Argument.Error_LValueRequired): Remove.  Inline into only user.
8530
8531         Simplifications.  Fix cs0191-2.cs
8532         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
8533         CS1649 and CS1651 to ...
8534         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
8535         the actual selection of the error code and message to a lookup
8536         table.  Add a dummy return value to simplify callsites.
8537         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
8538         readonly fields of other instances of the same type.  Move CS0197
8539         warning from ...
8540         * expression.cs (Argument.Resolve): ... here.  Simplify code.
8541         Ensure that ec.InRefOutArgumentResolving is only set during LValue
8542         resolution of an out or ref argument.  The code simplification
8543         above uses this invariant.
8544
8545 2006-04-18  Raja R Harinath  <rharinath@novell.com>
8546
8547         Possibly fix #77752.  Fix cs1690-[4-7].cs.
8548         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
8549         CheckMarshallByRefAccess.  Drop parameter.
8550         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
8551         warning.
8552         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
8553         InstanceExpression.
8554         * report.cs (AllWarnings): Add CS1690.
8555         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
8556         for ref access too.
8557         (LocalVariableReference.DoResolveBase): Update.
8558
8559 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8560
8561         * class.cs (MethodOrOperator): Moved common parts from method class.
8562         detect obsolete attributes.
8563         (Method.Define): Simplified as it reuses code from base.
8564         (Constructor.ValidAttributeTargets): Fixed issue found during
8565         refactoring.
8566         (Destructor.ValidAttributeTargets): Fixed issue found during
8567         refactoring.
8568         (Operator): Finished refactoring set off by #78020. Operator class is now
8569         ordinary method class.
8570
8571         * anonymous.cs: Updated.
8572
8573         * decl.cs (DeclSpace): Add IsGeneric
8574
8575 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8576
8577         * class.cs (Constructor.Emit): Don't emit the attributes twice.
8578
8579 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8580
8581         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
8582         detect obsolete attributes.
8583         (Method.CreateEmitContext): Moved to MethodOrOperator.
8584
8585 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8586
8587         A fix for #78048.
8588         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
8589         customized exception to make crash detection easier.
8590         (MethodOrOperator): Started to work on new base class for methods and
8591         operators.
8592         (Method): Derives from MethodOrOperator.
8593         (Constructor.Emit): Emits its own attributes.
8594         (AbstractPropertyEventMethod.Emit): Ditto.
8595         (Operator): Derives from MethodOrOperator, will refactor fully in extra
8596         patch.
8597         (Operator.Emit): It's temporary more tricky than should be.
8598         
8599         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
8600
8601         * report.cs (InternalErrorException): Add ctor with inner exception.
8602
8603 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
8604
8605         A fix for #76744.
8606         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
8607         only not visible.
8608
8609 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
8610
8611         A fix for #77916.
8612         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
8613         array.
8614
8615 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
8616
8617         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
8618         attribute is present and Guid not.
8619         (Interface.ApplyAttributeBuilder): Ditto.
8620
8621         * attribute.cs: Add error message.
8622
8623 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
8624
8625         A fix for #78020.
8626
8627         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
8628         sources (it's composite) so hold them in extra array as they are used in
8629         Emit phase only. It worked in the previous versions by mistake.
8630         (Attribute.Emit): Emit attribute for more owners when exist.
8631
8632         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
8633         it has now different behaviour.
8634
8635 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
8636
8637         * constant.cs (Constant.IsDefaultInitializer): New method.
8638
8639         * class.cs: Updated.
8640
8641         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
8642         re-initialize default values. It saves KBs almost for every assembly.
8643         Thanks Zoltan for the idea.
8644         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
8645         (ArrayCreation.DoResolve): Resolve only once.
8646         (ArrayCreation.Emit): Emit static initializer only when it is faster.
8647         (ArrayCreation.GetAttributableValue): Cope with optimized values.
8648
8649 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
8650
8651         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
8652         From #77961.
8653
8654 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
8655
8656         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
8657         in an embedded statement too.
8658
8659 2006-04-01  Raja R Harinath  <rharinath@novell.com>
8660
8661         Fix #77958
8662         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
8663
8664 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
8665
8666         A fix for #77966.
8667
8668         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
8669         was not specified.
8670
8671         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
8672
8673 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
8674
8675         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
8676         phase.
8677
8678         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
8679         LocalTemporary change.
8680
8681         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
8682         TypeContainer.
8683         (ClassOrStruct.DefineFieldInitializers): Implemented static field
8684         initializers optimization.
8685         (ClassOrStruct.TypeAttr): Moved from modifiers.
8686         (Constructor.CheckBase): Don't crash when static ctor has parameters.
8687         (FieldBase.ResolveInitializer): Resolves initializer.
8688         (FieldBase.HasDefaultInitializer): New property.
8689
8690         * cs-parser.jay: Removed message.
8691
8692         * expression.cs (CompilerGeneratedThis): New specialization.
8693
8694         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
8695
8696 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
8697
8698         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
8699
8700 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
8701
8702         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
8703         be now EnumConstants only.
8704
8705 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
8706
8707         * attribute.cs, driver.cs: Reset more caches.
8708
8709 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8710
8711         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
8712
8713 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8714
8715         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
8716         for easier reuse. Updated all overrides.
8717         (IntegralConstant): New base class for all integral constants.
8718         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
8719         of the constant range, report custom error.
8720         (UIntConstant.Reduce): Fixed uint conversion.
8721
8722         * ecore.cs, literal.cs: Reduce updates.
8723
8724 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8725
8726         A fix for #75813.
8727
8728         * class.cs (Constructor.Define): Removed extra if for default ctors.
8729         A patch from Atsushi Enomoto.
8730
8731 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8732
8733         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
8734         GetAttributableValue.
8735
8736         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
8737         when required.
8738
8739         * convert.cs (ImplicitConversionRequired): Error message moved to
8740         DoubleLiteral.
8741
8742         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
8743         automatic implicit conversion of an output value.
8744         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
8745
8746         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
8747         conversion.
8748         (TypeOf.GetAttributableValue): Add extra handling for object type.
8749
8750         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
8751         special error message.
8752
8753 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
8754
8755         * class.cs (Constructor.Emit): Don't crash when struct ctor is
8756         InternalCall.
8757         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
8758         compatible with MS runtime.
8759
8760 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
8761
8762         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
8763         attribute arguments here.
8764
8765         * class.cs (Indexer.Define): The check was moved to attribute class.
8766
8767 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
8768
8769         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
8770         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
8771         easier.
8772
8773 2006-03-22  Raja R Harinath  <rharinath@novell.com>
8774
8775         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
8776         mcs to keep code differences small.
8777         * attribute.cs (Attribute.GetParameterDefaultValue): New.
8778         * typemanager.cs (parameter_default_value_attribute_type): New.
8779         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
8780         CS1908 check.
8781
8782 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
8783
8784         * expression.cs (StringConcat.Append): Reverted back to no warning state.
8785
8786 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
8787
8788         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
8789
8790         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
8791         the blocks too.
8792
8793 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
8794
8795         * doc-bootstrap.cs : fix build.
8796
8797 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
8798
8799         * expression.cs (StringConcat.Append): Issue a warning when empty string
8800         is going to append.
8801
8802 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
8803
8804         * assign.cs (CompoundAssign.ResolveSource): Removed.
8805
8806         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
8807         clean up.
8808
8809         * class.cs (TypeContainer.FindMethods): Removed.
8810         (TypeContainer.CheckMemberUsage): Made static.
8811
8812         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
8813
8814         * constant.cs (CheckRange): Removed unused type argument.
8815         (CheckUnsigned): Removed unused type argument.
8816
8817         * cs-parser.jay: Updated after MemberAccess clean up.
8818         Uses Length for empty string test.
8819
8820         * cs-tokenizer.cs: Uses Length for empty string test.
8821         (IsCastToken): Made static.
8822         (is_hex): Made static.
8823         (real_type_suffix): Made static.
8824
8825         * decl.cs (SetupCache): Made static.
8826         (OnGenerateDocComment): Removed unused ds argument.
8827
8828         * delegate.cs (VerifyDelegate): Removed unused argument.
8829
8830         * doc.cs: Uses Length for empty string test.
8831
8832         * driver.cs: Uses Length for empty string test.
8833
8834         * enum.cs (IsValidEnumType): Made static
8835
8836         * expression.cs (EnumLiftUp): Removed unused argument.
8837         (ResolveMethodGroup): Ditto.
8838         (BetterConversion): Ditto.
8839         (GetVarargsTypes): Ditto.
8840         (UpdateIndices): Ditto.
8841         (ValidateInitializers): Ditto.
8842         (MemberAccess.ctor): Ditto.
8843         (GetIndexersForType): Ditto.
8844
8845         * flowanalysis.cs: (MergeFinally): Removed unused argument.
8846
8847         * iterators.cs: Updated after MemberAccess clean up.
8848
8849         * location.cs: Uses Length for empty string test.
8850
8851         * namespace.cs: Uses Length for empty string test.
8852
8853          * report.cs (CheckWarningCode): Made static.
8854
8855         * statement.cs (LabeledStatement): Removed unused argument.
8856
8857         * typemanager.cs (FilterNone): Removed.
8858
8859 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8860
8861         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
8862         obsolete.
8863
8864         * class.cs: Updated.
8865
8866 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8867
8868         * cs-parser.jay.cs: __arglist is not allowed for delegates.
8869
8870 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8871
8872         A fix for #77822.
8873
8874         * expression.cs (VerifyArgumentsCompat): Reverted to double error
8875         reporting, it's more tricky than I thought.
8876
8877 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8878
8879         A fix for #77816.
8880
8881         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
8882         host container.
8883         (AnonymousMethod.ImplicitStandardConversionExists): New method.
8884         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
8885         Add more error reporting; Fixed issue with params.
8886
8887         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
8888
8889         * cs-parser.jay: AnonymousMethod requires host container.
8890
8891         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
8892
8893 2006-03-18  Raja R Harinath  <harinath@gmail.com>
8894
8895         * class.cs: Change 'TypeContainer ds' constructor argument to
8896         'DeclSpace parent'.  Some classes were missed below due to
8897         different naming convention.
8898
8899         * class.cs (MemberCore.Parent): Delete.  This makes the
8900         ParentContainer changes below enforceable by the compiler.
8901
8902         Treat pointers to enclosing declaration space as 'DeclSpace', not
8903         'TypeContainer'.
8904         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
8905         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
8906
8907         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
8908         of TypeContainer.
8909         (Block.AddThisVariable): Likewise.
8910         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
8911         (AbstractPropertyEventMethod.Emit): Likewise.
8912         (AbstractPropertyEventMethod.EmitMethod): Likewise.
8913         (GetMethod.Define, SetMethod.Define): Likewise.
8914         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
8915         (DelegateMethod.EmitMethod): Likewise.
8916
8917         Fix regression test-partial-13.cs.
8918         Rationalize use of PartialContainer.  Ensure that the partial
8919         class semantics can be tied to type-correctness, i.e., any
8920         violation will cause a compile error.
8921         * class.cs, const.cs: Access all fields that belong to class
8922         TypeContainer via ParentContainer.  Arguments of EmitContexts and
8923         Resolve()-like functions still use 'Parent'.
8924
8925         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
8926         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
8927         (PropertyMethod.CheckModifiers): Remove unused argument.
8928         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
8929         DeclSpace.
8930
8931 2006-03-17  Raja R Harinath  <harinath@gmail.com>
8932
8933         Make semantics of PartialContainer simpler.
8934         * decl.cs (DeclSpace.IsPartial): Remove.
8935         * class.cs (TypeContainer.IsPartial): Likewise.
8936         (TypeContainer..ctor): Set PartialContainer to point to self.
8937         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
8938         (TypeContainer.FindNestedType): Likewise.
8939         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
8940
8941 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
8942
8943         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
8944
8945 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
8946
8947         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
8948         classes.
8949
8950 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
8951
8952         * class.cs (Operator.Define): An error for base conversion was not
8953         reported correctly.
8954
8955 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
8956
8957         * iterator.cs : yield break is allowed in try statement which has
8958           catch clauses. Fixed bug #77767.
8959
8960 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
8961
8962         A fix for #77593, #77574.
8963
8964         * class.cs (MethodCore.CheckBase): Another if for operator.
8965
8966 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
8967
8968         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
8969         were not resolved
8970
8971         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
8972         (DelegateCreation.ImplicitStandardConversionExists): New method for just
8973         conversion test.
8974         
8975         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
8976         not needed.
8977
8978         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
8979         Updated after another emitcontext usage was clean up. It should help us to
8980         synchronize with gmcs easier.
8981
8982 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
8983
8984         A fix for #77353.
8985
8986         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
8987         (Event.Define): ditto
8988         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
8989
8990         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
8991         Removed redundant code and set NewSlot for Invoke method too.
8992
8993         * parameter.cs (Parameters.ctor): Add custom, type ctor.
8994         (Parameters.MergeGenerated): New method. Use this method when you merge
8995         compiler generated argument with user arguments.
8996
8997 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
8998
8999         * attribute.cs (ResolveAsTypeTerminal): Removed.
9000
9001         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
9002         specialization for predefined types; 30% speed up.
9003         Finally placed obsolete check to right place.
9004         (Expression.ResolveType): Removed.
9005
9006         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
9007         Updated after ResolveType was removed.
9008
9009         * expression.cs (Cast.ctor): Check void cast.
9010         (Binary.ResolveAsTypeTerminal): Is never type.
9011         (Conditional.ResolveAsTypeTerminal): Is never type.
9012
9013         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
9014
9015 2006-03-01  Raja R Harinath  <rharinath@novell.com>
9016
9017         Fix #77679.
9018         * expression.cs (ParameterReference.DoResolveBase): Change return
9019         type to bool.
9020         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
9021         Update.
9022
9023         Fix #77628.
9024         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
9025
9026         Fix #77642.
9027         * typemanager.cs (GetFullNameSignature): Don't nullref on
9028         protected accessors.
9029
9030 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
9031
9032         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
9033         these two separated members to simplify the code.
9034         (Attribute.Resolve): Refactored to use new fields and methods.
9035         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
9036         implemented obsolete attribute checking.
9037         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
9038         implemented obsolete checking again. It look line never ending quest ;-)
9039         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
9040
9041         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
9042
9043         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
9044
9045         *class.cs (Property.Define): Add RegisterProperty call.
9046
9047         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
9048         argument groups (only 2).
9049
9050         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
9051         encoding expression to arguments.
9052         (Expression.ExprClassToResolveFlags): Just turned to property.
9053
9054         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
9055         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
9056         optimized as well as implemented support for zero-length attributes.
9057
9058         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
9059         Add caching of PropertyInfo's.
9060
9061 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
9062
9063         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
9064         error multiple times.
9065
9066 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
9067
9068         New partial class implementation.
9069         A fix for #77027, #77029, #77403
9070
9071         * attribute.cs (Attributable): Made attributes protected.
9072
9073         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
9074         the replacements of ClassPart and PartialContainer.
9075         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
9076         (TypeContainer.AddInterface): Ditto.
9077         (TypeContainer.AddPartial): The main method for partial classes. It checks
9078         for errors and merges ModFlags and attributes. At the end class is added to
9079         partial_parts list.
9080         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
9081         required here.
9082         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
9083         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
9084         from the rest of partial classes.
9085         (TypeContainer.GetClassBases): Simplified.
9086         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
9087         DefineType.
9088         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
9089         (TypeContainer.HasExplicitLayout): Uses Flags now.
9090         (PartialContainer): Removed.
9091         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
9092         (StaticClass): Was merged with Class.
9093         (Class.GetClassBases): class and static class bases are verified here.
9094         (Class.TypeAttr): Added static attributes when class is static.
9095         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
9096         (MemberBase): In some cases we need to call parent container for partial
9097         class. It should be eliminated but it's not easy now.
9098
9099         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
9100
9101         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
9102         partial classed to accumulate class comments.
9103         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
9104
9105         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
9106
9107         * driver.cs (MainDriver): Tree.GetDecl was removed.
9108
9109         * modifiers.cs (Modifiers): Add partial modifier.
9110
9111         * tree.cs (Tree.decl): Removed.
9112         (RootTypes): Started to use this class more often for root types
9113         specializations.
9114
9115 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
9116
9117         A fix for #77615
9118
9119         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
9120         external interface does not have an attribute.
9121
9122 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
9123
9124         Another prerequisites for new partial classs implementation.
9125         
9126         * attribute.cs (Attribute.Equal): Implemented.
9127         (Attribute.Emit): Changed as attributes can be applied more than twice.
9128         (Attributes.Emit): Check for duplicate attributes here.
9129
9130         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
9131         as a parameter, clean-up.
9132
9133 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
9134
9135         A fix for #77485
9136
9137         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
9138         contains obsolete attribute check which can in some cases look for base
9139         type of current class which is not initialized yet.
9140         (TypeContainer.BaseType): Replacement of ptype.
9141
9142         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
9143
9144 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
9145
9146         First of prerequisites for new partial classs implemention.
9147         
9148         * attribute.cs (Attributable): Extended by ResolveContext;
9149         Attributes finally have correct context for resolving in all cases.
9150         (AttachTo): Attribute owner is assigned here.
9151
9152         * codegen.cs (IResolveContext): Introduce new interface to hold
9153         all information needed in resolving phase.
9154         (EmitContext): Implements IResolveContext; more clean-up needed here.
9155         
9156         * decl.cs (MemberCore): Implemented IResolveContext.
9157
9158         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
9159         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
9160         parameter.cs, statement.cs, tree.cs, typemanager.cs:
9161         Refactored to use new IResolveContext instead of EmitContext; cleanup
9162
9163 2006-02-06  Miguel de Icaza  <miguel@novell.com>
9164
9165         * codegen.cs (EmitScopeInitFromBlock): check here the
9166         capture_context, there is no need to make two calls to the
9167         EmitContext. 
9168
9169         * anonymous.cs: Add some debugging messages that might help me
9170         track other instances of this problem in the future (the
9171         regression of test 467).
9172
9173         * cs-parser.jay: track the variable block, as we need to initalize
9174         any captured variables declared in this block for the "catch"
9175         portion of the "Try" statement.
9176
9177         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
9178         scope initialization for captured variables. 
9179
9180         Also, move the emit for the variables after the block location has
9181         been marked.
9182
9183 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
9184
9185         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
9186
9187 2006-02-02  Miguel de Icaza  <miguel@novell.com>
9188
9189         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
9190         commit yesterday, the initialization for the roots is necessary.
9191         What is not necessary is the scope activation.
9192
9193 2006-02-02  Raja R Harinath  <rharinath@novell.com>
9194
9195         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
9196         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
9197         CS0206 checks.
9198         (Argument.Resolve): Remove CS0206 checks.
9199
9200 2006-02-01  Miguel de Icaza  <miguel@novell.com>
9201
9202         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
9203         scopes for all the roots, the scopes will now be emitted when the
9204         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
9205
9206         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
9207         code.  This reduces a lot of existing cruft.
9208         
9209         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
9210         that the ScopeInfo is generated as we enter the scope, not at the
9211         time of use, which is what we used to do before.
9212
9213         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
9214         every time a Block is about to be emitted if we have a
9215         CaptureContext. 
9216
9217 2006-02-01  Raja R Harinath  <rharinath@novell.com>
9218
9219         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
9220         (Reset): Update.
9221         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
9222
9223         * typemanager.cs (cons_param_array_attribute): Make private.
9224         (Reset): Set it to null.
9225         (InitCoreHelpers): Don't initialize it.
9226         (ConsParamArrayAttribute): New.  Initialize it as needed.
9227         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
9228
9229 2006-01-31  Miguel de Icaza  <miguel@novell.com>
9230
9231         * expression.cs: There might be errors reported during the
9232         selection of applicable methods.  If there are errors, do not
9233         continue execution as it will lead the compiler to crash.
9234
9235 2006-01-30  Miguel de Icaza  <miguel@novell.com>
9236
9237         * expression.cs: Member access is not allowed on anonymous
9238         methods.  Fixes #77402.
9239
9240 2006-01-30  Raja R Harinath  <rharinath@novell.com>
9241
9242         Fix #77401
9243         * cs-parser.jay (VariableDeclaration): Don't set
9244         current_array_type to null.
9245         (field_declaration, event_declaration, declaration_statement):
9246         Set it to null here.
9247
9248 2006-01-28  Raja R Harinath  <harinath@gmail.com>
9249
9250         * typemanager.cs (GenericParameterPosition): New.
9251         * doc.cs: Use it.
9252
9253 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
9254
9255         * doc.cs : To process "include" elements, first we should create
9256           another list than XmlNodeList, because it could result in node
9257           removal, which could result in that the XmlNodeList gives up
9258           yielding next node.
9259
9260           (Also made code identical to gmcs again.)
9261
9262 2006-01-25  Miguel de Icaza  <miguel@novell.com>
9263
9264         * ecore.cs: Introduce an error report that we were not catching
9265         before, if not silent, we must report the error.  Gonzalo ran into
9266         it.
9267
9268 2006-01-23  Miguel de Icaza  <miguel@novell.com>
9269
9270         A fix for bug: #76957
9271         
9272         * iterators.cs (MoveNextMethod.CreateMethodHost): call
9273         ComputeMethodHost before creating the method, this is a new
9274         requirement. 
9275
9276         * anonymous.cs (AnonymousContainer): Now we track all the scopes
9277         that this method references (RegisterScope).  The actual scope
9278         where the method is hosted is computed with the ComputeMethodHost
9279         before we create the method.
9280
9281         Moved the Deepest routine here.
9282
9283         (AnonymousContainer.ComputeMethodHost): New routine used to
9284         compute the proper ScopeInfo that will host the anonymous method.
9285
9286         (ScopeInfo): Deal with multiple roots.  The problem was that we
9287         did not have a unique root where all ScopeInfos could be hanged
9288         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
9289         of roots.  
9290
9291         Remove AdjustMethodScope which is now computed at the end.  Remove
9292         LinkScope which did a partial link, instead link all ScopeInfos
9293         before code generation from the new "LinkScopes" routine. 
9294
9295         Simplify all the Add* routines as they no longer need to maintain
9296         the tree, they just need to record that they are using variables
9297         from a ScopeInfo.
9298
9299         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
9300         routines to produce the forest of ScopeInfo trees.
9301
9302         * class.cs (TypeContainer.AppendMethod): This is just like
9303         AddMethod, but ensures that an interface implementation method
9304         (IEnumerable.XXX) is not inserted at the beginning of the queue of
9305         methods, but at the end.
9306
9307         We use this functionality to ensure that the generated MoveNext
9308         method in the iterator class is resolved/emitted before the
9309         enumerator methods created.   
9310
9311         This is required because the MoveNext method computes the right
9312         ScopeInfo for the method.  And the other methods will eventually
9313         need to resolve and fetch information computed from the anonymous
9314         method. 
9315
9316 2006-01-21  Raja R Harinath  <harinath@gmail.com>
9317             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
9318
9319         Fix rest of #76995.
9320         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
9321         the 'aliases' hash.
9322         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
9323         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
9324
9325 2006-01-18  Raja R Harinath  <rharinath@novell.com>
9326
9327         Fix #76656, cs0231-2.cs.
9328         * cs-parser.jay (formal_parameter_list): Make error case catch
9329         more issues.
9330         (parenthesized_expression_0): Add CS1026 check.
9331         (invocation_expression): Remove unused { $$ = lexer.Location }.
9332
9333 2006-01-17  Raja R Harinath  <rharinath@novell.com>
9334
9335         Fix #76824.
9336         * cs-parser.jay (statement_expression): Don't list out the
9337         individual statement-expressions.  Convert syntax error into
9338         CS0201 check.
9339
9340 2006-01-16  Raja R Harinath  <rharinath@novell.com>
9341
9342         Fix #76874.
9343         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
9344         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
9345         CheckIntermediateModification.
9346         (FieldExpr.DoResolve): Add new two-argument version that
9347         allows us to resolve the InstanceExpression as an lvalue.
9348         The one-argument variant is now just a wrapper.
9349         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
9350         Resolve the lhs as an lvalue if the it has a value type.
9351         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
9352         from Assign.DoResolve.
9353         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
9354         resolved as an lvalue.
9355         (PropertyExpr.DoResolve): Update.
9356         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
9357         has a value type.  Move CS1612 check here from
9358         CheckIntermediateModification.
9359         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
9360         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
9361         'right_side' of a ResolveLValue on an 'out' argument.
9362         (EmptyExpression.LValueMemberAccess): New.  Used as the
9363         'right_side' of a propagated ResolveLValue on a value type.
9364         (LocalVariableReference.DoResolveBase): Recognize
9365         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
9366         Add CS1654 check.
9367         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
9368         EmptyExpression.Null.
9369
9370 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
9371
9372         * typemanager.cs : added IsGenericParameter(). In mcs it always
9373           return false.
9374         * doc.cs : for generic parameters, use GenericParameterPosition,
9375           not FullName.
9376
9377 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
9378
9379         * expression.cs: Fix Console.WriteLine ((this = x).foo);
9380
9381 2006-01-12  Miguel de Icaza  <miguel@novell.com>
9382
9383         This fixes the problem where we used ldfld instead of ldflda to
9384         load the "THIS" pointer on captured parameters, when THIS is a
9385         value type.  See bug #77205.
9386         
9387         * iterators.cs (CapturedThisReference.Emit): Pass false to
9388         EmitThis (we do not need the address).
9389
9390         * codegen.cs (EmitThis): it needs to know whether we need the
9391         address of `this' or not.  This is used by value types.  
9392
9393         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
9394         every other call passes false.
9395
9396 2006-01-12  Raja R Harinath  <rharinath@novell.com>
9397
9398         Fix #77221.
9399         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
9400         GetOverride.
9401         * expression.cs (Invocation.OverloadResolve): Update.
9402         (Invocation.DoResolve): Avoid double resolution of invocation.
9403
9404 2006-01-11  Raja R Harinath  <rharinath@novell.com>
9405
9406         Fix #77180.
9407         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
9408         unary negation of floating point types as 0-expr; negation cannot
9409         overflow in floating point types.
9410
9411         Fix #77204.
9412         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
9413         on operands of 'void' type.
9414
9415         Fix #77200.
9416         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
9417         and ExclusiveOr for boolean constants too.
9418
9419 2006-01-09  Raja R Harinath  <rharinath@novell.com>
9420
9421         Fix #75636.
9422         * expression.cs (Invocation.OverloadResolve): Replace reflected
9423         override methods with their base virtual methods, rather than
9424         skipping over them.
9425         * typemanager.cs (TypeManager.GetOverride): New.
9426
9427 2006-01-05  Jb Evain  <jbevain@gmail.com>
9428
9429         * class.cs (Property.Define, Indexer.Define): do not tag the
9430         properties as SpecialName | RTSpecialName.
9431
9432 2006-01-04  Miguel de Icaza  <miguel@novell.com>
9433
9434         * class.cs (MethodCore.IsDuplicateImplementation): This method was
9435         doing a low-level comparission of parameter types.  It was lacking
9436         a check for __argslist. 
9437
9438 2005-12-30  Miguel de Icaza  <miguel@novell.com>
9439
9440         * expression.cs (ParameterReference.DoResolveBase): Allow
9441         reference parameters if they are local to this block. 
9442
9443         This allows the ref and out parameters of a delegate to be used in
9444         an anonymous method, for example:
9445
9446         delegate void set (out int x);
9447
9448         set s = delegate (out int x){
9449                 x = 0;
9450         };
9451
9452         This is used by functionality introduced late in the C# language.
9453         
9454         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
9455         method that take ref and out parameters. 
9456
9457         Fixes #77119 which was a late change in the spec.
9458
9459 2005-12-23  Miguel de Icaza  <miguel@novell.com>
9460
9461         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
9462         parent if its the same scope.  Fixes #77060.
9463
9464 2005-12-21  Miguel de Icaza  <miguel@novell.com>
9465
9466         * driver.cs: Report the case of no source files and no -out:
9467         argument provided.
9468
9469 2005-12-20  Raja R Harinath  <rharinath@novell.com>
9470
9471         Fix #77035.
9472         * expression.cs (ComposedCast.GetSignatureForError): Define.
9473
9474 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9475
9476         Fix #76995
9477
9478         * namespace.cs (NamespaceEntry): Add extern_aliases as a
9479         ListDictionary, to contain the ExternAliasEntry entries (in
9480         addition to the NamespaceEntry.aliases hashtable). This field is
9481         shared between the original entry and its doppelganger (bodyless 
9482         copy of it).
9483         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
9484         extern_aliases field.
9485         (NamespaceEntry.Lookup): Move the IsImplicit check after the
9486         lookup in extern_aliases.
9487
9488 2005-12-16  Raja R Harinath  <rharinath@novell.com>
9489
9490         Fix #77006.
9491         * class.cs (TypeContainer.Mark_HasEquals): New.
9492         (TypeContainer.Mark_HasGetHashCode): New.
9493         (ClassPart): Override them.
9494         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
9495
9496         Fix #77008.
9497         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
9498         'parent' argument to the base constructor.
9499
9500         Remove all mention of TypeContainer from decl.cs.
9501         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
9502         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
9503         (DeclSpace.DeclSpace): Likewise.
9504         (DeclSpace.DefineMembers): Remove unused argument.
9505         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
9506         debugging check -- we don't care if the debug code throws an
9507         InvalidCastException instead of an InternalErrorException.
9508         * class.cs (TypeContainer.DefineMembers): Update to changes.
9509         (TypeContainer.DoDefineMembers): Likewise.
9510         (TypeContainer.GetMethods): Likewise.
9511         (PropertyMember.Define): Likewise.
9512         (MemberBase.Parent): New property that forwards to
9513         MemberCore.Parent, but ensures that we get a TypeContainer.
9514         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
9515         (RootContext.PopulateTypes): Likewise.  Remove special case code
9516         for !RootContext.StdLib: DefineMembers is idempotent.
9517
9518 2005-12-14  Miguel de Icaza  <miguel@novell.com>
9519
9520         * convert.cs (ExplicitConversionCore): Check the return value from
9521         ExplicitConversionCore which can return null on failure.  Fixes #76914
9522
9523 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
9524
9525         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
9526
9527 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
9528
9529         * doc.cs : The search for referenced namespace was insufficient to
9530           get global one as it used to do. Fixed bug #76965.
9531
9532 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
9533
9534         * doc.cs : check name in cref in the last phase that whether it is
9535           namespace or not.
9536
9537 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
9538
9539         * cs-tokenizer.cs : reverted the latest change: it somehow broke
9540           Mono.C5.
9541
9542 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
9543
9544         * doc.cs : so it turned out that we cannot skip override check for 
9545           interface members. Fixed bug #76954.
9546
9547 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
9548
9549         * cs-tokenizer.cs : fixed bug #75984:
9550           - #warning and #error should not be handled when the source line
9551             is disabled.
9552           - #line is not checked strictly when the source line is disabled.
9553           - #define and #undef is on the other hand checked strictly at any
9554             state.
9555
9556 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
9557
9558         * cs-tokenizer.cs : missing Location (actually, filename) in one of
9559           CS1027 report.
9560
9561 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
9562
9563         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
9564
9565         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
9566         event initializers.
9567         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
9568         (FieldBase.Initializer): Initializer is now optional.
9569         (EventField.Define): Only event field can have initializer.
9570
9571         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
9572
9573         * const.cs (Const): Reuse initializer.
9574
9575         * cs-parser.jay: Updated after FieldBase changes.
9576         Added current_array_type to simplify array initializers.
9577
9578         * ecore.cs (NullCast.IsDefaultValue): Implemented.
9579
9580         * expression.cs, iterators.cs: Updated.
9581
9582         * namespace.cs (NamespaceEntry): Made UsingFound private.
9583
9584 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
9585
9586         * parameterCollection.cs: Obsolete, removed.
9587         * parser.cs: Obsolete, removed.
9588
9589 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
9590
9591         Fix #76849.
9592         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
9593
9594         * enum.cs (Enum.Define): Set obsolete context here.
9595
9596 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
9597
9598         * doc.cs :
9599           - FindDocumentedMember() now expects 1) paramList as null
9600             when "we don't have to check the number of parameters" and
9601             2) Type.EmptyTypes when "there is no arguments".
9602           - Introduced FoundMember struct to hold the exact type which was
9603             used to find the documented member (the above change broke
9604             test-xml-044; it might be better just to use DeclaringType than
9605             what MS does, like this change does, but it depends on usage.)
9606
9607 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
9608
9609         * doc.cs : documented member might be from DeclaringType for nested
9610           types. Fixed bug #76782.
9611
9612 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
9613
9614         * anonymous.cs: Have the param code handle leaving copies on the
9615         stack etc. Allows anonymous params to take part in the assignment
9616         code (++, +=, etc). Fixes bug #76550
9617
9618         * expression.cs: Handle the prepare_for_load/leave_copy by passing
9619         it down to the anon code.
9620
9621         * iterators.cs: Use dummy var here
9622
9623         * codegen.cs: Handle new vars
9624
9625 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
9626
9627         Fix #76849.
9628         * class.cs (MethodData.Define): Set proper Obsolete context.
9629
9630         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
9631         obsolete context.
9632         (FieldExpr.DoResolve): Ditto.
9633
9634 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
9635
9636         Fix #76849.
9637         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
9638         parent is not obsolete.
9639
9640 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
9641
9642         * doc.cs : (FindDocumentedMember) find parameterless members first
9643           and get CS0419 in the early stage. Fixed first case of bug #76727.
9644
9645 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
9646
9647         Fix #76859.
9648         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
9649         no error was reported.
9650
9651         *expression.cs (Binary.DoResolve): left can be null.
9652
9653 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
9654
9655         Fix #76783.
9656         * class.cs (MethodData.Emit): Parameters should be labeled first.
9657
9658 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
9659
9660         Fix #76761.
9661         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
9662
9663 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
9664
9665         * attribute.cs (AreParametersCompliant): Moved to Parameter.
9666
9667         * class.cs (MethodCore): Parameter clean up.
9668         (IMethodData): Added ParameterInfo.
9669         (MethodData): Parameter clean up.
9670         (Indexer.Define): Parameter clean up.
9671
9672         * anonymous.cs,
9673         * codegen.cs,
9674         * cs-parser.jay,
9675         * decl.cs,
9676         * doc.cs,
9677         * ecore.cs,
9678         * flowanalysis.cs,
9679         * iterators.cs,
9680         * pending.cs,
9681         * statement.cs,
9682         * typemanager.cs: Parameter clean up.
9683
9684         * delegate.cs (Define): Get rid of duplicated code.
9685
9686         * expression.cs (ParameterReference): Removed useless parameters
9687         and simplified.
9688         (Invocation): Ditto.
9689
9690         * parameter.cs (ParamsParameter): New class, params specialization.
9691         (ArglistParameter): Attemp to separate arglist.
9692         (Parameter): Refactored to be reusable and faster.
9693         (Parameter.Modifier): Made understandable.
9694         (Parameters): Changed to be used as a class for `this' assembly
9695         parameters. Refactored to use new specialized classes.
9696
9697         * support.cs (ParameterData): Added Types property.
9698         (InternalParameters): Deleted.
9699
9700 2005-08-20  Martin Baulig  <martin@ximian.com>
9701
9702         Merging this patch from GMCS to fix #75867.
9703
9704         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
9705         scope if we don't already have it.
9706
9707 2005-11-17  Martin Baulig  <martin@ximian.com>
9708
9709         * anonymous.cs
9710         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
9711         inherit the scope from our parent.  Fixes #76653.
9712
9713 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9714
9715         * doc.cs : the previous patch does not actually fix the bug.
9716           PropertyInfo override check is now implemented and really fixed it.
9717         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
9718
9719 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9720
9721         * doc.cs : apply "override filter" also to properties.
9722           Fixed bug #76730.
9723
9724 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9725
9726         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
9727           no need to check overrides. For classes, omit those results from 
9728           interfaces since they must exist in the class. Fixed bug #76726.
9729
9730 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9731
9732         * typemanager.cs : (GetFullNameSignature) differentiate indexers
9733           with different parameters. Fixed the second problem in #76685.
9734
9735 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9736
9737         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
9738           get expected 'protected' access in CheckValidFamilyAccess()).
9739           Fixed bug #76692.
9740
9741 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9742
9743         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
9744           Fixed bug #76705.  CS1569 was incorrectly commented out.
9745
9746 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
9747
9748         * doc.cs : use Invocation.IsOverride() to do real override check.
9749         * expression.cs : made Invocation.IsOverride() internal.
9750
9751 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
9752
9753         * doc.cs : use TypeManager.FindMembers() instead of (possible)
9754           TypeBuilder.FindMembers() and filter overriden base members out.
9755           Fixed bug #76990.
9756
9757 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9758
9759         * doc.cs : ref/out parameters are represented as '@' (instead of
9760           '&' in type FullName). Fixed bug #76630 (additionally crefs).
9761
9762 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9763
9764         * doc.cs : when there was no '.' in cref to methods in doc comment,
9765           then parameters were missing in the output. Fixed bug #76691.
9766
9767 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9768
9769         * driver.cs : don't output docs when there is an error.
9770           Fixed bug #76693.
9771
9772 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9773
9774         * doc.cs :
9775           Now it should detect indexers. Fixed primary concern in bug #76685.
9776           Fixed CS0419 message to not show the identical member signature in
9777           the message.
9778
9779 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9780
9781         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
9782           instead of Type.FindMembers() since it does not handle events.
9783           Fixed bug #71604.
9784
9785 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
9786
9787         * codegen.cs: Fixed typo (speficied -> specified).
9788
9789 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
9790
9791         Fix #76369.
9792         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
9793
9794 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
9795
9796         * attribute.cs: Changed error message.
9797
9798         * cs-tokenizer.cs: One more check.
9799
9800 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
9801
9802         * statement.cs (Block.Resolve): Ignore empty statement.
9803
9804 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
9805
9806         * report.cs: Made error/warning methods more strict to avoid
9807         their misuse.
9808
9809         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
9810         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
9811         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
9812         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
9813
9814 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
9815
9816         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
9817         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
9818
9819         * class.cs (TypeContainer.IsComImport): New property.
9820         (Constructor.Define): Create proper ctor for ComImport types.
9821
9822         * expression.cs (New.CheckComImport): Fixed.
9823
9824 2005-11-07  Miguel de Icaza  <miguel@novell.com>
9825
9826         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
9827         that a parameter has been captured does not mean that we do not
9828         have to do the rest of the processing.  This fixes the second part
9829         of #76592.  If there was another anonymous method capturing
9830         values in the past, the Scope would never be set for the second
9831         method that captured the same parameter.
9832
9833         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
9834         properly manipulate the stack.   Second part of fix for #76592.
9835
9836         * expression.cs (New): Add support for invoking "new" on
9837         interfaces that have been flagged with the ComImport attribute and
9838         the CoClass.  Fixes #76637 
9839
9840         * statement.cs (Try.DoEmit): When a variable is captured, do not
9841         try to emit the vi.LocalBuilder variable as it has been captured.
9842         Create a temporary variable and store the results on the
9843         FieldBuilder.  Fixes #76642
9844
9845 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
9846
9847         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
9848
9849         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
9850
9851         * expression.cs (Binary.DoResolve): Added && optimalization.
9852     
9853         * typemanager.cs (AddUserType): Removed useless argument.
9854
9855 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
9856
9857         * statement.cs (Block.variables): Uses ListDictionary.
9858
9859 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
9860
9861         Fix #75969.
9862         * class.cs (PartialContainer.EmitType): Customized to emit
9863         security attributes.
9864         (ClassPart.ApplyAttributeBuilder): Transform security attribute
9865         for partial classes.
9866
9867 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
9868
9869         Fix #76599.
9870         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
9871         access has to be fixed.
9872         
9873         * typemanager.cs (IsUnmanagedType): Wrong common field type.
9874
9875 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
9876
9877         Fix #76590.
9878         * ecore.cs (NullCast.Reduce): Implemented.
9879
9880         * expression.cs (ArrayCreation.CheckIndices): Correcly check
9881         constant type.
9882         
9883         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
9884         properly.
9885         (Foreach.Resolve): Catch null properly.
9886
9887 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
9888  
9889         * cs-tokenizer.cs: Warning text fix.
9890
9891         * driver.cs: AllWarningNumbers exposed on public interface.
9892
9893         * report.cs (): Reviewed warning numbers.
9894         (IsValidWarning): Use binary search.
9895
9896 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
9897  
9898         * driver.cs: Implemeted resource visibility.
9899         (Resources): New class for code sharing between /res: and
9900         /linkres:
9901  
9902 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
9903
9904         Fix #76568.
9905         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
9906         folding.
9907         
9908         * convert (Convert.ImplicitReferenceConversion): NullCast holds
9909         contants only.
9910         
9911         * ecore.cs (NullCast): Child is contant only.
9912         
9913         * literal.cs (NullLiteral.Reduce): null can be converted to any
9914         reference type.
9915
9916 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
9917
9918         * driver.cs: Use Encoding.Default as default code page instead
9919           of ISO-28591.
9920
9921 2005-10-27  Raja R Harinath  <rharinath@novell.com>
9922
9923         Fix #76085.
9924         * expression.cs (Invocation.Error_InvalidArguments): Handle
9925         __arglist parameters.
9926         (Invocation.VerifyArgumentsCompat): Likewise.
9927         * support.cs (ReflectionParameters.GetSignatureForError): Print
9928         __arglist parameters.
9929         (InternalParamters.GetSignatureForError): Likewise.
9930         * parameter.cs (Parameters.GetSignatureForError): Likewise.
9931
9932 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
9933
9934         * attribute.cs (GetPropertyValue): Made public.
9935
9936         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
9937         Resolve.
9938         Add new property WrapNonExceptionThrows to handle 2.0 assembly
9939         attribute.
9940         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
9941         is not defined.
9942         
9943         * driver.cs: Reflect method name change.
9944         
9945         * statement.cs (Try.Resolve): Warn when try has both general
9946         exception handlers.
9947         
9948         * typemanager.cs: runtime_compatibility_attr_type new predefined
9949         type.
9950
9951 2005-10-26  Raja R Harinath  <harinath@gmail.com>
9952
9953         Fix #76419.
9954         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
9955         treat it as an empty parameter list.
9956
9957 2005-10-26  Raja R Harinath  <rharinath@novell.com>
9958
9959         Fix #76271.     
9960         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
9961         ResolveAsTypeStep silent.
9962         * statement.cs (Block.AddConstant): Mark block as used.
9963         (Block.ResolveMeta): Avoid piling on error messages
9964         if a constant initializer resolution fails.
9965
9966 2005-10-25  Raja R Harinath  <rharinath@novell.com>
9967
9968         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
9969         Remove.
9970         (NamespaceEntry.VerifyAllUsing): New.
9971         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
9972         behaviour.  Delegates actual resolution of alias to ...
9973         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
9974         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
9975         Update.
9976         * driver.cs (Driver.MainDriver): Update.
9977         
9978         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
9979         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
9980         property.
9981         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
9982         Remove.
9983         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
9984         RootNamespace.DefineNamespacesForAll.
9985
9986 2005-10-24  Raja R Harinath  <harinath@gmail.com>
9987
9988         * typemanager.cs (assemblies, external_aliases, modules)
9989         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
9990         (ComputeNamespaces, GetRootNamespace): Remove extra staging
9991         overhead.  Move resposibility ...
9992         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
9993         * driver.cs, attribute.cs, codegen.cs: Update to changes.
9994
9995 2005-10-23  Raja R Harinath  <harinath@gmail.com>
9996
9997         * namespace.cs (RootNamespace.all_namespaces): Renamed from
9998         cached_namespaces.  Improve usage.
9999         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
10000         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
10001         Move from GlobalRootNamespace and simplify.
10002         (RootNamespace.Global): Make instance variable.
10003         (RootNamespace.RootNamespace): Add "alias name" parameter.
10004         (GlobalRootNamespace): Simplify drastically.
10005         (Namespace.Lookup): Don't use GetNamespace.
10006         * typemanager.cs (GetRootNamespace): Rename from
10007         ComputeNamespaceForAlias.
10008         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
10009
10010 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
10011
10012         * anonymous.cs (AnonymousContainer): Don't crash when container
10013         doesn't exist.
10014
10015 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
10016
10017         * expression.cs (Binary.DoResolve): Warn when comparing same
10018         values.
10019
10020 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
10021
10022         Fix #76486.
10023         * expression.cs (Binary.DoResolve): It looks like there are no
10024         convetsion rules in enum context.
10025
10026 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10027
10028         Add support for extern alias qualifiers.
10029         * typemanager.cs: Move some LookupTypeReflection code
10030         to namespace.cs, to have cleaner code. Added some methods
10031         to help us keep track of the extern aliased references.
10032         * driver.cs: Add suport for extern alias assemblies on command
10033         line and check for their warnings/errors. Also keep track of the
10034         extern aliased assemblies.
10035         * namespace.cs: Move the global functionality of Namespace
10036         to GlobalRootNamespace/RootNamespace. Now the global namespace
10037         is GlobalRootNamespace.Globa. Also the code moved from 
10038         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
10039         Finally added LocalAliasEntry (AliasEntry before) and
10040         ExternAliasEntry, to handle alias statements.
10041         * cs-parser.jay: Add support in the grammar for extern alias
10042         statement.
10043         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
10044         Update callings to Namespace (now in GlobalRootNamespace).
10045
10046 2005-10-18  Raja R Harinath  <rharinath@novell.com>
10047
10048         Fix #76371.
10049         * class.cs (TypeContainer.DefineType): Move updating of
10050         topological sort earlier in the code.
10051         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
10052
10053 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
10054
10055         Fix #76273.
10056         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
10057         
10058         * constant.cs (Constant.TryReduce): Moved from Cast class.
10059         (Reduce): Made little bit more OO and fixed missing conversions.
10060         
10061         * ecore.cs (Reduce): Implemented.
10062         (Binary.EnumLiftUp): New method to upgrade values to enum values.
10063         
10064         * literal.cs (Reduce): Implemented.
10065         
10066         * class.cs: Reverted Miguel's wrong commit.
10067
10068 2005-10-14  Miguel de Icaza  <miguel@novell.com>
10069
10070         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
10071
10072 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
10073
10074         * cs-parser.jay, expression.cs : CS0214 was missing error location
10075           for constants. Fixed bug #76404.
10076
10077 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
10078
10079         Fix #76370.
10080         * convert.cs (ExplicitConversionCore): Fixed object->enum
10081         conversion.
10082
10083 2005-10-10  Raja R Harinath  <rharinath@novell.com>
10084
10085         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
10086         InstanceExpression.
10087         (PropertyExpr.EmitCall): Likewise.
10088         * expression.cs (Invocation.EmitArguments): Handle case where
10089         arguments == null.
10090         (Invocation.EmitCall): Avoid allocating temporary variable if
10091         there are no arguments.
10092
10093 2005-10-07  Raja R Harinath  <rharinath@novell.com>
10094
10095         Fix #76323.
10096         * convert.cs (ImplicitConversionStandard): Move conversion of
10097         void* to arbitrary pointer types ...
10098         (ExplicitConversionStandard): .. here.
10099         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
10100         error to always print typenames.
10101
10102 2005-10-07  Raja R Harinath  <rharinath@novell.com>
10103
10104         * convert.cs (GetConversionOperator): Rename from
10105         GetConversionOperators.  Move operator selection code from ...
10106         (UserDefinedConversion): ... here.
10107
10108 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
10109
10110         * convert.cs (ExplicitConversionCore): Removed duplicate enum
10111         conversion.
10112
10113 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
10114
10115         * assign.cs (Assign.DoResolve): Error method changed.
10116
10117         * cfold.cs (DoConstantNumericPromotions): Error method changed.
10118         
10119         * const.cs (ResolveValue): Reset in_transit immediately.
10120         
10121         * constant.cs: Error method changed.
10122         
10123         * convert.cs: Removed useless location parameter.
10124         (ExplicitNumericConversion): Don't do double enum check.
10125         (ExplicitConversionCore): Renamed from ExplicitConversion.
10126         (ExplicitUnsafe): Extracted from ExplicitConversion.
10127         (ExplicitConversion): Uses for error reporting.
10128         
10129         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
10130         error messages.
10131         (ResolveBoolean): Uses common error method.
10132         (CastToDecimal): Get rid of ec.
10133         (CastFromDecimal): Optimized.
10134         (ConvCast): Get rid of ec.
10135         
10136         * enum.cs (ResolveValue): Reset in_transit immediately.
10137         (Emit): Return after first error.
10138         
10139         * expression.cs: Convert changes.
10140         
10141         * literal.cs: Error method changed.
10142         
10143         * statement.cs: Error method changed.
10144
10145 2005-10-03  Raja R Harinath  <rharinath@novell.com>
10146
10147         * support.cs (SeekableStreamReader.Position): Don't error out when
10148         the requested position is just beyond the end of the current
10149         buffered data.
10150
10151 2005-09-28  Raja R Harinath  <rharinath@novell.com>
10152
10153         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
10154         try to keep in sync with the byte count of the underlying Stream.
10155         However, this limits us to a window size of 2048 characters: i.e.,
10156         the maximum lookahead of our lexer/parser can be 2048 characters.
10157
10158 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
10159
10160         Fix #76255.
10161         * driver.cs: Fix compilation files with full root path.
10162
10163 2005-09-25  Miguel de Icaza  <miguel@novell.com>
10164
10165         * report.cs (SymbolRelatedToPreviousError): Format the output so
10166         it does not use an open parenthesis that is never closed. 
10167
10168         * driver.cs: Follow coding guidelines
10169
10170 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
10171
10172         Fix #72930.
10173         * const.cs (Const.ResolveValue): Check for assigning non-null
10174         value to reference type.
10175
10176 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
10177
10178         * anonymous.cs: Implemented ExprClassName.
10179         
10180         * assign.cs (Assign.DoResolve): Don't chrash when type is not
10181         delegate.
10182         
10183         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
10184         check.
10185         
10186         * class.cs (StaticClass.DefineContainerMembers): Report protected
10187         members as error.
10188         
10189         * codegen.cs: if(ed) PRODUCTION.
10190         
10191         * convert.cs (Error_CannotImplicitConversion): Better error
10192         distinction.
10193         
10194         * cs-parser.jay: More error checks.
10195         
10196         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
10197         
10198         * driver.cs (CSCParseOption): Enabled wrong option check.
10199         
10200         * ecore.cs (Expression.ExprClassName): Turned to property.
10201         (MemberExpr.CheckIntermediateModification): For checking boxed
10202         value types     modification.
10203         
10204         * statement.cs (Fixed.Resolve): Expression type must be
10205         convertible to fixed type.
10206         (CollectionForeach.GetEnumeratorFilter,TryType):
10207         Small refactoring for easier error checking.
10208
10209 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
10210
10211         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
10212         attributes.
10213         
10214         * class.cs (GeneratedBaseInitializer): New class for customization
10215         compiler generated initializers.
10216         (MemberBase.DoDefine): Check Obsolete attribute here.
10217         (FieldMember.DoDefine): Ditto.
10218         
10219         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
10220         constants.
10221         
10222         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
10223         (MemberCore.GetObsoleteAttribute): Removed argument.
10224         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
10225         (MemberCore.CheckObsoleteType): New helper.
10226         
10227         * delegate.cs,
10228         * enum.cs,
10229         * statement.cs: Updates after MemberCore changes.
10230         
10231         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
10232         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
10233         
10234         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
10235         obsolete attribute for compiler construct.
10236         (As.DoResolve): Cache result.
10237         
10238         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
10239
10240 2005-09-26  Raja R Harinath  <rharinath@novell.com>
10241
10242         Fix #76133.
10243         * expression.cs (This.VerifyFixed): In a value type T, the type of
10244         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
10245         value type R, 'this' is treated as a value parameter.
10246
10247 2005-09-22  Miguel de Icaza  <miguel@novell.com>
10248
10249         * statement.cs (Lock): Use the TemporaryVariable class instead of
10250         manually using local variables as those do not work when variables
10251         are captured.
10252
10253         * ecore.cs: Moved the TemporaryVariable class from being a nested
10254         class inside Foreach to be a public class that can be employed in
10255         other places. 
10256
10257 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
10258
10259         * cs-parser.jay: interface_accessors replaced by
10260         accessor_declarations.
10261
10262         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
10263         location.
10264         
10265         * statement.cs (GotoCase.Resolve): Convert null constant to
10266         null case.
10267         (SwitchLabel.ResolveAndReduce): Ditto.
10268         (SwitchLabel.NullStringCase): Custom null stamp.
10269         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
10270         
10271         typemanager.cs (CSharpSignature): Don't skip first argument
10272         for full names.
10273
10274 2005-09-18  Miguel de Icaza  <miguel@novell.com>
10275
10276         * driver.cs: Set InEmacs based on the environment variable EMACS. 
10277
10278         * location.cs (InEmacs): in this mode, do not report column
10279         location as it confuses Emacs.
10280
10281 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
10282
10283         * cfold.cs, constant.cs, convert.cs, ecore.cs,
10284         expression.cs, iterators.cs, literal.cs: Store constants and
10285         literals location.
10286         
10287         * class.cs (MemberBase.ShortName): Pass location.
10288         
10289         * cs-parser.jay: Some location fixes.
10290         
10291         * ecore.cs (Expression.Location): Made virtual.
10292
10293 2005-09-05  Miguel de Icaza  <miguel@novell.com>
10294
10295         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
10296         if the underlying types are the same, otherwise we need to produce
10297         code that will do the proper cast.
10298
10299         This was exposed by Marek's constant rewrite which produced
10300         invalid code for the call site:
10301
10302         enum X : long { a }
10303         void Method (X v) {}
10304
10305         Method ((X) 5)
10306
10307         This fixes test-49.cs
10308
10309 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
10310
10311         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
10312           Type/Object should be allowed as well. Fixed bug #75968.
10313
10314 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
10315
10316         * expression.cs : (Binary.DoResolve): when one is enum constant and
10317           another is constant 0, then return enum one *as enum type*.
10318           Fixed bug 74846.
10319
10320 2005-09-02  Raja R Harinath  <rharinath@novell.com>
10321
10322         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
10323         internal.
10324
10325         Fix #75941.
10326         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
10327         flow-branching for LocalVariableReferences in case we were invoked
10328         from a MemberAccess.
10329         * expression.cs (LocalVariableReference.VerifyAssigned): New.
10330         Carved out of ...
10331         (LocalVariableReference.DoResolveBase): ... this.
10332         (MemberAccess.Resolve): Do the check that was disabled during
10333         SimpleNameResolve.
10334
10335 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
10336
10337         * class.cs :
10338           (PartialContainer.Create): check abstract/sealed/static strictly
10339           but abstract/sealed can exist only at one side. Fixed bug #75883.
10340
10341 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
10342
10343         Fix #75945.
10344         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
10345         specified, don't default to UnmanagedType.I4.
10346
10347 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
10348
10349         * expression.cs : conditional operator should check possibly
10350           incorrect assign expression. Fixed bug #75946.
10351
10352 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
10353
10354         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
10355           Reverting the change. gmcs is much complex than mcs on this matter.
10356
10357 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
10358
10359         * cs-tokenizer.cs : To read another token ahead of the actual 
10360           consumption, use new SavedToken and cache token instead of moving
10361           back the stream with SeekableStreamReader (it seemed problematic).
10362         * cs-parser.jay,
10363           driver.cs : Thus use StreamReader directly.
10364         * support.cs : Thus removed SeekableStreamReader.
10365
10366 2005-08-30  Raja R Harinath  <rharinath@novell.com>
10367
10368         Fix #75934.
10369         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
10370         (ScopeInfo.EmitScopeType): Use it to construct field names from
10371         names of captured locals.
10372
10373         Fix #75929.
10374         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
10375         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
10376         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
10377         (ExplicitConversion): Remove enum cases already handled by
10378         implicit conversion.  Move implicit conversion check to the beginning.
10379         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
10380         * expression.cs (ArrayCreation.EmitDynamicInitializers):
10381         Don't treat System.Enum as a struct.
10382
10383 2005-08-30  Jb Evain  <jbevain@gmail.com>
10384
10385         * attribute.cs: handles as expression in parameters.
10386
10387 2005-08-30  Raja R Harinath  <rharinath@novell.com>
10388
10389         Fix #75802.
10390         * class.cs (TypeContainer.VerifyClsName): Don't use a
10391         PartialContainer when verifying CLS compliance.
10392         (AbstractPropertyEventMethod): Set Parent here, ...
10393         (PropertyMethod): ... not here.
10394
10395 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
10396
10397         * attribute.cs : escaped attribute name should not be allowed to be
10398           resolved (e.g. @class as classAttribute). Fixed bug #75930.
10399
10400 2005-08-29  Raja R Harinath  <rharinath@novell.com>
10401
10402         Fix #75927.
10403         * convert.cs (ImplicitStandardConversionExists): Allow zero also
10404         when converting a long constant to unsigned long.
10405         * expression.cs (Invocation.OverloadResolve): Add sanity check to
10406         detect where IsApplicable and VerifyArgumentsCompat disagree.
10407
10408 2005-08-29  Raja R Harinath  <rharinath@novell.com>
10409         and Carlos Alberto Cortez  <carlos@unixmexico.org>
10410
10411         Fix #75848.
10412         * class.cs (TypeContainer.CanElideInitializer): New helper.
10413         (TypeContainer.EmitFieldInitializers): Use it to determine if we
10414         can safely emitting the initializer of a field.
10415
10416 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10417
10418         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
10419           allowed inside a switch (without loop). Fixed bug #75433.
10420
10421 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
10422
10423         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
10424         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
10425
10426 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10427
10428         * driver.cs : kinda reverting the default encoding changes (not exact 
10429           revert since I noticed that "codepage:reset" might not work fine).
10430
10431 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10432
10433         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
10434           Location. Now getter and setter store location correctly.
10435           (errors/cs0111-12.cs now reports the expected location.)
10436
10437 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10438
10439         * driver.cs : Use default encoding on the environment.
10440           Removed (now that) extra parameter for SeekableStreamReader.
10441         * support.cs : (SeekableStreamReader) third .ctor() argument for
10442           StreamReader is not required (always true). preamble size could
10443           be acquired in simpler and safe way.
10444
10445 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
10446
10447         * cs-parser.jay: report CS0642 at warning level 3
10448           and report CS0642 for an if else statement also
10449           fixes bug #74745. Patch by John Luke (and a bit
10450           modified by me).
10451           Removed extra CS0642 warning check for "while",
10452           "for" and "fixed".
10453         * statement.cs: In Block.Resolve(), CS0642 check
10454           is reimplemented to check a sequence of an empty
10455           statement and a block.
10456
10457           Both fix bug #66777.
10458
10459 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
10460
10461         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
10462         detection until I fix it.
10463         
10464         * cs-tokenizer.cs: Changed error message.
10465         
10466         * cs-parser.jay: Fixed 2 error locations.
10467         
10468         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
10469         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
10470         properties.
10471         
10472         * enum.cs (GetSignatureForError): Fixed.
10473         
10474         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
10475         method detection.
10476         
10477         * class.cs,
10478         * typemanager.cs (RegisterProperty): Removed.
10479         
10480         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
10481
10482 2005-08-24  Raja R Harinath  <rharinath@novell.com>
10483
10484         Fix #75874.
10485         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
10486         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
10487
10488 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10489
10490         * expression.cs : tiny fix is required for not warning positive ulong.
10491           See test-441.cs.
10492
10493 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10494
10495         * expression.cs : add CS0652 check for constant and integral
10496           expression. Fixed bug #53974.
10497
10498 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10499
10500         * expression.cs : in DoNumericPromotions(), check if there is implicit
10501           conversion overload for string (to check CS0034). Fixed bug #52492.
10502
10503 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10504
10505         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
10506
10507 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10508
10509         * ecore.cs : report location when it is *not* Null.
10510
10511 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10512
10513         * codegen.cs,
10514           ecore.cs,
10515           flowanalysis.cs,
10516           expression.cs:
10517           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
10518           correctly. Fixed bug #75721.
10519
10520 2005-08-23  Raja R Harinath  <rharinath@novell.com>
10521
10522         * support.cs (SeekableStreamReader.Position): Avoid an expensive
10523         loop that performs 'min (pos, char_count)'.
10524
10525         Fix #75862.
10526         * expression.cs (Unary.ResolveOperator): Don't discard implicit
10527         converted value in Operator.OnesComplement.
10528
10529 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
10530
10531         * anonymous.cs: If the anon method is pulled into a helper class,
10532         it needs to be `internal' not `private'. Fixes runtime behavior on
10533         msft. bug #75704
10534
10535 2005-08-20  Martin Baulig  <martin@ximian.com>
10536
10537         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
10538         scope if we don't already have it.
10539
10540         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
10541         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
10542         fixes #75867.
10543
10544 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
10545
10546         Fix #75803
10547         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
10548         is a partial class.
10549
10550 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
10551
10552         The big constants rewrite
10553         Fix #75746, #75685 and more
10554         As a side effect saved 1MB for MWF ;-)
10555         
10556         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
10557         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
10558         enum based for corlib compilation.
10559         
10560         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
10561         subtractions.
10562         
10563         * class.cs (FixedField.Define): Use ResolveAsConstant.
10564         
10565         * const.cs (IConstant): Interface constants and enums.
10566         (Const.ResolveValue): New method for constant resolvning.
10567         (ExternalConstant): Constants from imported assemblies.
10568         
10569         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
10570         conversion; like enums.
10571         (Constant.ToType): Converts this constant to different type.
10572         (Constant.Increment): Adds 1.
10573         
10574         * convert.cs (ImplicitConversionRequired): Simplified.
10575         
10576         * cs-parser.jay: Create EnumMember directly.
10577         
10578         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
10579         
10580         * doc.cs (GenerateEnumDocComment): Removed.
10581         
10582         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
10583         (ConvertIntLiteral): Removed.
10584         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
10585         
10586         * enum.cs (EnumMember): Implement IConstant.
10587         (Enum.IsValidEnumConstant): Removed.
10588         (Enum.GetNextDefaultValue): Removed.
10589         (Enum.FindMembers): Updated.
10590         (Enum.GenerateDocComment): Iterate enum members.
10591         
10592         * expression.cs (Cast.TryReduce): Handle enums correctly.
10593         (New.Constantify): Made public.
10594         (MemberAccess.DoResolve): Removed contant specific if(s).
10595         
10596         * literal.cs (NullLiteral): Implement new abstract methods.
10597         
10598         * statement.cs (GotoCase.Resolve): Use new constant methods.
10599         (SwitchLabel.ResolveAndReduce): Use new constant methods.
10600         
10601         * typemanager.cs (LookupEnum): Removed.
10602         (IsEnumType): Fixed to work with corlib.
10603         (RegisterConstant): Removed.
10604         (LookupConstant): Removed.
10605         (GetConstant): Changed to work with IConstant.
10606
10607 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
10608
10609         * location.cs : Fixed overflown (>255) column number.
10610
10611 2005-08-03  Raja R Harinath  <rharinath@novell.com>
10612
10613         First cut of the qualified-alias-member feature.
10614         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
10615         token.
10616         * cs-parser.jay (DOUBLE_COLON): New token.
10617         (namespace_or_type_name): Add rule for recognizing
10618         qualified-alias-members.
10619         (primary_expression): Likewise.
10620         (element_access): Allow QualifiedAliasMember as a possible
10621         type-bearing expression.
10622         (local_variable_type, local_variable_pointer_type): Likewise.
10623         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
10624         aliases in the current and enclosing namespace declarations.
10625         (NamespaceEntry.UsingAlias): Add CS0440 warning.
10626         * decl.cs (MemberName.is_double_colon): New.
10627         (MemberName.MemberName): Add new constructor for alias-member.
10628         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
10629         * expression.cs (QualifiedAliasMember): New expression type.
10630
10631 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10632
10633         * location.cs : it borked when no argument was specified.
10634
10635 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10636
10637         * location.cs : tiny ToString() format fix.
10638
10639 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10640
10641         * statement.cs : oops, it was missing.
10642
10643 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10644
10645         A set of fixes for precise line/column location.
10646
10647         * location.cs :
10648           "token" field now holds a file/line "delta", a line number offset 
10649           from the segment, and a column number. See also:
10650           http://lists.ximian.com/pipermail/mono-devel-list/2004-
10651           December/009508.html
10652           Removed static IsNull. Use instance IsNull property instead.
10653         * cs-tokenizer.cs :
10654           For some tokens it stores Location. For Identifier it stores
10655           LocatedToken which is a pair of string name and location.
10656           Column numbers are adjusted only at getChar().
10657         * report.cs :
10658           Use Location.ToString() for reporting (it now contains column).
10659         * cs-parser.jay :
10660           Largely modified to use LocatedToken instead of
10661           string (IDENTIFIER), and to acquire Location from some tokens.
10662         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
10663           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
10664           codegen.cs :
10665           Now MemberName holds Location. DeclSpace.ctor() receives Location
10666           as a parameter. Removed extra parameters to all derived classes.
10667           Replaced Location.IsNull() with instance property.
10668         * assign.cs, expression.cs :
10669           Added .ctor() overload that omits Location.
10670         * attribute.cs :
10671           Added "nameEscaped" flag that indicates the identifier was escaped
10672           in the source file. This fixes bug #57047.
10673
10674 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
10675
10676         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
10677         New method, looking for lo-case imported cls type.
10678
10679         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
10680         here.
10681
10682         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
10683
10684         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
10685
10686         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
10687         all_imported_types.
10688         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
10689
10690         Optimized to save 3.5 MB for SWF compilation.
10691
10692 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
10693
10694         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
10695         (PartialContainer.Create): Moved logic AddToContainer.
10696         (PartialContainer.MarkForDuplicationCheck): Shares name.
10697         
10698         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
10699         place.
10700         
10701         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
10702         initialization.
10703         (Namespace.GetSignatureForError): New method.
10704         
10705         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
10706         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
10707
10708 2005-08-01  Raja R Harinath  <rharinath@novell.com>
10709
10710         Fix #75669.
10711         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
10712         member lookup rather than qualifier_type, since qualifier_type can
10713         be null.
10714
10715 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
10716
10717         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
10718         enum member.
10719
10720 2005-07-31  Miguel de Icaza  <miguel@novell.com>
10721
10722         * statement.cs: Copy the local exception into the exception
10723         captured local.  Fixes 75674
10724
10725 2005-07-31  Raja R Harinath  <harinath@gmail.com>
10726
10727         Fix #75658.
10728         * expression.cs (Invocation.OverloadResolve): Don't report error
10729         CS1501 if error CS1502 has been reported.
10730         (New.DoResolve): Delegate CS1501 reporting to
10731         Invocation.OverloadResolve.
10732
10733         Fix #75656.
10734         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
10735         invariant-meaning-in-block property in an enclosing block if
10736         necessary.
10737
10738 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
10739
10740         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
10741         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
10742         (Switch.CheckSwitch): Just save 50kb for SWF.
10743
10744 2005-07-27  Martin Baulig  <martin@ximian.com>
10745
10746         * anonymous.cs (CaptureContext.AddField): Added
10747         `AnonymousContainer am' argument; compute its toplevel scope if
10748         it's not already computed.  Fixes #75649.
10749
10750 2005-07-26  Raja R Harinath  <rharinath@novell.com>
10751
10752         Fix #75628.
10753         * class.cs (Constructor.Emit): Reset block to null if the block
10754         resolve fails.
10755
10756 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
10757
10758         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
10759
10760 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
10761
10762         * class.cs (MethodData.Define): Check whether accessor implementing
10763         interface is public.
10764
10765         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
10766
10767 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
10768
10769         Fix #57245
10770         * namespace.cs (LookupType): Moved same type check to...
10771         
10772         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
10773         with the same name.
10774
10775 2005-07-21  Raja R Harinath  <rharinath@novell.com>
10776
10777         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
10778         already found a typebuilder.
10779         * class.cs (MethodCore.IsDuplicateImplementation): Compare
10780         MemberNames, not strings.
10781
10782         * const.cs (Error_ExpressionMustBeConst): 
10783         Rename from Error_EpressionMustBeConst.
10784         * const.cs, class.cs, statement.cd: Update.
10785
10786 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
10787
10788         Fix #65573
10789
10790         * const.cs (Const.LookupConstantValue): Report missing contant expression
10791         everytime.
10792         (Error_EpressionMustBeConstant): Only one error method.
10793
10794         * class.cs, statement.c: Updated.
10795
10796 2005-07-20  Raja R Harinath  <rharinath@novell.com>
10797
10798         * statement.cs (Block.Flags): Add back HasVarargs.
10799         (Block.flags): Make protected.
10800         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
10801
10802         * typemanager.cs (types, typecontainers, user_types): Remove.
10803         (UserTypes, TypeContainers): Likewise.
10804         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
10805         (CleanUp, Reset): Update.
10806         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
10807         (GetNestedType): Use Type.GetNestedType.
10808         (CoreLookupType): Take two arguments, the namespace and the
10809         basename of the type.  Update to use the Namespace.Lookup
10810         mechanism.
10811         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
10812         (RealMemberLookup): Use IsNestedChildOf instead of playing with
10813         string concatenation and substring matches.
10814         * class.cs, enum.cs, delegate.cs: Update to changes.
10815
10816 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
10817
10818         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
10819         Expression and made virtual.
10820
10821         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
10822         (ImplicitStandardConversionExists): Fixed `byte' typo ?
10823
10824         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
10825
10826         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
10827         error message.
10828
10829         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
10830         change.
10831
10832 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
10833
10834         Fix #57707
10835         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
10836         AssemblyCultureAttribute is not used on executable.
10837
10838         * rootcontext.cs,
10839         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
10840
10841 2005-07-16  Raja R Harinath  <rharinath@novell.com>
10842
10843         Fix #60638.
10844         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
10845         New.  Reports CS0252/CS0253.
10846         Mostly taken from preliminary patch by Duncak Mak.
10847         (Binary.DoResolveOperator): Store results of operator lookup.
10848         Use them to detect if we need to warn about unintended reference
10849         comparisons.
10850
10851 2005-07-15  Raja R Harinath  <rharinath@novell.com>
10852
10853         Fix #72969.
10854         * namespace.cs (Namespace.Lookup): Add back location parameter.
10855         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
10856         * delegate.cs, ecore.cs, expression.cs: Update to changes.
10857
10858         * codegen.cs (EmitContext.DeclSpace): Make readonly.
10859         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
10860         (Namespace.LookupType): ... this.
10861         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
10862         of namespaces.
10863         * typemanager.cs (LookupTypeReflection): Remove buggy code that
10864         purported to handle pointers.
10865         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
10866         CoreLookupType.
10867
10868 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
10869
10870         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
10871         type as namespace.
10872
10873 2005-07-15  Raja R Harinath  <rharinath@novell.com>
10874
10875         * namespace.cs (Namespace.Lookup): Drop location parameter.
10876         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
10877         (NamespaceEntry.Lookup): ... this.
10878         (NamespaceEntry.Error_AmbiguousTypeReference):
10879         Move here from DeclSpace.
10880         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
10881         names ...
10882         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
10883         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
10884         Move to NamespaceEntry.
10885         * delegate.cs, expression.cs: Update to changes.
10886
10887 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
10888
10889         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
10890         CheckAttributeType and refactored.
10891         (Attribute.ResolvePossibleAttributeType): Changed to reuse
10892         ResolveAsTypeTerminal error handling.
10893         (ResolveAsTypeTerminal): Introduced because of global attributes extra
10894         handling.
10895         (GetSignatureForError): Print errors in same way.
10896
10897         * class.cs,
10898         * codegen.cs: Reflect attribute GetSignatureForError change.
10899
10900         * ecore.cs,
10901         * expression.cs: Add silent parameter to ResolveAsTypeStep.
10902
10903         * namespace.cs (UsingEntry): Refactored to make fields private.
10904
10905         * assign.cs,
10906         statement.cs: Error_UnexpectedKind has extra parameter.
10907
10908 2005-07-14  Raja R Harinath  <rharinath@novell.com>
10909
10910         * ecore.cs (IAlias): Remove.
10911         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
10912         that implement the interface.
10913         * namespace.cs (Namespace): Likewise.
10914         (Namespace.declspaces): Renamed from 'defined_names'.
10915         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
10916         DeclSpace instead of an IAlias.
10917         * tree.cs (Tree.AddDecl): Update.
10918
10919 2005-07-12  Raja R Harinath  <rharinath@novell.com>
10920
10921         * statement.cs (Block.Flags); Remove HasVarargs.
10922         (Block.HasVarargs): Move to ToplevelBlock.
10923         (Block.ThisVariable, Block.AddThisVariable): Likewise.
10924         (Block.Variables): Make protected.  Initialize variable hashtable
10925         if necessary.
10926         (Block.AddVariable): Update.
10927         (Block.Resolve): Update to changes.
10928         (ToplevelBlock.HasVarargs): New boolean.
10929         (ToplevelBlock.ThisVariable): Move here from Block.
10930         (ToplevelBlock.AddThisVariable): Likewise.
10931         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
10932         * expression.cs (This.ResolveBase): Update to changes.
10933         (ArglistAccess.DoResolve): Likewise.
10934
10935 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
10936
10937         Fix #75321
10938         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
10939
10940         * class.cs (TypeContainer.VerifyMembers): Distinguish between
10941         not used and not used & assigned.
10942         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
10943
10944 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
10945
10946         Fix #75053
10947         * expression.cs (Is.DoResolve): null is never provided type.
10948
10949 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
10950
10951         Fix #52496
10952         * cs-parser.jay: Less strict event error rule to catch more errors.
10953
10954 2005-07-08  Martin Baulig  <martin@ximian.com>
10955
10956         Fix test-iter-10.cs - distinguish whether we `yield' in a property
10957         gettter (allowed) or setter (not allowed).
10958
10959         * class.cs (Accessor): Implement IIteratorContainer.
10960         (Accessor.Yields): New public field.
10961         (PropertyBase.PropertyMethod.Define): Handle iterators on a
10962         per-accessor basis.
10963
10964         * cs-parser.jay
10965         (get_accessor_declaration, set_accessor_declaration): Set the
10966         `yields' flag on the accessor, not the property.
10967         (property_declaration): Do the iterators check on a per-accessor
10968         basis and not for the whole property.
10969
10970 2005-07-08  Martin Baulig  <martin@ximian.com>
10971
10972         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
10973         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
10974
10975 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
10976
10977         Fix #74975
10978         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
10979         (ExtractSecurityPermissionSet): Cope with self referencing security
10980         attributes properly.
10981
10982         * driver.cs (SetOutputFile): Made public property OutputFile.
10983
10984 2005-07-07  Raja R Harinath  <rharinath@novell.com>
10985
10986         Fix #75486.
10987         * class.cs (TypeContainer.first_nonstatic_field): Rename from
10988         has_nonstatic_fields.  Make into a FieldBase pointer.
10989         (TypeContainer.AddField): Add CS0282 check.
10990         (TypeContainer.EmitType): Update.
10991
10992 2005-07-06  Miguel de Icaza  <miguel@novell.com>
10993
10994         * cs-tokenizer.cs (consume_identifier): Do not create strings to
10995         compare if they start with __.
10996
10997 2005-07-06  Raja R Harinath  <rharinath@novell.com>
10998
10999         * statement.cs (Switch.SwitchGoverningType): Only look at
11000         UserCasts that don't need implicit standard conversions to one of
11001         the allowed switch types (Fixes test-322.cs).
11002         (LocalInfo.Resolve): Re-enable sanity-test.
11003
11004 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
11005
11006         * cs-tokenizer.cs (consume_identifier): Detect double undescores
11007         
11008         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
11009         
11010         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
11011
11012 2005-07-06  Raja R Harinath  <rharinath@novell.com>
11013
11014         Fix #75472.
11015         * ecore.cs (SimpleName.GetSignatureForError): Add.
11016         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
11017         (MemberAccess.GetSignatureForError): Add.
11018
11019 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
11020  
11021         The big error and warning messages review.
11022         
11023         * anonymous.cs,
11024         * assign.cs,
11025         * attribute.cs,
11026         * class.cs,
11027         * codegen.cs,
11028         * convert.cs,
11029         * cs-parser.jay,
11030         * cs-tokenizer.cs,
11031         * decl.cs,
11032         * delegate.cs,
11033         * doc.cs,
11034         * driver.cs,
11035         * ecore.cs,
11036         * enum.cs,
11037         * expression.cs,
11038         * flowanalysis.cs,
11039         * iterators.cs,
11040         * literal.cs,
11041         * location.cs,
11042         * modifiers.cs,
11043         * namespace.cs,
11044         * parameter.cs,
11045         * pending.cs,
11046         * report.cs,
11047         * rootcontext.cs,
11048         * statement.cs,
11049         * support.cs,
11050         * tree.cs,
11051         * typemanager.cs: Updated.
11052         
11053         * class.cs: (MethodCore.SetYields): Moved here to share.
11054         (PropertyMethod.Define): Moved iterator setup here.
11055         
11056         * iterators.cs: Add orig_method to have full access to parent
11057         container.
11058
11059 2005-07-05  Raja R Harinath  <rharinath@novell.com>
11060
11061         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
11062         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
11063         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
11064         variable of struct type.
11065         * expression.cs (Unary.ResolveOperator): Update to change.
11066         (Indirection.VerifyFixed): Likewise.
11067         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
11068         (ParameterReference.VerifyFixed): Value parameters are fixed.
11069         (This.VerifyFixed): Treat 'this' as a value parameter.
11070         * statement.cs (LocalInfo.IsFixed): Remove.
11071
11072 2005-07-01  Martin Baulig  <martin@ximian.com>
11073
11074         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
11075         `ec.EmitThis ()' to get the correct scope.
11076
11077 2005-07-01  Martin Baulig  <martin@ximian.com>
11078
11079         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
11080         instance is a ParameterReference; fixes #75299.
11081
11082 2005-07-01  Martin Baulig  <martin@ximian.com>
11083
11084         Reverted Marek's latest patch (r46725):
11085         - it contains structural changes which are neither mentioned in
11086           the ChangeLog nor explained anywhere; for example the additional
11087           argument of EmitContext's and Iterator's .ctor's and the
11088           TypeContainer.DefineMembers() change.
11089         - structural changes like this should go in in seperate patches
11090           and not be hidden in a huge patch which just seems to affect
11091           warnings and errors.
11092           a big and hard to understand patch.
11093         - it breaks iterators and causes regressions, for instance in
11094           test-iter-03.cs.      
11095
11096 2005-06-30  Raja R Harinath  <rharinath@novell.com>
11097
11098         Fix #75412.
11099         * expression.cs (Indexers.map): Remove.
11100         (Indexers.Append): Filter out inaccessible setters and getters.
11101         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
11102
11103         Fix #75283.
11104         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
11105         Refactored from ...
11106         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
11107         (FieldExpr.Emit, PropertyExpr.Emit): Update.
11108         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
11109         * expression.cs (Invocation.EmitCall): Add CS0120 check.
11110
11111 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
11112
11113         Fix #75322
11114         * class.cs (FieldBase.GetInitializerExpression): One more field
11115         for backup.
11116
11117 2005-06-28  Miguel de Icaza  <miguel@novell.com>
11118
11119         * pending.cs: Do not define a proxy if the base method is virtual,
11120         it will be picked up by the runtime (bug 75270).
11121
11122 2005-06-08  Martin Baulig  <martin@ximian.com>
11123
11124         The big Iterators rewrite :-)
11125
11126         * iterators.cs: Rewrite this to use the anonymous methods framework.
11127
11128         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
11129         before the TypeContainers; see 2test-21.cs.
11130
11131         * class.cs
11132         (TypeContainer.DefineType): Don't create a new EmitContext if we
11133         already have one (this only happens if we're an Iterator).
11134         (TypeContainer.Define): Also call Define() on all our iterators.
11135         (Method.CreateEmitContext): Added support for iterators.
11136
11137         * anonymous.cs
11138         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
11139         (AnonymousContainer.CreateMethodHost): Moved here from
11140         AnonymousMethod and made abstract.
11141         (AnonymousContainer.CreateScopeType): New abstract method.
11142         (AnonymousContainer.IsIterator): New public property.
11143         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
11144         get the ScopeTypeBuilder rather than manually defining it here. 
11145         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
11146         iterators here.
11147
11148         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
11149         before RootContext.DefineTypes().
11150
11151         * codegen.cs (EmitContext.RemapToProxy): Removed.
11152         (EmitContext.CurrentAnonymousMethod): Changed type from
11153         AnonymousMethod -> AnonymousContainer.
11154         (EmitContext.ResolveTopBlock): Protect from being called twice.
11155         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
11156         (EmitContext.EmitThis): Removed the iterators hacks; use the
11157         anonymous methods framework for that.
11158
11159         * statement.cs
11160         (ToplevelBlock.Container): Make this a property, not a field.
11161         (ToplevelBlock.ReParent): New public method; move the
11162         ToplevelBlock into a new container.
11163         (Foreach.TemporaryVariable): Simplify.
11164
11165 2005-06-05  Martin Baulig  <martin@ximian.com>
11166
11167         * statement.cs (LocalInfo.CompilerGenerated): New flag.
11168         (Block.AddTemporaryVariable): New public method; creates a new
11169         `LocalInfo' for a temporary variable.
11170         (Block.EmitMeta): Create the LocalBuilders for all the temporary
11171         variables here.
11172         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
11173         non-iterator variables.
11174
11175 2005-06-05  Martin Baulig  <martin@ximian.com>
11176
11177         * statement.cs (Foreach.TemporaryVariable): Create the
11178         LocalBuilder in the Emit phase and not in Resolve since in some
11179         situations, we don't have an ILGenerator during Resolve; see
11180         2test-19.cs for an example.
11181
11182 2005-06-04  Martin Baulig  <martin@ximian.com>
11183
11184         **** Merged r45395 from GCS ****
11185
11186         The big Foreach rewrite - Part II.
11187
11188         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
11189         with `PropertyInfo ienumerator_getcurrent'.
11190
11191         * codegen.cs (VariableStorage): Removed.
11192
11193         * statement.cs
11194         (Foreach): Derive from Statement, not ExceptionStatement.
11195         (Foreach.CollectionForeach): New nested class.  Moved all the code
11196         dealing with collection foreach here.
11197         (Foreach.ForeachHelperMethods): Removed.
11198         (Foreach.TemporaryVariable): Implement IMemoryLocation.
11199
11200 2005-05-23  Martin Baulig  <martin@ximian.com>
11201
11202         * statement.cs (Try.DoResolve): Don't create a `finally' if we
11203         don't need to.  Fix #75014.
11204
11205 2005-05-20  Martin Baulig  <martin@ximian.com>
11206
11207         Merged r44808 from GMCS.
11208
11209         * class.cs (TypeContainer.CircularDepException): Removed.
11210         (TypeContainer.DefineType): Removed the `InTransit' stuff.
11211         (TypeContainer.CheckRecursiveDefinition): Check for circular class
11212         (CS0146) and interface (CS0529) dependencies here.
11213
11214 2005-06-21  Raja R Harinath  <rharinath@novell.com>
11215
11216         * expression.cs (Invocation.EmitCall): Fix initialization
11217         'this_call' to reflect current behaviour.  Fix indentation.
11218
11219         * convert.cs (FindMostEncompassedType): Add two trivial special
11220         cases (number_of_types == 0 || number_of_types == 1).
11221         (FindMostEncompasingType): Likewise.
11222
11223 2005-06-17  Raja R Harinath  <rharinath@novell.com>
11224
11225         Some cleanups preparing for the fix of #75283.
11226         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
11227         error testing.
11228         (EventExpr.InstanceResolve): Likewise.
11229         (EventExpr.DoResolve): Remove redundant checks.
11230
11231 2005-06-10  Duncan Mak  <duncan@novell.com>
11232
11233         * cs-tokenizer.cs (process_directives): New flag for controlling
11234         the processing of preprocessor directives.
11235         (x_token): After seeing a '#', return Token.NONE instead of going
11236         to handle_preprocessing_directive() when not processing
11237         directives. This avoids unnecessary processing during the token peek in
11238         is_punct().
11239
11240         This fixes #74939.
11241
11242         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
11243         the existing error reporting methods instead of Report.Error.
11244
11245         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
11246         after Raja's rewrite.
11247
11248 2005-06-08  Miguel de Icaza  <miguel@novell.com>
11249
11250         * class.cs: Small fix.
11251
11252 2005-06-08  Raja R Harinath  <rharinath@novell.com>
11253
11254         Fix #75160.
11255         * class.cs (GetPartialBases): Fix return value check of
11256         part.GetClassBases.
11257
11258 2005-06-07  Raja R Harinath  <rharinath@novell.com>
11259
11260         Ensure that partial classes are registered in their enclosing
11261         namespace.  Initial part of fix of #75160.
11262         * tree.cs (Tree.RecordDecl): Add new namespace argument.
11263         Register declspace with namespace here, not in
11264         DeclSpace.RecordDecl.
11265         * cs-parser.jay: Pass namespace to RecordDecl.
11266         * class.cs (PartialContainer.Create): Likewise.
11267         (ClassPart.DefineType): New sanity-check.  Throws an exception if
11268         called.
11269         * decl.cs (Declspace.RecordDecl): Remove.
11270         * namespace.cs (NamespaceEntry.DefineName): Remove.
11271
11272 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
11273
11274         * rootcontext.cs: Reset TargetExt as well.
11275
11276 2005-06-03  Raja R Harinath  <rharinath@novell.com>
11277
11278         * ecore.cs (Expression.Resolve): Emit CS0654 error when
11279         -langversion:ISO-1.
11280
11281 2005-06-02  Raja R Harinath  <rharinath@novell.com>
11282
11283         Fix #75080, cs0119.cs.
11284         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
11285         of ...
11286         (Expression.Resolve): ... this.  Use it.  Remove bogus code
11287         allowing ExprClass.Type and ExprClass.Namespace for
11288         ResolveFlags.VariableOrValue.
11289         (Expression.Resolve) [1-argument variant]: Change default resolve
11290         flags based on language version.
11291         (Expression.Error_UnexpectedKind): Use a simple string array
11292         rather than an ArrayList.
11293         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
11294         not ExprClass.Type.
11295         (TypeOfVoid.DoResolve): Likewise.
11296         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
11297         flags argument -- it always has the same value.
11298
11299 2005-05-31  Raja R Harinath  <rharinath@novell.com>
11300
11301         Fix #75081.
11302         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
11303         Use it in the error message.
11304         * assign.cs, expression.cs, statement.cs: Update.
11305
11306 2005-05-30  Raja R Harinath  <rharinath@novell.com>
11307
11308         Fix #75088.
11309         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
11310         the "almostMatchedMember" case too.
11311         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
11312         that failed the accessibility checks to 'almost_match'.
11313
11314 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
11315
11316         * attribute.cs: Use internal MethodBuilder methods to set
11317         ExactSpelling and SetLastError on PInvoke methods, instead
11318         of passing them via charset.  Fixes #75060.
11319
11320 2005-05-27  Raja R Harinath  <rharinath@novell.com>
11321
11322         * parameter.cs (Parameter): Remove TODO comment.
11323         (Parameter.DefineParameter): Remove Location parameter.
11324         (Parameters.LabelParameters): Likewise.
11325         * class.cs (Constructor.Emit): Update to change.
11326         (MethodData.Emit): Likewise.
11327         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
11328         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
11329
11330 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
11331
11332         * parameter.cs,
11333           Removed Parameters.Location and added Parameter.Location instead.
11334           Removed Location parameter from Emit() and GetSignature().
11335         * anonymous.cs,
11336           class.cs,
11337           cs-parser.jay,
11338           delegate.cs,
11339           iterators.cs,
11340           statement.cs :
11341           Modified all related calls.
11342
11343 2005-05-26  Raja R Harinath  <rharinath@novell.com>
11344
11345         Improve user-defined conversion handling.
11346         * convert.cs (GetConversionOperators): Rewrite.  Return only the
11347         applicable operators.
11348         (AddConversionOperators): New.  Helper for GetConversionOperators.
11349         (FindMostEncompassedType, FindMostEncompassingType): Verify that
11350         there is only one most encompassed/encompassing type.
11351         (FindMostSpecificSource, FindMostSpecificTarget): Remove
11352         "applicable operator" handling.
11353         (UserConversion): Move cache here from GetConversionOperators.
11354         Directly cache the chosen operator, rather than the whole
11355         MethodGroup.
11356         (ExplicitNumericConversion): Fix buggy implementation of Decimal
11357         case.  Allow conversion of decimal to sbyte and byte too.
11358         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
11359         New static methods.  Used to avoid allocating EmptyExpressions in
11360         convert.cs.
11361
11362 2005-05-24  Duncan Mak  <duncan@novell.com>
11363
11364         * ecore.cs (CastFromDecimal): New class for casting a decimal to
11365         another class, used in Convert.ExplicitNumericConversion.
11366         (CastToDecimal): New class, similar to above, but casts to
11367         System.Decimal, used in Convert.ImplicitNumericConversion and also
11368         in explicit convesion from double/float to decimal.
11369
11370         * convert.cs (ImplicitNumericConversion): Handle implicit
11371         conversions to System.Decimal.
11372         (ExplicitNumericConversion): handle explicit conversions to
11373         System.Decimal.
11374
11375         This fixes #68711.
11376         
11377 2005-05-20  Miguel de Icaza  <miguel@novell.com>
11378
11379         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
11380         know the type at this stage, just break through.   Fixes #75008 
11381
11382 2005-05-19  Martin Baulig  <martin@ximian.com>
11383
11384         * delegate.cs
11385         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
11386         to disable error reporting.
11387
11388         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
11389         here since we don't want to report an error; see the new test-336.cs.
11390
11391 2005-05-19  Raja R Harinath  <rharinath@novell.com>
11392
11393         * statement.cs (ToplevelBlock.GetParameterReference)
11394         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
11395         Move here from class Block.
11396         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
11397         * expression.cs (ParameterReference.DoResolveBase): Likewise.
11398
11399 2005-05-18  Martin Baulig  <martin@ximian.com>
11400
11401         Fix #74978.
11402
11403         * flowanalysis.cs
11404         (FlowBranching.Reachability): Add non-static public And() and Or()
11405         methods.
11406         (FlowBranchingSwitch): New class; do the `break_origins' thing
11407         like in FlowBranchingLoop.
11408         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
11409         reachability, not just locals and parameters.
11410         (FlowBranching.MergeChild): Remove some of the hacks for loop and
11411         switch; MergeBreakOrigins() now takes care of that.
11412
11413 2005-05-18  Martin Baulig  <martin@ximian.com>
11414
11415         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11416         a loop and may leave it, reset the barrier; fixes #74974.
11417
11418 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
11419         
11420         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
11421         is back.
11422         
11423         * cs-parser.jay: Catch more lexical errors.
11424         
11425         * report.cs: Add one more Error method.
11426         
11427         * rootcontext.cs,
11428         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
11429
11430 2005-05-17  Martin Baulig  <martin@ximian.com>
11431
11432         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
11433         #70970. 
11434
11435 2005-05-16  Raja R Harinath  <rharinath@novell.com>
11436
11437         Fix test-382.cs.  Emit values of decimal constants.
11438         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
11439         Carved out of ...
11440         (TypeContainer.AddField): ... this.
11441         (TypeContainer.EmitFieldInitializers): Allow the list of fields
11442         with initializers to include 'Const's.
11443         (ClassPart.RegisterFieldForInitialization): Forward to
11444         PartialContainer.
11445         * const.cs (Const.Const): Pass initializer to base class.
11446         (Const.Define): In case of decimal constants, register them for
11447         initialization in a static constructor.
11448
11449 2005-05-14  Martin Baulig  <martin@ximian.com>
11450
11451         * statement.cs (Block.Resolve): Correctly handle unreachable code;
11452         do not call ResolveUnreachable() on unreachable statements in
11453         here, see the comment in the source code.
11454
11455 2005-05-13  Raja R Harinath  <rharinath@novell.com>
11456
11457         Fix #74934.
11458         * expression.cs (BinaryResolveOperator): If one of the operands of
11459         an equality comparison is 'null' and the other is a pointer type,
11460         convert the null to a NullPointer.
11461         * convert.cs (ImplicitReferenceConversion): If the expression is a
11462         NullLiteral and the target type is a pointer type, return a
11463         NullPointer instead.
11464         (ImplicitConversionStandard): Likewise.
11465
11466 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
11467         
11468         * cs-parser.jay: Set readonly context based on special constructs.
11469         
11470         * expression.cs (LocalVariableReference.DoResolveBase): Improved
11471         readonly variable error handling.
11472         
11473         * rootcontext.cs (EmitCode): Don't verify members when error
11474         occurred.
11475         
11476         * statement.cs (LocalInfo): Add reaodnly context information.
11477         (SetReadOnlyContext, GetReadOnlyContext): New methods.
11478
11479 2005-05-13  Raja R Harinath  <rharinath@novell.com>
11480
11481         * statement.cs (Block.Resolve): Revert change below.  Modify fix
11482         for #74041 to initialize 'resolved' to false only for explicit
11483         blocks.  Fixes #74873.
11484
11485 2005-05-12  Raja R Harinath  <harinath@gmail.com>
11486
11487         Fix #74920.
11488         * typemanager.cs (unmanaged_enclosing_types): New.
11489         (IsUnmanagedType): Avoid infloops by using
11490         'unmanaged_enclosing_types' to talk with recursive invocations.
11491
11492 2005-05-13  Martin Baulig  <martin@ximian.com>
11493
11494         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
11495         instance variable, not a local.  Fix #74873.
11496         (Block.ResolveUnreachable): Set it to true here.
11497
11498 2005-05-11  Duncan Mak  <duncan@novell.com>
11499
11500         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
11501         continuing to process for 'arg'.
11502         (handle_preprocessing_directive): Check the argument of the #endif
11503         directive and report error CS1025 if there are any trailing
11504         characters.
11505
11506         According to the C# spec, having even whitespace after the #endif
11507         directive is illegal; however, because we call arg.TrimEnd ()
11508         beforehand, we have the same behavior as csc, allowing whitespace
11509         after the directive.
11510
11511         Fixes #74892.
11512
11513 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
11514
11515         Fix #74863.
11516         
11517         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
11518         (Constructor.GetObsoleteAttribute): Implemented correctly.
11519
11520 2005-05-10  Martin Baulig  <martin@ximian.com>
11521
11522         * support.cs (ReflectionParameters.ParameterModifier): Use
11523         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
11524         and `ParameterAttributes.In'.  Fixes #74884.
11525
11526 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
11527
11528         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
11529         
11530         * expression.cs (Argument.GetParameterModifier): Turned to property.
11531         (Invocation.Error_InvalidArguments): Add more descriptive errors.
11532         
11533         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
11534         its C# equivalent.
11535         
11536 2005-05-09  Raja R Harinath  <rharinath@novell.com>
11537
11538         Fix #74852.
11539         * decl.cs (MemberCache.AddMethods): Register override methods,
11540         rather than non-override methods.
11541         * typemanager.cs (RegisterOverride): New.
11542         (IsOverride): Update.
11543
11544 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
11545
11546         Fix #73105.
11547         
11548         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
11549         recursive declaration.
11550         
11551         * statement.cs (Block.ResolveMeta): Report any error in resolving.
11552         
11553 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
11554
11555         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
11556         
11557         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
11558
11559 2005-05-05  Raja R Harinath  <rharinath@novell.com>
11560
11561         Fix #74797.
11562         * decl.cs (DeclSpace.FamilyAccessible): 
11563         Use TypeManager.IsNestedFamilyAccessible.
11564
11565         Fix reopened #64812.
11566         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
11567         internal'.
11568
11569 2005-05-04  Raja R Harinath  <rharinath@novell.com>
11570             Abin Thomas  <projectmonokochi@rediffmail.com>
11571             Anoob V E  <projectmonokochi@rediffmail.com>
11572             Harilal P R  <projectmonokochi@rediffmail.com>
11573
11574         Fix #64812.
11575         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
11576         allow access to all static members.
11577
11578 2005-05-04  Martin Baulig  <martin@ximian.com>
11579
11580         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
11581
11582 2005-05-04  Martin Baulig  <martin@ximian.com>
11583
11584         Fix #74655.
11585
11586         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
11587         section at the end; make things work if `default' is not the last
11588         section.        
11589
11590 2005-05-04  Martin Baulig  <martin@ximian.com>
11591
11592         Fix #70400.
11593
11594         * statement.cs (Switch): Replaced the `got_default' field with a
11595         `default_section' one.
11596         (Switch.CheckSwitch): Set `default_section' here.
11597         (Switch.Resolve): If we're a constant switch and the constant is
11598         not found, use the default section.
11599
11600 2005-05-03  Martin Baulig  <martin@ximian.com>
11601
11602         * expression.cs (ArrayAccess.EmitGetLength): New public method.
11603
11604         * statement.cs (Foreach.ArrayForeach): New nested class.
11605         (Foreach.TemporaryVariable): New nested class.
11606         (Foreach.EmitArrayForeach): Removed; this is now in the new
11607         ArrayForeach class.
11608
11609 2005-05-03  Raja R Harinath  <rharinath@novell.com>
11610
11611         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
11612         more conservative.
11613         (VerifyPendingMethods): Revert change below.
11614
11615         * typemanager.cs (IsOverride, RegisterNonOverride): New.
11616         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
11617         that used to trigger warning -28.  Remove warning -28.
11618         * expression.cs (Invocation.OverloadResolve): Use
11619         TypeManager.IsOverride to distinguish override methods.
11620
11621         Fix #74773.
11622         * pending.cs (VerifyPendingMethods): If a base type implements the
11623         requested interface, don't bother checking individual methods of
11624         the base type.  As a side-effect, this prevents the creation of
11625         unnecessary proxies.
11626
11627 2005-05-02  Martin Baulig  <martin@ximian.com>
11628
11629         Fix #70182.
11630
11631         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
11632         Also `And' the locals if the old vector is null.
11633         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
11634         null; in this case we basically reset all the variables.        
11635
11636 2005-05-02  Martin Baulig  <martin@ximian.com>
11637
11638         Fix #74529.
11639
11640         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
11641         Added `FlowBranching branching' argument; always `and' the
11642         variables instead of `or'ing them unless we're an infinite loop.
11643
11644         * statement.cs (While.Resolve): Create a new sibling unless we're
11645         infinite.       
11646
11647 2005-05-02  Martin Baulig  <martin@ximian.com>
11648
11649         Fix #70140.
11650
11651         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
11652         arguments; use it instead of creating a new TopLevelBlock.
11653         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
11654         our ConstructorInitializer.
11655
11656         * statement.cs
11657         (TopLevelBlock.TopLevelBranching): New public property.
11658         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
11659         and create our `TopLevelBranching'.
11660
11661         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
11662         anonymous method host, use `block.TopLevelBranching' rather than
11663         creating a new branching.
11664
11665 2005-04-20  Miguel de Icaza  <miguel@novell.com>
11666
11667         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
11668         a ScopeInfo, if any of the current children is a child of the new
11669         entry, move those children there.
11670
11671 2005-04-30  Martin Baulig  <martin@ximian.com>
11672
11673         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
11674         at the beginning of a SwitchSection.  Fix #73335.
11675
11676 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
11677
11678         Fix #74378
11679         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
11680         
11681         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
11682         (FieldExpr.DoResolve): Obsolete members are ignored for field
11683         initializers.
11684         
11685 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
11686
11687         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
11688         of arrays detection.
11689
11690         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
11691         verification.
11692         (Field.VerifyClsCompliance): Volatile fields are not compliant.
11693
11694         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
11695         arrays report.
11696
11697 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
11698
11699         * cs-parser.jay: Use the prefered version of -unsafe in error
11700         message.
11701
11702 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
11703
11704         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
11705         circumstances.
11706
11707 2005-04-20  John Luke  <john.luke@gmail.com>
11708
11709         * driver.cs: fix typo in error message, --outout to --output
11710
11711 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
11712
11713         * codegen.cs (InRefOutArgumentResolving): New field.
11714         
11715         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
11716         fields outside contructor.
11717         
11718         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
11719         
11720 2005-04-19  Miguel de Icaza  <miguel@novell.com>
11721
11722         * anonymous.cs (CaptureContext.EmitParameterInstance): The
11723         parameter code was not completed ever, so it was not as up-to-date
11724         as local variables.  Must finish it.
11725
11726         The bug fix was to compare the Toplevel of the block, not the
11727         current block.  Thanks for Ben for pointing this out. 
11728
11729 2005-04-19  Raja R Harinath  <rharinath@novell.com>
11730
11731         * decl.cs (AddMethods): Use the declaring type of the problem
11732         method to determine if we want to squash a warning.
11733
11734 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
11735
11736         * attribute.cs: Removed debug output.
11737
11738         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
11739         
11740         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
11741         Report.Stderr.
11742         
11743 2005-04-18  Raja R Harinath  <rharinath@novell.com>
11744
11745         Fix #74481.
11746         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
11747         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
11748         all null comparisons against reference types.
11749
11750 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
11751
11752         Fix# 74565
11753         * class.cs (TypeContainer.CircularDepException) New nested
11754         exception class.
11755         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
11756         (TypeContainer.DefineType): Removed error, reset InTransit before
11757         exit.
11758         (Class.DefineType): Throw exception when is in Transit.
11759         Catch exception and report error.
11760         (Struct.DefineType): Throw exception when is in Transit.
11761         Catch exception and report error.
11762         (Interface.DefineType): Throw exception when is in Transit.
11763         Catch exception and report error.
11764
11765         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
11766         handle nested exception handlers.
11767
11768         * flowanalysis.cs (InTryWithCatch): New method, search for try with
11769         a catch.
11770
11771         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
11772         InFinally and InCatch storage.
11773
11774         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
11775         (Catch.Resolve): Set and Restore ec.InCatch.
11776         (Try.Resolve): Set and Restore ec.InFinally.
11777         (Try.HasCatch): True when try has catch.
11778
11779 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
11780
11781         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
11782           for the same event member, so exclude such cases from warning 419.
11783           Fixed bug #74633.
11784
11785 2005-04-16  Miguel de Icaza  <miguel@novell.com>
11786
11787         * expression.cs (Binary.ResolveOperator): Apply patch from John
11788         Luke to fix bug 59864: operators &, | and ^ on enumerations
11789         require that the same enum type on both sides.
11790
11791         * driver.cs: Add warnings to old flag usage, this is to assist
11792         people who produce Makefiles and hope that the Makefiles will be
11793         used on Windows.
11794
11795         * class.cs (TypeContainer.EmitType): Moved the definition of the
11796         special $PRIVATE$ field from the resolve phase to the Emit phase.
11797         During resolve we do not know if we are a struct with
11798         HasExplicitLayout, we know this only after the attributes for the
11799         type are emitted.
11800
11801         Set the FieldOffset to zero on the dummy field that we create for
11802         the class.   Fixes 74590.
11803
11804 2005-04-16  Raja R Harinath  <rharinath@novell.com>
11805
11806         Fix #73834.
11807         * ecore.cs (PropertyExpr.resolved): New.
11808         (DoResolve): Use it to handle a case of double resolution here.
11809         Handle a case of identical-name-and-type-name.
11810         * expression.cs (ArrayCreation.CheckIndices): Avoid double
11811         resolution by storing the results of expression resolution back
11812         into the "probes" array.
11813
11814 2005-04-15  Raja R Harinath  <rharinath@novell.com>
11815
11816         Fix cs0208-7.cs and cs0208-8.cs.
11817         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
11818         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
11819         error reporting to point out the reason a struct is not unmanaged.
11820
11821 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
11822
11823         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
11824           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
11825
11826 2005-04-13  Raja R Harinath  <rharinath@novell.com>
11827
11828         Fix #74528.
11829         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
11830         IdenticalNameAndTypeName here.
11831         (EventExpr.InstanceResolve): Likewise.
11832
11833 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
11834
11835         C# 2.0 DefaultCharSetAttribute implementation
11836         
11837         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
11838         which allows us to set GlobalNamespace for every resolve.
11839         (Attribute.ResolveArguments): Cut from Resolve.
11840         (Attribute.GetCharSetValue): Returns CharSet named argument.
11841         (Attribute.DefinePInvokeMethod): Gets default charset from
11842         module settings.
11843         (GlobalAttribute.ResolveAsTypeStep): Override.
11844         (GlobalAttribute.ResolveArguments): Override.
11845         
11846         * class.cs (TypeAttr): Is protected.
11847         
11848         * codegen.cs (ModuleClass.DefaultCharSet): New member.
11849         (ModuleClass.DefaultCharSetType): New memeber.
11850         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
11851         
11852         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
11853         charset from module.
11854         
11855         * delegate.cs (TypeAttr): Override.
11856         (Delegate.DefineType): Use this TypeAttr.
11857         
11858         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
11859         at very early stage (before types are defined) to resolve model
11860         module attributes. It will probably not work with corlib but it
11861         should be ok.
11862         
11863         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
11864         charset from module.
11865         
11866         * typemanager.cs (default_charset_type): New type.
11867
11868 2005-04-13  Raja R Harinath  <rharinath@novell.com>
11869
11870         * decl.cs (MemberCache.AddMethods): Don't warn if
11871         System.Object.Finalize has buggy MethodAttributes.
11872
11873         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
11874         removed below.
11875
11876 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
11877
11878         * doc.cs : detect ambiguous reference to overloaded members.
11879           Fixed bug #71603. MS 1.1 csc does not detect it.
11880
11881 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
11882
11883         * doc.cs : delegates must not be referenced with parameters.
11884           Fixed bug #71605.
11885
11886 2005-04-12  Miguel de Icaza  <miguel@novell.com>
11887
11888         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
11889
11890 2005-04-10  Miguel de Icaza  <miguel@novell.com>
11891
11892         * driver.cs (MainDriver): Stop processing if the CLS stage found
11893         errors. 
11894
11895         (CompilerCallableEntryPoint.InvokeCompiler): Always
11896         reset after execution;   Take a TextWriter argument for the
11897         output.
11898
11899         * report.cs: Use the error stream instead of hardcoding stderr. 
11900
11901 2005-04-09  Miguel de Icaza  <miguel@novell.com>
11902
11903         * class.cs: Reduce code paths to test, too small of an
11904         optimization to make it worth the extra testing.  Always perform
11905         it. 
11906
11907 2005-04-08  Raja R Harinath  <rharinath@novell.com>
11908
11909         Fix #74510.
11910         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
11911         operators that had errors reported on them.
11912
11913 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
11914
11915         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
11916         argument types.
11917         (Attribute.Resolve): Add named argument type checking.
11918         
11919         * class.cs (FixedField.Define): Use IsPrimitiveType
11920         
11921         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
11922         
11923         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
11924         unsafe parameter types.
11925         
11926         * statement.cs (Using.ResolveExpression): Add better error description.
11927         
11928         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
11929         
11930 2005-04-08  Raja R Harinath  <rharinath@novell.com>
11931
11932         Fix #74484.
11933         * attribute.cs (Attribute.GetAttributeUsage): Resolve
11934         AttributeUsageAttribute in the emitcontext of the attribute class,
11935         not in the emitcontext of the attributable entity it was attached to.
11936         * cs-parser.jay: Use 'current_class', not 'current_container',
11937         when creating a GlobalAttribute.
11938
11939 2005-04-08  Alp Toker  <alp@atoker.com>
11940
11941         * pending.cs: The fix to #58413 failed to compile methods implementing
11942         interfaces with/without params modifiers and vice versa, even though
11943         params modifiers aren't part of the signature. Make the modifier check
11944         less strict as in csc.
11945
11946 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
11947             Anoob V E  <projectmonokochi@rediffmail.com>
11948             Harilal P R  <projectmonokochi@rediffmail.com>
11949
11950         Fix #58413.
11951         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
11952         modifiers of pending methods.
11953         (PendingImplementation.PendingImplementation): Initialize it.
11954         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
11955         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
11956         with ParameterData.  Add check for modifiers.
11957         * class.cs (MethodData.Define): Update to changes.
11958
11959 2005-04-07  Raja R Harinath  <rharinath@novell.com>
11960
11961         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
11962
11963 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
11964
11965         * class.cs (PropertyMethod.Define): Check private accessor in abstract
11966         property.
11967         
11968         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
11969         
11970         * rootcontext.cs,
11971         * typemanager.cs: Registered RequiredAttributeAttribute.
11972         
11973 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
11974
11975         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
11976         Warning CS0169 is back at level 3.
11977         (IMethodData.SetMemberIsUsed): New method.
11978         
11979         * decl.cs (IsUsed): New value; moved from FieldBase.Status
11980         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
11981         
11982         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
11983
11984         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
11985         contants.
11986         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
11987         is used.
11988         
11989         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
11990         is used.
11991         
11992         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
11993         to avoid the problems with nested types.
11994
11995 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
11996             Anoob V.E  <projectmonokochi@rediffmail.com>
11997             Harilal P.R  <projectmonokochi@rediffmail.com>
11998             Raja R Harinath  <rharinath@novell.com>
11999
12000         Fix #73820.
12001         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
12002         attribute.
12003         * typemanager (GetConstructor): Make public.
12004
12005 2005-04-05  John Luke  <john.luke@gmail.com>
12006             Raja R Harinath  <rharinath@novell.com>
12007
12008         Fix #62232.
12009         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
12010         struct too.  Return false quicker in a few cases.
12011         (VerifyUnManaged): Use it.
12012
12013 2005-04-05  Raja R Harinath  <rharinath@novell.com>
12014
12015         Fix #74041.
12016         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
12017         not 'unreachable_seen'.
12018
12019 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
12020
12021         * attribute.cs (Attribute.GetValue): Removed unused.
12022         
12023         * codegen.cs (CodeGen.TrimExt): Removed unused.
12024         
12025         * cs-parser.jay (output): Removed unused.
12026         
12027         * cs-tokenizer.cs (hex_digits): Removed unused.
12028         
12029         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
12030         
12031         * expression.cs (Indirection.LoadExprValue): Removed unused.
12032         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
12033         
12034         * iterators.cs (Iterator.param_types): Removed unused.
12035         
12036         * statement.cs (Goto.block): Removed unused.
12037         (ToplevelBlock.did): Removed unused.
12038         (Switch.ResolveConstantSwitch): Removed unused.
12039
12040 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
12041
12042         * rootcontext.cs: Allow mcs to bootstrap with the compilation
12043         resetting thingy.
12044
12045 2005-04-01  Raja R Harinath  <rharinath@novell.com>
12046
12047         Fix #74232 and cs0208-3.cs.
12048         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
12049         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
12050         unmanaged type.  Don't use FieldBuilders when 't' is a
12051         TypeBuilder.  Use ModFlags and MemberType fields.
12052         * class.cs (MemberBase.member_type): Rename from MemberType.
12053         (MemberBase.MemberType): New property.  Determines member_type on
12054         demand.
12055         (MemberBase.DoDefine): Don't initialize MemberType here.
12056         (FieldMember.Define): Likewise.
12057
12058 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
12059
12060         Fix #74241
12061         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
12062         Attributes are emitted there.
12063         
12064 2005-04-01  Raja R Harinath  <rharinath@novell.com>
12065
12066         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
12067         keyword in 'partial enum' too.
12068         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
12069         is not allowed).
12070         Report from Kamil Skalski <nazgul@omega.pl>.
12071
12072         Fix #74309.
12073         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
12074         have partial containers too.
12075
12076         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
12077         in block' checks to Block.CheckInvariantMeaningInBlock.
12078         * statement.cs (Block.GetKnownVariableInfo): Make private.
12079         (Block.IsVariableUsedInChildBlock): Remove.
12080         (Block.IsVariableUsedInBlock): Likewise.
12081         (Block.CheckInvariantMeaningInBlock): New.  Show location of
12082         conflicting declaration.
12083         (Block.AddVariable): Make error messages less long-winded and more
12084         specific.  Show location of conflicting declaration.
12085         * parameter.cs (Parameters.Location): New readonly property.
12086
12087 2005-03-31  Raja R Harinath  <rharinath@novell.com>
12088
12089         Clean up semantics of invoking ResolveMemberAccess.
12090         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
12091         can have an instance, ensure that we pass in a non-TypeExpression
12092         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
12093         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
12094         argument.  Update to changes and simplify.
12095         (FieldExpr.Emitinstance): Remove CS0120 check.
12096         (PropertyExpr.EmitInstance): Likewise.
12097         * expression.cs (Argument.Resolve): Likewise.
12098         (Invocation.DoResolve): Update to changes in semantics of
12099         InstanceExpression.
12100
12101 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
12102
12103         Fix #74241
12104         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
12105         customization.
12106         
12107         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
12108
12109 2005-03-31  Raja R Harinath  <rharinath@novell.com>
12110
12111         Fix difference in behaviour with commandline invocation.
12112         * driver.cs (Driver.Reset): New.
12113         (CompilerCallableEntryPoint): Call it.
12114
12115         * statement.cs (If.Resolve): Avoid spurious "uninitialized
12116         variable" warnings if the boolean expression failed to resolve.
12117
12118 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
12119
12120         * attribute.cs: Fix the union of several permissions when some of them
12121         are unrestricted (so the result isn't an unrestricted permission set).
12122         Fix #74036.
12123
12124 2005-03-30  Raja R Harinath  <rharinath@novell.com>
12125
12126         * ecore.cs (MemberExpr): New class.  Convert from interface
12127         IMemberExpr.
12128         (MemberExpr.ResolveMemberAccess): Refactor and move here from
12129         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
12130         error checks.
12131         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
12132         (MethodGroupExpr.IsExplicitImpl): Remove.
12133         (Expression.GetFieldFromEvent): Remove.
12134         (SimpleName.MemberStaticCheck): Remove.
12135         (SimpleName.DoSimpleNameResolve): Update to changes.
12136         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
12137         (MemberAccess.IdenticalNameAndTypeName): Remove.
12138         (MemberAccess.error176): Move to MemberExpr.
12139         (MemberAccess.DoResolve): Update to changes.
12140         (BaseAccess.DoResolve): Likewise.
12141
12142 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
12143
12144         C# 2.0 Conditional attribute class implementation
12145         
12146         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
12147         Analyzes class whether it has attribute which has ConditionalAttribute
12148         and its condition is not defined.
12149         
12150         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
12151         (Class.IsExcluded): New method. Search for at least one defined
12152         condition in ConditionalAttribute of attribute class.
12153
12154 2005-03-30  Raja R Harinath  <rharinath@novell.com>
12155
12156         * ecore.cs (PropertyExpr): Derive from Expression, not
12157         ExpressionStatement.
12158         (PropertyExpr.EmitStatement): Remove.
12159
12160 2005-03-29  Raja R Harinath  <rharinath@novell.com>
12161
12162         Fix #74060.
12163         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
12164         internal field "value__" of an enum be private.  The examples for
12165         "value__" that I found on MSDN all used FieldAttributes.Private.
12166
12167         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
12168         Don't mention IL method attribute names.
12169
12170         Fix #47991.  Remove a TODO.
12171         * statement.cs (Block.Toplevel): Make into a field.
12172         (Block.Parameters): Move into ToplevelBlock.
12173         (Block.known_variables): Rename from child_variable_names.
12174         (Block.Block): Remove variants that take Parameters.  Initialize
12175         'Toplevel' with the immediately surrounding toplevel block.
12176         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
12177         LocalInfo parameter.
12178         (Block.GetKnownVariableInfo): New.
12179         (Block.IsVariableNameUsedInChildBlock): Update.
12180         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
12181         the block, even though it may not be in scope.
12182         (Block.AddVariable): Remove Parameters parameter.  Use
12183         Toplevel.Parameters instead.
12184         (Block.AddConstant): Remove Parameters parameter.
12185         (Block.GetParameterReference): Update to use Toplevel.Parameters.
12186         (Block.IsParamaterReference): Likewise.
12187         (Block.IsLocalParameter): Likewise.  Simplify a lot.
12188         (ToplevelBlock.Parameters): New.  Moved from Block.
12189         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
12190         initialize Parameters to a non-null value.
12191         * cs-parser.jay: Update to changes.
12192         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
12193         simple names that mean different things in the same block.  Use
12194         Block.IsVariableNameUsedInBlock.
12195
12196 2005-03-28  Raja R Harinath  <rharinath@novell.com>
12197
12198         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
12199         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
12200         GetTypeHandle.  It is possible for a reflected type to derive from
12201         a TypeBuilder (e.g., int[] derives from the TypeBuilder
12202         System.Array during mscorlib compilation).
12203         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
12204         contain a method_hash, don't create one either.  Don't create a
12205         deep copy of the base cache's method_hash.
12206         (MemberCache.SetupCache): Rename back from DeepCopy.
12207         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
12208         already initialized.  If we see an override function, add its
12209         underlying base virtual function to the member_hash too.
12210
12211         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
12212
12213 2005-03-26  Raja R Harinath  <harinath@acm.org>
12214
12215         Fix #73038.
12216         * assign.cs (Assign.DoResolve): When the RHS of an assignment
12217         fails to resolve, ensure that the LHS is still resolved as an
12218         lvalue.
12219
12220 2005-03-25  Raja R Harinath  <harinath@acm.org>
12221
12222         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
12223         ec.ContainerType.
12224         (Enum.current_ec): Remove.
12225         (Enum.LookupEnumValue): Remove EmitContext argument.
12226         Just uses the one created during DefineType.
12227         (Enum.FindMembers): Update.
12228         * expression.cs (MemberAccess.DoResolve): Update.
12229
12230 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
12231
12232         * assign.cs (Assign.DoResolve): Check for CS1717 when
12233         source and target are same (uses Equals).
12234
12235         * expression.cs (LocalVariableReference, ParameterReference,
12236         This): Implemented Equals, GetHashCode.
12237
12238         * statement.cs (Block.GetParameterReference): Removed useless
12239         local variable.
12240
12241 2005-03-22  Raja R Harinath  <rharinath@novell.com>
12242
12243         Fix cs0128.cs
12244         * statement.cs (Block.AddVariable): Ensure that we skip implicit
12245         blocks before deciding whether the error is cs0136 or cs0128.
12246
12247         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
12248         (using_alias_directive, using_namespace_directive): Pass
12249         MemberName, not an expression to Namespace.UsingAlias and
12250         Namespace.Using.
12251         (MakeName): Use the MemberName of the namespace.
12252         * namespace.cs (Namespace.MemberName): New.
12253         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
12254         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
12255         Likewise.
12256         * decl.cs (MemberName.Name): Make readonly.
12257         (MemberName.FromDotted): New "constructor".
12258         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
12259         (MemberCore.Name): Compute from MemberName on demand.
12260         (MemberCore.SetMemberName): Provide a way to change the
12261         MemberName.
12262         (MemberCore.AddToContainer): Don't take a fullname parameter.
12263         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
12264         fully qualified name of the container to the member name.
12265         (TypeContainer.AddToTypeContainer): Use a fully qualified name
12266         only if the type is a member of the root container.
12267         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
12268         MemberName.Left rather than searching for an embedded ".".
12269         (PartialContainer.CreatePart): Update to changes in RootContext.
12270         (MemberBase.ShortName): Turn into a property.  Use
12271         MemberCore.SetMemberName.
12272         (MemberBase.ExplicitInterfaceName): Remove.
12273         (MemberBase.UpdateMemberName): Remove.
12274         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
12275         (PropertyBase.SetMemberName): New override.
12276         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
12277         (Tree.GetDecl): New.
12278         (Tree.AllDecls): Rename from Decls.
12279         * attribute.cs, enum.cs, report.cs: Update to changes.
12280         * driver.cs (MainDriver): Use MemberName.FromDotted on
12281         RootContext.MainClass.
12282
12283 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
12284
12285         * class.cs (FixedField.Define): Check for CS1664 and more sanity
12286         checks.
12287
12288         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
12289
12290 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
12291
12292         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
12293         property accessor modifiers.
12294
12295         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
12296         fixed buffer attribute (CS1716).
12297         (PropertyMethod.HasCustomAccessModifier): When property accessor
12298         has custom modifier.
12299
12300         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
12301         modifiers.
12302         (PropertyExpr.DoResolveLValue): Add CS0272.
12303
12304 2005-03-17  Miguel de Icaza  <miguel@novell.com>
12305
12306         * convert.cs: When converting to a pointer, use the proper Conv.U
12307         or Conv.I depending on the source data type.
12308
12309         * cs-tokenizer.cs: Make the size for large decimal constants,
12310         fixes #72957.
12311
12312 2005-03-17  Martin Baulig  <martin@ximian.com>
12313
12314         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
12315         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
12316
12317 2005-03-17  Martin Baulig  <martin@ximian.com>
12318
12319         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
12320         to bool so we can return an error condition.
12321         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
12322         returned an error.
12323
12324 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
12325
12326         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
12327         attributes.
12328
12329 2005-03-16  Raja R Harinath  <rharinath@novell.com>
12330
12331         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
12332         Refactor to avoid traversing the list of assemblies, and to avoid
12333         string concatenation.
12334         * typemanager.cs (guid_attr_type): Remove.
12335         (negative_hits, pointers, references): Remove hashes.
12336         (type_hash): New.
12337         (GetConstructedType): New.  Uses type_hash to handle constructed
12338         types (arrays, references, pointers).
12339         (GetReferenceType, GetPointerType): Use it.
12340         (GetNestedType): New.  Uses type_hash to handle nested types of
12341         reflected types.
12342         (LookupType, LookupTypeDirect): Remove.
12343         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
12344         'types' hash and LookupTypeReflection directly.
12345         (params_string, params_object): Use GetConstructedType.
12346         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
12347         top-level types.
12348         (Namespace.Lookup): Use cached_types.
12349         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
12350         provided by old TypeManager.LookupType.
12351         * rootcontext.cs (MakeFQN): Remove.
12352         * decl.cs (DeclSpace.MakeFQN): Likewise.
12353         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
12354         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12355         TypeManager.GetConstructedType.
12356         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
12357
12358 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
12359
12360         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
12361         indexers.
12362
12363         * cs-parser.jay: Reports CS1527 for any namespace element.
12364
12365         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
12366         Added CS0407.
12367
12368         * expression.cs (ParameterReference.IsAssigned): Changed error to
12369         CS0269.
12370         (Error_WrongNumArguments): Moved CS0245 detection here.
12371
12372         * statement.cs (Return.Resolve): Add CS1622 report.
12373
12374 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
12375
12376         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
12377
12378 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
12379
12380         * attribute.cs expression.cs: Get rid of some allocations.
12381
12382 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
12383
12384         * doc.cs : just eliminate the latest change.
12385
12386 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
12387
12388         * doc.cs : commented out the latest change. It breaks xml-030.cs
12389
12390 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
12391
12392         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
12393           fail. So invoke CreateType() in FindDocumentedType().
12394
12395 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
12396
12397         * cs-tokenizer.cs : added IsKeyword().
12398         * doc.cs : Detect keyword incorrectly used as identifier.
12399           Allow identifiers prefixed by @.
12400
12401 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
12402
12403         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
12404         It caused exception in namespace resolving (again!).
12405         
12406         * class.cs (Class.ctor): Removed exit.
12407         (PropertyMethod.ctor): ditto.
12408         
12409         * codegen.cs (Codegen.Reset): Reset static data.
12410         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
12411         
12412         * cs-tokenizer.cs (Cleanup): Removed.
12413         
12414         * driver.cs (GetSystemDir): Rewrote to one line command.
12415         It caused problem with unloaded dynamic modules.
12416         (UnixParseOption): Removed Exit.
12417         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
12418         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
12419         Now can be mcs used as library.
12420         
12421         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
12422         empty location.
12423         
12424         * location.cs (Reset): Reset static data.
12425         
12426         * namespace.cs (Reset): Reset static data.
12427         
12428         * report.cs (Report.Reset): Reset static data.
12429         
12430         * rootcontext.cs (RootContext.Reset): Reset static data.
12431         
12432         * tree.cs (RootTypes.ctor): Use Location.Null
12433         
12434         * typemanager.cs (TypeManager.Reset): Reset static data.
12435         (CoreLookupType): Removed Exit.
12436         (TypeHandle.Reset): Reset static data.
12437         
12438 2005-03-10  Raja R Harinath  <rharinath@novell.com>
12439
12440         Fix #73516.
12441         * typemanager.cs (ComputeNamespaces): Import namespaces from
12442         referenced modules too.
12443
12444 2005-03-09  Raja R Harinath  <rharinath@novell.com>
12445
12446         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
12447         than '.'.
12448
12449 2005-03-09  Raja R Harinath  <rharinath@novell.com>
12450
12451         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
12452         enclosing DeclSpace.  This ensures that a name-lookup populates
12453         more caches and there are fewer 'TypeExpression's.  Carve out
12454         nested type lookup into ...
12455         (LookupNestedTypeInHierarchy): ... this.
12456
12457 2005-03-09  Raja R Harinath  <rharinath@novell.com>
12458
12459         Clean up a few partial-class semantics.  
12460         Fixes test-357.cs and cs1618-2.cs.
12461         * cs-parser.jay (struct_declaration): Use 'current_class' as
12462         parent of newly-created struct.  Remove call to Register ().
12463         Use 'pop_current_class' to complete handing the current struct.
12464         (interface_declaration): Likewise.
12465         (class_declaration): Likewise.
12466         (enum_declaration): Use 'current_class' as parent of newly created
12467         enum.
12468         (delegate_declaration): Likewise.
12469         (pop_current_class): New function.  This is used to handle closing
12470         up the 'current_class' and 'current_container', and pointing them
12471         to the enclosing class/container.
12472         (CSharpParser): Initialize 'current_class' too.
12473         * decl.cs (MemberCore): Add check for invariant: a partial
12474         container is not a parsed entity, and thus does not enclose any
12475         parsed members.
12476         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
12477         (DeclSpace.BaseTypeExpr): Use it.
12478         (DeclSpace.LookupType): Add check for invariant.
12479         * class.cs (TypeContainer): Add check for invariant: a nested
12480         class should have the same NamespaceEntry as its enclosing class.
12481         (TypeContainer.EmitFieldInitializers): Make virtual.
12482         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
12483         MemberCore.
12484         (TypeContainer.Register): Remove.
12485         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
12486         null.  Use TypeResolveEmitContext for resolving base types and
12487         interfaces.  Move initialization of Parts.TypeBuilder here from
12488         ...
12489         (TypeContainer.DefineNestedTypes): ... here.
12490         (PartialContainer): Take a Namespace not a NamespaceEntry.
12491         (PartialContainer.Create): Don't use Register.  Call the
12492         appropriate Add... function directly.
12493         (ClassPart): Take both the PartialContainer and the enclosing
12494         class as constructor arguments.
12495         (ClassPart.EmitFieldInitializers): Override.
12496         (ClassPart.PartFindNestedTypes): Remove.
12497         (FieldBase.GetInitializerExpression): Resolve the initializer
12498         expression in the emit context of the enclosing class.
12499         * tree.cs (RootTypes): Remove Register ().
12500         
12501 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
12502
12503         * cs-parser.jay: Removed CS0134.
12504         
12505         * driver.cs: Removed CS1901.
12506         
12507         * expression.cs (SizeOf.DoResolve): Don't report CS0233
12508         for predefined types.
12509
12510 2005-03-07  Duncan Mak  <duncan@novell.com>
12511
12512         * codegen.cs (Save):  Catch UnauthorizedAccessException as
12513         well. Fixes bug #73454.
12514
12515 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
12516
12517         * cs-tokenizer.cs (xtoken): Add CS1035.
12518         
12519         * class.cs (MethodData.Define): Add CS0683.
12520         (FieldMember.ctor): Add CS0681.
12521
12522 2005-03-07  Raja R Harinath  <rharinath@novell.com>
12523
12524         * ecore.cs (SimpleName.DoResolve): Rename from
12525         SimpleName.DoResolveAllowStatic.
12526         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
12527         Pass 'intermediate' flag to MemberStaticCheck.
12528         (SimpleName.MemberStaticCheck): Skip "static check" only in case
12529         of "intermediate" lookups via MemberAccess.
12530         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
12531         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
12532
12533 2005-03-07  Raja R Harinath  <rharinath@novell.com>
12534
12535         Fix #73394.
12536         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
12537         slipped in because of variable names that are identical to a
12538         builtin type's BCL equivalent ('string String;', 'int Int32;').
12539         (PropertyExpr.EmitInstance): Likewise.
12540
12541 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
12542
12543         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
12544         
12545         * report.cs (warning_ignore_table): Made public.
12546
12547 2005-03-04  Raja R Harinath  <rharinath@novell.com>
12548
12549         Fix #73282.
12550         * class.cs (MethodData.Emit): Pass 'container' to
12551         container.GetObsoleteAttribute instead of 'container.Parent'.
12552
12553 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
12554
12555         * cs-parser.jay: Add 1534 error test.
12556
12557         * iterators.cs (Yield.CheckContext): Add error 1629.
12558         (Iterator.ctor): Save unsafe modifier.
12559         (MoveNextMethod.DoEmit): Restore unsafe context.
12560
12561         * namespace.cs (UsingAlias): Better error message.
12562
12563 2005-03-03  Dan Winship  <danw@novell.com>
12564
12565         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
12566         the warning message [#73219]
12567
12568 2005-03-03  Raja R Harinath  <rharinath@novell.com>
12569
12570         Fix compile with MCS 1.0.0.0.
12571         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
12572         w_restore to not depend on string constant folding.
12573
12574 2005-03-03  Raja R Harinath  <rharinath@novell.com>
12575
12576         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
12577         CS0246 check to users who passed 'silent = false'.
12578         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
12579         check.
12580         (SimpleName.SimpleNameResolve): Update.
12581         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
12582         (MemberAccess.IdenticalNameAndTypeName): Update.
12583         * doc.cs (FindDocumentedTypeNonArray): Update.
12584
12585 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
12586
12587         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
12588         * parameters.cs (ComputeAndDefineParameters): Remove.
12589         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
12590         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
12591         Use GetParameterInfo.
12592
12593 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
12594
12595         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
12596
12597 2005-03-02  Raja R Harinath  <rharinath@novell.com>
12598
12599         Unify DeclSpace.LookupType and DeclSpace.FindType.
12600         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
12601         is in charge of defining nested types on demand.
12602         (DeclSpace.LookupType): Use it when the current_type is a
12603         TypeBuilder.  Use LookupTypeDirect for reflected types.
12604         (DeclSpace.FindType): Remove.
12605         (DeclSpace.LookupInterfaceOrClass): Likewise.
12606         (DeclSpace.DefineTypeAndParents): Likewise.
12607         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
12608         DeclSpace.LookupType.
12609         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
12610         * typemanager.cs (LookupType): Simplify.
12611         (AddUserType): Remove type from negative_hits.
12612         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
12613         * class.cs (TypeContainer.FindMembers): Move handling of nested
12614         types ...
12615         (TypeContainer.FindMembers_NestedTypes): ... here.
12616         (TypeContainer.FindNestedType): Implement override.
12617         (ClassPart.FindNestedType): Delegate to PartialContainer.
12618         (ClassPart.PartFindNestedType): Looks up the nested types of the
12619         part alone.
12620
12621 2005-03-02  Martin Baulig  <martin@ximian.com>
12622
12623         * class.cs (TypeContainer.DoDefineMembers): We also need a default
12624         static constructor in static classes.
12625
12626 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
12627
12628         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
12629         sizeParamIndex is not specified.
12630
12631 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
12632
12633         Fix #73117
12634         * report.cs (WarningMessage.IsEnabled): Missing null check.
12635
12636 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
12637
12638         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
12639         in the fields and not in the properties.
12640
12641 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
12642
12643         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
12644         fields as well.
12645
12646 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
12647
12648         * attribute.cs: Small refactoring (improved robustness).
12649         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
12650         (ValidateGuid): Removed.
12651         (Resolve): Removed referenced to above mentioned.
12652         (GetAttributeUsage): Made private and changed to work without
12653         class assistance.
12654         (GetIndexerAttributeValue): Don't crash.
12655         (GetConditionalAttributeValue): Ditto.
12656         (GetClsCompliantAttributeValue): Ditto.
12657         (ExtractSecurityPermissionSet): All attributes exceptions are
12658         error 648.
12659         (GetPropertyValue): New helper.
12660         (GetMethodImplOptions): New method.
12661         (DefinePInvokeMethod): Reuse common code. Implemented handling of
12662         some missing properties.
12663         
12664         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
12665         (Method.ApplyAttributeBuilder): Updated.
12666         
12667         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
12668         exception.
12669
12670 2005-02-28  Raja R Harinath  <rharinath@novell.com>
12671
12672         Fix #73052.
12673         * report.cs (Report.SymbolRelatedToPreviousError): Handle
12674         non-simple types (array, pointer, reference).
12675
12676 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
12677
12678         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
12679
12680         * class.cs (MethodCore.IsDuplicateImplementation): Special error
12681         for operators.
12682         (Method.CheckBase): Catch wrong destructor here.
12683         (MethodData.Define): Add errors 550, 668.
12684
12685         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
12686
12687         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
12688
12689         * pending.cs (VerifyPendingMethods): Add error 551.
12690
12691         * typemanager.cs (CSharpName): Next error report helper.
12692
12693 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
12694
12695         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
12696         attributes. Removed useless attribute double check.
12697         It saves almost 2MBs for corlib.
12698
12699 2005-02-25  Raja R Harinath  <rharinath@novell.com>
12700
12701         Fix #72924.
12702         * statement.cs (ExpressionStatement.Resolve): Make robust to being
12703         called twice in case of error.
12704
12705 2005-02-23  Chris Toshok  <toshok@ximian.com>
12706
12707         Fix compiler portions of #72827.
12708         * statement.cs (Block.Emit): call Begin/EndScope on the
12709         EmitContext instead of the ILGenerator.
12710
12711         * codegen.cs (EmitContext.BeginScope): new method, call
12712         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
12713         we have one.)
12714         (EmitContext.BeginScope): same, but EndScope and CloseScope
12715
12716         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
12717         offset and call the superclass's OpenScope(int) with it.
12718         (SymbolWriter.CloseScope): get the current il
12719         offset and call superclass's CloseScope(int) with it.
12720
12721 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
12722
12723         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
12724         CS1677 for out and ref as well.
12725
12726         * class.cs (Method.Define): Add error CS1599 detection.
12727         
12728         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
12729         
12730         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
12731         
12732         * delegate.cs (Delegate.Define): Add error CS1599 detection.
12733         
12734         * support.cs.cs (ModifierDesc): New helper method.
12735
12736 2005-02-23  Raja R Harinath  <rharinath@novell.com>
12737             Abin Thomas  <projectmonokochi@rediffmail.com>
12738             Anoob V E  <projectmonokochi@rediffmail.com>
12739             Harilal P R  <projectmonokochi@rediffmail.com>
12740
12741         Fix #57851, #72718.
12742         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
12743         MemberLookup (used for error reporting) actually returns a result.
12744         Fix error report number (122, not 112).
12745
12746 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
12747             Anoob V E  <projectmonokochi@rediffmail.com>
12748             Harilal P R  <projectmonokochi@rediffmail.com>
12749
12750         Fix #71134.
12751         * pending.cs (PendingImplementation.GetAbstractMethods):
12752         Find NonPublic members too.
12753
12754 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
12755
12756         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
12757         Fixed error 217.
12758         
12759         * class.cs (MethodCore.CheckMethodAgainstBase):
12760         Add error 239 report.
12761
12762 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12763
12764         Fix #68955.
12765         * expression.cs (Invocation.IsApplicable): Make public.
12766         (Invocation.IsParamsMethodApplicable): Likewise.
12767         * delegate.cs (Delegate.VerifyApplicability): Don't use
12768         Invocation.VerifyArgumentCompat for parameter applicability
12769         testing.  Use Invocation.IsApplicable and
12770         Invocation.IsParamsMethodApplicable.
12771
12772 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
12773
12774         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
12775         
12776         * class.cs (Operator.Define): Add error 217 report.
12777         
12778 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12779
12780         * namespace.cs (UsingEntry.Resolve): Undo change below.
12781
12782 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12783
12784         Fix #72756.
12785         * ecore.cs (Expression.MemberLookupFailed): Add argument to
12786         disable the error message when the extended MemberLookup also
12787         fails.
12788         (Expression.MemberLookupFinal): Update.
12789         (SimpleName.DoSimpleNameResolve): Update.
12790         * expression.cs (MemberAccess.ResolveNamespaceOrType):
12791         Don't use MemberLookupFinal.
12792         (New.DoResolve): Update.
12793         (BaseAccess.CommonResolve): Update.
12794
12795 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12796
12797         Fix #72732.
12798         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
12799         occured previously, don't resolve again.
12800
12801 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
12802
12803         Fix #69949
12804         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
12805         argument. Call ResolveAttributeUsage for unresolved.
12806         when types doesn't match ctor arguments.
12807         
12808         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
12809         for nested attribute classes.
12810         (Class.attribute_usage): Removed.
12811         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
12812         for attribute class.
12813         
12814         * ecore.cs (IsAttribute): Removed.
12815         
12816         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
12817         
12818         * rootcontext.cs (RegisterAttribute): Removed, attributes are
12819         now normal types.
12820         (attribute_types): Removed.
12821         (EmitCode): Global attributes are emited as the latest.
12822
12823 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
12824
12825         * class.cs (EmitFieldInitializers): Don't emit field initializer
12826         for default values when optimilization is on.
12827         
12828         * constant.cs (Constant.IsDefaultValue): New property.
12829         
12830         * driver.cs: Add /optimize handling.
12831         
12832         * constant.cs,
12833         * ecore.cs,
12834         * literal.cs: Implement new IsDefaultValue property.
12835         
12836         * rootcontext.cs (Optimize): New field, holds /optimize option.
12837
12838 2005-02-18  Raja R Harinath  <rharinath@novell.com>
12839
12840         Fix crasher in re-opened #72347.
12841         * namespace.cs (Namespace.Lookup): Return null if
12842         DeclSpace.DefineType returns null.
12843
12844         Fix #72678.
12845         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
12846
12847 2005-02-18  Raja R Harinath  <rharinath@novell.com>
12848
12849         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
12850         now returns null if it cannot resolve to an lvalue.
12851         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
12852         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
12853         returned null.  Remove check for SimpleName.
12854         (EventExpr.DoResolveLValue): New.
12855         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
12856         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
12857         error from ...
12858         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
12859         avoid CS0131 error.
12860         (Unary.ResolveOperator): Move CS0211 check ...
12861         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
12862         CS0131 error.
12863         (Unary.DoResolveLValue): Simplify.
12864         (AddressOf.DoResolveLValue): New.
12865         (ArrayAccess.DoResolveLValue): New.
12866
12867 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
12868
12869         * attribute.cs (Attribute.Resolve): Add arguments casting for
12870         when types doesn't match ctor arguments.
12871
12872 2005-02-16  Raja R Harinath  <rharinath@novell.com>
12873
12874         Fix parts of #63202.
12875         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
12876         lookup of operator in base type.  Ensure that all checks happen
12877         when the operator resolves to an "op_..." method.
12878
12879 2005-02-15  Raja R Harinath  <rharinath@novell.com>
12880
12881         Fix #71992.
12882         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
12883         'ignore_cs0104' parameter.  Pass it to ...
12884         (NamespaceEntry.Lookup): ... this.
12885         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
12886         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
12887         (TypeLookupExpression.DoResolveAsTypeStep): Update.
12888         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
12889         Update.  Request that cs0104 errors be ignored.
12890         (ComposedCast.ResolveAsTypeStep): Update.
12891
12892 2005-02-14  Raja R Harinath  <rharinath@novell.com>
12893
12894         Fix #59209.
12895         * expression.cs (Invocation.BetterFunction): Remove support for
12896         comparing virtual functions and their overrides.
12897         (Invocation.IsOverride): New.
12898         (Invocation.OverloadResolve): Don't consider 'override' functions
12899         during candidate selection.  Store them in a lookaside list.
12900         If the selected method is a 'virtual' function, use the list to
12901         find any overrides that are closer to the LHS type.
12902
12903 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
12904
12905         * expression.cs (New.DoResolve): Add complex core type reduction.
12906         (New.Constantify): Converts complex core type syntax like 'new int ()'
12907         to simple constant.
12908         
12909 2005-02-14  Raja R Harinath  <rharinath@novell.com>
12910
12911         * decl.cs (EntryType.EntryType): New constructor to create an
12912         updated copy of a cache entry.
12913         (MemberCache.AddMethods): Use it.
12914         (MemberCache.ClearDeclaredOnly): Remove.
12915         (MemberCache.MemberCache): Update.
12916
12917 2005-02-11  Miguel de Icaza  <miguel@novell.com>
12918
12919         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
12920         variable.  This one is represents the actual low-level declaration
12921         of the method, as opposed to the semantic level `IsStatic'.   
12922
12923         An anonymous method which is hosted into a static method might be
12924         actually an instance method.  IsStatic would reflect the
12925         container, while MethodIsStatic represents the actual code
12926         generated.
12927
12928         * expression.cs (ParameterReference): Use the new MethodIsStatic
12929         instead of IsStatic.
12930
12931         * anonymous.cs (AnonymousMethod.Compatible): Pass the
12932         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
12933         set on the current EmitContext. 
12934
12935         * expression.cs (Cast): Overload DoResolveLValue so we can pass
12936         resolve our casted expression as an LValue.  This triggers the
12937         proper LValue processing that is later required by Assign.
12938
12939         This fixes 72347.
12940
12941         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
12942
12943 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
12944
12945         C# 2.0 Fixed buffer implementation
12946
12947         * anonymous.cs: Update after RegisterHelperClass renaming.
12948
12949         * attribute.cs (AttributeTester.fixed_buffer_cache):
12950         Cache of external fixed buffers.
12951         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
12952         implementation if field is fixed buffer else null.
12953
12954         * class.cs
12955         (TypeContainer.AddField): Accept FieldMember instead of Field.
12956         (FieldBase.IsFieldClsCompliant): Extracted code from
12957         VerifyClsCompliance descendant customization.
12958         (FixedField): New class handles fixed buffer fields.
12959         (FixedFieldExternal): Keeps information about imported fixed
12960         buffer.
12961         (IFixedField): Make access to internal or external fixed buffer
12962         same.
12963
12964         * cs-parser.jay: Add fixed buffer parsing.
12965
12966         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
12967         buffer.
12968
12969         * expression.cs (Indirection): Extended implementation to accept
12970         fixed buffer field.
12971         (PointerArithmetic.Emit): Get element from fixed buffer as well.
12972         (ElementAccess.MakePointerAccess): Get type as parameter.
12973         (DoResolve): Add fixed buffer field expression conversion.
12974         (DoResolveLValue): Ditto.
12975         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
12976         (ArrayPtr): Derives from FixedBufferPtr.
12977         (ArrayPtr.Emit): Add extra emit for array elements.
12978
12979         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
12980
12981         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
12982         for compiler generated types.
12983         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
12984
12985         * statement.cs (Fixed): Refactored to be easier add fixed buffer
12986         and consume less memory.
12987         (Fixed.Resolve): Add fixed buffer case.
12988
12989         * typemanager.cs (compiler_generated_attr_ctor,
12990         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
12991         (HasElementType): Add our own implementation to work on every
12992         runtime.
12993
12994 2005-02-11  Miguel de Icaza  <miguel@novell.com>
12995
12996         * anonymous.cs (CaptureContext): Track whether `this' has been
12997         referenced.   
12998
12999         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
13000         only captured `this' if it was implicitly done (instance
13001         methods/variables were used). 
13002
13003         * codegen.cs (EmitContext.CaptureThis): New method to flag that
13004         `this' must be captured.
13005
13006 2005-01-30  Miguel de Icaza  <miguel@novell.com>
13007  
13008         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
13009         is null it means that there has been no need to capture anything,
13010         so we just create a sibling.
13011
13012         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
13013
13014         Just a partial fix.  The other half is fairly elusive.
13015         
13016 2005-02-10  Raja R Harinath  <rharinath@novell.com>
13017
13018         Fix #52586, cs0121-4.cs.
13019         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
13020         and return a hashtable.
13021         (MemberCache.ClearDeclaredOnly): New.
13022         (MemberCache.MemberCache): Update to change.  Make a deep copy of
13023         the method_hash of a base type too.
13024         (MemberCache.AddMethods): Adapt to having a deep copy of the base
13025         type methods.  Overwrite entries with the same MethodHandle so
13026         that the ReflectedType is correct.  The process leaves in base
13027         virtual functions and their overrides as distinct entries.
13028         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
13029         matters since it was boxed in a ArrayList before.
13030         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
13031         modifier.
13032         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
13033         case of a virtual function and its override (choose the overload
13034         as better).
13035         (Invocation.OverloadResolve): Avoid 'override' members during
13036         'applicable_type' calculation.
13037
13038 2005-02-09  Raja R Harinath  <rharinath@novell.com>
13039
13040         Combine two near-redundant caches.
13041         * typemanager.cs (method_params): Rename from method_internal_params.
13042         (TypeManager.GetParameterData): New.  Replace
13043         Invocation.GetParameterData.
13044         (TypeManager.LookupParametersByBuilder): Remove.
13045         * expression.cs (Invocation.method_parameter_cache): Remove.
13046         (Invocation.GetParameterData): Remove.
13047         Update to changes.
13048         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
13049         Update to changes.
13050
13051 2005-02-08  Raja R Harinath  <rharinath@novell.com>
13052
13053         Fix #72015.
13054         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
13055         TypeManager.multicast_delegate_type is null, resolve it by looking
13056         up "System.MulticastDelegate".
13057         * rootcontext.cs (RootContext.ResolveCore): Simplify.
13058
13059 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
13060             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
13061             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
13062
13063         Fix cs0164.cs.
13064         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
13065         (LabeledStatement.AddReference): New.  Set 'referenced'.
13066         (Goto.Resolve): Use it.
13067
13068 2005-02-05  John Luke  <john.luke@gmail.com>
13069
13070         * driver.cs: remove duplicate -doc line in Usage ()
13071
13072 2005-02-04  Raja R Harinath  <rharinath@novell.com>
13073
13074         * location.cs (Location.AddFile): Fix CS2002 error report.
13075
13076 2005-02-02  Martin Baulig  <martin@ximian.com>
13077
13078         * delegate.cs (Delegate.DefineType): Report an internal error if
13079         TypeManager.multicast_delegate_type is null.  See bug #72015 for
13080         details.        
13081
13082 2005-02-02  Raja R Harinath  <rharinath@novell.com>
13083
13084         Fix a crasher in a variant of #31984.
13085         * const.cs (Constant.CheckBase): New override that defers the
13086         new-or-override check in case the base type hasn't been populated
13087         yet.
13088         (Constant.Define): Ensure the new-or-override check is performed.
13089
13090 2005-02-01  Duncan Mak  <duncan@ximian.com>
13091
13092         * const.cs (LookupConstantValue): Check that `ce' is not null
13093         before calling GetValue ().
13094
13095 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13096
13097         Fix test-334.cs (#69519).
13098         * cs-parser.jay (using_alias_directive): Pass in an expression to
13099         NamespaceEntry.UsingAlias.
13100         (using_namespace_directive): Pass in an expression to
13101         NamespaceEntry.Using.
13102         (namespace_name): Don't flatten to a string.
13103         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
13104         (NamespaceEntry.AliasEntry.Resolve): Lookup using
13105         ResolveAsTypeStep.
13106         (NamespaceEntry.UsingEntry): Likewise.
13107         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
13108         changes.
13109         (NamespaceEntry.LookupForUsing): Remove.
13110         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
13111         names.
13112         (NamespaceEntry.Lookup): Remove support for dotted names.
13113
13114 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13115
13116         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
13117         split into two.
13118         (NamespaceEntry.ImplicitParent): Compute on demand.
13119         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
13120         parallels the current.
13121         (NamespaceEntry.LookupForUsing): Use it.
13122         (NamespaceEntry.Lookup): If the current namespace-entry is
13123         implicit, don't search aliases and using tables.
13124
13125 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13126
13127         Fix #31984.
13128         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
13129         BaseCache here.
13130         (TypeContainer.BaseCache): Compute on demand.
13131         (TypeContainer.FindMembers): Define constants and types if they're
13132         not already created.
13133         (FieldMember.Define): Move resetting of ec.InUnsafe before error
13134         check.
13135         * const.cs (Constant.Define): Make idempotent.
13136
13137 2005-01-29  Miguel de Icaza  <miguel@novell.com>
13138
13139         * pending.cs: Produce better code (no nops produced by using Ldarg
13140         + value).
13141         
13142         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
13143         i - 1' it should be arg + 1.
13144
13145         Fixes bug #71819.
13146
13147 2005-01-28  Raja R Harinath  <rharinath@novell.com>
13148
13149         * attribute.cs (Attribute.CheckAttributeType): Make private
13150         non-virtual.
13151         (Attribute.ResolveType): Make virtual.
13152         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
13153         handling of RootContext.Tree.Types.
13154
13155 2005-01-27  Raja R Harinath  <rharinath@novell.com>
13156
13157         Update attribute-handling to use the SimpleName/MemberAccess
13158         mechanisms.
13159         * cs-parser.jay (attribute): Pass in an expression to the
13160         constructors of Attribute and GlobalAttribute.
13161         * attribute.cs (Attribute): Take an expression for the name.
13162         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
13163         passed in attribute name expression.
13164         (Attribute.CheckAttributeType): Use it.
13165         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
13166         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
13167         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
13168         argument to prevent error messages if the lookup fails.
13169
13170 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
13171
13172         * expression.cs (Indirection): Implemented IVariable interface
13173         to support indirection in AddressOf operator.
13174         (PointerArithmetic.Emit): Add optimalization for case where
13175         result can be precomputed.
13176
13177 2005-01-26  Martin Baulig  <martin@ximian.com>
13178
13179         * class.cs (TypeContainer.AttributeTargets): Return the correct
13180         AttributeTargets depending on our `Kind' instead of throwing an
13181         exception; fixes #71632.
13182
13183 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
13184
13185         Fix #71257
13186         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
13187         constant members.
13188
13189 2005-01-25  Raja R Harinath  <rharinath@novell.com>
13190
13191         Fix #71602.
13192         * expression.cs (MemberAccess.DoResolve): Don't complain with
13193         cs0572 when the LHS of a member access has identical name and type
13194         name.
13195
13196 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
13197
13198         Fix #71651, #71675
13199         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
13200         CreatePermission.
13201         Create custom PermissionSet only for PermissionSetAttribute.
13202
13203 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
13204
13205         Fix #71649
13206         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
13207         delegates in static class.
13208
13209 2005-01-24  Martin Baulig  <martin@ximian.com>
13210
13211         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13212         merging an implicit block, just use its reachability.
13213
13214         * statement.cs (Block.Resolve): Make the unreachable code check
13215         work wrt. implicit blocks; see test-337 from #63842.
13216
13217 2005-01-21  Alp Toker  <alp@atoker.com>
13218  
13219         * cs-parser.jay: destructor_declaration's container is PartialContainer
13220         not Class when partial types are used, so use Kind prop instead of
13221         'is'.
13222         
13223 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
13224
13225         * cs-parser.jay: Improve error reporting when an interface
13226         declares new types.
13227
13228 2005-01-20  Dick Porter  <dick@ximian.com>
13229
13230         * support.cs: SeekableStreamReader fix from Sandor Dobos
13231         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
13232         chars are read.  Fixes bug 70369.
13233
13234 2005-01-20  Raja R Harinath  <rharinath@novell.com>
13235
13236         * cs-parser.jay (catch_clause): Simplify current_block handling
13237         somewhat.
13238
13239 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
13240
13241         * convert.cs (ImplicitStandardConversionExists): Synchronize the
13242         code with ImplicitStandardConversion to handle the implicit
13243         conversion of method groups into valid delegate invocations. 
13244
13245         The problem is that in parameter handling we were using this code
13246         path.  Fixes bug #64698
13247
13248 2005-01-19  Raja R Harinath  <rharinath@novell.com>
13249
13250         * cs-parser.jay: Fix several infelicities.
13251         - Avoid assigning to the parser value stack.  Code like 
13252           '$3 = null' is unclean.  Synthesize a value for the code block
13253           instead. 
13254         - Avoid using oob_stack for storing location information.  Use ...
13255         (_mark_): ... this.  New (empty) rule.  Saves the current location
13256         in $$.
13257         (foreach_statement): Avoid using oob_stack for current_block
13258         handling.  Use technique used in for_statement and
13259         using_statement.  Synthesize a value for the code block to store
13260         additional intermediate information.
13261
13262 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
13263
13264         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
13265         of a different type is only allowed to private fields of a
13266         containing type, not on fields of a base class.
13267
13268         See test-174.cs and error cs0122-9.cs
13269
13270 2005-01-13  Raja R Harinath  <rharinath@novell.com>
13271
13272         Fix test-335.cs (bug #58126).
13273         * cs-parser.jay (argument): Split out non-expression parts of the
13274         rule into 'non_simple_argument'.
13275         (invocation_expression): Support parenthesized invocations with
13276         multiple arguments, and with single non-simple arguments.
13277
13278 2005-01-13  Raja R Harinath  <rharinath@novell.com>
13279
13280         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
13281         places.
13282
13283 2005-01-12  Raja R Harinath  <rharinath@novell.com>
13284
13285         Fix cs0038-1.cs, cs1640-6.cs.
13286         * ecore.cs (Expression.Resolve): Remove special-case for
13287         SimpleName in error-handling.
13288         (Expression.almostMatchedMembers): Relax access permission to
13289         protected.
13290         (Expression.MemberLookupFailed): Handle duplicates in
13291         almostMatchedMembers list.
13292         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
13293         * expression.cs (New.DoResolve): Report CS1540 for more cases.
13294         * typemanager.cs (GetFullNameSignature): Use the MethodBase
13295         overload if the passed in MemberInfo is a MethodBase.
13296
13297 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
13298
13299         Fix #70749
13300         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
13301         for non-CAS & merge permission sets properly.
13302
13303 2005-01-11  Raja R Harinath  <rharinath@novell.com>
13304
13305         Improve standard-compliance of simple name and member access 
13306         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
13307         * ecore.cs (FullNamedExpression): New abstract base class 
13308         for Namespaces and TypeExpressions.
13309         (ResolveFlags.SimpleName): Remove.
13310         (SimpleName): Remove support for dotted names.
13311         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
13312         DeclSpace.FindType and DeclSpace.LookupType.
13313         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
13314         (Expression.ExprClassName): Make member function.
13315         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
13316         a namespace.  Remove creation of dotted "SimpleName"s.
13317         (MemberAccess.DoResolve): Likewise.
13318         * decl.cs (DeclSpace.Cache): Make private.
13319         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
13320         (DeclSpace.FindType): Update.
13321         (DeclSpace.LookupType): Move here from RootContext.  Return a 
13322         FullNamedExpression.
13323         * namespace.cs (Namespace): Derive from FullNamedExpression
13324         so that it can be part of expression resolution.
13325         (Namespace.Lookup): Return an FullNamedExpression.
13326         (NamespaceEntry.LookupAlias): Lookup aliases only in current
13327         namespace.
13328         * rootcontext.cs (NamespaceLookup): Remove.
13329         (LookupType): Move to DeclSpace.
13330         * attribute.cs (CheckAttributeType): Update.
13331         * doc.cs (FindDocumentedType): Remove allowAlias argument.
13332         (FindDocumentedTypeNonArray): Likewise.
13333
13334 2005-01-11  Raja R Harinath  <rharinath@novell.com>
13335
13336         Fix cs0509.cs, cs1632.cs.
13337         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
13338         is the same as IsInterface.
13339         (TypeContainer.GetClassBases): Likewise.
13340         * statement.cs (LabeledStatement.ig): New field.
13341         (LabeledStatement.LabelTarget): Save ILGenerator which created the
13342         label.
13343         (LabeledStatement.DoEmit): Check that the label was created with
13344         the same ILGenerator.
13345
13346 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
13347
13348         Fix #71058
13349         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
13350         accessors to its properties.
13351
13352         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
13353         from accessors to property.
13354         
13355 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
13356
13357         Fix #70722
13358         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
13359         only for overrides.
13360         
13361 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
13362
13363         * attribute.cs: Check for null and empty strings.  
13364
13365         I have lost another battle to Paolo.
13366
13367 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
13368
13369         Fix #70942
13370         * class.cs (PropertyMethod): Set Parent field in ctors.
13371         (SetMethod.InternalParameters): Add unsafe switch hack.
13372         Override MarkForDuplicationCheck where it is appropriate.
13373
13374         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
13375         It says whether container allows members with the same name.
13376         Base default is no.
13377         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
13378         Removed is_method parameter.
13379
13380 2005-01-06  Duncan Mak  <duncan@ximian.com>
13381
13382         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
13383         because the previous change led to incorrect reporting of CS1032
13384         ("Cannot define/undefine preprocessor symbols after first token in
13385         file"). Instead of using `tokens_seen' as the only flag that
13386         triggers CS1040, introduce `comments_seen'. This new flag is used
13387         to signify having seen comments on the current line, so it is
13388         unset after a newline.
13389
13390 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
13391
13392         * doc.cs : When searching for a type, find nested type too.
13393           This fixes bug #71040.
13394
13395 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
13396
13397         * doc.cs :
13398           - Warn missing member comment on those classes which also does not
13399             have doc comments. Fixed bug #71041.
13400           - Don't warn missing doc comment on default constructor.
13401             Fixed bug #71042.
13402
13403 2005-01-06  Duncan Mak  <duncan@ximian.com>
13404
13405         * cs-tokenizer.cs (xtoken): After handling traditional C-style
13406         comments, set `tokens_seen' to true. This allows us to detect
13407         misplaced preprocessor directives (i.e. not at the beginning of
13408         the a line, nor after whitespaces). In that case, report error
13409         CS1040. This fixes bug #56460.
13410
13411         * cs-parser.jay (interface_member_declaration): Add checks for
13412         IsExplicitImpl, and report CS0541 error if an interface member is
13413         defined as an explicit interface declaration.
13414
13415 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
13416
13417         Fix #70817
13418         * class.cs (PropertyMethod): Set Parent field in ctors.
13419         (SetMethod.InternalParameters): Add unsafe switch hack.
13420         
13421         * decl.cs (MemberCore.Parent): Cannot be readonly.
13422
13423 2005-01-06  Raja R Harinath  <rharinath@novell.com>
13424
13425         * decl.cs (DeclSpace.ResolveType): Remove.
13426         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
13427         Merge in code from ...
13428         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
13429         * class.cs, enum.cs: Update to changes.
13430
13431 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
13432
13433         * anonymous.cs: Ensure that we init the scope of our parent if it
13434         has not been initialized yet.
13435
13436 2004-12-30  Duncan Mak  <duncan@ximian.com>
13437
13438         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
13439         if field.FieldBuilder is null. Fixes #70758.
13440
13441         * convert.cs: Fixed some typos and updated some of the comments.
13442         (ImplicitStandardConversionExists):
13443         (TryImplicitIntConversion): If `target_type' is an interface and
13444         the type of `ic' implements this interface, return true or a new
13445         BoxedCast instead of null. This fixes #70468.
13446
13447 2004-12-29  Duncan Mak  <duncan@ximian.com>
13448
13449         * expression.cs (Argument.Emit): Check that Expr is
13450         IMemoryLocation before casting to it, and report CS1510 otherwise.
13451
13452         This fixes #70402.
13453
13454 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
13455
13456         * statement.cs (Block.ThisVariable): remove the recursion here, to
13457         make the --profile more sane.
13458
13459 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
13460
13461         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
13462         assembly, by JB Evain.
13463
13464 2004-12-17  Raja R Harinath  <rharinath@novell.com>
13465
13466         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
13467           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
13468         "parent" refers to enclosing type/class.  "base" refers to superclass.
13469
13470 2004-12-17  Raja R Harinath  <rharinath@novell.com>
13471
13472         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13473         Ensure that we only have GlobalAttributes.
13474         * attribute.cs (Attribute.Emit): Make non-virtual.
13475         (GlobalAttribute.Emit): Remove.
13476         (Attribute.Resolve): Make virtual.
13477         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
13478         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
13479         the argument. Don't create one.
13480         (Attribute.GetObsoleteAttribute): Likewise.
13481         (Attribute.GetClsCompliantAttributeValue): Likewise.
13482         * class.cs, decl.cs: Update to changes.
13483
13484 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
13485
13486         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
13487         
13488         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
13489         
13490         * statement.cs (Foreach.Resolve): Add error 186 report.
13491
13492 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
13493
13494         * expression.cs (Conditional.DoResolve): Add warning 429.
13495         
13496         * statement.cs (If.Resolve): Add warning 665.
13497
13498 2004-12-16  Raja R Harinath  <rharinath@novell.com>
13499
13500         New invariant: RootContext.Tree.Types.NamespaceEntry == null
13501         except when in the parser, and in GlobalAttribute.
13502         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
13503         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
13504         RootContext.Tree.Types.NamespaceEntry once work is done.
13505         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
13506         and resets RootContext.Tree.Types.NamespaceEntry.
13507
13508 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
13509
13510         * cs-parser.jay: Don't create a block for every variable.
13511
13512 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
13513
13514         * location.cs: Provide extra information.
13515
13516         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
13517         variables from the captured environment, it is the ldarg_0.
13518
13519 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
13520
13521         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
13522         find a conclusion.
13523         
13524         * class.cs: Changed warning level for 169 to avoid developer
13525         displeasure from warning flooding. It will be changed back when they
13526         fix most of current BCL warnings.
13527         
13528         * RootContext.cs: Pushed default WarningLevel to 3.
13529         
13530         * statement.cs: Removed unused variable.
13531
13532 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
13533
13534         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
13535         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
13536         Add error 502 report.
13537         (StaticClass.DefineType): Add error 441 report.
13538         (Class.AllowedModifiersProp): New virtual property as temporary
13539         extension to AllowedModifiers.
13540         (Class.DefineType): Add error 418 report. Moved ModFlags check here
13541         to share implementation with StaticClass and don't call virtual
13542         methods from ctor.
13543         
13544         * driver.cs (MainDriver): Add error 1558 test.
13545
13546         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
13547         report. Moved error 36 test here.
13548
13549         * statement.cs (Throw.Resolve): Add error 724 report.
13550
13551         * typemanager.cs: Add out_attribute_type core type.
13552         
13553 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
13554
13555         * class.cs (TypeContainer.VerifyClsCompliance): Add error
13556         3018 report.
13557         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
13558
13559         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
13560         3017 report.
13561         
13562         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
13563
13564         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
13565         Add error 3023 report.
13566         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
13567
13568         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
13569         implementation.
13570
13571 2004-12-12  John Luke  <john.luke@gmail.com>
13572
13573         * driver.cs (AddArgs): take -- into account when
13574         adding arguments, fixes bug 65710 
13575
13576 2004-12-12  Martin Baulig  <martin@ximian.com>
13577
13578         * expression.cs (Unary.TryReduceNegative): Added support for
13579         SByteConstant and ByteConstant.
13580         (Unary.Reduce): Check error values from TryReduceNegative().
13581
13582 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
13583
13584         * attributes.cs (Attribute.Resolve): Avoid multiple error report
13585         and report exception as error 182.
13586
13587 2004-12-10  Raja R Harinath  <rharinath@novell.com>
13588
13589         * driver.cs (Main): Fix message when there are warnings.
13590
13591 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
13592
13593         * delegate.cs: Fixed my fix from yesterday, sorry about that.
13594
13595 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
13596
13597         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
13598         Reduced number of warnings.
13599         
13600         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
13601
13602 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
13603
13604         * driver.cs: Removed message.
13605
13606         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
13607
13608 2004-12-08    <vargaz@freemail.hu>
13609
13610         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
13611
13612 2004-12-08  Martin Baulig  <martin@ximian.com>
13613
13614         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
13615         instead of a CS3002 for properties and indexer.
13616
13617 2004-12-08  Martin Baulig  <martin@ximian.com>
13618
13619         * decl.cs (MemberName.ToString): Make this work again.
13620
13621 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
13622
13623         * attribute.cs (Resolve): Add error 591 detection.
13624
13625         * class.cs (FieldMember.Define): Add error 1547 detection.
13626         (Indexer.Define): Add error 620 detection.
13627         (Operator.Define): Add error 590 detection.
13628
13629         * ecore.cs: Missing argument for error 79.
13630
13631         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
13632         detection.
13633
13634 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
13635
13636         Fix #70106
13637         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
13638         only.
13639
13640 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
13641
13642         * cs-parser.jay : handle doc comments on implicit/explicit operators.
13643           Some operator comments were suppressed.
13644         * doc.cs : Implicit/explicit operator name in doc comments are like
13645           "op_Explicit(type)~returnType", so added suffix handling.
13646
13647 2004-12-07  Martin Baulig  <martin@ximian.com>
13648
13649         * decl.cs
13650         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
13651         (MemberCore.GetClsCompliantAttributeValue): Likewise.
13652         (DeclSpace.ec): New protected field; store the EmitContext here.
13653         (DeclSpace.EmitContext): New public property; moved here from
13654         `TypeContainer'.
13655         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
13656         EmitContext.
13657
13658         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
13659         (Enum.Emit): Don't create a new EmitContext.
13660
13661         * delegate.cs (Delegate.DefineType): Always create the
13662         EmitContext.
13663
13664         * iterators.cs (Iterators.DefineIterator): Create a new
13665         EmitContext and store it in `ec'.
13666
13667 2004-08-24  Martin Baulig  <martin@ximian.com>
13668
13669         * typemanager.cs
13670         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
13671         this for accessibility checks.
13672         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
13673         IsNestedFamilyAccessible.
13674         (TypeManager.IsSubclassOf): New method, do what the name actually
13675         says.   
13676
13677 2004-12-06  Raja R Harinath  <rharinath@novell.com>
13678
13679         Fix crash on cs0657-17.cs.
13680         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13681         Use RootContext.Tree.Types, not 'new RootTypes ()'.
13682         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
13683         the case where the NamespaceEntry gets overwritten.
13684
13685 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
13686
13687         Fixed #69195, #56821
13688         * ecore.cs (ResolveBoolean): Tiny refactoring.
13689
13690         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
13691         of right expression resolving when left is false constant and
13692         operator is LogicalAnd OR true constant and operator is LogicalOr.
13693
13694         * statement.cs (ResolveUnreachable): Always reports warning.
13695
13696 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
13697
13698         * class.cs: Distinguish between 1721 and 1722 (just a little help
13699         for the programmer).
13700
13701 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
13702
13703         * delegate.cs: Only allow this on new versions of the language. 
13704
13705 2004-12-02  Duncan Mak  <duncan@ximian.com>
13706
13707         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
13708         Expression class.
13709         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
13710         here as a static method. Take an additional bool out parameter
13711         `must_do_cs1540_check' for signaling to InstanceResolve.
13712         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
13713         member field from PropertyExpr class and made it an argument of
13714         the method instead.
13715         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
13716         check for MarshalByRefObject, and report CS0122 instead of CS1540.
13717         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
13718         and `remove_accessor' as well as InstanceResolve: report CS0122
13719         where applicable.
13720
13721         Fixes #70129.
13722
13723 2004-12-03  Raja R Harinath  <rharinath@novell.com>
13724
13725         Fix test-327.cs, test-328.cs, and put in early infrastructure
13726         for eventually fixing #52697.
13727         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
13728         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
13729         from other methods.
13730         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
13731         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
13732         (VerifyUsing, error246): Update.
13733         * rootcontext.cs (RootContext.NamespaceLookup): Just use
13734         'NamespaceEntry.LookupNamespaceOrType'.
13735
13736 2004-12-03  Martin Baulig  <martin@ximian.com>
13737
13738         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13739         method as our child, call AnonymousMethod.Compatible() on it.
13740
13741 2004-12-03  Raja R Harinath  <rharinath@novell.com>
13742
13743         Disable XML documentation support in 'basic' profile.
13744         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
13745         Redirect XmlElement to System.Object.
13746         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
13747         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
13748         * mcs.exe.sources: Add doc-bootstrap.cs.
13749         * doc-bootstrap.cs: New file.  Contains empty stub implementation
13750         of doc.cs.
13751
13752 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
13753
13754         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
13755           comments are allowed.
13756
13757 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13758
13759         * delegate.cs: Add checks for subtypes in paramaters and return values
13760         in VerifyMethod () to add support for Covariance/Contravariance
13761         in delegates.
13762         
13763 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
13764
13765         * report.cs: Remove extra closing parenthesis.
13766
13767         * convert.cs (Error_CannotImplicitConversion): If the name of the
13768         types are the same, provide some extra information.
13769
13770         * class.cs (FieldBase): Use an unused bit field from the field to
13771         encode the `has_offset' property from the FieldMember.  This saves
13772         a couple of Ks on bootstrap compilation.
13773
13774         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13775         method as our child, return the AnonymousMethod resolved
13776         expression.
13777
13778         * expression.cs (New.DoResolve): Allow return values from
13779         NewDelegate to also include AnonymousMethods.
13780
13781         Fixes #70150.
13782
13783 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
13784
13785         Fix bug #70102
13786         * attribute.cs (Resolve): Improved implementation of params
13787         attribute arguments.
13788
13789         * support.cs (ParameterData): Add HasParams to be faster.
13790
13791 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
13792
13793         all things are for /doc support:
13794
13795         * doc.cs: new file that supports XML documentation generation.
13796         * mcs.exe.sources: added doc.cs.
13797         * driver.cs:
13798           Handle /doc command line option.
13799           Report error 2006 instead of 5 for missing file name for /doc.
13800           Generate XML documentation when required, after type resolution.
13801         * cs-tokenizer.cs:
13802           Added support for picking up documentation (/// and /** ... */),
13803           including a new XmlCommentState enumeration.
13804         * cs-parser.jay:
13805           Added lines to fill Documentation element for field, constant,
13806           property, indexer, method, constructor, destructor, operator, event
13807           and class, struct, interface, delegate, enum.
13808           Added lines to warn incorrect comment.
13809         * rootcontext.cs :
13810           Added Documentation field (passed only when /doc was specified).
13811         * decl.cs:
13812           Added DocComment, DocCommentHeader, GenerateDocComment() and
13813           OnGenerateDocComment() and some supporting private members for
13814           /doc feature to MemberCore.
13815         * class.cs:
13816           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
13817         * delegate.cs:
13818           Added overriden DocCommentHeader.
13819         * enum.cs:
13820           Added overriden DocCommentHeader and GenerateDocComment().
13821
13822 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
13823
13824         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
13825         unwrapping the enumeration values, chain to
13826         DoConstantNumericPromotions again, so we can promote things to the
13827         fundamental types (takes care of enums that are bytes, sbytes).
13828
13829         Fixes bug #62054.
13830
13831 2004-12-01  Raja R Harinath  <rharinath@novell.com>
13832
13833         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
13834         Fix long-standing bug in type-lookup.  Use FindType instead of
13835         LookupType when ec.ResolvingTypeTree.
13836         (Attribute.ResolveType, Attribute.Resolve)
13837         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
13838         Update to changes.
13839         (Attributes.Search): Remove internal version.  Update.
13840         (Attributes.SearchMulti): Update.
13841         (Attributes.GetClsCompliantAttribute): Remove.
13842         (Attributes.GetIndexerNameAttribute): Remove.
13843         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
13844         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
13845         * class.cs (Indexer.Define): Likewise.
13846
13847 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
13848
13849         Fix bug #68790
13850         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
13851         MarshallByReference members access.
13852
13853         * expression.cs: Use CheckMarshallByRefAccess;
13854         Better error CS0197 message.
13855
13856         * report.cs: Print whole related error message.
13857
13858 2004-11-30  Raja R Harinath  <rharinath@novell.com>
13859
13860         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
13861         the current directory to help debugging.
13862
13863 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
13864
13865         * class (GetClassBases): Better error 60 report.
13866         (EventProperty): Disabled warning 67 detection.
13867
13868 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
13869
13870         Fix bug #60324
13871         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
13872
13873         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
13874         precise values.
13875
13876 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
13877
13878         Fix bug #49488
13879         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
13880
13881         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
13882
13883 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
13884
13885         * attribute.cs (Attribute.Resolve): Refine error reporting and
13886         report a cs0117 if the identifier does not exist, to distinguish
13887         from 0617 which is a miss-use of the actual identifier.
13888
13889         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
13890         between cs0070 and cs0079.
13891
13892         * class.cs (MemberBase.DoDefine): When reporting a wrong
13893         accessibility level, we use MethodCore to compare instead of
13894         Method (this was a regression in some refactoring effort).
13895
13896         So now we correctly report cs0056 again.
13897
13898         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
13899         testing the target_type (which was known to be object_type) and
13900         not the source type (which is anonymous_method).
13901
13902         Fixed reporting of error cs1660.
13903
13904         * expression.cs (UserCast.Source): Expose the underlying cast.
13905
13906         * statement.cs (Switch.SwitchGoverningType): Sort the list of
13907         allowed types to find a match to int32 first (most common).
13908
13909         In addition, it ignores any ImplicitUserConversions that did an
13910         internal implicit conversion (as the switch statement allows only
13911         one integral conversion to exist).
13912
13913         * class.cs (PartialContainer.Create): rename `name' to
13914         `member_name' for clarity.  Then replace the string calls with a
13915         call to MemberName.GetPartialName, as now using
13916         MemberName.ToString is an error (this is due to the side effects
13917         it had, that were fixed in the past).
13918
13919         This will restore the error reporting on a number of partial class
13920         errors that were missusing this (and getting an exception as a
13921         results, which is now just a plain textual warning, because
13922         yyparse debug output would crash otherwise).
13923
13924 2004-11-26  Raja R Harinath  <rharinath@novell.com>
13925
13926         * Makefile (PROGRAM_INSTALL_DIR): Remove.
13927
13928 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
13929
13930         * rootcontext.cs (LookupType): Make sure to cache lookups that
13931         don't give us a negative result. This saves about 5% of corlib
13932         compilation time.
13933
13934 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
13935
13936         * report.cs (AbstractMessage.Print): messages are sent to stderr
13937
13938         * class.cs (TypeContainer.GetClassBases): It is an error to have a
13939         non-interface in the list of interfaces (at this point, either
13940         parent was properly set, or a base class is being listed in the
13941         interfaces section).
13942
13943         This flags error 1722, and resolves the crash from bug 69259.
13944
13945 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
13946
13947         * statement.cs (Using.EmitExpressionFinally): make this work right
13948         for valuetypes. Fixes 69926.
13949
13950 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
13951
13952         * const.cs (Const.ChangeType): Cope with the "0 literal can be
13953         converted to an enum" here, before we try to change the underlying
13954         type.  This code exists, but it is a different code path than the
13955         one used while encoding constants.
13956
13957         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
13958         old bug: when converting from the null literal to a pointer,
13959         return an EmptyCast, not the NullLiteral.
13960
13961         This fixes #69921, the recent null_type changes probably made this
13962         bug more prominent.
13963
13964         (ImplicitReferenceConversionExists): In addition, resynchronized
13965         the code here, so it matches the same code in
13966         ImplicitReferenceConversionExists for the `from any class-type S
13967         to any interface-type T'.
13968         
13969
13970 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
13971
13972         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
13973
13974 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
13975
13976         * cs-parser.jay: Use verbosity accordingly. 
13977
13978 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
13979
13980         * expression.cs (Unary.ResolveOperator): Do not report warning;
13981         AddressOf reads from variable.
13982         
13983         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
13984
13985 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
13986
13987         Fix bug #69462
13988
13989         * attribute.cs (Attributable): Removed CheckTargets.
13990         (Attributes.Emit): Explicit attribute targets are tested here.
13991
13992         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
13993         not enabled for interfaces.
13994
13995         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
13996         (GetAssemblyName): Ouch next bug there.
13997
13998 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13999
14000         * expression.cs: Error 275 added.
14001         
14002 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
14003
14004         Fix bug #69177 (Implemented decimal constant support)
14005
14006         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
14007         (BinaryFold): Add DecimalConstant.
14008
14009         * const.cs (Define): Decimal constant 
14010         (is not constant.
14011         (ChangeType): Add decimal type handling.
14012         (LookupConstantValue): Don't set value for decimal type but
14013         emit DecimalConstantAttribute. Needed for constant optimization.
14014
14015         * constant.cs (ToDecimal): New method.
14016         (ConvertToDecimal): New method.
14017         (IntConstant): Implemented ConvertToDecimal.
14018         (DecimalConstant.Emit): Emit optimized version for decimals in
14019         int range.
14020
14021         * expression.cs (ResolveOperator): Changed order of constant
14022         reduction to work correctly with native types which have
14023         overloaded operators.
14024         (ResolveMemberAccess): Extract constant value from attribute
14025         for decimal type.
14026
14027         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
14028
14029         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
14030         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
14031         (ChangeType): Decimal is special.
14032         (TypeToCoreType): Add decimal type.
14033
14034 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
14035
14036         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
14037         decimal types.
14038
14039 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
14040
14041         * class.cs (EventField.ApplyAttributeBuilder): Fix error
14042         test cs1667-5.cs.
14043
14044 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
14045
14046         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
14047
14048         * pending.cs (PendingImplementation): Grab only interfaces.
14049
14050 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
14051
14052         * statement.cs (ForeachHelperMethods): Add location member and
14053         error 202 detection.
14054
14055 2004-11-19  Raja R Harinath  <rharinath@novell.com>
14056
14057         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
14058         automatically handled by executable.make.
14059         (PROGRAM): Make profile-specific.
14060
14061 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
14062
14063         * expression.cs (DoResolveBase): Fixed wrong warning for out
14064         variables.
14065
14066 2004-11-18  Martin Baulig  <martin@ximian.com>
14067
14068         Merged latest changes into gmcs.  Please keep this comment in
14069         here, it makes it easier for me to see what changed in MCS since
14070         the last time I merged.
14071
14072 2004-11-17  Raja R Harinath  <rharinath@novell.com>
14073
14074         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
14075         (TypeHandle.GetMemberCache): New.
14076         (TypeHandle.TypeHandle): Update.
14077         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
14078         (TypeManager.LookupParentInterfacesCache):
14079         Rename from LookupInterfaceCache.  Optimize slightly.
14080         (TypeManager.MemberLookup_FindMembers): Update.
14081         * decl.cs (MemberCache.MemberCache): Set Container to null in the
14082         multi-type variant.
14083         (AddCacheContents): Rename from AddHashtable.
14084         * class.cs (TypeContainer.parent_container): Remove.
14085         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
14086         (TypeContainer.DoDefineMembers): Don't initialize it.
14087         Update to name changes.
14088         
14089 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
14090
14091         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
14092         that factors the code to check access modifiers on override.  
14093
14094         (PropertyBase): Use the code here.
14095
14096         Patch from Lluis S'anchez, fixes bug #69361.
14097
14098 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
14099
14100         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
14101         routine that is used to report the use of a captured variable
14102         whose address has been taken.
14103
14104         There are two checks: one when variables are being captured and
14105         the other check is when the address of a variable is taken. 
14106         
14107         (because an anonymous methods might be resolved before *or* after
14108         the address has been taken) and 
14109
14110         * expression.cs (Conditional.DoResolve): Remove the special
14111         casing that Martin added to trueExpr and falseExpr being both
14112         NullLiteral.  We get the right behavior now just by introducing
14113         the null_type into the compiler. 
14114
14115         * convert.cs (ExplicitConversion): Change the code to use
14116         null_type instead of testing `expr is NullLiteral'.
14117         (ImplicitConversionStandard): use null_type too.
14118         (ImplicitReferenceConversionExists): use null_type too.
14119         (ImplicitReferenceConversion): use null_type too.
14120
14121         * literal.cs: The type of `NullLiteral' is now null_type instead
14122         of object_type. 
14123         (Resolve): Set the type here.
14124
14125         * typemanager.cs: Introduce null_type.
14126
14127 2004-11-17  Martin Baulig  <martin@ximian.com>
14128
14129         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
14130         direction, like FindMembers() does.  Fixes #69546, testcase is in
14131         test-315.cs.    
14132
14133 2004-11-16  Martin Baulig  <martin@ximian.com>
14134
14135         This is based on a patch from Marek Safar, see bug #69082.
14136         Fixes bugs #63705 and #67130.
14137
14138         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
14139         method; create a MemberCache for an interface type and cache the
14140         result.
14141
14142         * decl.cs (IMemberContainer.ParentContainer): Removed.
14143         (IMemberContainer.ParentCache): New property.
14144         (MemberCache.SetupCacheForInterface): Removed.
14145         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
14146         to create a cache for an interface's "parent".
14147
14148         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
14149         interfaces too.
14150
14151 2004-11-16  Martin Baulig  <martin@ximian.com>
14152
14153         Merged back from gmcs; these changes already went into gmcs a
14154         couple of weeks ago.
14155
14156         * typemanager.cs
14157         (TypeManager.AddUserType): Removed the `ifaces' argument.
14158         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
14159         `TypeExpr []'.
14160         (TypeManager.AddUserInterface): Removed.
14161         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
14162         `TypeExpr []'.
14163         (TypeManager.GetInterfaces): Likewise.
14164         (TypeManager.GetExplicitInterfaces): Likewise.
14165
14166         * ecore.cs (TypeExpr.GetInterfaces): Removed.
14167
14168         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
14169         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
14170
14171 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
14172
14173         * statement.cs: Avoid adding bools to a hashtable.
14174
14175 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
14176
14177         * expression.cs (Invocation.OverloadResolve): Flag error if we are
14178         calling an unsafe method from a safe location.
14179
14180 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
14181
14182         Fix #69167
14183         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
14184
14185 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
14186
14187         * namespace.cs (VerifyUsing): use GetPartialName instead of
14188         ToString. 
14189
14190 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
14191
14192         * statement.cs (Return.Resolve): Fix regression in typo: if
14193         `in_exc', we have to request a NeedReturnLabel, this was a typo
14194         introduced in the anonymous method check-in.  Fixes #69131.
14195
14196         * Indexers were using the ShortName when defining themselves,
14197         causing a regression in the compiler bootstrap when applying the
14198         patch from 2004-11-02 (first part), now they use their full name
14199         and the bug is gone.
14200
14201 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
14202
14203         * driver.cs: Strip the path from the names of embedded resources. Fixes
14204         #68519.
14205
14206 2004-11-04  Raja R Harinath  <rharinath@novell.com>
14207
14208         Fix error message regression: cs0104-2.cs.
14209         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
14210         (AliasEntry.Resolve): Update.
14211         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
14212         'silent' flag.
14213         (RootContext.LookupType): Update.
14214
14215 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
14216
14217         * cs-parser.jay: Add support for handling accessor modifiers
14218         * class: Add support port accessor modifiers and error checking,
14219         define PropertyMethod.Define as virtual (not abstract anymore)
14220         * ecore.cs: Add checking for proeprties access with access modifiers
14221         * iterators.cs: Modify Accessor constructor call based in the modified
14222         constructor
14223 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
14224
14225         * expression.cs (StringConcat): Handle being called twice,
14226         as when we have a concat in a field init with more than two
14227         ctors in the class
14228
14229 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
14230
14231         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
14232         special case explicit implementations, we should always produce
14233         the .property or .event declaration.
14234         
14235         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
14236         since it will not return correct data if people use this
14237         unresolved in the presence of using statements (see test-313).
14238
14239         * class.cs (MethodData.Define): If we are an explicit interface
14240         implementation, set the method name to the full name of the
14241         interface plus the name of the method.  
14242
14243         Notice that using the method.MethodName.GetFullName() does not
14244         work, as it will only contain the name as declared on the source
14245         file (it can be a shorthand in the presence of using statements)
14246         and not the fully qualifed type name, for example:
14247
14248         using System;
14249
14250         class D : ICloneable {
14251                 object ICloneable.Clone ()  {
14252                 }
14253         }
14254
14255         Would produce a method called `ICloneable.Clone' instead of
14256         `System.ICloneable.Clone'.
14257
14258         * namespace.cs (Alias.Resolve): Use GetPartialName.
14259         
14260 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
14261
14262         * cs-parser.jay: Add error 1055 report.
14263
14264 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
14265
14266         * assign.cs (Assign.DoResolve): Only do the transform of
14267         assignment into a New if the types are compatible, if not, fall
14268         through and let the implicit code deal with the errors and with
14269         the necessary conversions. 
14270
14271 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
14272
14273         * cs-parser.jay: Add error 1031 report.
14274
14275         * cs-tokenizer.cs: Add location for error 1038.
14276
14277 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14278
14279         * cs-parser.jay: Add error 1016 report.
14280
14281 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14282
14283         * cs-parser.jay: Add errors 1575,1611 report.
14284
14285 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14286
14287         * cs-parser.jay: Add error 1001 report.
14288
14289 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14290
14291         Fix #68850
14292         * attribute.cs (GetMarshal): Add method argument for
14293         caller identification.
14294
14295         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
14296         agument for GetMarshal and RuntimeMissingSupport.
14297
14298 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14299
14300         * attribute.cs (ExtractSecurityPermissionSet): Removed
14301         TypeManager.code_access_permission_type.
14302
14303         * typemanager.cs: Removed TypeManager.code_access_permission_type.
14304
14305 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
14306
14307         * expression.cs (LocalVariableReference.DoResolveLValue): Check
14308         for obsolete use of a variable here.   Fixes regression on errors
14309         cs0619-25 and cs0619-26.
14310
14311 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
14312
14313         Fix #62358, implemented security attribute encoding.
14314
14315         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
14316         Tests permitted SecurityAction for assembly or other types.
14317         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
14318         data from SecurityPermissionAttribute to PermisionSet class.
14319
14320         * class.cs (ApplyAttributeBuilder): Added special handling
14321         for System.Security.Permissions.SecurityAttribute based types.
14322
14323         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
14324         special handling for System.Security.Permissions.SecurityAttribute
14325         based types.
14326
14327         * enum.cs (ApplyAttributeBuilder): Added special handling
14328         for System.Security.Permissions.SecurityAttribute based types.
14329
14330         * parameter.cs (ApplyAttributeBuilder): Added special handling
14331         for System.Security.Permissions.SecurityAttribute based types.
14332
14333         * rootcontext.cs: Next 2 core types.
14334
14335         * typemanager.cs (TypeManager.security_permission_attr_type):
14336         Built in type for the SecurityPermission Attribute.
14337         (code_access_permission_type): Build in type.
14338
14339 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
14340
14341         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
14342         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
14343         all of this information into
14344         EmitContext.EmitCapturedVariableInstance.
14345         
14346         * codegen.cs (EmitCapturedVariableInstance): move here the
14347         funcionality of emitting an ldarg.0 in the presence of a
14348         remapping.   This centralizes the instance emit code.
14349
14350         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
14351         then emit a load of this: it means that we have reached the
14352         topmost ScopeInfo: the one that contains the pointer to the
14353         instance of the class hosting the anonymous method.
14354
14355         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
14356         captures to the topmost CaptureContext.
14357
14358 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
14359
14360         * expression.cs (LocalVariableReference): Move the knowledge about
14361         the iterators into codegen's EmitCapturedVariableInstance.
14362
14363 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
14364
14365         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
14366         all code paths return a value from an anonymous method (it is the
14367         same as the 161 error, but for anonymous methods).
14368
14369 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
14370
14371         The introduction of anonymous methods in the compiler changed
14372         various ways of doing things in the compiler.  The most
14373         significant one is the hard split between the resolution phase
14374         and the emission phases of the compiler.
14375
14376         For instance, routines that referenced local variables no
14377         longer can safely create temporary variables during the
14378         resolution phase: they must do so from the emission phase,
14379         since the variable might have been "captured", hence access to
14380         it can not be done with the local-variable operations from the runtime.
14381         
14382         * statement.cs 
14383
14384         (Block.Flags): New flag `IsTopLevel' to indicate that this block
14385         is a toplevel block.
14386
14387         (ToplevelBlock): A new kind of Block, these are the blocks that
14388         are created by the parser for all toplevel method bodies.  These
14389         include methods, accessors and anonymous methods.
14390
14391         These contain some extra information not found in regular blocks:
14392         A pointer to an optional CaptureContext (for tracking captured
14393         local variables and parameters).  A pointer to the parent
14394         ToplevelBlock.
14395         
14396         (Return.Resolve): Catch missmatches when returning a value from an
14397         anonymous method (error 1662).
14398         Invoke NeedReturnLabel from the Resolve phase instead of the emit
14399         phase.
14400
14401         (Break.Resolve): ditto.
14402
14403         (SwitchLabel): instead of defining the labels during the
14404         resolution phase, we now turned the public ILLabel and ILLabelCode
14405         labels into methods called GetILLabelCode() and GetILLabel() that
14406         only define the label during the Emit phase.
14407
14408         (GotoCase): Track the SwitchLabel instead of the computed label
14409         (its contained therein).  Emit the code by using
14410         SwitchLabel.GetILLabelCode ().
14411
14412         (LocalInfo.Flags.Captured): A new flag has been introduce to track
14413         whether the Local has been captured or not.
14414
14415         (LocalInfo.IsCaptured): New property, used to tell whether the
14416         local has been captured.
14417         
14418         * anonymous.cs: Vastly updated to contain the anonymous method
14419         support.
14420
14421         The main classes here are: CaptureContext which tracks any
14422         captured information for a toplevel block and ScopeInfo used to
14423         track the activation frames for various local variables.   
14424
14425         Each toplevel block has an optional capture context associated
14426         with it.  When a method contains an anonymous method both the
14427         toplevel method and the anonymous method will create a capture
14428         context.   When variables or parameters are captured, they are
14429         recorded on the CaptureContext that owns them, for example:
14430
14431         void Demo () {
14432              int a;
14433              MyDelegate d = delegate {
14434                  a = 1;
14435              }
14436         }
14437
14438         Here `a' will be recorded as captured on the toplevel
14439         CapturedContext, the inner captured context will not have anything
14440         (it will only have data if local variables or parameters from it
14441         are captured in a nested anonymous method.
14442
14443         The ScopeInfo is used to track the activation frames for local
14444         variables, for example:
14445
14446         for (int i = 0; i < 10; i++)
14447                 for (int j = 0; j < 10; j++){
14448                    MyDelegate d = delegate {
14449                         call (i, j);
14450                    }
14451                 }
14452
14453         At runtime this captures a single captured variable `i', but it
14454         captures 10 different versions of the variable `j'.  The variable
14455         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
14456         recorded on a child.  
14457
14458         The toplevel ScopeInfo will also track information like the `this'
14459         pointer if instance variables were referenced (this is necessary
14460         as the anonymous method lives inside a nested class in the host
14461         type of the method). 
14462
14463         (AnonymousMethod): Expanded to track the Toplevel, implement
14464         `AnonymousMethod.Compatible' to tell whether an anonymous method
14465         can be converted to a target delegate type. 
14466
14467         The routine now also produces the anonymous method content
14468
14469         (AnonymousDelegate): A helper class that derives from
14470         DelegateCreation, this is used to generate the code necessary to
14471         produce the delegate for the anonymous method that was created. 
14472
14473         * assign.cs: API adjustments for new changes in
14474         Convert.ImplicitStandardConversionExists.
14475
14476         * class.cs: Adjustments to cope with the fact that now toplevel
14477         blocks are of type `ToplevelBlock'. 
14478
14479         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
14480         insteda of standard blocks.
14481
14482         Flag errors if params arguments are passed to anonymous methods.
14483
14484         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
14485         `CurrentAnonymousMethod' which points to the current Anonymous
14486         Method.  The variable points to the AnonymousMethod class that
14487         holds the code being compiled.  It is set in the new EmitContext
14488         created for the anonymous method.
14489
14490         (EmitContext.Phase): Introduce a variable and an enumeration to
14491         assist in enforcing some rules about when and where we are allowed
14492         to invoke certain methods (EmitContext.NeedsReturnLabel is the
14493         only one that enfonces this right now).
14494
14495         (EmitContext.HaveCaptureInfo): new helper method that returns
14496         whether we have a CapturedContext initialized.
14497
14498         (EmitContext.CaptureVariable): New method used to register that a
14499         LocalInfo must be flagged for capturing. 
14500
14501         (EmitContext.CapturedParameter): New method used to register that a
14502         parameters must be flagged for capturing. 
14503         
14504         (EmitContext.CapturedField): New method used to register that a
14505         field must be flagged for capturing. 
14506
14507         (EmitContext.HaveCapturedVariables,
14508         EmitContext.HaveCapturedFields): Return whether there are captured
14509         variables or fields. 
14510
14511         (EmitContext.EmitMethodHostInstance): This is used to emit the
14512         instance for the anonymous method.  The instance might be null
14513         (static methods), this (for anonymous methods that capture nothing
14514         and happen to live side-by-side with the current method body) or a
14515         more complicated expression if the method has a CaptureContext.
14516
14517         (EmitContext.EmitTopBlock): Routine that drives the emission of
14518         code: it will first resolve the top block, then emit any metadata
14519         and then emit the code.  The split is done so that we can extract
14520         any anonymous methods and flag any captured variables/parameters.
14521         
14522         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
14523         during this phase, the ILGenerator should not be used as labels
14524         and local variables declared here might not be accessible to any
14525         code that is part of an anonymous method.  
14526
14527         Exceptions to this include the temporary variables that are
14528         created by some statements internally for holding temporary
14529         variables. 
14530         
14531         (EmitContext.EmitMeta): New routine, in charge of emitting all the
14532         metadata for a cb
14533
14534         (EmitContext.TemporaryReturn): This method is typically called
14535         from the Emit phase, and its the only place where we allow the
14536         ReturnLabel to be defined other than the EmitMeta.  The reason is
14537         that otherwise we would have to duplicate a lot of logic in the
14538         Resolve phases of various methods that today is on the Emit
14539         phase. 
14540
14541         (EmitContext.NeedReturnLabel): This no longer creates the label,
14542         as the ILGenerator is not valid during the resolve phase.
14543
14544         (EmitContext.EmitThis): Extended the knowledge in this class to
14545         work in anonymous methods in addition to iterators. 
14546
14547         (EmitContext.EmitCapturedVariableInstance): This emits whatever
14548         code is necessary on the stack to access the instance to a local
14549         variable (the variable will be accessed as a field).
14550
14551         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
14552         EmitContext.EmitAddressOfParameter): Routines to support
14553         parameters (not completed at this point). 
14554         
14555         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
14556         will also remove the parameters.
14557
14558         * convert.cs (Convert): Define a `ConstantEC' which points to a
14559         null.  This is just to prefity some code that uses
14560         ImplicitStandardConversion code and do not have an EmitContext
14561         handy.
14562
14563         The idea is to flag explicitly that at that point in time, it is
14564         known that the conversion will not trigger the delegate checking
14565         code in implicit conversions (which requires a valid
14566         EmitContext). 
14567
14568         Everywhere: pass new EmitContext parameter since
14569         ImplicitStandardConversionExists now requires it to check for
14570         anonymous method conversions. 
14571
14572         (Convert.ImplicitStandardConversionExists): If the type of an
14573         expression is the anonymous_method_type, and the type is a
14574         delegate, we invoke the AnonymousMethod.Compatible method to check
14575         whether an implicit conversion is possible. 
14576
14577         (Convert.ImplicitConversionStandard): Only do implicit method
14578         group conversions if the language level is not ISO_1.
14579
14580         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
14581         MethodInfo for the Invoke method.  used by Delegate and
14582         AnonymousDelegate.
14583
14584         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
14585         method conversions if the target type is a delegate.
14586
14587         Removed extra debugging nops.
14588
14589         (LocalVariableReference): Turn the `local_info' into a public
14590         field. 
14591
14592         Add `prepared' field, the same hack used for FieldExprs to cope
14593         with composed assignments, as Local variables do not necessarily
14594         operate purely on the stack as they used to: they can be captured
14595         fields. 
14596
14597         Add `temp' for a temporary result, like fields.
14598
14599         Refactor DoResolve and DoResolveLValue into DoResolveBase.
14600
14601         It now copes with Local variables that are captured and emits the
14602         proper instance variable to load it from a field in the captured
14603         case. 
14604
14605         (ParameterReference.DoResolveBase): During the resolve phase,
14606         capture parameters if we are in an anonymous method.
14607
14608         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
14609         anonymous method, use the EmitContext helper routines to emit the
14610         parameter reference.
14611
14612         * iterators.cs: Set RemapToProxy to true/false during the
14613         EmitDispose class.
14614
14615         * parameters.cs (GetParameterByName): New helper method. 
14616
14617         * typemanager.cs (anonymous_method_type) a new type that
14618         represents an anonyous method.  This is always an internal type,
14619         used as a fencepost to test against the anonymous-methodness of an
14620         expression. 
14621         
14622 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
14623
14624         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
14625         561 report.
14626         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
14627
14628 2004-10-18  Martin Baulig  <martin@ximian.com>
14629
14630         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
14631         `Type' directly, but call ResolveType() on it.
14632         (Catch.Resolve): Likewise.
14633         (Foreach.Resolve): Likewise.
14634
14635 2004-10-18  Martin Baulig  <martin@ximian.com>
14636
14637         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
14638         `Type' directly, but call ResolveType() on it.
14639         (Probe.DoResolve): Likewise.
14640         (ArrayCreation.LookupType): Likewise.
14641         (TypeOf.DoResolve): Likewise.
14642         (SizeOf.DoResolve): Likewise.
14643
14644 2004-10-18  Martin Baulig  <martin@ximian.com>
14645
14646         * expression.cs (Invocation.BetterFunction): Put back
14647         TypeManager.TypeToCoreType().
14648
14649 2004-10-18  Raja R Harinath  <rharinath@novell.com>
14650
14651         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
14652         the ResolveType.
14653
14654 2004-10-18  Martin Baulig  <martin@ximian.com>
14655
14656         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
14657         `Type' directly, but call ResolveType() on it.
14658
14659 2004-10-18  Martin Baulig  <martin@ximian.com>
14660
14661         * class.cs (FieldMember.Define): Don't access the TypeExpr's
14662         `Type' directly, but call ResolveType() on it.
14663         (MemberBase.DoDefine): Likewise.
14664
14665         * expression.cs (New.DoResolve): Don't access the TypeExpr's
14666         `Type' directly, but call ResolveType() on it.
14667         (ComposedCast.DoResolveAsTypeStep): Likewise.
14668
14669         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
14670         `Type' directly, but call ResolveType() on it.
14671
14672 2004-10-17  John Luke  <john.luke@gmail.com>
14673
14674         * class.cs (Operator.GetSignatureForError): use CSharpName
14675
14676         * parameter.cs (Parameter.GetSignatureForError): Returns
14677         correct name even if was not defined.
14678
14679 2004-10-13  Raja R Harinath  <rharinath@novell.com>
14680
14681         Fix #65816.
14682         * class.cs (TypeContainer.EmitContext): New property.
14683         (DefineNestedTypes): Create an emitcontext for each part.
14684         (MethodCore.DoDefineParameters): Use container's emitcontext.
14685         Pass type array to InternalParameters.
14686         (MemberBase.DoDefine): Use container's emitcontext.
14687         (FieldMember.Define): Likewise.
14688         (Event.Define): Likewise.
14689         (SetMethod.GetParameterInfo): Change argument to EmitContext.
14690         Pass type array to InternalParameters.
14691         (SetIndexerMethod.GetParameterInfo): Likewise.
14692         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
14693         * delegate.cs (Define): Pass emitcontext to
14694         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
14695         array to InternalParameters.
14696         * expression.cs (ParameterReference.DoResolveBase): Pass
14697         emitcontext to GetParameterInfo.
14698         (ComposedCast.DoResolveAsTypeStep): Remove check on
14699         ec.ResolvingTypeTree.
14700         * parameter.cs (Parameter.Resolve): Change argument to
14701         EmitContext.  Use ResolveAsTypeTerminal.
14702         (Parameter.GetSignature): Change argument to EmitContext.
14703         (Parameters.ComputeSignature): Likewise.
14704         (Parameters.ComputeParameterTypes): Likewise.
14705         (Parameters.GetParameterInfo): Likewise.
14706         (Parameters.ComputeAndDefineParameterTypes): Likewise.
14707         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
14708         * support.cs (InternalParameters..ctor): Remove variant that takes
14709         a DeclSpace.
14710         * typemanager.cs (system_intptr_expr): New.
14711         (InitExpressionTypes): Initialize it.
14712
14713 2004-10-12  Chris Toshok  <toshok@ximian.com>
14714
14715         * cs-parser.jay: fix location for try_statement and catch_clause.
14716
14717 2004-10-11  Martin Baulig  <martin@ximian.com>
14718
14719         * report.cs: Don't make --fatal abort on warnings, we have
14720         -warnaserror for that.
14721
14722 2004-10-07  Raja R Harinath  <rharinath@novell.com>
14723
14724         More DeclSpace.ResolveType avoidance.
14725         * decl.cs (MemberCore.InUnsafe): New property.
14726         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
14727         with newly created EmitContext.
14728         (FieldMember.Define): Likewise.
14729         * delegate.cs (Delegate.Define): Likewise.
14730         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
14731         only if normal name-lookup fails.
14732         (TypeExpr.DoResolve): Enable error-checking.
14733         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
14734         (SizeOf.DoResolve): Likewise.
14735         (ComposedCast.DoResolveAsTypeStep): Likewise.
14736         (StackAlloc.DoResolve): Likewise.
14737         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
14738         (Block.Unsafe): New property.
14739         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
14740         (Unsafe): Set 'unsafe' flag of contained block.
14741         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
14742         (Fixed.Resolve): Likewise.
14743         (Catch.Resolve): Likewise.
14744         (Using.ResolveLocalVariableDecls): Likewise.
14745         (Foreach.Resolve): Likewise.
14746
14747 2004-10-05  John Luke <john.luke@gmail.com>
14748
14749         * cs-parser.jay: add location to error CS0175
14750
14751 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
14752
14753         * ecore.cs (Expression.Constantity): Add support for turning null
14754         into a constant.
14755
14756         * const.cs (Const.Define): Allow constants to be reference types
14757         as long as the value is Null.
14758
14759 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
14760
14761         * namespace.cs (NamespaceEntry.Using): No matter which warning
14762         level is set, check if this namespace name has already been added.
14763
14764 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
14765
14766         * expression.cs: reftype [!=]= null should always use br[true,false].
14767         # 67410
14768
14769 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
14770
14771         Fix #67108
14772         * attribute.cs: Enum conversion moved to 
14773         GetAttributeArgumentExpression to be applied to the all
14774         expressions.
14775
14776 2004-10-01  Raja R Harinath  <rharinath@novell.com>
14777
14778         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
14779         * class.c (TypeContainer.DefineType): Flag error if
14780         base types aren't accessible due to access permissions.
14781         * decl.cs (DeclSpace.ResolveType): Move logic to
14782         Expression.ResolveAsTypeTerminal.
14783         (DeclSpace.ResolveTypeExpr): Thin layer over
14784         Expression.ResolveAsTypeTerminal.
14785         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
14786         Refactor code into NestedAccess.  Use it.
14787         (DeclSpace.NestedAccess): New.
14788         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
14789         argument to silence errors.  Check access permissions.
14790         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
14791         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
14792         (Cast.DoResolve): Likewise.
14793         (New.DoResolve): Likewise.
14794         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
14795         (TypeOf.DoResolve): Likewise.
14796
14797         * expression.cs (Invocation.BetterConversion): Return the Type of
14798         the better conversion.  Implement section 14.4.2.3 more faithfully.
14799         (Invocation.BetterFunction): Make boolean.  Make correspondence to
14800         section 14.4.2.2 explicit.
14801         (Invocation.OverloadResolve): Update.
14802         (Invocation): Remove is_base field.
14803         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
14804         (Invocation.Emit): Likewise.
14805
14806 2004-09-27  Raja R Harinath  <rharinath@novell.com>
14807
14808         * README: Update to changes.
14809
14810 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
14811
14812         * cs-parser.jay: Reverted 642 warning fix.
14813
14814 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14815
14816         Fix bug #66615
14817         * decl.cs (FindMemberWithSameName): Indexer can have more than
14818         1 argument.
14819
14820 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14821
14822         * expression.cs (LocalVariableReference.DoResolveLValue):
14823         Do not report warning 219 for out values.
14824         (EmptyExpression.Null): New member to avoid extra allocations.
14825
14826 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14827
14828         * cs-parser.jay: Fix wrong warning 642 report.
14829
14830         * cs-tokenizer.cs (CheckNextToken): New helper;
14831         Inspect next character if is same as expected.
14832
14833 2004-09-23  Martin Baulig  <martin@ximian.com>
14834
14835         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
14836         (Convert.ImplicitReferenceConversionExists): Likewise.
14837
14838 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14839
14840         * class.cs (Operator.Define): Add error 448 and 559 report.
14841
14842 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
14843
14844         * class.cs (MemberBase.IsTypePermitted): New protected
14845         method for checking error CS0610.
14846
14847 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
14848
14849         * class.cs (TypeContainer.HasExplicitLayout): New property
14850         Returns whether container has StructLayout attribute set Explicit.
14851         (FieldMember): New abstract class for consts and fields.
14852         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
14853         (Field): Reuse FieldMember.
14854
14855         * const.cs (Const): Reuse FieldMember.
14856
14857         * rootcontext.cs: EmitConstants call moved to class.
14858
14859 2004-09-22  Martin Baulig  <martin@ximian.com>
14860
14861         Thanks to Peter Sestoft for this bug report.
14862
14863         * expression.cs (Conditional): If both the `trueExpr' and the
14864         `falseExpr' is a NullLiteral, return a NullLiteral.
14865
14866 2004-09-22  Martin Baulig  <martin@ximian.com>
14867
14868         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
14869         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
14870         for the "get_Current" call.
14871
14872 2004-09-22  Martin Baulig  <martin@ximian.com>
14873
14874         Marek and me just fixed one of our oldest bugs: #28562 :-)
14875
14876         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
14877
14878         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
14879         we're an EnumConstant, just return that.
14880         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
14881         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
14882         to get the value which'll actually be written into the attribute.
14883         However, we have to use GetValue() to access the attribute's value
14884         in the compiler.        
14885
14886 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
14887
14888         * constant.cs (Constant.IsNegative): New abstract property
14889         IsNegative.
14890
14891         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
14892         (StackAlloc.DoResolve): Reused IsNegative.
14893
14894 2004-09-21  Martin Baulig  <martin@ximian.com>
14895
14896         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
14897         if we're used in an iterator, we may be called from different
14898         methods.
14899
14900         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
14901         we actually have an exception block.
14902
14903 2004-09-20  John Luke <jluke@cfl.rr.com>
14904
14905         * class.cs, cs-parser.jay: Improve the error report for 1520:
14906         report the actual line where the error happens, not where the
14907         class was declared.
14908
14909         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
14910         Pass location information that was available elsewhere.
14911
14912 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
14913
14914         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
14915         runtime to delay sign assemblies.
14916
14917 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
14918
14919         * cs-parser.jay: Do not report the stack trace, this is barely
14920         used nowadays.
14921
14922 2004-08-22  John Luke  <john.luke@gmail.com>
14923  
14924         * driver.cs : check that a resource id is not already used
14925         before adding it, report CS1508 if it is, bug #63637
14926
14927 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
14928
14929         * ecore.cs: Removed dead code.
14930
14931 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
14932
14933         * class.cs: Do not report warning CS0067 on the interfaces.
14934
14935 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
14936
14937         * cs-parser.jay: Add error 504 report.
14938
14939 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
14940
14941         * rootcontext.cs: WarningLevel is 4 by default now.
14942
14943         * statement.cs (Fixed.Resolve): Do not null
14944         VariableInfo.
14945
14946 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
14947
14948         Fixed bug #55780
14949         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
14950         deep search when property is not virtual.
14951         (PropertyExpr.ResolveAccessors): Make one call for both
14952         accessors.
14953
14954 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14955
14956         Fixed bug #65766
14957         * statement.cs: Error 152 report constains also location.
14958
14959 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14960
14961         Fixed bug #65766
14962         * const.cs: Explicitly set constant as static.
14963
14964 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14965
14966         Fixed bug #64226
14967         * cs-parser.jay: Add error 1017 report.
14968
14969 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14970
14971         Fixed bug #59980, #64224
14972         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
14973
14974         * typemanager.cs (IsSpecialMethod): Simplified
14975
14976 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
14977
14978         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
14979         condition with better params.
14980
14981 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
14982
14983         Fixed bug #65238
14984         * attribute.cs (Resolve): Property has to have both
14985         accessors.
14986
14987 2004-09-14  Martin Baulig  <martin@ximian.com>
14988
14989         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
14990
14991 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
14992
14993         Fixed bug #61902
14994         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
14995         called and is obsolete then this member suppress message
14996         when call is inside next [Obsolete] method or type.
14997
14998         * expression.cs: Use TestObsoleteMethodUsage member.
14999
15000 2004-09-14  Martin Baulig  <martin@ximian.com>
15001
15002         * cs-parser.jay: Sync a bit with the GMCS version.
15003
15004 2004-09-14  Martin Baulig  <martin@ximian.com>
15005
15006         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
15007         (CSharpParser.yacc_verbose_flag): New public field.
15008
15009         * genericparser.cs: Removed.
15010
15011 2004-09-14  Raja R Harinath  <rharinath@novell.com>
15012
15013         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
15014
15015 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
15016
15017         * class.cs (MethodCore.CheckBase): Fix bug #65757.
15018
15019 2004-09-10  Martin Baulig  <martin@ximian.com>
15020
15021         Backported my MemberName changes from GMCS into MCS.
15022
15023         - we are now using a special `MemberName' class instead of using
15024         strings; in GMCS, the `MemberName' also contains the type
15025         arguments.
15026
15027         - changed the grammar rules a bit:
15028           * the old `member_name' is now a `namespace_or_type_name':
15029             The rule is that we use `namespace_or_type_name' everywhere
15030             where we expect either a "member name" (GetEnumerator) or a
15031             "member name" with an explicit interface name
15032             (IEnumerable.GetEnumerator).
15033             In GMCS, the explicit interface name may include type arguments
15034             (IEnumerable<T>.GetEnumerator).
15035           * we use `member_name' instead of just `IDENTIFIER' for
15036             "member names":
15037             The rule is that we use `member_name' wherever a member may
15038             have type parameters in GMCS.       
15039
15040         * decl.cs (MemberName): New public class.
15041         (MemberCore.MemberName): New public readonly field.
15042         (MemberCore.ctor): Take a `MemberName' argument, not a string.
15043         (DeclSpace): Likewise.
15044
15045         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
15046         * enum.cs (Enum.ctor): Likewise.
15047
15048         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
15049         MemberName.     
15050         (AliasEntry.ctor): Take a MemberName, not an Expression.
15051         (AliasEntry.UsingAlias): Likewise.
15052
15053         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
15054         (IMethodData.MemberName): Changed type from string to MemberName.
15055         (MemberBase.ExplicitInterfaceName): Likewise.
15056         (AbstractPropertyEventMethod.SetupName): Make this private.
15057         (AbstractPropertyEventMethod.ctor): Added `string prefix'
15058         argument; compute the member name here.
15059         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
15060         on the `member.MemberName' and the `prefix'.
15061
15062         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
15063         not `type_name'.
15064         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
15065         thus, we get a `MemberName' instead of a `string'.  These
15066         declarations may have type parameters in GMCS.
15067         (interface_method_declaration, delegate_declaration): Likewise.
15068         (class_declaration, interface_declaration): Likewise.
15069         (method_header): Use `namespace_or_type_name' instead of
15070         `member_name'.  We may be an explicit interface implementation.
15071         (property_declaration, event_declaration): Likewise.
15072         (member_name): This is now just an `IDENTIFIER', not a
15073         `namespace_or_type_name'.
15074         (type_name, interface_type): Removed.
15075         (namespace_or_type_name): Return a MemberName, not an Expression.
15076         (primary_expression): Use `member_name' instead of `IDENTIFIER';
15077         call GetTypeExpression() on the MemberName to get an expression.
15078         (IndexerDeclaration.interface_type): Changed type from string to
15079         MemberName.
15080         (MakeName): Operate on MemberName's instead of string's.
15081
15082 2004-09-13  Raja R Harinath  <rharinath@novell.com>
15083
15084         Fix bug #55770.
15085         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
15086         (NamespaceEntry.Lookup): Add new argument to flag if we want the
15087         lookup to avoid symbols introduced by 'using'.
15088         * rootcontext.cs (NamespaceLookup): Update.
15089
15090 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
15091
15092         * class.cs (TypeContainer.DoDefineMembers): Do not call
15093         DefineDefaultConstructor for static classes.
15094
15095 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
15096
15097         * attribute.cs (Attribute.Resolve): Add error 653 report.
15098
15099         * class.cs (Class.ApplyAttributeBuilder): Add error 641
15100         report.
15101         (Method.ApplyAttributeBuilder): Add error 685 report.
15102         (Operator.Define): Add error 564 report.
15103
15104         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
15105
15106         * expression.cs (Invocation.DoResolve): Add error
15107         245 and 250 report.
15108
15109         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
15110         error 674 report.
15111
15112 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15113
15114         * class.cs (ConstructorInitializer.Resolve):
15115         Wrong error number (515->516).
15116
15117 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15118
15119         * class.cs (Indexer.Define): Add error 631 report.
15120
15121 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15122
15123         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
15124
15125 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15126
15127         * expression.cs (Probe.DoResolve): Add error CS0241 report.
15128
15129 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
15130
15131         * cs-parser.jay: Added error CS0241 report.
15132
15133 2004-09-10  Raja R Harinath  <rharinath@novell.com>
15134
15135         * cs-parser.jay (fixed_statement): Introduce a scope for the
15136         declaration in the 'fixed' statement.
15137
15138 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15139
15140         * cs-parser.jay: Added CS0230 error report.
15141
15142 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15143
15144         * cs-parser.jay: Added errors CS0231 and CS0257 report.
15145
15146 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15147
15148         * expression.cs (Argument.Resolve): Added error CS0192 and
15149         CS0199 report.
15150
15151 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15152
15153         C# 2.0 #pragma warning feature
15154
15155         * cs-tokenizer.cs (PreProcessPragma): New method; 
15156         Handles #pragma directive.
15157
15158         * report.cs (WarningRegions): New class; Support
15159         class for #pragma warning directive. It tests whether
15160         warning is enabled for a given line.
15161
15162 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
15163
15164         * const.cs: Add more descriptive error report, tahnks to
15165         Sebastien. 
15166
15167 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
15168
15169         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
15170
15171 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
15172
15173         * expression.cs: Apply patch from Ben: Remove dead code from
15174         ArrayCreation, and remove the TurnintoConstant call in const.cs,
15175         as that code just threw an exception anwyays.
15176
15177         * const.cs: Remove the call to the turnintoconstant, for details
15178         see bug: #63144
15179         
15180         * literal.cs: The type of the null-literal is the null type;  So
15181         we use a placeholder type (literal.cs:System.Null, defined here)
15182         for it.
15183
15184         * expression.cs (Conditional.DoResolve): Remove some old code that
15185         is no longer needed, conversions have been fixed.
15186
15187         (ArrayCreationExpression.DoResolve): Return false if we fail to
15188         resolve the inner expression.
15189
15190 2004-09-07  Raja R Harinath  <rharinath@novell.com>
15191
15192         Fix test-290.cs.
15193         * cs-parser.jay (delegate_declaration): Record a delegate
15194         declaration as a type declaration.
15195         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
15196
15197 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
15198
15199         * parameter.cs: Do not crash if the type can not be resolved. 
15200
15201         * expression.cs: Report errors with unsafe pointers, fixes #64896
15202
15203 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
15204
15205         * expression.cs: Pointer arith always needs to do a conv.i
15206         if the operand is a long. fix 65320
15207
15208 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
15209
15210         Fixed cs0619-37.cs, cs0619-38.cs
15211
15212         * enum.cs (GetObsoleteAttribute): Removed.
15213
15214         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
15215         on Enum member is double staged. The first is tested member
15216         and then enum.
15217
15218 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
15219
15220         Fixed #56986, #63631, #65231
15221
15222         * class.cs: (TypeContainer.AddToMemberContainer): New method,
15223         adds member to name container.
15224         (TypeContainer.AddToTypeContainer): New method, adds type to
15225         name container.
15226         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
15227         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
15228         AddOperator): Simplified by reusing AddToMemberContainer.
15229         (TypeContainer.UserDefinedStaticConstructor): Changed to property
15230         instead of field.
15231         (Method.CheckForDuplications): Fixed implementation to test all
15232         possibilities.
15233         (MemberBase): Detection whether member is explicit interface
15234         implementation is now in constructor.
15235         (MemberBase.UpdateMemberName): Handles IndexerName.
15236         (Accessor): Changed to keep also location information.
15237         (AbstractPropertyEventMethod): Is derived from MemberCore.
15238         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
15239         will be emited or not.
15240         (PropertyBase.AreAccessorsDuplicateImplementation):
15241         Tests whether accessors are not in collision with some method.
15242         (Operator): Is derived from MethodCore to simplify common
15243         operations.
15244
15245         * decl.cs (Flags.TestMethodDuplication): Test for duplication
15246         must be performed.
15247         (DeclSpace.AddToContainer): Adds the member to defined_names
15248         table. It tests for duplications and enclosing name conflicts.
15249
15250         * enum.cs (EnumMember): Clean up to reuse the base structures
15251
15252 2004-09-03  Martin Baulig  <martin@ximian.com>
15253
15254         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
15255         into TypeContainer, to make partial classes work again.
15256
15257 2004-09-03  Martin Baulig  <martin@ximian.com>
15258
15259         * rootcontext.cs (RootContext.V2): Removed.
15260
15261 2004-03-23  Martin Baulig  <martin@ximian.com>
15262
15263         * expression.cs (Invocation.OverloadResolve): Added `bool
15264         may_fail' argument and use it instead of the Location.IsNull() hack.
15265
15266 2004-09-03  Martin Baulig  <martin@ximian.com>
15267
15268         Merged latest changes into gmcs.  Please keep this comment in
15269         here, it makes it easier for me to see what changed in MCS since
15270         the last time I merged.
15271
15272 2004-09-03  Raja R Harinath  <rharinath@novell.com>
15273
15274         Fix #61128.
15275         * expression.cs (BetterConversion): Don't allow either conversion 
15276         to be null.  Remove redundant implicit conversion test when 'q ==
15277         null' -- when this function is invoked, we already know that the
15278         implicit conversion exists.
15279         (BetterFunction): Assume that 'best' is non-null.  Remove
15280         redundant reimplementation of IsApplicable when 'best' is null.
15281         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
15282         number of arguments.
15283         (IsAncestralType): Extract from OverloadResolve.
15284         (OverloadResolve): Make robust to the MethodGroupExpr being
15285         unsorted.  Implement all the logic of Section 14.5.5.1, and
15286         support overloading of methods from multiple applicable types.
15287         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
15288
15289         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
15290         (RealError, Warning): Append type of report to related symbol.
15291
15292 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
15293
15294         * enum.cs: Fixed CLS-Compliance checks for enum members.
15295         Error tests cs3008-8.cs, cs3014-8.cs
15296
15297 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
15298
15299         Fixed bug #62342, #63102
15300         * class.cs: ImplementIndexer uses member.IsExplicitImpl
15301         like ImplementMethod.
15302
15303 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
15304
15305         * attribute.cs (Attribute.GetAttributeArgumentExpression):
15306         Fixed bug #65170.
15307
15308 2004-09-02  Martin Baulig  <martin@ximian.com>
15309
15310         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
15311         TypeManager.GetArgumentTypes() rather than calling GetParameters()
15312         on the MethodBase.
15313
15314 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
15315
15316         C# 2.0 Static classes implemented
15317
15318         * class.cs (TypeContainer): instance_constructors,
15319         initialized_fields, initialized_static_fields,
15320         default_constructor, base_inteface_types are protected to be
15321         accessible from StaticClass.
15322         (TypeContainer.DefineDefaultConstructor): New virtual method
15323         for custom default constructor generating
15324         (StaticClass): New class to handle "Static classes" feature.
15325
15326         * cs-parser.jay: Handle static keyword on class like instance
15327         of StaticClass.
15328
15329         * driver.cs: Added "/langversion" command line switch with two
15330         options (iso-1, default).
15331
15332 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
15333
15334         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
15335
15336 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
15337
15338         * delegate.cs: Style.
15339
15340 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
15341
15342         * delegate.cs: Add seperate instance expr field for miguel.
15343
15344 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15345
15346         * PointerArithmetic (Resolve): make sure we are not doing
15347         pointer arith on void*. Also, make sure we are resolved
15348         by not setting eclass until resolve.
15349
15350         All callers: Make sure that PointerArithmetic gets resolved.
15351
15352 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15353
15354         * ArrayCreation (LookupType): If the type does not resolve 
15355         to an array, give an error.
15356
15357 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
15358
15359         * statement.cs (Try.Resolve): Fixed bug #64222
15360
15361 2004-08-27  Martin Baulig  <martin@ximian.com>
15362
15363         * class.cs
15364         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
15365         crash here.     
15366
15367 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
15368
15369         * ecore.cs (Constantify): Get underlying type via
15370         System.Enum.GetUnderlyingType to avoid StackOverflow on the
15371         Windows in special cases.
15372
15373 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
15374
15375         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
15376         for obtaining also private methods.
15377         (GetRemoveMethod): Used GetRemoveMethod (true)
15378         for obtaining also private methods.
15379
15380 2004-08-24  Martin Baulig  <martin@ximian.com>
15381
15382         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
15383         MethodAttributes.HideBySig for operators.
15384
15385 2004-08-23  Martin Baulig  <martin@ximian.com>
15386
15387         Back to the old error reporting system :-)
15388
15389         * report.cs (Message): Removed.
15390         (Report.MessageData, ErrorData, WarningData): Removed.
15391         (Report.Error, Warning): Back to the old system.
15392
15393 2004-08-23  Martin Baulig  <martin@ximian.com>
15394
15395         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
15396
15397         * class.cs (TypeContainer.ParentContainer): New public virtual
15398         method; replaces the explicit interface implementation.
15399         (ClassPart.ParentContainer): Override.
15400
15401 2004-08-23  Martin Baulig  <martin@ximian.com>
15402
15403         * statement.cs (Switch): Added support for constant switches; see
15404         #59428 or test-285.cs.
15405
15406 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
15407
15408         Fixed bug #62740.
15409         * statement.cs (GetEnumeratorFilter): Removed useless
15410         logic because C# specs is strict. GetEnumerator must be
15411         public.
15412
15413 2004-08-22  Martin Baulig  <martin@ximian.com>
15414
15415         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15416         a switch and may break, reset the barrier.  Fixes #59867.
15417
15418 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
15419
15420         CLS-Compliance speed up (~5% for corlib)
15421
15422         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
15423         New method. Tests container for CLS-Compliant names
15424
15425         * class.cs (TypeContainer.VerifyClsName): New method.
15426         Checks whether container name is CLS Compliant.
15427         (Constructor): Implements IMethodData.
15428
15429         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
15430         low-case table for CLS Compliance test.
15431         (MemberCache.VerifyClsParameterConflict): New method.
15432         Checks method parameters for CS3006 error.
15433
15434         * enum.cs (EnumMember): Is derived from MemberCore.
15435         (Enum.VerifyClsName): Optimized for better performance.
15436
15437 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
15438
15439         * report.cs: Renamed Error_T to Error and changed all
15440         references.
15441
15442 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
15443
15444         * class.cs (TypeContainer.IndexerArrayList): New inner class
15445         container for indexers.
15446         (TypeContainer.DefaultIndexerName): New constant for default
15447         indexer name. Replaced all "Item" with this constant.
15448         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
15449
15450         * typemanager.cs (TypeManager.default_member_ctor): Cache here
15451         DefaultMemberAttribute constructor.
15452
15453 2004-08-05  Martin Baulig  <martin@ximian.com>
15454
15455         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
15456         Fix bug #59429.
15457
15458 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
15459
15460         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
15461         multi platforms problem.
15462
15463         * compiler.csproj: Included shared files.
15464
15465 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
15466
15467         Fix bug 60333, 55971 in the more general way
15468         * attribute.cs (Attribute.GetAttributeArgumentExpression):
15469         Added arg_type argument for constant conversion.
15470         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
15471
15472 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
15473
15474         Fix bug #59760
15475         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
15476         OperatorArrayList, MethodCoreArrayList for typecontainer
15477         containers. Changed class member types to these new types.
15478         (MethodArrayList.DefineMembers): Added test for CS0659.
15479
15480 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
15481
15482         * cfold.cs: Synchronize the folding with the code in expression.cs
15483         Binary.DoNumericPromotions for uint operands.
15484
15485         * attribute.cs: Revert patch from Raja, it introduced a regression
15486         while building Blam-1.2.1 (hard to isolate a test case).
15487
15488 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
15489
15490         Fix for #55382
15491         * class.cs:
15492         (TypeContainer.Define): Renamed to DefineContainerMembers because of
15493         name collision.
15494         (MethodCore.parent_method): New member. The method we're overriding
15495         if this is an override method.
15496         (MethodCore.CheckBase): Moved from Method class and made common.
15497         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
15498         private.
15499         (MethodCore.CheckForDuplications): New abstract method. For custom
15500         member duplication search in a container
15501         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
15502         method and its return type.
15503         (Event.conflict_symbol): New member. Symbol with same name in the
15504         parent class.
15505
15506         * decl.cs:
15507         (MemberCache.FindMemberWithSameName): New method. The method
15508         is looking for conflict with inherited symbols.
15509
15510 2004-08-04  Martin Baulig  <martin@ximian.com>
15511
15512         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
15513
15514         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
15515
15516 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
15517
15518         * report.cs (Message): New enum for better error, warning reference in
15519         the code.
15520         (MessageData): New inner abstract class. It generally handles printing of
15521         error and warning messages.
15522         Removed unused Error, Warning, Message methods.
15523
15524 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
15525
15526         Fix for cs0592-8.cs test
15527         * attribute.cs
15528         (Attributable.ValidAttributeTargets): Made public.
15529         (Attribute.ExplicitTarget): New member for explicit target value.
15530         (Attribute.CheckTargets): Now we translate explicit attribute
15531         target to Target here.
15532
15533 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
15534
15535         * ecore.cs (MethodGroupExpr): new IsBase property.
15536
15537         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
15538
15539         * delegate.cs (DelegateCreation): store a MethodGroupExpr
15540         rather than an instance expr.
15541
15542         (DelegateCreation.Emit): Use the method group rather than
15543         the instance expression. Also, if you have base.Foo as the
15544         method for a delegate, make sure to emit ldftn, not ldftnvirt.
15545
15546         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
15547
15548         (NewDelegate.DoResolve): Only check for the existance of Invoke
15549         if the method is going to be needed. Use MethodGroupExpr.
15550
15551         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
15552
15553         * expression.cs: For pointer arith., make sure to use
15554         the size of the type, not the size of the pointer to
15555         the type.
15556
15557 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
15558
15559         Fix for #60722
15560         * class.cs (Class): Added error CS0502 test.
15561
15562 2004-08-03  John Luke  <jluke@cfl.rr.com>
15563             Raja R Harinath  <rharinath@novell.com>
15564
15565         Fix for #60997.
15566         * attribute.cs (Attribute.complained_before): New flag.
15567         (Attribute.ResolveType, Attribute.Resolve),
15568         (Attribute.DefinePInvokeMethod): Set it.
15569         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
15570         
15571 2004-08-03  Martin Baulig  <martin@ximian.com>
15572
15573         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
15574         use a user-defined operator; we still need to do numeric
15575         promotions in case one argument is a builtin type and the other
15576         one has an implicit conversion to that type.  Fixes #62322.
15577
15578 2004-08-02  Martin Baulig  <martin@ximian.com>
15579
15580         * statement.cs (LocalInfo.Flags): Added `IsThis'.
15581         (LocalInfo.IsThis): New public property.
15582         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
15583
15584 2004-08-01  Martin Baulig  <martin@ximian.com>
15585
15586         * class.cs (TypeContainer.GetClassBases): Don't set the default
15587         here since we may get called from GetPartialBases().
15588         (TypeContainer.DefineType): If GetClassBases() didn't return a
15589         parent, use the default one.
15590
15591 2004-07-30  Duncan Mak  <duncan@ximian.com>
15592
15593         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
15594
15595 2004-07-30  Martin Baulig  <martin@ximian.com>
15596
15597         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
15598
15599         * class.cs (SourceMethod): New public class, derive from the
15600         symbol writer's ISourceMethod.
15601         (Method): Use the new symbol writer API.
15602
15603         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
15604         as argument and use the new symbol writer.
15605
15606         * location.cs
15607         (SourceFile): Implement the symbol writer's ISourceFile.
15608         (Location.SymbolDocument): Removed.
15609         (Location.SourceFile): New public property.
15610
15611         * symbolwriter.cs: Use the new symbol writer API.
15612
15613 2004-07-30  Raja R Harinath  <rharinath@novell.com>
15614
15615         * Makefile (install-local): Remove.  Functionality moved to
15616         executable.make.
15617
15618 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
15619
15620         * Makefile: Install mcs.exe.config file together with mcs.exe.
15621         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
15622         correct runtime version.
15623         
15624 2004-07-25  Martin Baulig  <martin@ximian.com>
15625
15626         * class.cs
15627         (TypeContainer.RegisterOrder): Removed, this was unused.
15628         (TypeContainer, interface_order): Removed.
15629         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
15630         TypeContainer as argument since we can also be called with a
15631         `PartialContainer' for a partial class/struct/interface.
15632         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
15633         of checking whether we're an `Interface' - we could be a
15634         `PartialContainer'.
15635         (PartialContainer.Register): Override; call
15636         AddClass()/AddStruct()/AddInterface() on our parent.
15637
15638         * cs-parser.jay (interface_member_declaration): Add things to the
15639         `current_container', not the `current_class'.
15640
15641         * rootcontext.cs (RegisterOrder): The overloaded version which
15642         takes an `Interface' was unused, removed.
15643
15644         * typemanager.cs (TypeManager.LookupInterface): Return a
15645         `TypeContainer', not an `Interface'.
15646         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
15647         contain a `PartialContainer' for an interface, so check it's
15648         `Kind' to figure out what it is.
15649
15650 2004-07-25  Martin Baulig  <martin@ximian.com>
15651
15652         * class.cs (Class.DefaultTypeAttributes): New public constant.
15653         (Struct.DefaultTypeAttributes): Likewise.
15654         (Interface.DefaultTypeAttributes): Likewise.
15655         (PartialContainer.TypeAttr): Override this and add the
15656         DefaultTypeAttributes.
15657
15658 2004-07-25  Martin Baulig  <martin@ximian.com>
15659
15660         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
15661         we can just use the `Parent' field instead.
15662
15663 2004-07-25  Martin Baulig  <martin@ximian.com>
15664
15665         * class.cs (TypeContainer.Emit): Renamed to EmitType().
15666
15667 2004-07-25  Martin Baulig  <martin@ximian.com>
15668
15669         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
15670         our parts before defining any methods.
15671         (TypeContainer.VerifyImplements): Make this virtual.
15672         (ClassPart.VerifyImplements): Override and call VerifyImplements()
15673         on our PartialContainer.
15674
15675 2004-07-25  Martin Baulig  <martin@ximian.com>
15676
15677         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
15678
15679         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
15680         argument, we can just use the `Parent' field instead.
15681
15682         * class.cs
15683         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
15684         (MemberBase.DoDefine): Likewise.
15685
15686 2004-07-24  Martin Baulig  <martin@ximian.com>
15687
15688         * decl.cs (MemberCore.Parent): New public field.
15689         (DeclSpace.Parent): Moved to MemberCore.
15690
15691         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
15692         (MemberBase.ctor): Added TypeContainer argument, pass it to our
15693         parent's .ctor.
15694         (FieldBase, Field, Operator): Likewise.
15695         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
15696         (EventField, Event): Likewise.
15697
15698 2004-07-23  Martin Baulig  <martin@ximian.com>
15699
15700         * class.cs (PartialContainer): New public class.
15701         (ClassPart): New public class.
15702         (TypeContainer): Added support for partial classes.
15703         (TypeContainer.GetClassBases): Splitted some of the functionality
15704         out into GetNormalBases() and GetPartialBases().
15705
15706         * cs-tokenizer.cs (Token.PARTIAL): New token.
15707         (Tokenizer.consume_identifier): Added some hacks to recognize
15708         `partial', but only if it's immediately followed by `class',
15709         `struct' or `interface'.
15710
15711         * cs-parser.jay: Added support for partial clases.
15712
15713 2004-07-23  Martin Baulig  <martin@ximian.com>
15714
15715         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
15716         a `DeclSpace' and also made it readonly.
15717         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
15718         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
15719         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
15720
15721         * cs-parser.jay: Pass the `current_class', not the
15722         `current_container' (at the moment, this is still the same thing)
15723         to a new Method, Property, Event, Indexer or Constructor.
15724
15725 2004-07-23  Martin Baulig  <martin@ximian.com>
15726
15727         * cs-parser.jay (CSharpParser): Added a new `current_class' field
15728         and removed the `current_interface' one.
15729         (struct_declaration, class_declaration, interface_declaration):
15730         Set `current_class' to the newly created class/struct/interface;
15731         set their `Bases' and call Register() before parsing their body.
15732
15733 2004-07-23  Martin Baulig  <martin@ximian.com>
15734
15735         * class.cs (Kind): New public enum.
15736         (TypeContainer): Made this class abstract.
15737         (TypeContainer.Kind): New public readonly field.
15738         (TypeContainer.CheckDef): New public method; moved here from
15739         cs-parser.jay.
15740         (TypeContainer.Register): New public abstract method.
15741         (TypeContainer.GetPendingImplementations): New public abstract
15742         method.
15743         (TypeContainer.GetClassBases): Removed the `is_class' and
15744         `is_iface' parameters.
15745         (TypeContainer.DefineNestedTypes): Formerly known as
15746         DoDefineType().
15747         (ClassOrStruct): Made this class abstract.
15748
15749         * tree.cs (RootTypes): New public type. 
15750
15751 2004-07-20  Martin Baulig  <martin@ximian.com>
15752
15753         * tree.cs (Tree.RecordNamespace): Removed.
15754         (Tree.Namespaces): Removed.
15755
15756         * rootcontext.cs (RootContext.IsNamespace): Removed.
15757
15758         * cs-parser.jay (namespace_declaration): Just create a new
15759         NamespaceEntry here.
15760
15761 2004-07-20  Martin Baulig  <martin@ximian.com>
15762
15763         * statement.cs (ExceptionStatement): New abstract class.  This is
15764         now used as a base class for everyone who's using `finally'.
15765         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
15766         our local variables before using them.
15767
15768         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
15769         virtual method.  This is used by Yield.Resolve() to "steal" an
15770         outer block's `finally' clauses.
15771         (FlowBranchingException): The .ctor now takes an ExceptionStatement
15772         argument.
15773
15774         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
15775         version which takes an ExceptionStatement.  This version must be
15776         used to create exception branchings.
15777
15778         * iterator.cs
15779         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
15780         (Iterator.EmitMoveNext): Added exception support; protect the
15781         block with a `fault' clause, properly handle 'finally' clauses.
15782         (Iterator.EmitDispose): Run all the `finally' clauses here.
15783
15784 2004-07-20  Martin Baulig  <martin@ximian.com>
15785
15786         * iterator.cs: This is the first of a set of changes in the
15787         iterator code.  Match the spec more closely: if we're an
15788         IEnumerable, then GetEnumerator() must be called.  The first time
15789         GetEnumerator() is called, it returns the current instance; all
15790         subsequent invocations (if any) must create a copy.
15791
15792 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
15793
15794         * expression.cs: Resolve the constant expression before returning
15795         it. 
15796
15797 2004-07-19  Martin Baulig  <martin@ximian.com>
15798
15799         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
15800         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
15801         the return type of the new EmitContext.
15802
15803 2004-07-18  Martin Baulig  <martin@ximian.com>
15804
15805         * class.cs (Property.Define): Fix iterators.
15806
15807         * iterators.cs (Iterator.Define): Moved the
15808         `container.AddInterator (this)' call here from the .ctor; only do
15809         it if we resolved successfully.
15810
15811 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
15812
15813         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
15814         `true' for preprocessing directives that we parse.  The return
15815         value indicates whether we should return to regular tokenizing or
15816         not, not whether it was parsed successfully.
15817
15818         In the past if we were in: #if false ... #line #endif, we would
15819         resume parsing after `#line'.  See bug 61604.
15820
15821         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
15822         building: IsEnumType should return true only for enums, not for
15823         enums or System.Enum itself.  This fixes #61593.
15824
15825         Likely what happened is that corlib was wrong: mcs depended on
15826         this bug in some places.  The bug got fixed, we had to add the
15827         hack, which caused bug 61593.
15828
15829         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
15830         that was a workaround for the older conditions.
15831
15832 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
15833
15834         * assign.cs: IAssignMethod has a new interface, as documented
15835         inline. All assignment code now uses this new api.
15836
15837         * ecore.cs, expression.cs: All classes which implement
15838         IAssignMethod now use the new interface.
15839
15840         * expression.cs (Invocation): add a hack to EmitCall so that
15841         IndexerAccess can be the target of a compound assignment without
15842         evaluating its arguments twice.
15843
15844         * statement.cs: Handle changes in Invocation api.
15845
15846 2004-07-16  Martin Baulig  <martin@ximian.com>
15847
15848         * iterators.cs: Rewrote this.  We're now using one single Proxy
15849         class for both the IEnumerable and the IEnumerator interface and
15850         `Iterator' derives from Class so we can use the high-level API.
15851
15852         * class.cs (TypeContainer.AddIterator): New method.
15853         (TypeContainer.DoDefineType): New protected virtual method, which
15854         is called from DefineType().
15855         (TypeContainer.DoDefineMembers): Call DefineType() and
15856         DefineMembers() on all our iterators.
15857         (TypeContainer.Emit): Call Emit() on all our iterators.
15858         (TypeContainer.CloseType): Call CloseType() on all our iterators.
15859
15860         * codegen.cs (EmitContext.CurrentIterator): New public field.
15861
15862 2004-07-15  Martin Baulig  <martin@ximian.com>
15863
15864         * typemanager.cs
15865         (TypeManager.not_supported_exception_type): New type.   
15866
15867 2004-07-14  Martin Baulig  <martin@ximian.com>
15868
15869         * iterators.cs: Use real error numbers.
15870
15871 2004-07-14  Martin Baulig  <martin@ximian.com>
15872
15873         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
15874         requires this to be a System.Collection.IEnumerable and not a
15875         class implementing that interface.
15876         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
15877
15878 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
15879
15880         * class.cs: Fixed previous fix, it broke some error tests.
15881
15882 2004-07-12  Martin Baulig  <martin@ximian.com>
15883
15884         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
15885         Fixes #61293.
15886
15887 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
15888
15889         * assign.cs (LocalTemporary): Add new argument: is_address,If
15890         `is_address' is true, then the value that we store is the address
15891         to the real value, and not the value itself.
15892         
15893         * ecore.cs (PropertyExpr): use the new local temporary
15894         stuff to allow us to handle X.Y += z (where X is a struct)
15895
15896 2004-07-08  Martin Baulig  <martin@ximian.com>
15897
15898         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
15899         not always return, just like we're doing in Using.Resolve().
15900
15901 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
15902
15903         * cs-parser.jay (fixed_statement): flag this as Pinned.
15904
15905 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
15906
15907         * typemanager.cs (TypeManager): Removed MakePinned method, this
15908         mechanism is replaced with the .NET 2.x compatible mechanism of
15909         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
15910
15911         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
15912         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
15913         `IsFixed' property which has a different meaning.
15914
15915 2004-07-02  Raja R Harinath  <rharinath@novell.com>
15916
15917         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
15918         visible from inside a nested class, not just the names of the
15919         immediately enclosing class.
15920         Fix for bug #60730.
15921
15922 2004-06-24  Raja R Harinath  <rharinath@novell.com>
15923
15924         * expression.cs (BetterConversion): Remove buggy special-case
15925         handling of "implicit constant expression conversions".  At this
15926         point, we already know that the conversion is possible -- we're
15927         only checking to see which is better.
15928
15929 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15930
15931         * cs-parser.jay: Added error CS0210 test.
15932
15933 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15934
15935         * cs-parser.jay: Added error CS0134 test.
15936
15937 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15938
15939         Fix bug #52507
15940         * cs-parser.jay: Added error CS0145 test.
15941
15942 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15943
15944         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
15945
15946 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
15947         
15948         * expression.cs (StackAlloc.Resolve): The argument may not
15949         be a constant; deal with this case.
15950         
15951 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
15952
15953         * attribute.cs (IndexerName_GetIndexerName): Renamed to
15954         GetIndexerAttributeValue.
15955         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
15956
15957         * class.cs (Indexer.Define): Added error tests for CS0415,
15958         CS0609.
15959
15960 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
15961
15962         * attribute.cs (Attribute.Resolve): Keep field code in sync with
15963         property code.
15964
15965 2004-06-23  Martin Baulig  <martin@ximian.com>
15966
15967         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
15968         neither return nor throw, reset the barrier as well.  Fixes #60457.
15969
15970 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
15971
15972         * class.cs : EventAttributes is now set to None by default.
15973           This fixes bug #60459.
15974
15975 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
15976
15977         Fix bug #60219
15978         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
15979         Don't throw exception but return null (it's sufficient now).
15980
15981 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
15982
15983         * typemanager.cs (GetArgumentTypes): Faster implementation.
15984
15985 2004-06-18  Martin Baulig  <martin@ximian.com>
15986
15987         * attribute.cs (Attribute.Resolve): Check whether we're an
15988         EmptyCast which a Constant child.  Fixes #60333.
15989
15990 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
15991
15992         * statement.cs (EmitCollectionForeach): Account for the fact that
15993         not all valuetypes are in areas which we can take the address of.
15994         For these variables, we store to a temporary variable. Also, make
15995         sure that we dont emit a `callvirt' on a valuetype method.
15996
15997 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
15998
15999         * expression.cs (StackAlloc.DoReSolve): Added test for
16000         negative parameter (CS0247).
16001
16002 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
16003
16004         Fix bug #59792
16005         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
16006
16007 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
16008
16009         Fix bug #59781
16010         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
16011         ulong.
16012
16013 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
16014
16015         Fix bug #58254 & cs1555.cs, cs1556.cs
16016         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
16017
16018 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
16019
16020         * cs-parser.jay: Added error CS1669 test for indexers.
16021
16022 2004-06-11  Martin Baulig  <martin@ximian.com>
16023
16024         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
16025         call this twice: for params and varargs methods.
16026
16027 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16028
16029         * class.cs:
16030         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
16031
16032 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16033
16034         * attribute.cs (Attribute.GetValidTargets): Made public.
16035
16036         * class.cs: 
16037         (AbstractPropertyEventMethod): New class for better code sharing.
16038         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
16039         CS1667 report.
16040         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
16041
16042 2004-06-11  Raja R Harinath  <rharinath@novell.com>
16043
16044         Fix bug #59477.
16045         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
16046         that the call to Resolve is part of a MemberAccess.
16047         (Expression.Resolve): Use it for SimpleName resolution.
16048         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
16049         Add 'intermediate' boolean argument.
16050         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
16051         error message when the SimpleName can be resolved ambiguously
16052         between an expression and a type.
16053         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
16054         public.
16055         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
16056         call on the left-side.
16057
16058 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16059
16060         * class.cs:
16061         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
16062
16063 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16064
16065         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
16066
16067 2004-06-11  Martin Baulig  <martin@ximian.com>
16068
16069         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
16070         varargs methods if applicable.
16071
16072 2004-06-11  Martin Baulig  <martin@ximian.com>
16073
16074         * expression.cs (Invocation.EmitCall): Don't use
16075         `method.CallingConvention == CallingConventions.VarArgs' since the
16076         method could also have `CallingConventions.HasThis'.
16077
16078 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16079
16080         * class.cs (Event.GetSignatureForError): Implemented.
16081         Fixed crash in error test cs3010.cs
16082
16083 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
16084
16085         * cs-tokenizer.cs: Change the way we track __arglist to be
16086         consistent with the other keywords.
16087
16088 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
16089
16090         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
16091         tomorrow.
16092
16093 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
16094
16095         * codegen.cs: Check that all referenced assemblies have a strongname
16096         before strongnaming the compiled assembly. If not report error CS1577.
16097         Fix bug #56563. Patch by Jackson Harper.
16098         * typemanager.cs: Added a method to return all referenced assemblies.
16099         Fix bug #56563. Patch by Jackson Harper.
16100
16101 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
16102
16103         * class.cs:
16104         (Method.ApplyAttributeBuilder): Moved and added conditional
16105         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
16106
16107         * delegate.cs:
16108         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
16109
16110 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
16111
16112         Fixed #59640
16113         * class.cs: (EventField.attribute_targets): Changed default target.
16114
16115 2004-06-08  Martin Baulig  <martin@ximian.com>
16116
16117         * expression.cs (Invocation.EmitCall): Enable varargs methods.
16118
16119 2004-06-08  Martin Baulig  <martin@ximian.com>
16120
16121         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
16122
16123 2004-06-07  Martin Baulig  <martin@ximian.com>
16124
16125         Added support for varargs methods.
16126
16127         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
16128         keyword.
16129
16130         * cs-parser.jay: Added support for `__arglist'.
16131
16132         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
16133
16134         * expression.cs (Argument.AType): Added `ArgList'.
16135         (Invocation): Added support for varargs methods.
16136         (ArglistAccess): New public class.
16137         (Arglist): New public class.
16138
16139         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
16140
16141         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
16142         a method's top-level block if the method has varargs.
16143
16144         * support.cs (ReflectionParameters, InternalParameters): Added
16145         support for varargs methods.    
16146
16147 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
16148
16149         * class.cs: Provide location in indexer error report.
16150
16151         * driver.cs: Use standard names.
16152
16153         * namespace.cs: Catch the use of using after a namespace has been
16154         declared also on using aliases.
16155
16156 2004-06-03  Raja R Harinath  <rharinath@novell.com>
16157
16158         Bug #50820.
16159         * typemanager.cs (closure_private_ok, closure_invocation_type)
16160         (closure_qualifier_type, closure_invocation_assembly)
16161         (FilterWithClosure): Move to ...
16162         (Closure): New internal nested class.
16163         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
16164         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
16165         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
16166         (MemberLookup, MemberLookupFailed): Use it.
16167         * expression.cs (New.DoResolve): Treat the lookup for the
16168         constructor as being qualified by the 'new'ed type.
16169         (Indexers.GetIndexersForTypeOrInterface): Update.
16170
16171 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
16172
16173         * attribute.cs
16174         (GetConditionalAttributeValue): New method. Returns
16175         condition of ConditionalAttribute.
16176         (SearchMulti): New method.  Returns all attributes of type 't'.
16177         Use it when attribute is AllowMultiple = true.
16178         (IsConditionalMethodExcluded): New method.
16179
16180         * class.cs
16181         (Method.IsExcluded): Implemented. Returns true if method has conditional
16182         attribute and the conditions is not defined (method is excluded).
16183         (IMethodData): Extended interface for ConditionalAttribute support.
16184         (PropertyMethod.IsExcluded): Implemented.
16185
16186         * decl.cs
16187         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
16188
16189         * expression.cs
16190         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
16191         on the method.
16192
16193 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
16194
16195         * expression.cs (ArrayCreationExpression): Make this just an
16196         `expression'. It can't be a statement, so the code here was
16197         dead.
16198
16199 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
16200
16201         Fixed #59072
16202         * typemanager.cs (GetFullNameSignature): New method for
16203         MethodBase types.
16204
16205 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
16206
16207         Fixed #56452
16208         * class.cs (MemberBase.GetSignatureForError): New virtual method.
16209         Use this method when MethodBuilder is null.
16210         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
16211         Added test for error CS0626 (MONO reports error for this situation).
16212         (IMethodData.GetSignatureForError): Extended interface.
16213
16214 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
16215
16216         * attribute.cs
16217         (AttributeTester.GetObsoleteAttribute): Returns instance of
16218         ObsoleteAttribute when type is obsolete.
16219
16220         * class.cs
16221         (TypeContainer.VerifyObsoleteAttribute): Override.
16222         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
16223         (MethodCode.VerifyObsoleteAttribute): Override.
16224         (MemberBase.VerifyObsoleteAttribute): Override.
16225
16226         * decl.cs
16227         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
16228         and report proper error.
16229
16230         *delegate.cs
16231         Delegate.VerifyObsoleteAttribute): Override.
16232
16233         * ecore.cs
16234         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
16235         and report proper error.
16236         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
16237
16238         * enum.cs
16239         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
16240         and enum member.
16241
16242         * expression.cs
16243         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
16244         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
16245         Added test for ObsoleteAttribute.
16246
16247         * statement.cs
16248         (Catch): Derived from Statement.
16249
16250 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
16251  
16252         Fixed bug #59071 & cs0160.cs
16253  
16254         * statement.cs (Try.Resolve): Check here whether order of catch
16255         clauses matches their dependencies.
16256
16257 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
16258
16259         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
16260         caused a regression: #59343.  Referencing nested classes from an
16261         assembly stopped working.
16262
16263 2004-05-31  Martin Baulig  <martin@ximian.com>
16264
16265         MCS is now frozen for beta 2.
16266
16267 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16268
16269         * convert.cs: add a trivial cache for overload operator resolution.
16270
16271 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16272
16273         * decl.cs: If possible, use lookuptypedirect here. We can only do
16274         this if there is no `.' after the namespace. Avoids using
16275         LookupType, which does lots of slow processing.
16276         (FindNestedType) New method, does what it says :-).
16277         * namespace.cs: use LookupTypeDirect.
16278         * rootcontext.cs: use membercache, if possible.
16279         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
16280
16281 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16282
16283         * expression.cs:
16284         According to the spec, 
16285
16286         In a member access of the form E.I, if E is a single identifier,
16287         and if the meaning of E as a simple-name (§7.5.2) is a constant,
16288         field, property, localvariable, or parameter with the same type as
16289         the meaning of E as a type-name (§3.8), then both possible
16290         meanings of E are permitted.
16291
16292         We did not check that E as a simple-name had the same type as E as
16293         a type name.
16294
16295         This trivial check gives us 5-7% on bootstrap time.
16296
16297 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16298
16299         * expression.cs (Invocation.OverloadResolve): Avoid the
16300         use of hashtables and boxing here by allocating on demand.
16301
16302 2004-05-30  Martin Baulig  <martin@ximian.com>
16303
16304         * rootcontext.cs (RootContext.LookupType): Don't cache things if
16305         we're doing a silent lookup.  Don't try to lookup nested types in
16306         TypeManager.object_type (thanks to Ben Maurer).
16307
16308 2004-05-30  Martin Baulig  <martin@ximian.com>
16309
16310         Committing a patch from Ben Maurer.
16311
16312         * rootcontext.cs (RootContext.LookupType): Cache negative results.
16313
16314 2004-05-29  Martin Baulig  <martin@ximian.com>
16315
16316         * class.cs (IMethodData.ShouldIgnore): New method.
16317
16318         * typemanager.cs (TypeManager.MethodFlags): Don't take a
16319         `Location' argument, we don't need it anywhere.  Use
16320         `IMethodData.ShouldIgnore ()' instead of
16321         `MethodData.GetMethodFlags ()'.
16322         (TypeManager.AddMethod): Removed.
16323         (TypeManager.AddMethod2): Renamed to AddMethod.
16324
16325 2004-05-29  Martin Baulig  <martin@ximian.com>
16326
16327         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
16328
16329         * convert.cs (Convert.ImplicitReferenceConversion): If we're
16330         converting from a class type S to an interface type and we already
16331         have an object on the stack, don't box it again.  Fixes #52578.
16332
16333 2004-05-29  Martin Baulig  <martin@ximian.com>
16334
16335         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16336         Added support for `params' parameters.  Fixes #59267.
16337
16338 2004-05-29  Martin Baulig  <martin@ximian.com>
16339
16340         * literal.cs (NullPointer): Provide a private .ctor which sets
16341         `type' to TypeManager.object_type.  Fixes #59048.
16342
16343 2004-05-29  Martin Baulig  <martin@ximian.com>
16344
16345         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
16346         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
16347
16348         * ecore.cs (EventExpr.instance_expr): Make the field private.
16349
16350 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
16351
16352         Fixed bug #50080 & cs0214-2.cs
16353         * expression.cs (Cast.DoResolve): Check unsafe context here.
16354         
16355         * statement.cs (Resolve.DoResolve): Likewise.
16356
16357 2004-05-26  Martin Baulig  <martin@ximian.com>
16358
16359         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
16360
16361         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
16362         (RootContext.LookupType): Pass down the `silent' flag.
16363
16364 2004-05-25  Martin Baulig  <martin@ximian.com>
16365
16366         * expression.cs
16367         (MethodGroupExpr.IdenticalTypeName): New public property.
16368         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
16369         expression actually refers to a type.
16370
16371 2004-05-25  Martin Baulig  <martin@ximian.com>
16372
16373         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
16374         for #56176 and made it actually work.
16375
16376 2004-05-25  Martin Baulig  <martin@ximian.com>
16377
16378         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
16379         (FieldExpr, PropertyExpr): Override and implement
16380         CacheTemporaries.  Fixes #52279.
16381
16382 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
16383
16384         * location.cs: In the new compiler listing a file twice is a
16385         warning, not an error.
16386
16387 2004-05-24  Martin Baulig  <martin@ximian.com>
16388
16389         * enum.cs (Enum.DefineType): For the `BaseType' to be a
16390         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
16391
16392 2004-05-24  Martin Baulig  <martin@ximian.com>
16393
16394         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
16395         walking the `using' list.  Fixes #53921.
16396
16397 2004-05-24  Martin Baulig  <martin@ximian.com>
16398
16399         * const.cs (Const.LookupConstantValue): Added support for
16400         EmptyCast's; fixes #55251.
16401
16402 2004-05-24  Martin Baulig  <martin@ximian.com>
16403
16404         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
16405         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
16406         which does the CS0135 check.  The reason is that we first need to
16407         check whether the variable actually exists.
16408
16409 2004-05-24  Martin Baulig  <martin@ximian.com>
16410
16411         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
16412         than RootContext.LookupType() to find the explicit interface
16413         type.  Fixes #58584.
16414
16415 2004-05-24  Raja R Harinath  <rharinath@novell.com>
16416
16417         * Makefile: Simplify.  Use executable.make.
16418         * mcs.exe.sources: New file.  List of sources of mcs.exe.
16419
16420 2004-05-24  Anders Carlsson  <andersca@gnome.org>
16421
16422         * decl.cs:
16423         * enum.cs:
16424         Use the invariant culture when doing String.Compare for CLS case
16425         sensitivity.
16426         
16427 2004-05-23  Martin Baulig  <martin@ximian.com>
16428
16429         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
16430         don't have any dots.  Fixes #52622, added cs0246-8.cs.
16431
16432         * namespace.cs (NamespaceEntry.Lookup): Likewise.
16433         
16434 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
16435
16436         * class.cs (MemberBase.Define): Reuse MemberType member for 
16437         resolved type. Other methods can use it too.
16438
16439 2004-05-23  Martin Baulig  <martin@ximian.com>
16440
16441         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
16442         the variable also exists in the current block (otherwise, we need
16443         to report a CS0103).  Fixes #58670.
16444
16445 2004-05-23  Martin Baulig  <martin@ximian.com>
16446
16447         * flowanalysis.cs (Reachability.Reachable): Compute this
16448         on-the-fly rather than storing it as a field.
16449
16450 2004-05-23  Martin Baulig  <martin@ximian.com>
16451
16452         * flowanalysis.cs (Reachability.And): Manually compute the
16453         resulting `barrier' from the reachability.      
16454        
16455 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
16456
16457         Fix bug #57835
16458         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
16459         instance of ObsoleteAttribute when symbol is obsolete.
16460
16461         * class.cs
16462         (IMethodData): Extended interface for ObsoleteAttribute support.
16463
16464 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
16465
16466         * attribute.cs: Fix bug #55970
16467
16468 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
16469
16470         Fix bug #52705
16471         * attribute.cs
16472         (GetObsoleteAttribute): New method. Creates the instance of
16473         ObsoleteAttribute.
16474         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
16475         ObsoleteAttribute when member is obsolete.
16476         (AttributeTester.Report_ObsoleteMessage): Common method for
16477         Obsolete error/warning reporting.
16478
16479         * class.cs
16480         (TypeContainer.base_classs_type): New member for storing parent type.
16481
16482         * decl.cs
16483         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
16484         for this MemberCore.
16485
16486 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
16487
16488         * attribute.cs, const.cs: Fix bug #58590
16489
16490 2004-05-21  Martin Baulig  <martin@ximian.com>
16491
16492         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
16493         out parameters if the end of the method is unreachable.  Fixes
16494         #58098. 
16495
16496 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
16497
16498         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
16499         Hari was right, why extra method.
16500
16501 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
16502
16503         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
16504
16505 2004-05-20  Martin Baulig  <martin@ximian.com>
16506
16507         Merged this back from gmcs to keep the differences to a minumum.
16508
16509         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
16510         instead of a Declspace.
16511         (Attribute.ResolveType): Likewise.
16512         (Attributes.Search): Likewise.
16513         (Attributes.Contains): Likewise.
16514         (Attributes.GetClsCompliantAttribute): Likewise.
16515
16516         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
16517         argument.
16518         (MethodData.ApplyAttributes): Take an EmitContext instead of a
16519         DeclSpace.
16520
16521 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
16522
16523         Fix bug #58688 (MCS does not report error when the same attribute
16524         is assigned twice)
16525
16526         * attribute.cs (Attribute.Emit): Distinction between null and default.
16527
16528 2004-05-19  Raja R Harinath  <rharinath@novell.com>
16529
16530         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
16531         of a top-level attribute without an attribute target.
16532         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
16533         Make non-static.
16534         (Attribute.Conditional_GetConditionName), 
16535         (Attribute.Obsolete_GetObsoleteMessage): Update.
16536         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
16537         part of ScanForIndexerName.
16538         (Attribute.CanIgnoreInvalidAttribute): New function.
16539         (Attribute.ScanForIndexerName): Move to ...
16540         (Attributes.ScanForIndexerName): ... here.
16541         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
16542         (Attributes.Search): New internal variant that can choose not to
16543         complain if types aren't resolved.  The original signature now
16544         complains.
16545         (Attributes.GetClsCompliantAttribute): Use internal variant, with
16546         complaints suppressed.
16547         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
16548         only if it not useful.
16549         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
16550         top-level for attributes that are shared between the assembly
16551         and a top-level class.
16552         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
16553         * class.cs: Update to reflect changes.
16554         (DefineIndexers): Fuse loops.
16555         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
16556         a couple more variants of attribute names.
16557
16558 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
16559
16560         Fix bug #52585 (Implemented explicit attribute declaration)
16561
16562         * attribute.cs:
16563         (Attributable.ValidAttributeTargets): New abstract method. It gets
16564         list of valid attribute targets for explicit target declaration.
16565         (Attribute.Target): It holds target itself.
16566         (AttributeSection): Removed.
16567         (Attribute.CheckTargets): New method. It checks whether attribute
16568         target is valid for the current element.
16569
16570         * class.cs:
16571         (EventProperty): New class. For events that are declared like
16572         property (with add and remove accessors).
16573         (EventField): New class. For events that are declared like field.
16574         class.cs
16575
16576         * cs-parser.jay: Implemented explicit attribute target declaration.
16577
16578         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
16579         Override ValidAttributeTargets.
16580
16581         * parameter.cs:
16582         (ReturnParameter): Class for applying custom attributes on 
16583         the return type.
16584         (ParameterAtribute): New class. Class for applying custom
16585         attributes on the parameter type.
16586
16587 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
16588
16589         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
16590         definitions. 
16591
16592         (Method): Allow UNSAFE here.
16593
16594         * modifiers.cs: Support unsafe reporting.
16595
16596 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
16597
16598         * decl.cs: Fix bug #58478.
16599
16600 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16601
16602         * statement.cs: When checking for unreachable code on an EmptyStatement,
16603         set the location. Fixes bug #58488.
16604
16605 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
16606
16607         * driver.cs: Add -pkg handling.
16608
16609         From Gonzalo: UseShelLExecute=false
16610
16611 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
16612
16613         * attribute.cs:
16614         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
16615         for attribute.
16616         (Attribute.IsClsCompliaceRequired): Moved to base for better
16617         accesibility.
16618         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
16619         when attribute is AttributeUsageAttribute.
16620         (Attribute.GetValidTargets): Simplified.
16621         (Attribute.GetAttributeUsage): New method returns AttributeUsage
16622         attribute for this type.
16623         (Attribute.ApplyAttributes): Method renamed to Emit and make
16624         non-static.
16625         (GlobalAttributeSection): New class for special handling of global
16626         attributes (assembly, module).
16627         (AttributeSection.Emit): New method.
16628
16629         * class.cs: Implemented Attributable abstract methods.
16630         (MethodCore.LabelParameters): Moved to Parameter class.
16631         (Accessor): Is back simple class.
16632         (PropertyMethod): Implemented Attributable abstract class.
16633         (DelegateMethod): Implemented Attributable abstract class.
16634         (Event): New constructor for disctintion between normal Event
16635         and Event with accessors.
16636
16637         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
16638
16639         * codegen.cs, const.cs, decl.cs, delegate.cs:
16640         (CommonAssemblyModulClass): Implemented Attributable abstract class
16641         and simplified.
16642
16643         * enum.cs: Implement IAttributeSupport interface.
16644         (EnumMember): New class for emum members. Implemented Attributable
16645         abstract class
16646
16647         * parameter.cs:
16648         (ParameterBase): Is abstract.
16649         (ReturnParameter): New class for easier [return:] attribute handling.
16650
16651         * typemanager.cs: Removed builder_to_attr.
16652
16653 2004-05-11  Raja R Harinath  <rharinath@novell.com>
16654
16655         Fix bug #57151.
16656         * attribute.cs (Attribute.GetPositionalValue): New function.
16657         * class.cs (TypeContainer.VerifyMembers): New function.
16658         (TypeContainer.Emit): Use it.
16659         (ClassOrStruct): New base class for Class and Struct.
16660         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
16661         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
16662         class.
16663         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
16664         then each non-static field should have a FieldOffset attribute.
16665         Otherwise, none of the fields should have a FieldOffset attribute.
16666         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
16667         and FieldOffset attributes.
16668         * typemanager.cs (TypeManager.struct_layout_attribute_type)
16669         (TypeManager.field_offset_attribute_type): New core types.
16670         (TypeManager.InitCoreTypes): Initialize them.
16671
16672 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
16673
16674         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
16675         Return correct type.
16676         From bug #58270.
16677
16678 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
16679
16680         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
16681         be implicitly converted to ulong.
16682         
16683         * expression.cs: The logic for allowing operator &, | and ^ worked
16684         was wrong, it worked before because we did not report an error in
16685         an else branch.  Fixes 57895.
16686
16687         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
16688         allow volatile fields to be reference types.
16689
16690 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
16691
16692         * driver.cs: Add support for /debug-
16693
16694 2004-05-07  Raja R Harinath  <rharinath@novell.com>
16695
16696         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
16697         Add a 'complain' parameter to silence errors.
16698         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
16699         silently overlooked type-resolutions.
16700         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
16701         to reflect changes.
16702         (Attributes.Search): New function.
16703         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
16704         (Attributes.GetAttributeFullName): Remove hack.
16705         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
16706         Update to reflect changes.
16707         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
16708         Use Attributes.Search instead of nested loops.
16709
16710 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
16711
16712         * decl.cs:
16713         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
16714         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
16715         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
16716
16717         * report.cs: (Report.Warning): Renamed to Warning_T because of
16718         parameter collision.
16719
16720 2004-05-05  Raja R Harinath  <rharinath@novell.com>
16721
16722         * expression.cs (MemberAccess.ResolveMemberAccess):
16723         Exit with non-zero status after Report.Error.
16724         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
16725         Likewise.
16726         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
16727
16728 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
16729
16730         * support.cs: Don't hang when the file is empty.
16731
16732 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
16733
16734         * support.cs: In SeekableStreamReader, compute the preamble size of the
16735           underlying stream. Position changes should take into account that initial
16736           count of bytes.
16737
16738 2004-05-03  Todd Berman  <tberman@sevenl.net>
16739
16740         * driver.cs: remove unused GetSysVersion function.
16741
16742 2004-05-03  Todd Berman  <tberman@sevenl.net>
16743
16744         * driver.cs: Remove the hack from saturday, as well as the hack
16745         from jackson (LoadAssemblyFromGac), also adds the CWD to the
16746         link_paths to get that bit proper.
16747
16748 2004-05-01  Todd Berman  <tberman@sevenl.net>
16749
16750         * driver.cs: Try a LoadFrom before a Load, this checks the current
16751         path. This is currently a bug in mono that is be fixed, however, this
16752         provides a workaround for now. This will be removed when the bug
16753         is fixed.
16754
16755 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
16756
16757         * CryptoConvert.cs: Updated to latest version. Fix issue with 
16758         incomplete key pairs (#57941).
16759
16760 2004-05-01  Todd Berman  <tberman@sevenl.net>
16761
16762         * driver.cs: Remove '.' from path_chars, now System.* loads properly
16763         from the GAC
16764
16765 2004-04-30  Jackson Harper  <jackson@ximian.com>
16766
16767         * codegen.cs: Open keys readonly.
16768         
16769 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16770
16771         * typemanager.cs: don't report cyclic struct layout when a struct
16772         contains 2 or more fields of the same type. Failed for Pango.AttrShape
16773         which has 2 Pango.Rectangle fields.
16774
16775 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
16776
16777         * expression.cs: Handle IntPtr comparisons with IL code
16778         rather than a method call.
16779
16780 2004-04-29  Martin Baulig  <martin@ximian.com>
16781
16782         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
16783         the list of PropertyInfo's in class hierarchy and find the
16784         accessor.  Fixes #56013.
16785
16786 2004-04-29  Martin Baulig  <martin@ximian.com>
16787
16788         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
16789
16790 2004-04-29  Martin Baulig  <martin@ximian.com>
16791
16792         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16793
16794         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
16795
16796 2004-04-29  Martin Baulig  <martin@ximian.com>
16797
16798         * class.cs (ConstructorInitializer.Resolve): Check whether the
16799         parent .ctor is accessible.  Fixes #52146.
16800
16801 2004-04-29  Martin Baulig  <martin@ximian.com>
16802
16803         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16804
16805         * statement.cs (Using.EmitLocalVariableDecls): Use
16806         TypeManager.idisposable_type, not typeof (IDisposable).
16807         (Foreach.EmitCollectionForeach): Added support for valuetypes.
16808
16809 2004-04-29  Martin Baulig  <martin@ximian.com>
16810
16811         * class.cs (Event.Define): Don't emit the field and don't set
16812         RTSpecialName and SpecialName for events on interfaces.  Fixes
16813         #57703. 
16814
16815 2004-04-29  Raja R Harinath  <rharinath@novell.com>
16816
16817         Refactor Attribute.ApplyAttributes.
16818         * attribute.cs (Attributable): New base class for objects that can
16819         have Attributes applied on them.
16820         (Attribute): Make AttributeUsage fields public.
16821         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
16822         (Attribute.IsInternalCall): New property.
16823         (Attribute.UsageAttr): Convert to a public read-only property.
16824         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
16825         (Attribute.ResolveType, Attribute.Resolve)
16826         (Attribute.ScanForIndexerName): Update to reflect changes.
16827         (Attribute.CheckAttributeTarget): Re-format.
16828         (Attribute.ApplyAttributes): Refactor, to various
16829         Attributable.ApplyAttributeBuilder methods.
16830         * decl.cs (MemberCore): Make Attributable.
16831         * class.cs (Accessor): Make Attributable.
16832         (MethodData.ApplyAttributes): Use proper attribute types, not
16833         attribute names.
16834         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
16835         (TypeContainer.ApplyAttributeBuilder)
16836         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
16837         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
16838         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
16839         (Operator.ApplyAttributeBuilder): New factored-out methods.
16840         * const.cs (Const.ApplyAttributeBuilder): Likewise.
16841         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
16842         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
16843         * parameter.cs (ParameterBase): New Attributable base class
16844         that can also represent Return types.
16845         (Parameter): Update to the changes.
16846
16847 2004-04-29  Jackson Harper  <jackson@ximian.com>
16848
16849         * driver.cs: Prefer the corlib system version when looking for
16850         assemblies in the GAC. This is still a hack, but its a better hack
16851         now.
16852         
16853 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
16854
16855         * decl.cs, enum.cs: Improved error 3005 reporting.
16856   
16857         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
16858         (related_symbols): New private member for list of symbols
16859         related to reported error/warning.
16860         
16861         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
16862
16863 2004-04-29  Martin Baulig  <martin@ximian.com>
16864
16865         * ecore.cs (Expression.Constantify): If we're an enum and
16866         TypeManager.TypeToCoreType() doesn't give us another type, use
16867         t.UnderlyingSystemType.  Fixes #56178.  
16868
16869 2004-04-29  Martin Baulig  <martin@ximian.com>
16870
16871         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
16872         interfaces and for each interface, only add members directly
16873         declared in that interface.  Fixes #53255.
16874
16875 2004-04-28  Martin Baulig  <martin@ximian.com>
16876
16877         * expression.cs (ConditionalLogicalOperator): Use a temporary
16878         variable for `left' to avoid that we evaluate it more than once;
16879         bug #52588.
16880
16881 2004-04-28  Martin Baulig  <martin@ximian.com>
16882
16883         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
16884         `void[]' (CS1547).
16885
16886 2004-04-28  Martin Baulig  <martin@ximian.com>
16887
16888         * statement.cs (LocalInfo.Resolve): Check whether the type is not
16889         void (CS1547).
16890
16891         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
16892         whether the type is not void (CS1547).
16893
16894 2004-04-28  Martin Baulig  <martin@ximian.com>
16895
16896         * expression.cs (Unary.DoResolveLValue): Override this and report
16897         CS0131 for anything but Operator.Indirection.
16898
16899 2004-04-28  Martin Baulig  <martin@ximian.com>
16900
16901         Committing a patch from Ben Maurer; see bug #50820.
16902
16903         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16904         check for classes.
16905
16906         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16907         classes.        
16908
16909 2004-04-28  Martin Baulig  <martin@ximian.com>
16910
16911         Committing a patch from Ben Maurer; see bug #50820.
16912
16913         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16914         check for classes.
16915
16916         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16917         classes.        
16918
16919 2004-04-28  Martin Baulig  <martin@ximian.com>
16920
16921         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
16922         (Block.AddLabel): Call DoLookupLabel() to only search in the
16923         current block.
16924
16925 2004-04-28  Martin Baulig  <martin@ximian.com>
16926
16927         * cfold.cs (ConstantFold.BinaryFold): Added special support for
16928         comparing StringConstants and NullLiterals in Equality and Inequality.
16929
16930 2004-04-28  Jackson Harper  <jackson@ximian.com>
16931
16932         * driver.cs: Attempt to load referenced assemblies from the
16933         GAC. This is the quick and dirty version of this method that
16934         doesnt take into account versions and just takes the first
16935         canidate found. Will be good enough for now as we will not have more
16936         then one version installed into the GAC until I update this method.
16937
16938 2004-04-28  Martin Baulig  <martin@ximian.com>
16939
16940         * typemanager.cs (TypeManager.CheckStructCycles): New public
16941         static method to check for cycles in the struct layout.
16942
16943         * rootcontext.cs (RootContext.PopulateTypes): Call
16944         TypeManager.CheckStructCycles() for each TypeContainer.
16945         [Note: We only need to visit each type once.]
16946
16947 2004-04-28  Martin Baulig  <martin@ximian.com>
16948
16949         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
16950
16951         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
16952         success and added `out object value'.  Use a `bool resolved' field
16953         to check whether we've already been called rather than
16954         `ConstantValue != null' since this breaks for NullLiterals.
16955
16956 2004-04-28  Raja R Harinath  <rharinath@novell.com>
16957
16958         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
16959         setting of this flag, since the 'set' method may be non-public.
16960
16961 2004-04-28  Raja R Harinath  <rharinath@novell.com>
16962
16963         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
16964         check on current_vector.Block.
16965
16966 2004-04-27  Martin Baulig  <martin@ximian.com>
16967
16968         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
16969         a field initializer.  Fixes #56459.
16970
16971 2004-04-27  Martin Baulig  <martin@ximian.com>
16972
16973         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
16974         we're not attempting to use an indexer.  Fixes #52154.
16975
16976 2004-04-27  Martin Baulig  <martin@ximian.com>
16977
16978         * statement.cs (Return): Don't create a return label if we don't
16979         need it; reverts my change from January 20th.  Thanks to Ben
16980         Maurer for this.
16981
16982 2004-04-27  Martin Baulig  <martin@ximian.com>
16983
16984         According to the spec, `goto' can only leave a nested scope, but
16985         never enter it.
16986
16987         * statement.cs (Block.LookupLabel): Only lookup in the current
16988         block, don't recurse into parent or child blocks.
16989         (Block.AddLabel): Check in parent and child blocks, report
16990         CS0140/CS0158 if we find a duplicate.
16991         (Block): Removed this indexer for label lookups.
16992         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
16993         this already does the error reporting for us.
16994
16995         * flowanalysis.cs
16996         (FlowBranching.UsageVector.Block): New public variable; may be null.
16997         (FlowBranching.CreateSibling): Added `Block' argument.
16998         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
16999         label for the target of a `goto' and check whether we're not
17000         leaving a `finally'.
17001
17002 2004-04-27  Martin Baulig  <martin@ximian.com>
17003
17004         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
17005         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
17006         just for returns).
17007
17008 2004-04-27  Martin Baulig  <martin@ximian.com>
17009
17010         * statement.cs (Block.AddLabel): Also check for implicit blocks
17011         and added a CS0158 check.
17012
17013 2004-04-27  Martin Baulig  <martin@ximian.com>
17014
17015         * flowanalysis.cs (FlowBranchingLoop): New class.
17016         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
17017         UsageVector's instead of an ArrayList.
17018         (FlowBranching.Label): Likewise.
17019         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
17020         (FlowBranching.AddBreakVector): New method.
17021
17022 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
17023
17024         * attribute.cs: Small regression fix: only convert the type if we
17025         the type is different, fixes System.Drawing build.
17026
17027 2004-04-27  Martin Baulig  <martin@ximian.com>
17028
17029         * attribute.cs (Attribute.Resolve): If we have a constant value
17030         for a named field or property, implicity convert it to the correct
17031         type.
17032
17033 2004-04-27  Raja R Harinath  <rharinath@novell.com>
17034
17035         * statement.cs (Block.Block): Implicit blocks share
17036         'child_variable_names' fields with parent blocks.
17037         (Block.AddChildVariableNames): Remove.
17038         (Block.AddVariable): Mark variable as "used by a child block" in
17039         every surrounding block.
17040         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
17041         been used in a child block, complain about violation of "Invariant
17042         meaning in blocks" rule.
17043         * cs-parser.jay (declare_local_variables): Don't use
17044         AddChildVariableNames.
17045         (foreach_statement): Don't create an implicit block: 'foreach'
17046         introduces a scope.
17047
17048 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
17049
17050         * convert.cs (ImplicitNumericConversion): 0 is also positive when
17051         converting from 0L to ulong.  Fixes 57522.
17052
17053 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
17054
17055         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
17056         derived class hides via 'new' keyword field from base class (test-242.cs).
17057         TODO: Handle this in the more general way.
17058         
17059         * class.cs (CheckBase): Ditto.
17060
17061 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
17062
17063         * decl.cs (caching_flags): New member for storing cached values
17064         as bit flags.
17065         (MemberCore.Flags): New enum where bit flags for caching_flags
17066         are defined.
17067         (MemberCore.cls_compliance): Moved to caching_flags.
17068         (DeclSpace.Created): Moved to caching_flags.
17069
17070         * class.cs: Use caching_flags instead of DeclSpace.Created
17071         
17072 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
17073
17074         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
17075         if we are only a derived class, not a nested class.
17076
17077         * typemanager.cs: Same as above, but do this at the MemberLookup
17078         level (used by field and methods, properties are handled in
17079         PropertyExpr).   Allow for the qualified access if we are a nested
17080         method. 
17081
17082 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
17083
17084         * class.cs: Refactoring.
17085         (IMethodData): New inteface; Holds links to parent members
17086         to avoid member duplication (reduced memory allocation).
17087         (Method): Implemented IMethodData interface.
17088         (PropertyBase): New inner classes for get/set methods.
17089         (PropertyBase.PropertyMethod): Implemented IMethodData interface
17090         (Event): New inner classes for add/remove methods.
17091         (Event.DelegateMethod): Implemented IMethodData interface.
17092
17093         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
17094         EmitContext (related to class.cs refactoring).
17095
17096 2004-04-21  Raja R Harinath  <rharinath@novell.com>
17097
17098         * delegate.cs (Delegate.VerifyApplicability): If the number of
17099         arguments are the same as the number of parameters, first try to
17100         verify applicability ignoring  any 'params' modifier on the last
17101         parameter.
17102         Fixes #56442.
17103
17104 2004-04-16  Raja R Harinath  <rharinath@novell.com>
17105
17106         * class.cs (TypeContainer.AddIndexer): Use
17107         'ExplicitInterfaceName' to determine if interface name was
17108         explicitly specified.  'InterfaceType' is not initialized at this time.
17109         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
17110         Indexers array is already in the required order.  Initialize
17111         'IndexerName' only if there are normal indexers.
17112         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
17113         (TypeContainer.Emit): Emit DefaultMember attribute only if
17114         IndexerName is initialized.
17115         Fixes #56300.
17116
17117 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
17118
17119         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
17120         Fixes #57007
17121
17122 2004-04-15  Raja R Harinath  <rharinath@novell.com>
17123
17124         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
17125         attributes.
17126         Fix for #56456.
17127
17128         * attribute.cs (Attribute.Resolve): Check for duplicate named
17129         attributes.
17130         Fix for #56463.
17131
17132 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
17133
17134         * iterators.cs (MarkYield): track whether we are in an exception,
17135         and generate code accordingly.  Use a temporary value to store the
17136         result for our state.
17137
17138         I had ignored a bit the interaction of try/catch with iterators
17139         since their behavior was not entirely obvious, but now it is
17140         possible to verify that our behavior is the same as MS .NET 2.0
17141
17142         Fixes 54814
17143
17144 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
17145
17146         * iterators.cs: Avoid creating temporaries if there is no work to
17147         do. 
17148
17149         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
17150         Enumerations, use TypeManager.EnumToUnderlying and call
17151         recursively. 
17152
17153         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
17154         bug #57013
17155
17156         (This.Emit): Use EmitContext.EmitThis to emit our
17157         instance variable.
17158
17159         (This.EmitAssign): Ditto.
17160
17161         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
17162         codepaths, we will move all the functionality into
17163         Mono.CSharp.This 
17164
17165         (FieldExpr.EmitAssign): Ditto.
17166
17167         This fixes several hidden bugs that I uncovered while doing a code
17168         review of this today.
17169
17170         * codegen.cs (EmitThis): reworked so the semantics are more clear
17171         and also support value types "this" instances.
17172
17173         * iterators.cs: Changed so that for iterators in value types, we
17174         do not pass the value type as a parameter.  
17175
17176         Initialization of the enumerator helpers is now done in the caller
17177         instead of passing the parameters to the constructors and having
17178         the constructor set the fields.
17179
17180         The fields have now `assembly' visibility instead of private.
17181
17182 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
17183
17184         * expression.cs (Argument.Resolve): Check if fields passed as ref
17185         or out are contained in a MarshalByRefObject.
17186
17187         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
17188         another compiler type.
17189
17190 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
17191
17192         * class.cs (Indexer.Define): use the new name checking method.
17193         Also, return false on an error.
17194         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
17195         (is_identifier_[start/part]_character): make static.
17196
17197 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
17198
17199         * expression.cs (Binary.ResolveOperator): Do no append strings
17200         twice: since we can be invoked more than once (array evaluation)
17201         on the same concatenation, take care of this here.  Based on a fix
17202         from Ben (bug #56454)
17203
17204 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
17205
17206         * codegen.cs: Fix another case where CS1548 must be reported (when 
17207         delay-sign isn't specified and no private is available #56564). Fix
17208         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
17209         error when MCS is used on the MS runtime and we need to delay-sign 
17210         (which seems unsupported by AssemblyBuilder - see #56621).
17211
17212 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
17213
17214         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
17215         (TypeManager.ComputeNamespaces): Faster implementation for
17216         Microsoft runtime.
17217
17218         * compiler.csproj: Updated AssemblyName to mcs.
17219
17220 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
17221
17222         * rootcontext.cs: Add new types to the boot resolution.
17223
17224         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
17225         MulticastDelegate is not allowed.
17226
17227         * typemanager.cs: Add new types to lookup: System.TypedReference
17228         and ArgIterator.
17229
17230         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
17231         check for TypedReference or ArgIterator, they are not allowed. 
17232
17233         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
17234         makes us properly catch 1510 in some conditions (see bug 56016 for
17235         details). 
17236
17237 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
17238
17239         * CryptoConvert.cs: update from corlib version
17240         with endian fixes.
17241
17242 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
17243
17244         * class.cs (Indexer.Define): Check indexername declaration
17245
17246 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
17247
17248         * attribute.cs (IsClsCompliant): Fixed problem with handling
17249         all three states (compliant, not-compliant, undetected).
17250
17251 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
17252
17253         * attribute.cs (Attribute): Location is now public.
17254         (Resolve): Store resolved arguments (pos_values) in attribute class.
17255         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
17256         (GetClsCompliantAttributeValue): New method that gets
17257         CLSCompliantAttribute value.
17258         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
17259         if exists else null.
17260         (AttributeTester): New class for CLS-Compliant verification routines.
17261
17262         * class.cs (Emit): Add CLS-Compliant verification.
17263         (Method.GetSignatureForError): Implemented.
17264         (Constructor.GetSignatureForError): Implemented
17265         (Constructor.HasCompliantArgs): Returns if constructor has
17266         CLS-Compliant arguments.
17267         (Constructor.Emit): Override.
17268         (Construcor.IsIdentifierClsCompliant): New method; For constructors
17269         is needed to test only parameters.
17270         (FieldBase.GetSignatureForError): Implemented.
17271         (TypeContainer): New member for storing base interfaces.
17272         (TypeContainer.FindMembers): Search in base interfaces too.
17273
17274         * codegen.cs (GetClsComplianceAttribute): New method that gets
17275         assembly or module CLSCompliantAttribute value.
17276         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
17277         for assembly.
17278         (ModuleClass.Emit): Add error 3012 test.
17279
17280         * const.cs (Emit): Override and call base for CLS-Compliant tests.
17281
17282         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
17283         state for all decl types.
17284         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
17285         if CLS-Compliant tests are required.
17286         (IsClsCompliaceRequired): New method. Analyze whether code
17287         must be CLS-Compliant.
17288         (IsExposedFromAssembly): New method. Returns true when MemberCore
17289         is exposed from assembly.
17290         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
17291         value or gets cached value.
17292         (HasClsCompliantAttribute): New method. Returns true if MemberCore
17293         is explicitly marked with CLSCompliantAttribute.
17294         (IsIdentifierClsCompliant): New abstract method. This method is
17295         used to testing error 3005.
17296         (IsIdentifierAndParamClsCompliant): New method. Common helper method
17297         for identifier and parameters CLS-Compliant testing.
17298         (VerifyClsCompliance): New method. The main virtual method for
17299         CLS-Compliant verifications.
17300         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
17301         null. I don't know why is null (too many public members !).
17302         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
17303         and get value of first CLSCompliantAttribute that found.
17304
17305         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
17306         (VerifyClsCompliance): Override and add extra tests.
17307
17308         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
17309         clscheck- disable CLS-Compliant verification event if assembly is has
17310         CLSCompliantAttribute(true).
17311
17312         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
17313         ApllyAttribute is now called in emit section as in the other cases.
17314         Possible future Emit integration.
17315         (IsIdentifierClsCompliant): New override.
17316         (VerifyClsCompliance): New override.
17317         (GetEnumeratorName): Returns full enum name.
17318
17319         * parameter.cs (GetSignatureForError): Implemented.
17320
17321         * report.cs (WarningData): New struct for Warning message information.
17322         (LocationOfPreviousError): New method.
17323         (Warning): New method. Reports warning based on the warning table.
17324         (Error_T): New method. Reports error based on the error table.
17325
17326         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
17327         verifications are done here.
17328
17329         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
17330
17331         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
17332         CLSCompliantAttribute.
17333         (all_imported_types): New member holds all imported types from other
17334         assemblies.
17335         (LoadAllImportedTypes): New method fills static table with exported types
17336         from all referenced assemblies.
17337         (Modules): New property returns all assembly modules.
17338
17339 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
17340
17341         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
17342         throwing a parser error.
17343
17344         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
17345         which removes the hardcoded get_/set_ prefixes for properties, as
17346         IL allows for the properties to be named something else.  
17347
17348         Bug #56013
17349
17350         * expression.cs: Do not override operand before we know if it is
17351         non-null.  Fix 56207
17352
17353 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17354
17355         * typemanager.cs: support for pinned variables.
17356
17357 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17358
17359         * decl.cs, typemanager.cs: Avoid using an arraylist
17360         as a buffer if there is only one result set.
17361
17362 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17363
17364         * expression.cs: Make sure you cant call a static method
17365         with an instance expression, bug #56174.
17366
17367 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
17368
17369         * class.cs (IsDuplicateImplementation): Improve error reporting to
17370         flag 663 (method only differs in parameter modifier).
17371
17372         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
17373         in preprocessor directives.
17374
17375         * location.cs (LookupFile): Allow for the empty path.
17376
17377         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
17378         better approach for some of that patch, but its failing with the
17379         CharSet enumeration.  For now try/catch will do.
17380
17381         * typemanager.cs: Do not crash if a struct does not have fields.
17382         Fixes 56150.
17383
17384 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17385
17386         * expression.cs: cs0213, cant fix a fixed expression.
17387         fixes 50231.
17388
17389 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17390
17391         * cs-parser.jay: detect invalid embeded statements gracefully.
17392         bug #51113.
17393
17394 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17395
17396         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
17397         As a regex:
17398         s/
17399         the invocation type may not be a subclass of the tye of the item/
17400         The type of the item must be a subclass of the invocation item.
17401         /g
17402
17403         Fixes bug #50820.
17404
17405 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
17406
17407         * attribute.cs: Added methods to get a string and a bool from an
17408         attribute. Required to information from AssemblyKeyFileAttribute,
17409         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
17410         * codegen.cs: Modified AssemblyName creation to include support for
17411         strongnames. Catch additional exceptions to report them as CS1548.
17412         * compiler.csproj: Updated include CryptoConvert.cs.
17413         * compiler.csproj.user: Removed file - user specific configuration.
17414         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
17415         Mono.Security assembly. The original class is maintained and tested in
17416         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
17417         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
17418         like CSC 8.0 (C# v2) supports.
17419         * Makefile: Added CryptoConvert.cs to mcs sources.
17420         * rootcontext.cs: Added new options for strongnames.
17421
17422 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
17423
17424         * driver.cs: For --expect-error, report error code `2'
17425         if the program compiled with no errors, error code `1' if
17426         it compiled with an error other than the one expected.
17427
17428 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
17429
17430         * compiler.csproj: Updated for Visual Studio .NET 2003.
17431         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
17432         * compiler.sln: Updated for Visual Studio .NET 2003.
17433
17434 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
17435
17436         * expression.cs: Fix bug #47234. We basically need to apply the
17437         rule that we prefer the conversion of null to a reference type
17438         when faced with a conversion to 'object' (csc behaviour).
17439
17440 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17441
17442         * statement.cs: Shorter form for foreach, eliminates
17443         a local variable. r=Martin.
17444
17445 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17446
17447         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
17448         checks if we can use brtrue/brfalse to test for 0.
17449         * expression.cs: use the above in the test for using brtrue/brfalse.
17450         cleanup code a bit.
17451
17452 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17453
17454         * expression.cs: Rewrite string concat stuff. Benefits:
17455
17456         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
17457         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
17458         rather than a concat chain.
17459
17460         * typemanager.cs: Add lookups for more concat overloads.
17461
17462 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17463
17464         * expression.cs: Emit shorter il code for array init.
17465
17466         newarr
17467         dup
17468         // set 1
17469
17470         // set 2
17471
17472         newarr
17473         stloc.x
17474
17475         ldloc.x
17476         // set 1
17477
17478         ldloc.x
17479         // set 2
17480
17481 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
17482
17483         * statement.cs: Before, two switch blocks would be merged if the
17484         total size of the blocks (end_item - begin_item + 1) was less than
17485         two times the combined sizes of the blocks.
17486
17487         Now, it will only merge if after the merge at least half of the
17488         slots are filled.
17489
17490         fixes 55885.
17491
17492 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
17493
17494         * class.cs : csc build fix for GetMethods(). See bug #52503.
17495
17496 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
17497
17498         * expression.cs: Make sure fp comparisons work with NaN.
17499         This fixes bug #54303. Mig approved this patch a long
17500         time ago, but we were not able to test b/c the runtime
17501         had a related bug.
17502
17503 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
17504
17505         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
17506
17507 2004-03-19  Martin Baulig  <martin@ximian.com>
17508
17509         * class.cs (MemberCore.IsDuplicateImplementation): Report the
17510         error here and not in our caller.
17511
17512 2004-03-19  Martin Baulig  <martin@ximian.com>
17513
17514         * interface.cs: Completely killed this file.
17515         (Interface): We're now a TypeContainer and live in class.cs.
17516
17517         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
17518         argument; we're now also called for interfaces.
17519         (TypeContainer.DefineMembers): Allow this method being called
17520         multiple times.
17521         (TypeContainer.GetMethods): New public method; formerly known as
17522         Interface.GetMethod().  This is used by PendingImplementation.
17523         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
17524         it's now private and non-static.
17525         (Interface): Moved this here; it's now implemented similar to
17526         Class and Struct.
17527         (Method, Property, Event, Indexer): Added `bool is_interface'
17528         argument to their .ctor's.
17529         (MemberBase.IsInterface): New public field.
17530
17531         * cs-parser.jay: Create normal Method, Property, Event, Indexer
17532         instances instead of InterfaceMethod, InterfaceProperty, etc.
17533         (opt_interface_base): Removed; we now use `opt_class_base' instead.
17534         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
17535
17536 2004-03-19  Martin Baulig  <martin@ximian.com>
17537
17538         * class.cs (MethodCore.IsDuplicateImplementation): New private
17539         method which does the CS0111 checking.
17540         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
17541         Use IsDuplicateImplementation().
17542
17543 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
17544
17545         * decl.cs (FindMemberToOverride): New method to find the correct
17546         method or property to override in the base class.
17547         * class.cs
17548             - Make Method/Property use the above method to find the
17549               version in the base class.
17550             - Remove the InheritableMemberSignatureCompare as it is now
17551               dead code.
17552
17553         This patch makes large code bases much faster to compile, as it is
17554         O(n) rather than O(n^2) to do this validation.
17555
17556         Also, it fixes bug 52458 which is that nested classes are not
17557         taken into account when finding the base class member.
17558
17559         Reviewed/Approved by Martin.
17560
17561 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
17562
17563         * interface.cs: In all interface classes removed redundant
17564         member initialization.
17565
17566 2004-03-16  Martin Baulig  <martin@ximian.com>
17567
17568         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
17569
17570 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
17571
17572         * decl.cs (DefineTypeAndParents): New helper method to define a
17573         type's containers before the type itself is defined;  This is a
17574         bug exposed by the recent changes to Windows.Forms when an
17575         implemented interface was defined inside a class that had not been
17576         built yet.   
17577
17578         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
17579
17580         (Check): Loop correctly to report errors modifiers
17581         (UNSAFE was not in the loop, since it was the same as TOP).
17582
17583         * interface.cs: Every interface member now takes a ModFlags,
17584         instead of a "is_new" bool, which we set on the base MemberCore. 
17585
17586         Every place where we called "UnsafeOk" in the interface, now we
17587         call the proper member (InterfaceMethod.UnsafeOK) instead to get
17588         the unsafe settings from the member declaration instead of the
17589         container interface. 
17590
17591         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
17592
17593         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
17594         `set_indexer_name' to the pending bits (one per type).
17595
17596         We fixed a bug today that was picking the wrong method to
17597         override, since for properties the existing InterfaceMethod code
17598         basically ignored the method name.  Now we make sure that the
17599         method name is one of the valid indexer names.
17600
17601 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
17602  
17603         * support.cs (SeekableStreamReader): Keep track of stream byte
17604         positions and don't mix them with character offsets to the buffer.
17605
17606         Patch from Gustavo Giráldez
17607
17608 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
17609
17610         * interface.cs (InterfaceSetGetBase): Removed double member
17611         initialization, base class does it as well.
17612
17613 2004-03-13  Martin Baulig  <martin@ximian.com>
17614
17615         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
17616         when compiling corlib.
17617
17618 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
17619
17620         * convert.cs (ExplicitConversion): We were reporting an error on
17621         certain conversions (object_type source to a value type, when the
17622         expression was `null') before we had a chance to pass it through
17623         the user defined conversions.
17624
17625         * driver.cs: Replace / and \ in resource specifications to dots.
17626         Fixes 50752
17627
17628         * class.cs: Add check for duplicate operators.  Fixes 52477
17629
17630 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
17631
17632         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
17633         that are in the middle of the statements, not only at the end.
17634         Fixes #54987
17635
17636         * class.cs (TypeContainer.AddField): No longer set the
17637         `HaveStaticConstructor' flag, now we call it
17638         `UserDefineStaticConstructor' to diferentiate the slightly
17639         semantic difference.
17640
17641         The situation is that we were not adding BeforeFieldInit (from
17642         Modifiers.TypeAttr) to classes that could have it.
17643         BeforeFieldInit should be set to classes that have no static
17644         constructor. 
17645
17646         See:
17647
17648         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
17649
17650         And most importantly Zoltan's comment:
17651
17652         http://bugzilla.ximian.com/show_bug.cgi?id=44229
17653
17654         "I think beforefieldinit means 'it's ok to initialize the type sometime 
17655          before its static fields are used', i.e. initialization does not need
17656          to be triggered by the first access to the type. Setting this flag
17657          helps the JIT to compile better code, since it can run the static
17658          constructor at JIT time, and does not need to generate code to call it
17659          (possibly lots of times) at runtime. Unfortunately, mcs does not set
17660          this flag for lots of classes like String. 
17661          
17662          csc sets this flag if the type does not have an explicit static 
17663          constructor. The reasoning seems to be that if there are only static
17664          initalizers for a type, and no static constructor, then the programmer
17665          does not care when this initialization happens, so beforefieldinit
17666          can be used.
17667          
17668          This bug prevents the AOT compiler from being usable, since it 
17669          generates so many calls to mono_runtime_class_init that the AOT code
17670          is much slower than the JITted code. The JITted code is faster, 
17671          because it does not generate these calls if the vtable is type is
17672          already initialized, which is true in the majority of cases. But the
17673          AOT compiler can't do this."
17674
17675 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
17676
17677         * class.cs (MethodData.Emit): Refactor the code so symbolic
17678         information is generated for destructors;  For some reasons we
17679         were taking a code path that did not generate symbolic information
17680         before. 
17681
17682 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
17683
17684         * class.cs: Create a Constructor.CheckBase method that
17685         takes care of all validation type code. The method
17686         contains some code that was moved from Define.
17687
17688         It also includes new code that checks for duplicate ctors.
17689         This fixes bug #55148.
17690
17691 2004-03-09  Joshua Tauberer <tauberer@for.net>
17692
17693         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
17694         a { ... }-style array creation invokes EmitStaticInitializers
17695         which is not good for reference-type arrays.  String, decimal
17696         and now null constants (NullCast) are not counted toward
17697         static initializers.
17698
17699 2004-03-05  Martin Baulig  <martin@ximian.com>
17700
17701         * location.cs (SourceFile.HasLineDirective): New public field;
17702         specifies whether the file contains or is referenced by a "#line"
17703         directive.
17704         (Location.DefineSymbolDocuments): Ignore source files which
17705         either contain or are referenced by a "#line" directive.        
17706
17707 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
17708
17709         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
17710         direct access to our parent, so check the method inline there.
17711
17712 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
17713
17714         * expression.cs (Invocation.EmitCall): Miguel's last commit
17715         caused a regression. If you had:
17716
17717             T t = null;
17718             t.Foo ();
17719
17720         In Foo the implict this would be null.
17721
17722 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
17723
17724         * expression.cs (Invocation.EmitCall): If the method is not
17725         virtual, do not emit a CallVirt to it, use Call.
17726
17727         * typemanager.cs (GetFullNameSignature): Improve the method to
17728         cope with ".ctor" and replace it with the type name.
17729
17730         * class.cs (ConstructorInitializer.Resolve): Now the method takes
17731         as an argument the ConstructorBuilder where it is being defined,
17732         to catch the recursive constructor invocations.
17733
17734 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
17735
17736         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
17737         routines to check if a type is an enumerable/enumerator allow
17738         classes that implement the IEnumerable or IEnumerator interfaces.
17739
17740         * class.cs (Property, Operator): Implement IIteratorContainer, and
17741         implement SetYields.
17742
17743         (Property.Define): Do the block swapping for get_methods in the
17744         context of iterators.   We need to check if Properties also
17745         include indexers or not.
17746
17747         (Operator): Assign the Block before invoking the
17748         OperatorMethod.Define, so we can trigger the Iterator code
17749         replacement. 
17750
17751         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
17752         Property and Operator classes are not created when we parse the
17753         declarator but until we have the block completed, so we use a
17754         singleton SimpleIteratorContainer.Simple to flag whether the
17755         SetYields has been invoked.
17756
17757         We propagate this setting then to the Property or the Operator to
17758         allow the `yield' to function.
17759
17760 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
17761
17762         * codegen.cs: Implemented attribute support for modules.
17763         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
17764         Assembly/Module functionality.
17765
17766         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
17767         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
17768         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
17769
17770 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
17771
17772         * interface.cs (FindMembers): The operation is performed on all base
17773         interfaces and not only on the first. It is required for future CLS Compliance patch.
17774
17775 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
17776
17777         * statement.cs, codegen.cs:
17778         This patch deals with patterns such as:
17779
17780         public class List : IEnumerable {
17781
17782                 public MyEnumerator GetEnumerator () {
17783                         return new MyEnumerator(this);
17784                 }
17785
17786                 IEnumerator IEnumerable.GetEnumerator () {
17787                         ...
17788                 }
17789                 
17790                 public struct MyEnumerator : IEnumerator {
17791                         ...
17792                 }
17793         }
17794
17795         Before, there were a few things we did wrong:
17796         1) we would emit callvirt on a struct, which is illegal
17797         2) we emited ldarg when we needed to emit ldarga
17798         3) we would mistakenly call the interface methods on an enumerator
17799         type that derived from IEnumerator and was in another assembly. For example:
17800
17801         public class MyEnumerator : IEnumerator
17802
17803         Would have the interface methods called, even if there were public impls of the
17804         method. In a struct, this lead to invalid IL code.
17805
17806 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
17807
17808         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
17809           renamed to Emit.
17810
17811         * delegate.cs (Define): Fixed crash when delegate type is undefined.
17812
17813 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
17814
17815         * cs-parser.jay: Fix small regression: we were not testing V2
17816         compiler features correctly.
17817
17818         * interface.cs: If the emit context is null, then create one
17819
17820 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
17821
17822         * decl.cs (GetSignatureForError): New virtual method to get full name
17823           for error messages.
17824
17825         * attribute.cs (IAttributeSupport): New interface for attribute setting.
17826           Now it is possible to rewrite ApplyAttributes method to be less if/else.
17827
17828         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
17829           Duplicated members and code in these classes has been removed.
17830           Better encapsulation in these classes.
17831
17832 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
17833
17834         * assign.cs (Assign.DoResolve): When dealing with compound
17835         assignments, there is a new rule in ECMA C# 2.4 (might have been
17836         there before, but it is documented here) that states that in:
17837
17838         a op= b;
17839
17840         If b is of type int, and the `op' is a shift-operator, then the
17841         above is evaluated as:
17842
17843         a = (int) a op b 
17844
17845         * expression.cs (Binary.ResolveOperator): Instead of testing for
17846         int/uint/long/ulong, try to implicitly convert to any of those
17847         types and use that in pointer arithmetic.
17848
17849         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
17850         method to print information for from the type, not from the
17851         null-method we were given.
17852
17853 2004-02-01  Duncan Mak  <duncan@ximian.com>
17854
17855         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
17856         parsing for cmd, fixes bug #53694.
17857
17858 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
17859
17860         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
17861         in the member name duplication tests. Property and operator name duplication
17862         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
17863
17864 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
17865
17866         * interface.cs (PopulateMethod): Fixed crash when interface method
17867         returns not existing type (error test cs0246-3.cs).
17868
17869 2004-02-02  Ravi Pratap M <ravi@ximian.com>
17870
17871         * cs-parser.jay (interface_accessors): Re-write actions to also
17872         store attributes attached to get and set methods. Fix spelling
17873         while at it.
17874
17875         (inteface_property_declaration): Modify accordingly.
17876
17877         (InterfaceAccessorInfo): New helper class to store information to pass
17878         around between rules that use interface_accessors.
17879
17880         * interface.cs (Emit): Apply attributes on the get and set
17881         accessors of properties and indexers too.
17882
17883         * attribute.cs (ApplyAttributes): Modify accordingly to use the
17884         right MethodBuilder when applying attributes to the get and set accessors.
17885
17886 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
17887
17888         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
17889
17890 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
17891
17892         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
17893
17894 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
17895
17896         * cs-parser.jay: Remove YIELD token, instead use the new grammar
17897         changes that treat `yield' specially when present before `break'
17898         or `return' tokens.
17899
17900         * cs-tokenizer.cs: yield is no longer a keyword.
17901
17902 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
17903
17904         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
17905         setting for default constructors.
17906         For default constructors are almost every time set wrong Modifier. The
17907         generated IL code has been alright. But inside mcs this values was
17908         wrong and this was reason why several of my CLS Compliance tests
17909         failed.
17910
17911 2004-01-22  Martin Baulig  <martin@ximian.com>
17912
17913         * cs-parser.jay (namespace_or_type_name): Return an Expression,
17914         not a QualifiedIdentifier.  This is what `type_name_expression'
17915         was previously doing.
17916         (type_name_expression): Removed; the code is now in
17917         `namespace_or_type_name'.
17918         (qualified_identifier): Removed, use `namespace_or_type_name'
17919         instead.
17920         (QualifiedIdentifier): Removed this class.      
17921
17922 2004-01-22  Martin Baulig  <martin@ximian.com>
17923
17924         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
17925         not a string as alias name.
17926
17927 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
17928
17929         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
17930         #52730 bug, and instead compute correctly the need to use a
17931         temporary variable when requesting an address based on the
17932         static/instace modified of the field and the constructor.
17933  
17934 2004-01-21  Martin Baulig  <martin@ximian.com>
17935
17936         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
17937         class and namespace before looking up aliases.  Fixes #52517.
17938
17939 2004-01-21  Martin Baulig  <martin@ximian.com>
17940
17941         * flowanalysis.cs (UsageVector.Merge): Allow variables being
17942         assinged in a 'try'; fixes exception4.cs.
17943
17944 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17945         * class.cs : Implemented parameter-less constructor for TypeContainer
17946
17947         * decl.cs: Attributes are now stored here. New property OptAttributes
17948
17949         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
17950
17951         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
17952
17953 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17954
17955         * typemanager.cs (CSharpSignature): Now reports also inner class name.
17956           (CSharpSignature): New method for indexer and property signature.
17957
17958 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17959
17960         * pending.cs (IsVirtualFilter): Faster implementation.
17961
17962 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17963
17964         * typemanager.cs: Avoid inclusion of same assembly more than once.
17965
17966 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17967
17968         * cs-parser.jay: Fixed problem where the last assembly attribute
17969           has been applied also to following declaration (class, struct, etc.)
17970           
17971 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17972
17973         * class.cs: Added error CS0538, CS0539 reporting.
17974         Fixed crash on Microsoft runtime when field type is void.
17975
17976         * cs-parser.jay: Added error CS0537 reporting.
17977
17978         * pending.cs: Added error CS0535 reporting.
17979         Improved error report for errors CS0536, CS0534.
17980
17981 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
17982
17983         Merge a few bits from the Anonymous Method MCS tree.
17984
17985         * statement.cs (ToplevelBlock): New class for toplevel methods,
17986         will hold anonymous methods, lifted variables.
17987
17988         * cs-parser.jay: Create toplevel blocks for delegates and for
17989         regular blocks of code. 
17990
17991 2004-01-20  Martin Baulig  <martin@ximian.com>
17992
17993         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
17994         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
17995         and `NeedExplicitReturn'; added `IsLastStatement'.
17996         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
17997         have a `ReturnLabel' or we're not unreachable.
17998
17999         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
18000         child's reachability; don't just override ours with it.  Fixes
18001         #58058 (lluis's example).
18002         (FlowBranching): Added public InTryOrCatch(), InCatch(),
18003         InFinally(), InLoop(), InSwitch() and
18004         BreakCrossesTryCatchBoundary() methods.
18005
18006         * statement.cs (Return): Do all error checking in Resolve().
18007         Unless we are the last statement in a top-level block, always
18008         create a return label and jump to it.
18009         (Break, Continue): Do all error checking in Resolve(); also make
18010         sure we aren't leaving a `finally'.
18011         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
18012         statement in a top-level block.
18013         (Block.Flags): Added `IsDestructor'.
18014         (Block.IsDestructor): New public property.
18015
18016 2004-01-20  Martin Baulig  <martin@ximian.com>
18017
18018         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
18019
18020 2004-01-20  Martin Baulig  <martin@ximian.com>
18021
18022         * statement.cs (Statement.ResolveUnreachable): New public method.
18023         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
18024         (Block.Resolve): Resolve unreachable statements.
18025
18026 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
18027
18028         * expression.cs: We need to fix the case where we do
18029         not have a temp variable here.
18030
18031         * assign.cs: Only expression compound assignments need
18032         temporary variables.
18033
18034 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
18035
18036         * flowanalysis.cs: Reduce memory allocation in a few ways:
18037           - A block with no variables should not allocate a bit
18038             vector for itself.
18039           - A method with no out parameters does not need any tracking
18040             for assignment of the parameters, so we need not allocate
18041             any data for it.
18042           - The arrays:
18043                 public readonly Type[] VariableTypes;
18044                 public readonly string[] VariableNames;
18045             Are redundant. The data is already stored in the variable
18046             map, so we need not allocate another array for it.
18047           - We need to add alot of checks for if (params | locals) == null
18048             due to the first two changes.
18049
18050 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
18051
18052         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
18053         implement IMemoryLocation, we store a copy on a local variable and
18054         take the address of it.  Patch from Benjamin Jemlich
18055
18056         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
18057         to use a special "type_name_expression" rule which reduces the
18058         number of "QualifiedIdentifier" classes created, and instead
18059         directly creates MemberAccess expressions.
18060
18061 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
18062
18063         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
18064         that fixes #52853.  Null literal assignment to ValueType
18065
18066         * class.cs (MethodData.Emit): Instead of checking the name of the
18067         method to determine if its a destructor, create a new derived
18068         class from Method called Destructor, and test for that.  
18069
18070         * cs-parser.jay: Create a Destructor object instead of a Method.  
18071
18072         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
18073
18074         Fixes: 52933
18075
18076 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
18077
18078         * expression.cs (Binary.ResolveOperator): Perform an implicit
18079         conversion from MethodGroups to their delegate types on the
18080         Addition operation.
18081
18082         * delegate.cs: Introduce a new class DelegateCreation that is the
18083         base class for `NewDelegate' and `ImplicitDelegateCreation',
18084         factor some code in here.
18085
18086         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
18087         conversion from MethodGroups to compatible delegate types. 
18088
18089         * ecore.cs (Expression.Resolve): Do not flag error 654
18090         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
18091         we allow conversions from MethodGroups to delegate types now.
18092
18093         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
18094         assignments in v2 either.
18095
18096 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
18097
18098         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
18099         static read-only fields in ctors.
18100
18101         Applied patch from Benjamin Jemlich 
18102
18103         * expression.cs (UnaryMutator): Avoid leaking local variables. 
18104
18105 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
18106
18107         * cs-tokenizer.cs (IsCastToken): Allow the various native types
18108         here to return true, as they can be used like this:
18109
18110                 (XXX) int.MEMBER ()
18111
18112         Fixed 49836 and all the other dups
18113
18114 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
18115
18116         * driver.cs: Implement /win32res and /win32icon.
18117
18118 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
18119
18120         * cs-parser.jay: Add a rule to improve error handling for the
18121         common mistake of placing modifiers after the type.
18122
18123 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
18124
18125         * cs-parser.jay (interface_event_declaration): Catch
18126         initialization of events on interfaces, and report cs0068
18127
18128         * cs-parser.jay (interface_event_declaration): Catch
18129         initialization of events. 
18130
18131         * ecore.cs: Better report missing constructors.
18132
18133         * expression.cs (Binary.ResolveOperator): My previous bug fix had
18134         the error reporting done in the wrong place.  Fix.
18135
18136         * expression.cs (Binary.ResolveOperator): Catch the 
18137         operator + (E x, E y) error earlier, and later allow for implicit
18138         conversions in operator +/- (E e, U x) from U to the underlying
18139         type of E.
18140
18141         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
18142         52596, if the container class is abstract, the default constructor
18143         is protected otherwise its public (before, we were always public).
18144
18145         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
18146         fixed statement.
18147
18148         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
18149         Jemlich that fixes bug #52597, MCS was generating invalid code for
18150         idisposable structs.   Thanks to Ben for following up with this
18151         bug as well.
18152
18153 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
18154
18155         * driver.cs: Allow assemblies without code to be generated, fixes
18156         52230.
18157
18158 2004-01-07  Nick Drochak <ndrochak@gol.com>
18159
18160         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
18161
18162 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
18163
18164         * cs-parser.jay: Add rules to improve error reporting if fields or
18165         methods are declared at the namespace level (error 116)
18166
18167         * Add rules to catch event add/remove
18168
18169 2004-01-04  David Sheldon <dave-mono@earth.li>
18170
18171   * expression.cs: Added matching ")" to error message for 
18172   CS0077
18173
18174 2004-01-03 Todd Berman <tberman@gentoo.org>
18175
18176         * ecore.cs, attribute.cs:
18177         Applying fix from #52429.
18178
18179 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18180
18181         * ecore.cs, expression.cs, statement.cs:
18182         Total rewrite of how we handle branching. We
18183         now handle complex boolean expressions with fewer
18184         jumps. As well if (x == 0) no longer emits a ceq.
18185
18186         if (x is Foo) is much faster now, because we generate
18187         better code.
18188
18189         Overall, we get a pretty big improvement on our benchmark
18190         tests. The code we generate is smaller and more readable.
18191
18192         I did a full two-stage bootstrap. The patch was reviewed
18193         by Martin and Miguel.
18194
18195 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18196
18197         * cs-parser.jay: Make primary_expression not take a QI.
18198         we dont need this because the member_access rule covers
18199         us here. So we replace the rule with just IDENTIFIER.
18200
18201         This has two good effects. First, we remove a s/r conflict.
18202         Second, we allocate many fewer QualifiedIdentifier objects.
18203
18204 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18205
18206         * attribute.cs: Handle MarshalAs attributes as pseudo, and
18207         set the correct information via SRE. This prevents
18208         hanging on the MS runtime. Fixes #29374.
18209
18210 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18211
18212         * convert.cs: correctly handle conversions to value types
18213         from Enum and ValueType as unboxing conversions.
18214
18215         Fixes bug #52569. Patch by Benjamin Jemlich.
18216
18217 2004-01-02  Ravi Pratap  <ravi@ximian.com>
18218
18219         * expression.cs (BetterConversion): Prefer int -> uint
18220         over int -> ulong (csc's behaviour). This fixed bug #52046.
18221
18222 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
18223
18224         * decl.cs (MemberCache.FindMembers): now returns a
18225         MemberInfo [].
18226
18227         * typemanager.cs: In general, go with with ^^.
18228         (CopyNewMethods): take an IList.
18229         (RealMemberLookup): Only allocate an arraylist
18230         if we copy from two sets of methods.
18231
18232         This change basically does two things:
18233         1) Fewer array lists allocated due to CopyNewMethods.
18234         2) the explicit cast in MemberList costed ALOT.
18235
18236 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
18237
18238         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
18239         a hashtable to avoid needless string allocations when an identifier is
18240         used more than once (the common case).
18241
18242 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
18243
18244         * pending.cs: MS's TypeBuilder.GetInterfaces ()
18245         is broken, it will not return anything. So, we
18246         have to use the information we have in mcs to
18247         do the task.
18248
18249         * typemanager.cs: Add a cache for GetInterfaces,
18250         since this will now be used more often (due to ^^)
18251
18252         (GetExplicitInterfaces) New method that gets the
18253         declared, not effective, interfaces on a type
18254         builder (eg, if you have interface IFoo, interface
18255         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
18256         { IBar }.
18257
18258         This patch makes MCS able to bootstrap itself on
18259         Windows again.
18260
18261 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
18262
18263         * expression.cs: Remove the Nop's that Miguel put
18264         in by mistake.
18265
18266 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
18267
18268         * report.cs, codegen.cs: Give the real stack trace to
18269         the error when an exception is thrown.
18270
18271 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
18272
18273         * decl.cs: only allocate hashtables for ifaces if 
18274         it is an iface!
18275
18276 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
18277
18278         * expression.cs: fix the error from cs0121-2.cs
18279         (a parent interface has two child interfaces that
18280         have a function with the same name and 0 params
18281         and the function is called through the parent).
18282
18283 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
18284
18285         * class.cs, rootcontext.cs, typmanager.cs: do not
18286         leak pointers.
18287
18288 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
18289
18290         * codegen.cs: remove stack for the ec flow branching.
18291         It is already a linked list, so no need.
18292
18293 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
18294
18295         * Makefile: Allow custom profiler here.
18296
18297 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
18298
18299         * typemanager.cs (LookupType):
18300           - Use a static char [], because split takes
18301             a param array for args, so it was allocating
18302             every time.
18303           - Do not store true in a hashtable, it boxes.
18304
18305 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
18306
18307         * flowanalysis.cs: bytify common enums.
18308
18309 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
18310
18311         * modifiers.cs: Add a new set of flags for the
18312         flags allowed on explicit interface impls.
18313         * cs-parser.jay: catch the use of modifiers in
18314         interfaces correctly.
18315         * class.cs: catch private void IFoo.Blah ().
18316
18317         All related to bug #50572.
18318
18319 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
18320
18321         * decl.cs: Rewrite the consistant accessability checking.
18322         Accessability is not linear, it must be implemented in
18323         a tableish way. Fixes #49704.
18324
18325 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
18326
18327         * expression.cs: Handle negation in a checked context.
18328         We must use subtraction from zero. Fixes #38674.
18329
18330 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18331
18332         * class.cs: Ignore static void main in DLLs.
18333         * rootcontext.cs: Handle the target type here,
18334         since we are have to access it from class.cs
18335         * driver.cs: account for the above.
18336
18337 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18338
18339         * report.cs: Give line numbers and files if available.
18340
18341 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
18342
18343         * driver.cs: Implement /addmodule.
18344
18345         * typemanager.cs:  Change 'modules' field so it now contains Modules not
18346         ModuleBuilders.
18347
18348 2003-12-20  Martin Baulig  <martin@ximian.com>
18349
18350         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
18351         (FieldBase.IsAssigned): Removed this field.
18352         (FieldBase.SetAssigned): New public method.
18353         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
18354
18355 2003-12-20  Martin Baulig  <martin@ximian.com>
18356
18357         * expression.cs (LocalVariableReference.DoResolve): Don't set
18358         `vi.Used' if we're called from DoResolveLValue().
18359
18360         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
18361         returns the usage vector it just merged into the current one -
18362         pass this one to UsageWarning().
18363         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
18364         of the `EmitContext', don't call this recursively on our children.
18365
18366 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
18367
18368         * driver.cs: Implement /target:module.
18369
18370 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
18371
18372         * support.cs (CharArrayHashtable): New helper class.
18373
18374         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
18375         char arrays, not strings, so we can avoid creating a string in
18376         consume_identifier if the identifier is a keyword.
18377
18378 2003-12-16  Martin Baulig  <martin@ximian.com>
18379
18380         * statement.cs (LocalInfo.Assigned): Removed this property.
18381         (LocalInfo.Flags): Removed `Assigned'.
18382         (LocalInfo.IsAssigned): New public method; takes the EmitContext
18383         and uses flow analysis.
18384         (Block.UsageWarning): Made this method private.
18385         (Block.Resolve): Call UsageWarning() if appropriate.
18386
18387         * expression.cs (LocalVariableReference.DoResolve): Always set
18388         LocalInfo.Used here.
18389
18390 2003-12-13  Martin Baulig  <martin@ximian.com>
18391
18392         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
18393         any value here; we're now using flow analysis to figure out
18394         whether a statement/block returns a value.
18395
18396 2003-12-13  Martin Baulig  <martin@ximian.com>
18397
18398         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
18399         working again.
18400         (FlowBranching.MergeFinally): Don't call
18401         `branching.CheckOutParameters()' here, this is called in
18402         MergeTopBlock().
18403         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
18404         when adding the `finally' vector.       
18405
18406 2003-12-13  Martin Baulig  <martin@ximian.com>
18407
18408         * flowanalysis.cs
18409         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
18410         actually work and also fix #48962.
18411
18412 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
18413
18414         * decl.cs: Do not check System.Object for nested types,
18415         since we know it does not have any. Big bang for buck:
18416
18417         BEFORE:
18418            Run 1:   8.35 seconds
18419            Run 2:   8.32 seconds
18420            corlib:  17.99 seconds
18421         AFTER:
18422            Run 1:   8.17 seconds
18423            Run 2:   8.17 seconds
18424            corlib:  17.39 seconds
18425
18426 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
18427
18428         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
18429         time we are returning 0 members, so we save alot here.
18430
18431 2003-12-11  Martin Baulig  <martin@ximian.com>
18432
18433         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
18434         `MergeChild()', also just take the `FlowBranching' as argument;
18435         call Merge() on it and return the result.
18436         (FlowBranching.Merge): We don't need to do anything if we just
18437         have one sibling.
18438
18439 2003-12-11  Martin Baulig  <martin@ximian.com>
18440
18441         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
18442         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
18443         Maurer for this idea.
18444
18445 2003-12-11  Martin Baulig  <martin@ximian.com>
18446
18447         * flowanalysis.cs (MergeResult): This class is now gone; we now
18448         use the `UsageVector' for this.  The reason for this is that if a
18449         branching just has one sibling, we don't need to "merge" them at
18450         all - that's the next step to do.
18451         (FlowBranching.Merge): We now return a `UsageVector' instead of a
18452         `MergeResult'.
18453
18454 2003-12-11  Martin Baulig  <martin@ximian.com>
18455
18456         Reworked flow analyis and made it more precise and bug-free.  The
18457         most important change is that we're now using a special `Reachability'
18458         class instead of having "magic" meanings of `FlowReturns'.  I'll
18459         do some more cleanups and optimizations and also add some more
18460         documentation this week.
18461
18462         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
18463         largely reworked this class.
18464         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
18465         the new `Reachability' class instead of having "magic" values here.
18466         (FlowBranching): We're now using an instance of `Reachability'
18467         instead of having separate `Returns', `Breaks' etc. fields.
18468
18469         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
18470         based on flow analysis; ignore the return value of block.Emit ().
18471
18472 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
18473
18474         * driver.cs typemanager.cs: Find the mono extensions to corlib even
18475         if they are private.
18476
18477 2003-12-09  Martin Baulig  <martin@ximian.com>
18478
18479         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
18480         call them directly on the UsageVector.
18481
18482 2003-12-09  Martin Baulig  <martin@ximian.com>
18483
18484         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
18485         Changed return type from `FlowReturns' to `Reachability'.
18486
18487 2003-12-09  Martin Baulig  <martin@ximian.com>
18488
18489         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
18490         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
18491         `Reachable' fields with a single `Reachability' one.
18492
18493 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18494
18495         * class.cs (FindMembers): Remove foreach's.
18496
18497         Bootstrap times:
18498
18499         BEFORE
18500                 Run 1:   8.74 seconds
18501                 Run 2:   8.71 seconds
18502
18503         AFTER
18504                 Run 1:   8.64 seconds
18505                 Run 2:   8.58 seconds
18506
18507
18508 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18509
18510         * cs-parser.jay:
18511         * gen-treedump.cs:
18512         * statement.cs:
18513         This patch does a few things:
18514                 1. EmptyStatement is now a singleton, so it is never reallocated.
18515                 2. All blah is EmptyStatement constructs have been changed to
18516                    blah == EmptyStatement.Value, which is much faster and valid
18517                    now that EmptyStatement is a singleton.
18518                 3. When resolving a block, rather than allocating a new array for
18519                    the non-empty statements, empty statements are replaced with
18520                    EmptyStatement.Value
18521                 4. Some recursive functions have been made non-recursive.
18522         Mainly the performance impact is from (3), however (1) and (2) are needed for
18523         this to work. (4) does not make a big difference in normal situations, however
18524         it makes the profile look saner.
18525
18526         Bootstrap times:
18527
18528         BEFORE
18529         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
18530         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
18531         Total memory allocated: 56397 KB
18532
18533         AFTER
18534         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
18535         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
18536         Total memory allocated: 55666 KB
18537
18538 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18539
18540         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
18541         than the hashtable in a hashtable version
18542
18543         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
18544         we always end up concating a string. This results in a huge perf
18545         loss, because many strings have to be tracked by the GC. In this
18546         patch, we first use a hashtable that works with two keys, so that
18547         the strings do not need to be concat'ed.
18548
18549         Bootstrap times:
18550         BEFORE
18551                 Run 1:   8.74 seconds
18552                 Run 2:   8.71 seconds
18553
18554         AFTER
18555                 Run 1:   8.65 seconds
18556                 Run 2:   8.56 seconds
18557
18558 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18559
18560         * Makefile: Add a new target `do-time' that does a quick and simple
18561         profile, leaving easy to parse output.
18562
18563 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
18564
18565         * codegen.cs (Init): Create the dynamic assembly with 
18566         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
18567
18568 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
18569
18570         * support.cs: Make the PtrHashtable use only one
18571         instance of its comparer.
18572
18573 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
18574
18575         * typemanager.cs: Fix lookup of GetNamespaces.
18576
18577 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
18578
18579         * expression.cs: Removed redundant line.
18580
18581         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
18582         ArrayLists, use for loops with bounds.  
18583
18584         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
18585         arraylist.
18586
18587         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
18588         arraylists, use for loop with bounds.
18589
18590         The above three changes give us a 0.071 second performance
18591         improvement out of 3.294 seconds down to 3.223.  On my machine
18592         the above changes reduced the memory usage by 1,387 KB during
18593         compiler bootstrap.
18594
18595         * cs-parser.jay (QualifiedIdentifier): New class used to represent
18596         QualifiedIdentifiers.  Before we created a new string through
18597         concatenation, and mostly later on, the result would be
18598         manipulated by DecomposeQI through string manipulation.
18599
18600         This reduced the compiler memory usage for bootstrapping from
18601         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
18602         compile times in 0.05 seconds.
18603
18604 2003-11-28  Dick Porter  <dick@ximian.com>
18605
18606         * support.cs: Do string compares with the Invariant culture.
18607
18608         * rootcontext.cs: 
18609         * gen-treedump.cs: 
18610         * expression.cs: 
18611         * driver.cs: 
18612         * decl.cs: 
18613         * codegen.cs: 
18614         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
18615         the comparison is done with the Invariant culture.
18616
18617 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
18618
18619         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
18620         GetEnumerator method.
18621
18622         (ProbeCollectionType): Iterate starting at the most specific type
18623         upwards looking for a GetEnumerator
18624
18625         * expression.cs: Shift count can be up to 31 for int/uint and 63
18626         for long/ulong.
18627
18628 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
18629
18630         * statement.cs (Block.LookupLabel): Also look for the label on the
18631         children blocks.  Use a hash table to keep track of visited
18632         nodes. 
18633
18634         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
18635         we actually did transform the other operand, otherwise fall back
18636         to the common codepath that casts to long.
18637
18638         * cs-tokenizer.cs: Use the same code pattern as the int case.
18639         Maybe I should do the parsing myself, and avoid depending on the
18640         Parse routines to get this done.
18641
18642 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
18643
18644         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
18645         which fixes bug 51347.  This time test it.
18646
18647         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
18648         attributes for example can not tell the difference between these.
18649         The difference was only a syntax feature of the language. 
18650
18651         * attribute.cs: Apply attributes to delegates.
18652
18653         * delegate.cs: Call the apply attributes method.
18654
18655 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
18656
18657         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
18658         comparing 0 vs Byte.MinValue, not the value
18659
18660         (ImplicitConversionRequired): When reporting a conversion error,
18661         use error 31 to print out the constant error instead of the
18662         simpler 29.
18663
18664         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
18665         which fixes bug 51347.
18666
18667 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
18668
18669         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
18670         which fixes the -warnaserror command line option.
18671
18672 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
18673
18674         * cfold.cs (DoNumericPromotions): During constant folding of
18675         additions on UIntConstant, special case intconstants with
18676         IntConstants like we do on the expression binary operator. 
18677
18678 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
18679
18680         * convert.cs (ImplicitReferenceConversion): We were missing a case
18681         (System.Enum are not value types or class types, so we need to
18682         classify them separatedly).
18683
18684         * driver.cs: We do not support error 2007.
18685
18686 2003-11-12 Jackson Harper <jackson@ximian.com>
18687
18688         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
18689         system directory. Also use the full file name so users can
18690         libraries names mscorlib-o-tron.dll in a non system dir.
18691
18692 2003-11-10  Martin Baulig  <martin@ximian.com>
18693
18694         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
18695         (TypeManager.InitCoreTypes): Initialize them here, but instead of
18696         calling `ResolveType()' on them, directly assign their `Type'.
18697
18698 2003-11-08  Martin Baulig  <martin@ximian.com>
18699
18700         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
18701         return value and the `out parent' parameter.
18702         (TypeContainer.DefineType): Moved the CS0644 check into
18703         GetClassBases().  Don't pass the interface types to the
18704         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
18705         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
18706
18707         * ecore.cs (TypeExpr.IsAttribute): New property.
18708         (TypeExpr.GetInterfaces): New method.
18709
18710         * interface.cs (Interface.GetInterfaceTypeByName): Return a
18711         TypeExpr instead of a Type.
18712         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
18713         (Interface.DefineType): Don't pass the interface types to the
18714         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
18715         them later and then call `TypeBulider.AddInterfaceImplementation()'.
18716
18717         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
18718         instead of a `Type[]'.
18719         (TypeManager.RegisterBuilder): Likewise.
18720         (TypeManager.AddUserInterface): Likewise.
18721         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
18722         `Type[]' and also return a `TypeExpr[]'.
18723         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
18724
18725 2003-11-08  Martin Baulig  <martin@ximian.com>
18726
18727         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
18728         Expression.     
18729
18730 2003-11-08  Martin Baulig  <martin@ximian.com>
18731
18732         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
18733         TypeManager.ResolveExpressionTypes().
18734
18735         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
18736         instead of an Expression.
18737         (TypeExpr): This is now an abstract base class for `TypeExpression'.
18738         (TypeExpression): New public class; formerly known as `TypeExpr'.
18739
18740         * expression.cs (ComposedCast): Derive from TypeExpr.
18741
18742         * typemanager.cs (TypeManager.system_*_expr): These are now
18743         TypExpr's instead of Expression's.
18744         (TypeManager.ResolveExpressionTypes): New public static function;
18745         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
18746         of them.        
18747
18748 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
18749
18750         * expression.cs (New.DoResolve): Do not dereference value that
18751         might be a null return.
18752
18753         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
18754         sure that the constant value has the right type.  Fixes an
18755         unreported bug, similar to 50425.
18756
18757         * const.cs (Const.LookupConstantValue): Call
18758         ImplicitStandardConversionExists before doing a conversion to
18759         avoid havng the TypeManager.ChangeType do conversions.
18760
18761         Reduced the number of casts used
18762
18763         (Const.ChangeType): New routine to enable reuse of the constant
18764         type changing code from statement.
18765
18766         * typemanager.cs (ChangeType): Move common initialization to
18767         static global variables.
18768
18769         Fixes #50425.
18770
18771         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
18772         every value type to go through, even if it was void.  Fix that. 
18773
18774         * cs-tokenizer.cs: Use is_identifier_start_character on the start
18775         character of the define, and the is_identifier_part_character for
18776         the rest of the string.
18777
18778 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
18779
18780         * expression.cs (UnaryMutator.EmitCode): When I updated
18781         LocalVariableReference.DoResolve, I overdid it, and dropped an
18782         optimization done on local variable references.
18783
18784 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
18785
18786         * ecore.cs: Convert the return from Ldlen into an int.
18787
18788 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
18789
18790         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
18791         the accessibility, this is a special case for toplevel non-public
18792         classes (internal for instance).
18793
18794 2003-10-20  Nick Drochak <ndrochak@gol.com>
18795
18796         * ecore.cs: Fix typo and build.  Needed another right paren.
18797
18798 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
18799
18800         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
18801         `internal' case regular and protected, but not allowing protected
18802         to be evaluated later.  Bug 49840
18803
18804 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
18805
18806         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
18807         to kb.Nlast, and not the kb.nFirst to isolate the switch
18808         statement.
18809
18810         Extract the underlying type, so enumerations of long/ulong are
18811         treated like long/ulong.
18812
18813 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
18814
18815         * expression.cs (New): Overload the meaning of RequestedType to
18816         track the possible creation of the NewDelegate type, since
18817         DoResolve is invoked more than once for new constructors on field
18818         initialization.
18819
18820         See bugs: #48800 and #37014
18821
18822         * cs-parser.jay (declare_local_constants): Take an arraylist
18823         instead of a single constant.
18824
18825         (local_constant_declaration): It should take a
18826         constant_declarators, not a constant_declarator.  Fixes 49487
18827
18828         * convert.cs: Fix error report.
18829
18830 2003-10-13 Jackson Harper <jackson@ximian.com>
18831
18832         * typemanager.cs (TypeToCoreType): Add float and double this fixes
18833         bug #49611
18834
18835 2003-10-09  Martin Baulig  <martin@ximian.com>
18836
18837         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
18838         to the .ctor.
18839         (MethodCore.DoDefineParameters): Removed the TypeContainer
18840         argument; use the DeclSpace which was passed to the .ctor instead.
18841         (MethodCore.CheckParameter): Take a DeclSpace instead of a
18842         TypeContainer; we only need a DeclSpace here.
18843
18844 2003-10-09  Martin Baulig  <martin@ximian.com>
18845
18846         * class.cs (MethodData): Added additional `DeclSpace ds' argument
18847         to the .ctor.
18848         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
18849         EmitContext's .ctor.    
18850
18851 2003-10-09  Martin Baulig  <martin@ximian.com>
18852
18853         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
18854         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
18855         AsAccessible(), moved them as well.
18856
18857         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
18858
18859 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
18860
18861         * cs-parser.jay : Renamed yyName to yyNames related to jay.
18862
18863 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
18864
18865         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
18866         generation for >=, as spotted by Paolo, bug 48679.  
18867         Patch from David Waite.
18868
18869         * cs-tokenizer.cs: Add handling for #pragma.
18870
18871         * cs-parser.jay: Allow for both yield and yield return in the
18872         syntax.  The anti-cobolization of C# fight will go on!
18873
18874         * class.cs (TypeBuilder.DefineType): Catch error condition here
18875         (Parent.DefineType erroring out and returning null).
18876
18877         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
18878         coping with enumerations variables, we were mistakenly processing
18879         them as a regular value type instead of built-in types.  Fixes the
18880         bug #48063
18881
18882         * typemanager.cs (IsBuiltinOrEnum): New method.
18883
18884 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
18885
18886         * cs-parser.jay: Upgrade: yield now needs the return clause.
18887
18888 2003-09-19  Martin Baulig  <martin@ximian.com>
18889
18890         * decl.cs (MemberCache.SetupCacheForInterface): Take a
18891         `MemberCache parent' argument.  Normally, an interface doesn't
18892         have a parent type except System.Object, but we use this in gmcs
18893         for generic type parameters.
18894
18895 2003-09-18  Martin Baulig  <martin@ximian.com>
18896
18897         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
18898         on `type.IsInterface'; don't check whether the type has a parent
18899         to determine whether it's an interface.
18900
18901 2003-09-15  Martin Baulig  <martin@ximian.com>
18902
18903         * class.cs (TypeContainer.DefineType): Added an error flag to
18904         avoid reporting duplicate CS0146's ("class definition is
18905         circular.").
18906
18907         * driver.cs (Driver.MainDriver): Abort if
18908         RootContext.ResolveTree() reported any errors.
18909
18910 2003-09-07  Martin Baulig  <martin@ximian.com>
18911
18912         * report.cs (Error, Warning): Added overloaded versions which take
18913         a `params object[] args' and call String.Format().
18914
18915 2003-09-07  Martin Baulig  <martin@ximian.com>
18916
18917         * decl.cs (DeclSpace..ctor): Don't call
18918         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
18919         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
18920         (DeclSpace.RecordDecl): New method.
18921
18922         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
18923
18924 2003-09-02  Ravi Pratap  <ravi@ximian.com>
18925
18926         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
18927         value attributes to be applied to ParameterBuilders.
18928
18929         * class.cs (MethodCore.LabelParameters): Make static and more
18930         generic so that it can be used from other places - like interface
18931         methods, for instance.
18932
18933         * interface.cs (Interface.Emit): Call LabelParameters before
18934         emitting attributes on the InterfaceMethod.
18935
18936 2003-08-26  Martin Baulig  <martin@ximian.com>
18937
18938         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
18939         resolving aliases; fixes #47927.
18940
18941 2003-08-26  Martin Baulig  <martin@ximian.com>
18942
18943         * statement.cs (Using.DoResolve): This is internally emitting a
18944         try/finally clause, so we need to set ec.NeedExplicitReturn if we
18945         do not always return.  Fixes #47681.
18946
18947 2003-08-26  Martin Baulig  <martin@ximian.com>
18948
18949         * decl.cs (MemberCore): Moved WarningNotHiding(),
18950         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
18951         into MemberBase.
18952         (AdditionResult): Make this nested in DeclSpace.
18953         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
18954         argument; call NamespaceEntry.Define() unless we're nested in a
18955         class or struct.
18956
18957         * namespace.cs (Namespace.DefineName): New public function.  This
18958         is called from DeclSpace's .ctor to add 
18959         (Namespace.Lookup): Include DeclSpaces in the lookup.
18960
18961         * class.cs (Operator): Derive from MemberBase, not MemberCore.
18962
18963         * const.cs (Const): Derive from MemberBase, not MemberCore.     
18964
18965 2003-08-25  Martin Baulig  <martin@ximian.com>
18966
18967         * convert.cs (Convert.ExplicitReferenceConversion): When
18968         converting from an interface type to a class, unbox if the target
18969         type is a struct type.  Fixes #47822.
18970
18971 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18972
18973         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
18974         #47854.
18975
18976 2003-08-22  Martin Baulig  <martin@ximian.com>
18977
18978         * class.cs (TypeManager.DefineType): When defining a nested type,
18979         call DefineType() on our parent; fixes #47801.
18980
18981 2003-08-22  Martin Baulig  <martin@ximian.com>
18982
18983         * class.cs (MethodData.Define): While checking if a method is an
18984         interface implementation, improve the test a bit more to fix #47654.
18985
18986 2003-08-22  Martin Baulig  <martin@ximian.com>
18987
18988         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
18989         correctly; fixes #47722.
18990
18991 2003-08-22  Martin Baulig  <martin@ximian.com>
18992
18993         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
18994         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
18995
18996         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
18997
18998 2003-08-22  Martin Baulig  <martin@ximian.com>
18999
19000         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
19001         can only be assigned in static constructors.  Fixes #47161.
19002
19003 2003-08-22  Martin Baulig  <martin@ximian.com>
19004
19005         Rewrote and improved the flow analysis code.
19006
19007         * flowbranching.cs (FlowBranching): Make this class abstract.
19008         (FlowBranching.CreateBranching): New static function to create a
19009         new flow branching.
19010         (FlowBranchingBlock, FlowBranchingException): New classes.
19011         (FlowBranching.UsageVector.Type): New public readonly field.
19012         (FlowBranching.UsageVector.Breaks): Removed the setter.
19013         (FlowBranching.UsageVector.Returns): Removed the setter.
19014         (FlowBranching.UsageVector): Added Break(), Return(),
19015         NeverReachable() and Throw() methods to modify the reachability.
19016         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
19017         done by FlowBranching.Merge().
19018         (FlowBranching.UsageVector.MergeChild): New method; merges the
19019         merge result into the current vector.
19020         (FlowBranching.Merge): New abstract method to merge a branching.
19021
19022 2003-08-12  Martin Baulig  <martin@ximian.com>
19023
19024         * expression.cs (Indirection.CacheTemporaries): Create the
19025         LocalTemporary with the pointer type, not its element type.
19026
19027 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
19028
19029         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
19030         token was a keyword or not.
19031
19032         Add `error' options where an IDENTIFIER was expected;  Provide
19033         CheckToken and CheckIdentifierToken convenience error reporting
19034         functions. 
19035
19036         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
19037
19038         * decl.cs: Rename `NamespaceEntry Namespace' public field into
19039         NameSpaceEntry NameSpaceEntry.
19040
19041         (LookupInterfaceOrClass): Avoid creating a full qualified name
19042         from namespace and name: avoid doing lookups when we know the
19043         namespace is non-existant.   Use new Tree.LookupByNamespace which
19044         looks up DeclSpaces based on their namespace, name pair.
19045
19046         * driver.cs: Provide a new `parser verbose' to display the
19047         exception thrown during parsing.  This is turned off by default
19048         now, so the output of a failure from mcs is more graceful.
19049
19050         * namespace.cs: Track all the namespaces defined in a hashtable
19051         for quick lookup.
19052
19053         (IsNamespace): New method
19054
19055 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
19056
19057         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
19058         we know that we need to concatenate (full typename can never be
19059         null). 
19060
19061         * class.cs: ditto.
19062
19063         * statement.cs: Use a bitfield;  Do not initialize to null things
19064         which are done by the constructor by default.
19065
19066         * cs-parser.jay: bug fix, parameter was 4, not 3.
19067
19068         * expression.cs: Just use the property;
19069
19070         * statement.cs: No need for GetVariableInfo method.
19071
19072 2003-08-08  Martin Baulig  <martin@ximian.com>
19073
19074         * flowanalysis.cs (FlowReturns): This is now nested in the
19075         `FlowBranching' class.
19076         (MyBitVector): Moved this here from statement.cs.
19077         (FlowBranching.SiblingType): New enum type.
19078         (FlowBranching.CreateSibling): Added `SiblingType' argument.
19079
19080 2003-08-07  Martin Baulig  <martin@ximian.com>
19081
19082         * flowanalysis.cs (FlowBranchingType): This is now nested in the
19083         `FlowBranching' class and called `BranchingType'.
19084
19085 2003-08-07  Martin Baulig  <martin@ximian.com>
19086
19087         * flowanalysis.cs: Moved all the control flow analysis code into
19088         its own file.
19089
19090 2003-08-07  Martin Baulig  <martin@ximian.com>
19091
19092         * assign.cs (Assign.DoResolve): `target' must either be an
19093         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
19094         #37319.
19095
19096 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
19097
19098         * expression.cs (BinaryMethod): This kind of expression is created by the
19099         Binary class if it determines that the operator has to be handled
19100         by a method.
19101
19102         (BinaryDelegate): This kind of expression is created if we are
19103         dealing with a + or - operator on delegates.
19104
19105         (Binary): remove method, argumetns, and DelegateOperator: when
19106         dealing with methods, 
19107
19108         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
19109
19110         * statement.cs (Block): use bitfields for the three extra booleans
19111         we had in use.   Remove unused topblock parameter.
19112
19113         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
19114
19115         * assign.cs: Drop extra unneeded tests.
19116
19117 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
19118
19119         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
19120
19121         * statement.cs (Foreach): Use VariableStorage instead of
19122         LocalBuilders.   
19123
19124         * codegen.cs (VariableStorage): New class used by clients that
19125         require a variable stored: locals or fields for variables that
19126         need to live across yield.
19127
19128         Maybe provide a convenience api for EmitThis+EmitLoad?
19129
19130         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
19131         these bad boys.
19132
19133 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
19134
19135         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
19136         RemapParameterLValue): New methods that are used to turn a
19137         precomputed FieldInfo into an expression like this:
19138
19139                 instance.FieldInfo
19140
19141         The idea is to use this instead of making LocalVariableReference
19142         have more than one meaning.
19143
19144         * cs-parser.jay: Add error production to BASE.
19145
19146         * ecore.cs: Deal with TypeManager.GetField returning null, which
19147         is now a valid return value.
19148
19149         (FieldExprNoAddress): New expression for Fields whose address can
19150         not be taken.
19151
19152         * expression.cs (LocalVariableReference): During the resolve
19153         phases, create new expressions if we are in a remapping context.
19154         Remove code that dealt with remapping here.
19155
19156         (ParameterReference): same.
19157
19158         (ProxyInstance): New expression, like the `This' expression, but
19159         it is born fully resolved.  We know what we are doing, so remove
19160         the errors that are targeted to user-provided uses of `this'.
19161
19162         * statement.cs (Foreach): our variable is now stored as an
19163         Expression;  During resolution, follow the protocol, dont just
19164         assume it will return this.
19165
19166 2003-08-06  Martin Baulig  <martin@ximian.com>
19167
19168         * support.cs (SeekableStreamReader.cs): New public class.
19169
19170         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
19171         SeekableStreamReader instead of the normal StreamReader.
19172
19173 2003-08-04  Martin Baulig  <martin@ximian.com>
19174
19175         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
19176         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
19177         deambiguate casts and delegate invocations.
19178         (parenthesized_expression): Use the new tokens to ensure this is
19179         not a cast of method invocation.
19180
19181         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
19182         when reading a `)' and Deambiguate_CloseParens () was previously
19183         called.
19184
19185         * expression.cs (ParenthesizedExpression): New class.  This is
19186         just used for the CS0075 test.
19187         (Binary.DoResolve): Check for CS0075.   
19188
19189 2003-07-29  Ravi Pratap  <ravi@ximian.com>
19190
19191         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
19192         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
19193         reference comparison.
19194
19195         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
19196         examine the ReturnType for equality - this is necessary in the
19197         cases of implicit and explicit operators whose signature also
19198         includes the return type.
19199
19200 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
19201
19202         * namespace.cs: Cache the result of the namespace computation,
19203         instead of computing it every time.
19204
19205 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
19206
19207         * decl.cs: Use a global arraylist that we reuse over invocations
19208         to avoid excesive memory consumption.  Reduces memory usage on an
19209         mcs compile by one meg (45 average).
19210
19211         * typemanager.cs (LookupTypeReflection): In .NET pointers are
19212         private, work around that.
19213
19214 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
19215
19216         * literal.cs (IntLiteral): Define Zero and One static literals. 
19217
19218         * cs-parser.jay (integer_literal): use static literals to reduce
19219         memory usage for the most used literals (0, 1 and -1).  211kb
19220         reduced in memory usage.
19221
19222         Replace all calls to `new ArrayList' with `new
19223         ArrayList(4)' which is a good average number for most allocations,
19224         and also requires only 16 bytes of memory for its buffer by
19225         default. 
19226
19227         This reduced MCS memory usage in seven megabytes for the RSS after
19228         bootstrapping.
19229
19230 2003-07-28  Ravi Pratap  <ravi@ximian.com>
19231
19232         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
19233         handle params methods the correct way by forming only one
19234         applicable set with params and normal methods in them. Earlier we
19235         were looking at params methods only if we found no normal methods
19236         which was not the correct thing to do.
19237
19238         (Invocation.BetterFunction): Take separate arguments indicating
19239         when candidate and the best method are params methods in their
19240         expanded form.
19241
19242         This fixes bugs #43367 and #46199.
19243
19244         * attribute.cs: Documentation updates.
19245
19246         (CheckAttribute): Rename to CheckAttributeTarget.
19247         (GetValidPlaces): Rename to GetValidTargets.
19248
19249         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
19250         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
19251
19252         Fixes bug #44468.
19253
19254 2003-07-28  Martin Baulig  <martin@ximian.com>
19255
19256         * class.cs (TypeContainer.DefineMembers): Use the base type's full
19257         name when looking up the base class of a nested class.  Fixes #46977.
19258
19259 2003-07-26  Martin Baulig  <martin@ximian.com>
19260
19261         * expression.cs (Indexers.Indexer): New nested struct; contains
19262         getter, setter and the indexer's type.
19263         (Indexers.Properties): This is now an ArrayList of
19264         Indexers.Indexer's.
19265         (IndexerAccess.DoResolveLValue): Correctly set the type if the
19266         indexer doesn't have any getters.
19267
19268         * assign.cs (Assign.DoResolve): Also do the implicit conversions
19269         for embedded property and indexer assignments.
19270
19271 2003-07-26  Martin Baulig  <martin@ximian.com>
19272
19273         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
19274         preprocessor directive is not the first non-whitespace character
19275         on a line.
19276
19277 2003-07-26  Martin Baulig  <martin@ximian.com>
19278
19279         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
19280         namespace parsing, follow the spec more closely.
19281
19282         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
19283         NamespaceEntry.Lookup().
19284
19285 2003-07-25  Martin Baulig  <martin@ximian.com>
19286
19287         * MethodCore.cs (OverridesSomething): New public field; it's set
19288         from TypeContainer.DefineMembers if this method overrides
19289         something (which doesn't need to be a method).  Fix #39462.
19290
19291 2003-07-25  Ravi Pratap  <ravi@ximian.com>
19292
19293         * typemanager.cs (GetMembers): Ensure that the list of members is
19294         reversed. This keeps things in sync.
19295
19296         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
19297         find an AttributeUsage attribute.
19298
19299         * expression.cs (Invocation.OverloadResolve): Perform the check
19300         which disallows Invoke to be directly called on a Delegate.
19301
19302         (Error_InvokeOnDelegate): Report error cs1533.
19303
19304 2003-07-25  Martin Baulig  <martin@ximian.com>
19305
19306         * expression.cs (Indexers.GetIndexersForType): Only look in the
19307         interface hierarchy if the requested type is already an
19308         interface.  Fixes #46788 while keeping #46502 fixed.
19309
19310 2003-07-25  Martin Baulig  <martin@ximian.com>
19311
19312         * class.cs (TypeContainer.DefineMembers): Check whether all
19313         readonly fields have been assigned and report warning CS0649 if
19314         not.
19315
19316         * statement.cs (LocalInfo.IsFixed): Always return true if this is
19317         a valuetype.
19318
19319 2003-07-24  Ravi Pratap  <ravi@ximian.com>
19320
19321         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
19322         returned from GetMethods to make things consistent with the
19323         assumptions MCS makes about ordering of methods.
19324
19325         This should comprehensively fix bug #45127 and it does :-)
19326
19327         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
19328         ordering is actually reverse.
19329
19330         * Clean up some debug messages I left lying around.
19331
19332         * interface.cs (Populate*): Get rid of code which emits attributes
19333         since the stage in which we emit attributes is the 'Emit' stage,
19334         not the define stage.
19335
19336         (Emit): Move attribute emission for interface members here.
19337
19338 2003-07-22  Ravi Pratap  <ravi@ximian.com>
19339
19340         * expression.cs (Invocation.OverloadResolve): Follow the spec more
19341         closely: we eliminate methods in base types when we have an
19342         applicable method in a top-level type.
19343
19344         Please see section 14.5.5.1 for an exact description of what goes
19345         on. 
19346
19347         This fixes bug #45127 and a host of other related to corlib compilation.
19348
19349         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
19350         array is the method corresponding to the top-level type (this is
19351         because of the changes made to icall.c) so we change this
19352         accordingly.
19353
19354         (MethodGroupExpr.Name): This too.
19355
19356         * typemanager.cs (GetElementType): New method which does the right
19357         thing when compiling corlib. 
19358
19359         * everywhere: Make use of the above in the relevant places.
19360
19361 2003-07-22  Martin Baulig  <martin@ximian.com>
19362
19363         * cs-parser.jay (invocation_expression): Moved
19364         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
19365         `cast_expression', but create a InvocationOrCast which later
19366         resolves to either an Invocation or a Cast.
19367
19368         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
19369         method; call this before EmitStatement() to make sure that this
19370         expression can be used as a statement.
19371
19372         * expression.cs (InvocationOrCast): New class; resolves to either
19373         an Invocation or a Cast.
19374
19375         * statement.cs (StatementExpression): Call ResolveStatement() on
19376         the ExpressionStatement before emitting it.
19377
19378 2003-07-21  Martin Baulig  <martin@ximian.com>
19379
19380         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
19381         `ref' and `out' attributes match; fixes #46220.
19382         (MemberAccess.ResolveMemberAccess): You can't reference a type
19383         through an expression; fixes #33180.
19384         (Indexers.GetIndexersForType): Don't return the indexers from
19385         interfaces the class implements; fixes #46502.
19386
19387 2003-07-21  Martin Baulig  <martin@ximian.com>
19388
19389         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
19390         CS0661 checks; fixes bug #30442.
19391
19392 2003-07-21  Martin Baulig  <martin@ximian.com>
19393
19394         * decl.cs (AdditionResult): Added `Error'.
19395
19396         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
19397
19398         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
19399         makes cs0031.cs actually work.
19400
19401 2003-07-20  Martin Baulig  <martin@ximian.com>
19402
19403         * namespace.cs: Fixed that bug which caused a crash when compiling
19404         the debugger's GUI.
19405
19406 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
19407
19408         * typemanager.cs (LookupTypeReflection): Never expose types which
19409         are NotPublic, NestedPrivate, NestedAssembly, or
19410         NestedFamANDAssem.  We used to return these, and later do a check
19411         that would report a meaningful error, but the problem is that we
19412         would not get the real match, if there was a name override.
19413
19414 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
19415
19416         * namespace.cs (Namespace, Name): Do not compute the namespace
19417         name dynamically, compute it in the constructor.  This reduced
19418         memory usage by 1697 KB.
19419
19420         * driver.cs: Use --pause to pause at the end.
19421
19422 2003-07-17  Peter Williams  <peter@newton.cx>
19423
19424         * Makefile: Change the name of the test target so that it doesn't
19425         conflict with the recursive test target.
19426
19427 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
19428
19429         * expression.cs (LocalVariableReference.Emit, EmitAssign,
19430         AddressOf): Do not use EmitThis, that was wrong, use the actual
19431         this pointer.
19432
19433 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
19434
19435         * class.cs (MethodData.Define): While checking if a method is an
19436         interface implementation, improve the test: If we are not public
19437         (use new test here: use the computed MethodAttributes directly,
19438         instead of the parsed modifier flags) check if the `implementing'
19439         method comes from an interface or not.
19440
19441         * pending.cs (VerifyPendingMethods): Slightly better error
19442         message.
19443
19444         * makefile: add test target that does the mcs bootstrap.
19445
19446 2003-07-16  Ravi Pratap  <ravi@ximian.com>
19447
19448         * interface.cs (Define): Do nothing here since there are no
19449         members to populate etc. Move the attribute emission out of here
19450         since this was just totally the wrong place to put it. Attribute
19451         application happens during the 'Emit' phase, not in the 'Define'
19452         phase.
19453
19454         (Emit): Add this method and move the attribute emission here
19455
19456         * rootcontext.cs (EmitCode): Call the Emit method on interface
19457         types too.
19458
19459 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
19460
19461         * expression.cs (OverloadResolve): Report error only if Location
19462         is not 'Null' which means that there was a probe going on.
19463
19464 2003-07-14  Martin Baulig  <martin@ximian.com>
19465
19466         * expression.cs (ConditionalLogicalOperator): New public class to
19467         implement user defined conditional logical operators.
19468         This is section 14.11.2 in the spec and bug #40505.
19469
19470 2003-07-14  Martin Baulig  <martin@ximian.com>
19471
19472         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
19473
19474 2003-07-14  Martin Baulig  <martin@ximian.com>
19475
19476         * codegen.cs (EmitContext.InFixedInitializer): New public field.
19477
19478         * ecore.cs (IVariable.VerifyFixed): New interface method.
19479
19480         * expression.cs (Unary.ResolveOperator): When resolving the `&'
19481         operator, check whether the variable is actually fixed.  Fixes bug
19482         #36055.  Set a variable definitely assigned when taking its
19483         address as required by the spec.
19484
19485         * statement.cs (LocalInfo.IsFixed): New field.
19486         (LocalInfo.MakePinned): Set `IsFixed' to true.
19487
19488 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
19489
19490         * attribute.cs (Attribute.Resolve): While doing a Member lookup
19491         for .ctors, ensure that we only ask for members declared in the
19492         attribute type (BindingFlags.DeclaredOnly).
19493
19494         Fixes bug #43632.
19495
19496         * expression.cs (Error_WrongNumArguments): Report error 1501
19497         correctly the way CSC does.
19498
19499 2003-07-13  Martin Baulig  <martin@ximian.com>
19500
19501         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
19502         lookup on the fully qualified name, to make things like "X.X" work
19503         where "X.X" is a fully qualified type name, but we also have a
19504         namespace "X" in the using list.  Fixes #41975.
19505
19506 2003-07-13  Martin Baulig  <martin@ximian.com>
19507
19508         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
19509         function. If we're a CompoundAssign, we need to create an embedded
19510         CompoundAssign, not an embedded Assign.
19511         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
19512         Fixes #45854.
19513
19514 2003-07-13  Martin Baulig  <martin@ximian.com>
19515
19516         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
19517         work to fix bug #46088.
19518
19519 2003-07-13  Ravi Pratap <ravi@ximian.com>
19520
19521         * class.cs (Operator.Emit): Do not emit attributes here - it is
19522         taken care of by the Method class that we delegate too. This takes
19523         care of bug #45876.
19524
19525 2003-07-10  Martin Baulig  <martin@ximian.com>
19526
19527         * expression.cs (TypeOfVoid): New class.
19528         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
19529
19530 2003-07-10  Martin Baulig  <martin@ximian.com>
19531
19532         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
19533         bug #35957.
19534
19535 2003-07-10  Martin Baulig  <martin@ximian.com>
19536
19537         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
19538         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
19539
19540         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
19541
19542         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
19543
19544 2003-07-10  Martin Baulig  <martin@ximian.com>
19545
19546         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
19547         of decimal.  Fixes #42850.
19548
19549         NOTE: I also fixed the created byte blob, but this doesn't work on
19550         the MS runtime and csc never produces any byte blobs for decimal
19551         arrays.
19552
19553 2003-07-10  Martin Baulig  <martin@ximian.com>
19554
19555         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
19556         structs; fixes #32068.
19557         (Block.AddChildVariableNames): Fixed #44302.
19558
19559 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19560
19561         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
19562
19563 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
19564
19565         * attribute.cs: And this test is onger needed.
19566
19567 2003-07-08  Martin Baulig  <martin@ximian.com>
19568
19569         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
19570         inaccessible types.  Fixes #36313.
19571
19572         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
19573
19574         * namespace.cs (NamespaceEntry): Create implicit entries for all
19575         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
19576         implicit entries for N1.N2 and N1.
19577
19578 2003-07-08  Martin Baulig  <martin@ximian.com>
19579
19580         Rewrote the handling of namespaces to fix a lot of the issues
19581         wrt. `using' aliases etc.
19582
19583         * namespace.cs (Namespace): Splitted this class into a
19584         per-assembly `Namespace' and a per-file `NamespaceEntry'.
19585
19586         * typemanager.cs (TypeManager.IsNamespace): Removed.
19587         (TypeManager.ComputeNamespaces): Only compute namespaces from
19588         loaded assemblies here, not the namespaces from the assembly we're
19589         currently compiling.
19590
19591 2003-07-08  Martin Baulig  <martin@ximian.com>
19592
19593         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
19594
19595 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
19596
19597         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
19598         already fixed it.  
19599
19600         I thought about the memory savings here, but LookupTypeReflection
19601         is used under already very constrained scenarios.  Compiling
19602         corlib or mcs only exposes one hit, so it would not really reduce
19603         any memory consumption.
19604
19605 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19606
19607         * typemanager.cs: fixes bug #45889 by only adding public types from
19608         other assemblies to the list of known types.
19609
19610 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
19611
19612         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
19613         on the type we resolved.
19614
19615 2003-07-05  Martin Baulig  <martin@ximian.com>
19616
19617         * pending.cs (PendingImplementation.ParentImplements): Don't
19618         create the proxy if the parent is abstract.
19619
19620         * class.cs (TypeContainer.DefineIndexers): Process explicit
19621         interface implementations first.  Fixes #37714.
19622
19623 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
19624
19625         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
19626         defined recursively;  but since we modify the input parameters
19627         (left is set to `this' temporarily), we reset this value if the
19628         left_is_explicit is false, which gives the original semantics to
19629         the code.  
19630
19631         * literal.cs (NullPointer): new class used to represent a null
19632         literal in a pointer context.
19633
19634         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
19635         type is a pointer, use a NullPointer object instead of a
19636         NullLiteral.   Closes 43687
19637
19638         (ExplicitConversion): Convert pointer values using
19639         the conv opcode to the proper type.
19640
19641         * ecore.cs (New): change ValueTypeVariable property into a method,
19642         that returns whether the valuetype is suitable for being used.
19643
19644         * expression.cs (Binary.DoNumericPromotions): Only return if we
19645         the int constant was a valid uint, and we can return both left and
19646         right as uints.  If not, we continue processing, to trigger the
19647         type conversion.  This fixes 39018.
19648
19649         * statement.cs (Block.EmitMeta): During constant resolution, set
19650         the CurrentBlock property on the emitcontext, so that we resolve
19651         constants propertly.
19652
19653 2003-07-02  Martin Baulig  <martin@ximian.com>
19654
19655         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
19656         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
19657
19658         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
19659         than emitting it here.
19660
19661         * statement.cs: Fixed some more flow analysis bugs.
19662
19663 2003-07-02  Martin Baulig  <martin@ximian.com>
19664
19665         * class.cs (MethodData.Define): When implementing interface
19666         methods, set Final unless we're Virtual.
19667
19668         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
19669         check work for interface methods.
19670
19671 2003-07-01  Martin Baulig  <martin@ximian.com>
19672
19673         * ecore.cs (EmitContext.This): Replaced this property with a
19674         GetThis() method which takes a Location argument.  This ensures
19675         that we get the correct error location for a CS0188.
19676
19677 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
19678
19679         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
19680         ImplicitStandardConversion.
19681
19682         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
19683
19684 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
19685
19686         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
19687         optimization.
19688
19689 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
19690
19691         * class.cs (Constructor.Define): Turn off initlocals for unsafe
19692         constructors.
19693
19694         (MethodData.Define): Turn off initlocals for unsafe methods.
19695
19696 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
19697
19698         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
19699         complete;  Fixes #37521.
19700
19701         * delegate.cs: Use Modifiers.TypeAttr to compute the
19702         TypeAttributes, instead of rolling our own.  This makes the flags
19703         correct for the delegates.
19704
19705 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
19706
19707         * class.cs (Constructor.Define): Set the private flag for static
19708         constructors as well.
19709
19710         * cs-parser.jay (statement_expression): Set the return value to
19711         null, to avoid a crash when we catch an error.
19712
19713 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
19714
19715         * cs-parser.jay: Applied patch from Jackson that adds support for
19716         extern and unsafe modifiers to destructor declarations.
19717
19718         * expression.cs: Report error 21 if the user is trying to index a
19719         System.Array.
19720
19721         * driver.cs: Add an error message, suggested by the bug report.
19722
19723         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
19724         if we do not have a ": this ()" constructor initializer.  Fixes 45149
19725
19726 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
19727
19728         * namespace.cs: Add some information to reduce FAQs.
19729
19730 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
19731
19732         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
19733         underlying enumeration types.  Fixes #43915.
19734
19735         * expression.cs: Treat ushort/short as legal values to be used in
19736         bitwise operations.
19737
19738 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
19739
19740         * delegate.cs: transfer custom attributes for paramenters from
19741         the delegate declaration to Invoke and BeginInvoke.
19742
19743 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
19744
19745         * attribute.cs: handle custom marshalers and emit marshal info
19746         for fields, too.
19747
19748 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
19749
19750         * makefile.gnu: Added anonymous.cs to the compiler sources.
19751
19752 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
19753
19754         * iterators.cs: Change the name of the proxy class to include two
19755         underscores.
19756
19757         * cs-parser.jay: Update grammar to include anonymous methods.
19758
19759         * anonymous.cs: new file.
19760
19761 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
19762
19763         * class.cs (Field.Define): Add missing test for pointers and
19764         safety. 
19765
19766 2003-05-27  Ravi Pratap  <ravi@ximian.com>
19767
19768         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
19769         we use the stobj opcode.
19770
19771         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
19772         since it wasn't the correct fix. 
19773
19774         It still is puzzling that we are required to use stobj for IntPtr
19775         which seems to be a ValueType.
19776
19777 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
19778
19779         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
19780         during regular simple name resolution.   Now, the trick is that
19781         instead of returning for processing the simplename, we do a
19782         TypeManager.LookupType (ie, a rooted lookup as opposed to a
19783         contextual lookup type).   If a match is found, return that, if
19784         not, return for further composition.
19785
19786         This fixes long-standing 30485.
19787
19788         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19789         using the address to initialize an object, do an Stobj instead of
19790         using the regular Stelem.
19791
19792         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
19793         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
19794         Because if we are a BaseIndexerAccess that value will be true.
19795         Fixes 43643.
19796
19797         * statement.cs (GotoCase.Resolve): Return after reporting an
19798         error, do not attempt to continue. 
19799
19800         * expression.cs (PointerArithmetic.Emit): If our operand is a
19801         long, convert our constants to match the operand before
19802         multiplying.  Convert to I type before adding.   Fixes 43670.
19803
19804 2003-05-14  Ravi Pratap  <ravi@ximian.com>
19805
19806         * enum.cs (ImplicitConversionExists) : Rename to
19807         ImplicitEnumConversionExists to remove ambiguity. 
19808
19809         * ecore.cs (NullCast): New type of cast expression class which
19810         basically is very similar to EmptyCast with the difference being
19811         it still is a constant since it is used only to cast a null to
19812         something else
19813         (eg. (string) null)
19814
19815         * convert.cs (ImplicitReferenceConversion): When casting a null
19816         literal, we return a NullCast.
19817
19818         * literal.cs (NullLiteralTyped): Remove - I don't see why this
19819         should be around anymore.
19820
19821         The renaming (reported was slightly wrong). Corrections:
19822
19823         ConvertImplicitStandard -> ImplicitConversionStandard
19824         ConvertExplicitStandard -> ExplicitConversionStandard
19825
19826         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
19827         before passing them in !
19828
19829         * convert.cs (ImplicitConversionStandard): When comparing for
19830         equal expr and target types, ensure that expr is not a
19831         NullLiteral.
19832
19833         In general, we must not be checking (expr_type ==
19834         target_type) in the top level conversion methods
19835         (ImplicitConversion, ExplicitConversion etc). This checking is
19836         done in the methods that they delegate to.
19837
19838 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
19839
19840         * convert.cs: Move Error_CannotConvertType,
19841         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
19842         ImplicitNumericConversion, ImplicitConversionExists,
19843         ImplicitUserConversionExists, StandardConversionExists,
19844         FindMostEncompassedType, FindMostSpecificSource,
19845         FindMostSpecificTarget, ImplicitUserConversion,
19846         ExplicitUserConversion, GetConversionOperators,
19847         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
19848         TryImplicitIntConversion, Error_CannotConvertImplicit,
19849         ConvertImplicitRequired, ConvertNumericExplicit,
19850         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
19851         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
19852         its own file.
19853
19854         Perform the following renames:
19855
19856         StandardConversionExists -> ImplicitStandardConversionExists
19857         ConvertImplicit -> ImplicitConversion
19858         ConvertImplicitStandard -> ImplicitStandardConversion
19859         TryImplicitIntConversion -> ImplicitIntConversion
19860         ConvertImplicitRequired -> ImplicitConversionRequired
19861         ConvertNumericExplicit -> ExplicitNumericConversion
19862         ConvertReferenceExplicit -> ExplicitReferenceConversion
19863         ConvertExplicit -> ExplicitConversion
19864         ConvertExplicitStandard -> ExplicitStandardConversion
19865
19866 2003-05-19  Martin Baulig  <martin@ximian.com>
19867
19868         * statement.cs (TypeInfo.StructInfo): Made this type protected.
19869         (TypeInfo): Added support for structs having structs as fields.
19870
19871         * ecore.cs (FieldExpr): Implement IVariable.
19872         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
19873         VariableInfo for the field.
19874
19875 2003-05-18  Martin Baulig  <martin@ximian.com>
19876
19877         * expression.cs (This.DoResolve): Report a CS0027 if we're
19878         emitting a field initializer.
19879
19880 2003-05-18  Martin Baulig  <martin@ximian.com>
19881
19882         * expression.cs (This.ResolveBase): New public function.
19883         (This.DoResolve): Check for CS0188.
19884
19885         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
19886         This.Resolve().
19887
19888         * ecore.cs (MethodGroupExpr.DoResolve): Set the
19889         `instance_expression' to null if we don't have any non-static
19890         methods.
19891
19892 2003-05-18  Martin Baulig  <martin@ximian.com>
19893
19894         Reworked the way how local variables and parameters are handled by
19895         the flow analysis code.
19896
19897         * statement.cs (TypeInfo, VariableMap): New public classes.
19898         (VariableInfo): New public class.  This is now responsible for
19899         checking whether a variable has been assigned.  It is used for
19900         parameters and local variables.
19901         (Block.EmitMeta): Take the InternalParameters as argument; compute
19902         the layout of the flow vectors here.
19903         (Block.LocalMap, Block.ParameterMap): New public properties.
19904         (FlowBranching): The .ctor doesn't get the InternalParameters
19905         anymore since Block.EmitMeta() now computes the layout of the flow
19906         vector.
19907         (MyStructInfo): This class is now known as `StructInfo' and nested
19908         in `TypeInfo'; we don't access this directly anymore.
19909
19910         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
19911         property and removed IsAssigned(), IsFieldAssigned(),
19912         SetAssigned() and SetFieldAssigned(); we now call them on the
19913         VariableInfo so we don't need to duplicate this code everywhere.
19914
19915         * expression.cs (ParameterReference): Added `Block block' argument
19916         to the .ctor.
19917         (LocalVariableReference, ParameterReference, This): The new
19918         VariableInfo class is now responsible for all the definite
19919         assignment stuff.
19920
19921         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
19922         IsParameterAssigned, SetParameterAssigned): Removed.
19923
19924 2003-05-18  Martin Baulig  <martin@ximian.com>
19925
19926         * typemanager.cs (InitCoreTypes): Try calling
19927         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
19928         the 3-args-version.  Corlib now also needs our `void_type'.
19929         (GetMethod): Added overloaded version which takes an optional
19930         `bool report_errors' to allow lookups of optional methods.
19931
19932 2003-05-12  Martin Baulig  <martin@ximian.com>
19933
19934         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
19935         only used for locals and not for parameters.
19936
19937 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
19938
19939         * support.cs (InternalParameters.ParameterType): Return the
19940         ExternalType of the parameter.
19941
19942         * parameter.cs (Parameter.ExternalType): drop the two arguments,
19943         they were unused.
19944
19945 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
19946
19947         * class.cs (MethodData.Define): Do not set the `newslot' on
19948         interface members, if they are also flagged as "override".
19949
19950         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
19951         better code for ++i and i++.  This only works for static fields
19952         and local variables.
19953
19954         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
19955         want to pull the DeclSpace out of the builder_to_declspace instead
19956         of the TypeBuilder (like in TypeContainer.FindMembers).
19957
19958         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
19959         instead of LookupTypeContainer.  Fixes the crash on .NET for
19960         looking up interface members.
19961
19962         * const.cs: Create our own emit context during the Definition
19963         stage, so that constants are evaluated in the proper context, when
19964         a recursive definition happens.
19965
19966 2003-05-11  Martin Baulig  <martin@ximian.com>
19967
19968         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
19969         new block for a switch section.
19970         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
19971         the adding/lookup in the switch block.  Fixes #39828.
19972
19973 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
19974
19975         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
19976         functionality: I needed to convert the data after I had performed
19977         the add/sub operation into the operands type size.
19978
19979         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
19980         pass the type for the box operation, otherwise the resulting
19981         object would have been of type object.
19982
19983         (BoxedCast): Add constructor to specify the type to box as.
19984
19985 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
19986
19987         * iterators.cs: I was reusing the `count' variable inadvertently,
19988         take steps to not allow this to happen.
19989
19990 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
19991
19992         * attribute.cs (Attribute.Resolve): Params attributes are encoded
19993         by creating an array at the point where the params starts and
19994         putting all those arguments there, then adjusting the size of the
19995         array.
19996
19997 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
19998
19999         * expression.cs (New.AddressOf): Implement interface
20000         IMemoryLocation.  This is used when the `new' operator is used in
20001         the context of an invocation to a method on a value type.
20002
20003         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
20004         example. 
20005
20006         * namespace.cs: Also check the using aliases here.
20007
20008         * driver.cs: Move the test for using validity after the types have
20009         been entered, so we do a single pass that also includes the using
20010         aliases. 
20011
20012         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
20013         in the regular case.   CreateSiblingForFinally is doing extra
20014         error checking.
20015
20016         * attribute.cs (GetAttributeArgumentExpression): Store the result
20017         on an out value, and use the return value to indicate failure
20018         instead of using null (which is a valid return for Constant.GetValue).
20019
20020         * statement.cs: Perform the analysis flow for the increment
20021         portion after the statement, because this will be the real flow of
20022         execution.  Fixes #42385
20023
20024         * codegen.cs (EmitContext.EmitArgument,
20025         EmitContext.EmitStoreArgument): New helper functions when the
20026         RemapToProxy flag is set.
20027
20028         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
20029         function.
20030
20031         Add support for remapping parameters. 
20032
20033         * iterators.cs: Propagate parameter values;  Store parameter
20034         values in the proxy classes.
20035
20036 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
20037
20038         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
20039         need a proxy reference;  I do not know what I was thinking
20040
20041         * cs-parser.jay (constructor_initializer): catch another error,
20042         and display nice message.
20043
20044         (field_declaration): catch void field declaration
20045         to flag a better error. 
20046
20047         * class.cs (MemberBase.CheckBase): Report an error instead of a
20048         warning if a new protected member is declared in a struct. 
20049         (Field.Define): catch the error of readonly/volatile.
20050
20051         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
20052
20053         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
20054         volatile variable is taken
20055
20056 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
20057
20058         * statement.cs (Fixed.Resolve): Report an error if we are not in
20059         an unsafe context.
20060
20061 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
20062
20063         * typemanager.cs: reuse the code that handles type clashes for
20064         delegates and enumerations.
20065
20066         * class.cs (Report28): Always report.
20067
20068         * expression.cs (EncodeAsAttribute): Allow nulls here.
20069
20070 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
20071
20072         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
20073         the functionality for testing whether an expression is valid for
20074         an attribute here.  Also handle the case of arrays of elements
20075         being stored. 
20076
20077         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
20078         encoding a linear array into an array of objects that are suitable
20079         to be passed to an CustomAttributeBuilder.
20080
20081         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
20082
20083         * ecore.cs: (FieldExpr): Handle field remapping here.
20084
20085         * iteratators.cs: Pass the instance variable (if the method is an
20086         instance method) to the constructors, so we can access the field
20087         variables on the class.
20088
20089         TODO: Test this with structs.  I think the THIS variable on
20090         structs might have to be a pointer, and not a refenrece
20091
20092 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
20093
20094         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
20095         local variables to fields in a proxy class.
20096
20097         * iterators.cs (PopulateProxy): Rename our internal fields to
20098         <XXX>.  
20099         Create a <THIS> field if we are an instance method, so we can
20100         reference our parent container variables.
20101         (MapVariable): Called back from the EmitContext code to enter a
20102         new variable to field mapping into the proxy class (we just create
20103         a FieldBuilder).
20104
20105         * expression.cs
20106         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
20107         for using the remapped locals to fields.
20108
20109         I placed the code here, because that gives the same semantics to
20110         local variables, and only changes the Emit code.
20111
20112         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
20113         statements inside iterators.
20114         (VariableInfo): Add a FieldBuilder for the cases when we are
20115         remapping local variables to fields in a proxy class
20116
20117         * ecore.cs (SimpleNameResolve): Avoid testing two times for
20118         current_block != null.
20119
20120         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
20121         not cope with strings, as it has been moved to the
20122         TableSwitchEmit.  Fixed bug in switch generation.
20123
20124         * expression.cs (New.DoResolve): Provide more context for the user
20125         when reporting an error.
20126
20127         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
20128         pointers. 
20129
20130         * expression.cs (MemberAccess.DoResolve): When we get a type back,
20131         check the permissions for it.  Note than in a type-resolution
20132         context the check was already present in DeclSpace.ResolveType,
20133         but was missing from the MemberAccess.
20134
20135         (ArrayCreation.CheckIndices): warn if the user has
20136         more nested levels of expressions, but there are no more
20137         dimensions specified.  Avoids crash on bug 41906.
20138
20139 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
20140
20141         * statement.cs (Block): replace Implicit bool, for a generic
20142         flags.   
20143         New flag: `Unchecked'.  This is used during the EmitMeta phase
20144         (which is out-of-line with the regular Resolve/Emit process for a
20145         statement, as this is done ahead of time, but still gets a chance
20146         to call constant resolve).
20147
20148         (Block.Flags): new enum for adding a new flag.
20149
20150         (Block.EmitMeta): track the state of unchecked.
20151
20152         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
20153         to enable constant resolution to work there as well.
20154
20155 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
20156
20157         * typemanager.cs (ienumerable_type): Also look up
20158         System.Collections.IEnumerable. 
20159
20160 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
20161
20162         TODO: Test more than one conditional per method.
20163
20164         * class.cs (Indexer.Define): Report the location where the user is
20165         referencing the unsupported feature.
20166
20167         (MethodData): Overload the use of `conditionals' to
20168         minimize the creation of needless ArrayLists.   This saves roughly
20169         212kb on my machine.
20170
20171         (Method): Implement the new IIteratorContainer interface.
20172         (Method.SetYields): Implement the method by setting the ModFlags
20173         to contain METHOD_YIELDS.
20174
20175         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
20176         which just got set to null.
20177
20178         * iterators.cs: New file.
20179
20180         (Yield, YieldBreak): New statements.
20181
20182         * statement.cs (Return.Resolve): Flag an error if we are used in
20183         an iterator method.
20184
20185         * codegen.cs (InIterator): New flag set if the code is being
20186         compiled in an iterator method.
20187
20188         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
20189         internal modifier, and we just use it to avoid adding extra
20190         fields, as this is seldom used.  
20191
20192         * cs-parser.jay: Add yield_statement (yield and yield break).
20193
20194         * driver.cs: New flag -v2 to turn on version 2 features. 
20195
20196         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
20197         hashtable when v2 is enabled.
20198
20199 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
20200
20201         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
20202         there is already a namespace defined with this name.
20203
20204         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
20205         people upgraded their corlibs.
20206
20207         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
20208         always use fully qualified types, no need to use the compiler
20209         front end.
20210
20211         (TypeManager.IsNamespace): Use binarysearch.
20212
20213         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
20214         AddDelegate): I did not quite use the new IsValid API properly: I
20215         have to pass the short-name and the fullname.  I was passing only
20216         the basename instead of the fullname sometimes. 
20217
20218         (TypeContainer.DefineType): call NamespaceClash.
20219
20220         * interface.cs (Interface.DefineType): use NamespaceClash before
20221         defining the type.
20222
20223         * delegate.cs (Delegate.DefineType): use NamespaceClash before
20224         defining the type.
20225
20226         * enum.cs: (Enum.DefineType): use NamespaceClash before
20227         defining the type.
20228
20229         * typemanager.cs (: 3-line patch that gives us some tasty 11%
20230         speed increase.  First, use the negative_hits cache when we get a
20231         negative.  Second, add the type with its full original name
20232         instead of the new . and + encoded name (reflection uses + to
20233         separate type from a nested type).  Use LookupTypeReflection
20234         directly which bypasses the type->name hashtable (that we already
20235         know does not contain the type.
20236
20237         * decl.cs (DeclSpace.ResolveTypeExpr): track the
20238         location/container type. 
20239
20240         * driver.cs: When passing utf8, use directly the UTF8Encoding.
20241
20242 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
20243
20244         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
20245
20246         * delegate.cs (NewDelegate.Resolve): Test whether an instance
20247         method is being referenced in the method group from a static
20248         context, and report error 120 if so.
20249
20250         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
20251         Error118. 
20252
20253         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
20254         is created, we create the A namespace).
20255
20256         * cs-parser.jay: A namespace also introduces a DeclarationFound.
20257         Fixes #41591
20258
20259 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
20260
20261         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
20262         invocation to ModuleBuilder.GetType with the same values will
20263         return a new type instance, so we need to cache its return
20264         values. 
20265
20266         * expression.cs (Binary.ResolveOperator): Only allow the compare
20267         operators on enums if they are of the same type.
20268
20269         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
20270         types of ValueType on their own case.  Before we were giving them
20271         the same treatment as objects.
20272
20273         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
20274         fullname.  Short name is used to compare against container name.
20275         Fullname is used to check against defined namespace names.
20276
20277         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
20278         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
20279
20280         (Method.CheckBase): Call parent.
20281         (MemberBase.CheckBase): Check for protected members on sealed
20282         classes.
20283         (PropertyBase.CheckBase): Call parent.
20284         (Field.Define): Call parent.
20285
20286         * report.cs: Negative error codes are now mapped to 8000 - code,
20287         so that the display is render more nicely.
20288
20289         * typemanager.cs: Do not use try/catch, instead report a regular
20290         error. 
20291
20292         (GetPointerType, GetReferenceType): These methods provide
20293         mechanisms to obtain the T* and T& from a T.  We had the code
20294         previously scattered around the code base, and it also used
20295         TypeManager.LookupType that would go through plenty of caches.
20296         This one goes directly to the type source.
20297
20298         In some places we did the Type.GetType followed by
20299         ModuleBuilder.GetType, but not in others, so this unifies the
20300         processing as well.
20301
20302         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
20303         statements now that we have namespace information.
20304
20305         * typemanager.cs (IsNamespace): New method, returns whether the
20306         string presented is a namespace or not.
20307
20308         (ComputeNamespaces): New public entry point, computes the list of
20309         available namespaces, using the GetNamespaces API call in Mono, or
20310         the slower version in MS.NET.   
20311
20312         Now before we start the semantic analysis phase, we have a
20313         complete list of namespaces including everything that the user has
20314         provided.
20315
20316         Deleted old code to cache namespaces in .nsc files.
20317
20318 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
20319
20320         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
20321         class/struct location definition Location for the implicit
20322         constructor location.
20323
20324         (Operator.Define): Use the location of the operator for the
20325         implicit Method definition.
20326
20327         (Constructor.Emit): use the constructor location for the implicit
20328         base initializer constructor.
20329
20330         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
20331         and the Expression class now contains two new methods:
20332
20333         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
20334         isolate type lookup from the rest of the resolution process.
20335
20336         Since we use Expressions to hold type definitions due to the way
20337         we parse the input we have historically overloaded Resolve to
20338         perform the Type lookups if a special flag is passed.  Now this is
20339         eliminated and two methods take their place. 
20340
20341         The differences in the two methods between xStep and xTerminal is
20342         that xStep is involved in our current lookup system that uses
20343         SimpleNames to compose a name, while xTerminal is used just to
20344         catch the case where the simplename lookup failed.
20345
20346 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
20347
20348         * expression.cs (ResolveMemberAccess): Remove redundant code.
20349         TypeExpr expressions are always born fully resolved.
20350
20351         * interface.cs (PopulateMethod): Do not lookup the types twice.
20352         We were doing it once during SemanticAnalysis and once during
20353         PopulateMethod.
20354
20355         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
20356         in local variable type definitions, were being returned as a
20357         SimpleName (we decomposed everything into a string), that is
20358         because primary_expression was being used instead of a type in the
20359         grammar (reduce/reduce conflicts).
20360
20361         The part that was wrong is that we converted the expression into a
20362         string (an oversimplification in one hand, compounded with primary
20363         expressions doing string concatenation).
20364
20365         So things like:
20366
20367         A.B.C [] x;
20368
20369         Would return "A.B.C[]" as a SimpleName.  This stopped things like
20370         using clauses from working on this particular context.  And a type
20371         was being matched directly against "A.B.C[]".
20372
20373         We now use the correct approach, and allow for ComposedCast to be
20374         part of the unary expression.  So the "A.B.C []" become a composed
20375         cast of "A.B.C" (as a nested group of MemberAccess with a
20376         SimpleName at the end) plus the rank composition "[]". 
20377
20378         Also fixes 35567
20379
20380 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
20381
20382         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
20383         for the access level checking.
20384
20385         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
20386         `TypeContainer container', because I kept getting confused when I
20387         was debugging this code.
20388
20389         * expression.cs (Indexers): Instead of tracking getters/setters,
20390         we now track them in parallel.  We create one arraylist less, but
20391         most importantly it is possible now for the LValue code to find a
20392         matching get for a set.
20393
20394         (IndexerAccess.DoResolveLValue): Update the code.
20395         GetIndexersForType has been modified already to extract all the
20396         indexers from a type.  The code assumed it did not.
20397
20398         Also make the code set the correct return type for the indexer.
20399         This was fixed a long time ago for properties, but was missing for
20400         indexers.  It used to be void_type.
20401
20402         (Binary.Emit): Test first for doubles instead of
20403         floats, as they are more common.
20404
20405         (Binary.EmitBranchable): Use the .un version of the branch opcodes
20406         when dealing with floats and the <=, >= operators.  This fixes bug
20407         #39314 
20408
20409         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
20410         to load the array value by emitting a load on the foreach variable
20411         type.  This was incorrect.  
20412
20413         We now emit the code to load an element using the the array
20414         variable type, and then we emit the conversion operator.
20415
20416         Fixed #40176
20417
20418 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
20419
20420         * attribute.cs: Avoid allocation of ArrayLists in the common case.
20421
20422 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
20423
20424         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
20425         test for protection before we test for signatures. 
20426
20427         (MethodSignature.ToString): implement.
20428
20429         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
20430         to the case where we reduced into a LongConstant.
20431
20432         * decl.cs (CheckAccessLevel): If the type is an array, we can not
20433         depend on whether the information is acurrate, because the
20434         Microsoft runtime will always claim that the array type is public,
20435         regardless of the real state.
20436
20437         If the type is a pointer, another problem happens: the type is
20438         reported as non-public in Microsoft.  
20439
20440         In both cases we have to call CheckAccessLevel recursively with
20441         the underlying type as the argument to be tested.
20442
20443 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
20444
20445         * assign.cs (Assign.Emit): If we are dealing with a compound
20446         assignment expression, we should use the code path that stores the
20447         intermediate result in a temporary value.  This fixes #40903.
20448
20449         *expression.cs (Indirection.ToString): Provide ToString method for
20450         debugging. 
20451
20452 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
20453
20454         * class.cs: Null out fields holding references to Block objects so
20455         they can be garbage collected.
20456
20457         * expression.cs (OverloadResolve): Remove unused local.
20458
20459 2003-04-07  Martin Baulig  <martin@ximian.com>
20460
20461         * codegen.cs (EmitContext.CurrentFile): New public field.
20462         (EmitContext.Mark): Use the CurrentFile to check whether the
20463         location is in the correct file.
20464         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
20465
20466 2003-04-07  Martin Baulig  <martin@ximian.com>
20467
20468         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
20469
20470         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
20471         location.  [FIXME: The location argument which gets passed to this
20472         method is sometimes wrong!]
20473
20474 2003-04-07  Nick Drochak <ndrochak@gol.com>
20475
20476         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
20477
20478 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
20479
20480         * expression.cs (Indirection.EmitAssign): We were using the
20481         temporary, but returning immediately instead of continuing the
20482         EmitAssing flow.
20483
20484 2003-04-06  Martin Baulig  <martin@ximian.com>
20485
20486         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
20487         if it's a nested child, but also deriving from the outer class.
20488         See test 190.cs.
20489
20490         * typemanager.cs (IsNestedChildOf): Make this work if it's a
20491         nested child, but also deriving from the outer class.  See
20492         test-190.cs.
20493         (FilterWithClosure): We may access private members of the outer
20494         class if we're a nested child and deriving from the outer class.
20495         (RealMemberLookup): Only set `closure_private_ok' if the
20496         `original_bf' contained BindingFlags.NonPublic.
20497
20498 2003-04-05  Martin Baulig  <martin@ximian.com>
20499
20500         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
20501
20502 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
20503
20504         * class.cs (Event.Define): Do not allow abstract events to have
20505         initializers. 
20506
20507 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
20508
20509         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
20510         block in event declarations.
20511
20512         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
20513         value type, get its address.
20514
20515         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
20516         leaving a class on the stack instead of a boolean value (int
20517         0/1).  Change the code so we compare against null, and then the
20518         result against zero.
20519
20520         * class.cs (TypeContainer.GetClassBases): We were checking for the
20521         parent class being sealed too late.
20522
20523         * expression.cs (Binary.Emit): For <= and >= when dealing with
20524         floating point values, use cgt.un and clt.un instead of cgt and
20525         clt alone.
20526
20527 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
20528
20529         * statement.cs: Apply the same optimization as MS: skip the 
20530         GetEnumerator returning an IEnumerator, and use the one returning a 
20531         CharEnumerator instead. This allows us to avoid the try-finally block 
20532         and the boxing.
20533
20534 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
20535
20536         * cs-parser.jay: Attributes cannot be applied to
20537                          namespaces. Fixes #40473
20538
20539 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20540
20541         * class.cs:
20542         (Add*): check if the name is valid using the full name for constants,
20543         fields, properties and events.
20544
20545 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
20546
20547         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
20548         char constants to be part of the enumeration.
20549
20550         * expression.cs (Conditional.DoResolve): Add support for operator
20551         true. Implements the missing functionality from 14.12
20552
20553         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
20554         operator true/false as required by the spec.
20555
20556         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
20557         implicit conversion to boolean.
20558
20559         * statement.cs (Statement.ResolveBoolean): A boolean expression is
20560         also one where the type implements `operator true'. 
20561
20562         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
20563         get an expression that will invoke operator true based on an
20564         expression.  
20565
20566         (GetConversionOperators): Removed the hack that called op_True
20567         here.  
20568
20569         (Expression.ResolveBoolean): Move this from Statement.
20570
20571 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
20572
20573         * ecore.cs (FieldExpr): do not allow initialization of initonly
20574         fields on derived classes
20575
20576 2003-03-13  Martin Baulig  <martin@ximian.com>
20577
20578         * statement.cs (Block.Emit): Call ig.BeginScope() and
20579         ig.EndScope() when compiling with debugging info; call
20580         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
20581
20582 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
20583
20584         * expression.cs (Indexers): Do not construct immediately, allow
20585         for new members to be appended as we go.  Fixes 38143
20586
20587 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20588
20589         * expression.cs: save/restore context when resolving an unchecked
20590         expression.
20591
20592 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
20593
20594         * cfold.cs: Catch division by zero in modulus operator during
20595         constant folding.
20596
20597 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
20598
20599         * interface.cs (Interface.DefineMembers): Avoid defining members
20600         twice. 
20601
20602 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
20603
20604         * driver.cs: handle the +/- options for -noconfig
20605
20606         * statement.cs (Unckeched.Resolve): Also track the state of
20607         unchecked in the Resolve phase.
20608
20609 2003-02-27  Martin Baulig  <martin@ximian.com>
20610
20611         * ecore.cs (Expression.MemberLookup): Don't create a
20612         MethodGroupExpr for something which is not a method.  Fixes #38291.
20613
20614 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
20615
20616         * class.cs (MemberBase.CheckParameters): Also check that the type
20617         is unmanaged if it is a pointer.
20618
20619         * expression.cs (SizeOf.Resolve): Add location information.
20620
20621         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
20622         a managed type is declared.
20623
20624         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
20625         parameter modifiers as well.  Fixes bug 38606
20626
20627         * class.cs: Very sad.  Am backing out the speed up changes
20628         introduced by the ArrayList -> Array in the TypeContainer, as they
20629         were not actually that much faster, and introduced a bug (no error
20630         reports on duplicated methods).
20631
20632         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
20633         source first, this will guarantee that we have a valid expression
20634         before calling in lower levels functions that will require a
20635         resolved object.  Then use this original_source in the
20636         target.ResolveLValue instead of the original source that was
20637         passed to us.
20638
20639         Another change.  Use target.Resolve instead of LValueResolve.
20640         Although we are resolving for LValues, we will let the Assign code
20641         take care of that (it will be called again from Resolve).  This
20642         basically allows code like this:
20643
20644         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
20645         class Y { void A (X x) { x [0] += o; }
20646
20647         The problem was that the indexer was trying to resolve for
20648         set_Item (idx, object o) and never finding one.  The real set_Item
20649         was set_Item (idx, X).  By delaying the process we get the right
20650         semantics. 
20651
20652         Fixes bug 36505
20653
20654 2003-02-23  Martin Baulig  <martin@ximian.com>
20655
20656         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
20657         while calling DoEmit ().
20658
20659         * codegen.cs (EmitContext.Mark): Don't mark locations in other
20660         source files; if you use the #line directive inside a method, the
20661         compiler stops emitting line numbers for the debugger until it
20662         reaches the end of the method or another #line directive which
20663         restores the original file.
20664
20665 2003-02-23  Martin Baulig  <martin@ximian.com>
20666
20667         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
20668
20669 2003-02-23  Martin Baulig  <martin@ximian.com>
20670
20671         * statement.cs (Block.AddChildVariableNames): We need to call this
20672         recursively, not just for our immediate children.
20673
20674 2003-02-23  Martin Baulig  <martin@ximian.com>
20675
20676         * class.cs (Event.Define): Always make the field private, like csc does.
20677
20678         * typemanager.cs (TypeManager.RealMemberLookup): Make events
20679         actually work, fixes bug #37521.
20680
20681 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
20682
20683         * delegate.cs: When creating the various temporary "Parameters"
20684         classes, make sure that we call the ComputeAndDefineParameterTypes
20685         on those new parameters (just like we do with the formal ones), to
20686         allow them to be resolved in the context of the DeclSpace.
20687
20688         This fixes the bug that Dick observed in Bugzilla #38530.
20689
20690 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
20691
20692         * expression.cs (ResolveMemberAccess): When resolving a constant,
20693         do not attempt to pull a constant if the value was not able to
20694         generate a valid constant.
20695
20696         * const.cs (LookupConstantValue): Do not report more errors than required.
20697
20698 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20699
20700         * expression.cs: fixes bug #38328.
20701
20702 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
20703
20704         * class.cs: Changed all the various members that can be part of a
20705         class from being an ArrayList to be an Array of the right type.
20706         During the DefineType type_list, interface_list, delegate_list and
20707         enum_list are turned into types, interfaces, delegates and enums
20708         arrays.  
20709
20710         And during the member population, indexer_list, event_list,
20711         constant_list, field_list, instance_constructor_list, method_list,
20712         operator_list and property_list are turned into their real arrays.
20713
20714         Although we could probably perform this operation earlier, for
20715         good error reporting we need to keep the lists and remove the
20716         lists for longer than required.
20717
20718         This optimization was triggered by Paolo profiling the compiler
20719         speed on the output of `gen-sample-program.pl' perl script. 
20720
20721         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
20722         not crash in methods like MemberLookupFailed that use this field.  
20723
20724         This problem arises when the compiler fails to resolve a type
20725         during interface type definition for example.
20726
20727 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
20728
20729         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
20730         inherit from System.Object, so we have to stop at null, not only
20731         when reaching System.Object.
20732
20733 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
20734
20735         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
20736         DeclaredOnly because the parent indexer might have had a different
20737         name, but did not loop until the top of the hierarchy was reached.
20738
20739         The problem this one fixes is 35492: when a class implemented an
20740         indexer from an interface, we were getting the interface method
20741         (which was abstract) and we were flagging an error (can not invoke
20742         abstract method).
20743
20744         This also keeps bug 33089 functioning, and test-148 functioning.
20745
20746         * typemanager.cs (IsSpecialMethod): The correct way of figuring
20747         out if a method is special is to see if it is declared in a
20748         property or event, or whether it is one of the predefined operator
20749         names.   This should fix correctly #36804.
20750
20751 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
20752
20753         The goal here is to remove the dependency on EmptyCast.Peel ().
20754         Killing it completely.
20755
20756         The problem is that currently in a number of places where
20757         constants are expected, we have to "probe" for an EmptyCast, and
20758         Peel, which is not the correct thing to do, as this will be
20759         repetitive and will likely lead to errors. 
20760
20761         The idea is to remove any EmptyCasts that are used in casts that
20762         can be reduced to constants, so we only have to cope with
20763         constants. 
20764
20765         This bug hunt was triggered by Bug 37363 and the desire to remove
20766         the duplicate pattern where we were "peeling" emptycasts to check
20767         whether they were constants.  Now constants will always be
20768         constants.
20769
20770         * ecore.cs: Use an enumconstant here instead of wrapping with
20771         EmptyCast.  
20772
20773         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
20774         throwing me off.  By handling this we can get rid of a few hacks.
20775
20776         * statement.cs (Switch): Removed Peel() code.
20777
20778 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
20779
20780         * class.cs: Location information for error 508
20781
20782         * expression.cs (New.DoResolve): Add a guard against double
20783         resolution of an expression.  
20784
20785         The New DoResolve might be called twice when initializing field
20786         expressions (see EmitFieldInitializers, the call to
20787         GetInitializerExpression will perform a resolve on the expression,
20788         and later the assign will trigger another resolution
20789
20790         This leads to bugs (#37014)
20791
20792         * delegate.cs: The signature for EndInvoke should contain any ref
20793         or out parameters as well.  We were not doing this in the past. 
20794
20795         * class.cs (Field.Define): Do not overwrite the type definition
20796         inside the `volatile' group.  Turns out that volatile enumerations
20797         were changing the type here to perform a validity test, which
20798         broke conversions. 
20799
20800 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
20801
20802         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
20803         and structs, we do not want to load the instance variable
20804
20805         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
20806         enum_type has to be handled like an object reference (implicit
20807         conversions exists from this to object), but the regular IsClass
20808         and IsValueType tests will never return true for this one.
20809
20810         Also we use TypeManager.IsValueType instead of type.IsValueType,
20811         just for consistency with the rest of the code (this is only
20812         needed if we ever use the construct exposed by test-180.cs inside
20813         corlib, which we dont today).
20814
20815 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
20816
20817         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
20818         just InternalCall.
20819
20820 2003-02-09  Martin Baulig  <martin@ximian.com>
20821
20822         * namespace.cs (Namespace..ctor): Added SourceFile argument.
20823         (Namespace.DefineNamespaces): New static public method; this is
20824         called when we're compiling with debugging to add all namespaces
20825         to the symbol file.
20826
20827         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
20828         pass it to the Namespace's .ctor.
20829
20830         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
20831         and MethodBase arguments; pass the namespace ID to the symwriter;
20832         pass the MethodBase instead of the token to the symwriter.
20833         (SymbolWriter.DefineNamespace): New method to add a namespace to
20834         the symbol file.
20835
20836 2003-02-09  Martin Baulig  <martin@ximian.com>
20837
20838         * symbolwriter.cs: New file.  This is a wrapper around
20839         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
20840         methods here in near future.
20841
20842 2003-02-09  Martin Baulig  <martin@ximian.com>
20843
20844         * codegen.cs (EmitContext.Mark): Just pass the arguments to
20845         ILGenerator.MarkSequencePoint() which are actually used by the
20846         symbol writer.
20847
20848 2003-02-09  Martin Baulig  <martin@ximian.com>
20849
20850         * location.cs (SourceFile): New public sealed class.  This
20851         contains the name and an index which is used in the location's token.
20852         (Location): Reserve an appropriate number of bits in the token for
20853         the source file instead of walking over that list, this gives us a
20854         really huge performance improvement when compiling with debugging.
20855
20856         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
20857         `SourceFile' argument instead of a string.
20858         (Driver.ProcessFile): Add all the files via Location.AddFile(),
20859         but don't parse/tokenize here, we need to generate the list of all
20860         source files before we do that.
20861         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
20862         the files.
20863
20864         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
20865         instead of a string.
20866
20867         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
20868         of a string.
20869
20870 2003-02-09  Martin Baulig  <martin@ximian.com>
20871
20872         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
20873         filename on `#line default'.
20874
20875 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
20876
20877         * statement.cs: don't clear the pinned var when the fixed statement
20878         returns from the method (fixes bug#37752).
20879
20880 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
20881
20882         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
20883         to IsValueType.
20884
20885 2003-02-07  Martin Baulig  <martin@ximian.com>
20886
20887         * driver.cs: Removed the `--debug-args' command line argument.
20888
20889         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
20890         automatically by the AsssemblyBuilder.
20891         (CodeGen.InitializeSymbolWriter): We don't need to call any
20892         initialization function on the symbol writer anymore.  This method
20893         doesn't take any arguments.
20894
20895 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
20896
20897         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
20898         from referenced assemblies as well.
20899
20900 2003-02-02  Martin Baulig  <martin@ximian.com>
20901
20902         * class.cs (MethodData.Emit): Generate debugging info for external methods.
20903
20904 2003-02-02  Martin Baulig  <martin@ximian.com>
20905
20906         * class.cs (Constructor.Emit): Open the symbol writer before
20907         emitting the constructor initializer.
20908         (ConstructorInitializer.Emit): Call ec.Mark() to allow
20909         single-stepping through constructor initializers.
20910
20911 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
20912
20913         * class.cs: Handle error 549: do not allow virtual methods in
20914         sealed classes. 
20915
20916 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
20917
20918         * decl.cs: Check access levels when resolving types
20919
20920 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
20921
20922         * statement.cs: Add parameters and locals set in catch blocks that might 
20923         return to set vector
20924
20925 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
20926
20927         * class.cs (Operator): Set the SpecialName flags for operators.
20928
20929         * expression.cs (Invocation.DoResolve): Only block calls to
20930         accessors and operators on SpecialName methods.
20931
20932         (Cast.TryReduce): Handle conversions from char constants.
20933
20934
20935 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
20936
20937         * statement.cs: small memory and time optimization in FlowBranching.
20938
20939 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
20940
20941         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
20942         problem that the last fix but in the other sid (Set).
20943
20944         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
20945         access when there is no indexer in the hierarchy.
20946
20947 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
20948
20949         * class.cs: Combine some if statements.
20950
20951 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20952
20953         * driver.cs: fixed bug #37187.
20954
20955 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
20956
20957         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
20958         any indexer, it's needed to build a list with all the indexers in the
20959         hierarchy (AllGetters), else we have problems. Fixes #35653.
20960
20961 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
20962
20963         * class.cs (MethodData.Define): It is wrong for an interface
20964         implementation to be static in both cases: explicit and implicit.
20965         We were only handling this in one case.
20966
20967         Improve the if situation there to not have negations.
20968
20969         * class.cs (Field.Define): Turns out that we do not need to check
20970         the unsafe bit on field definition, only on usage.  Remove the test.
20971
20972 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20973
20974         * driver.cs: use assembly.Location instead of Codebase (the latest
20975         patch made mcs fail when using MS assemblies).
20976
20977 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
20978
20979         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
20980         get the path to *corlib.dll.
20981
20982 2003-01-21  Nick Drochak <ndrochak@gol.com>
20983
20984         * cs-tokenizer.cs:
20985         * pending.cs:
20986         * typemanager.cs: Remove compiler warnings
20987
20988 2003-01-20  Duncan Mak  <duncan@ximian.com>
20989
20990         * AssemblyInfo.cs: Bump the version number to 0.19.
20991
20992 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20993
20994         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
20995
20996 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
20997
20998         * class.cs (Constructor::Emit): Emit debugging info for constructors.
20999
21000 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
21001
21002         * cs-parser.jay: Small fix: we were not comparing the constructor
21003         name correctly.   Thanks to Zoltan for the initial pointer.
21004
21005 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
21006
21007         * cs-tokenizer.cs: Set file name when specified with #line
21008
21009 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
21010
21011         * cs-parser.jay: Only perform the constructor checks here if we
21012         are named like the class;  This will help provider a better
21013         error.  The constructor path is taken when a type definition is
21014         not found, but most likely the user forgot to add the type, so
21015         report that rather than the constructor error.
21016
21017 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
21018
21019         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
21020         allocations.
21021
21022 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21023
21024         * cs-parser.jay: Add cleanup call.
21025
21026 2003-01-13  Duncan Mak  <duncan@ximian.com>
21027
21028         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
21029         consistent with other methods.
21030
21031 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21032
21033         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
21034
21035 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
21036
21037         * attribute.cs: only set GuidAttr to true when we have a
21038         GuidAttribute.
21039
21040 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21041
21042         * ecore.cs:
21043         * expression.cs:
21044         * typemanager.cs: fixes to allow mcs compile corlib with the new
21045         Type.IsSubclassOf fix.
21046
21047 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
21048
21049         * expression.cs (LocalVariableReference.DoResolve): Classify a
21050         constant as a value, not as a variable.   Also, set the type for
21051         the variable.
21052
21053         * cs-parser.jay (fixed_statement): take a type instead of a
21054         pointer_type, so we can produce a better error message later.
21055
21056         * statement.cs (Fixed.Resolve): Flag types that are not pointers
21057         as an error.  
21058
21059         (For.DoEmit): Make inifinite loops have a
21060         non-conditional branch back.
21061
21062         (Fixed.DoEmit): First populate the pinned variables, then emit the
21063         statement, then clear the variables.  Before I was emitting the
21064         code once for each fixed piece.
21065
21066
21067 2003-01-08  Martin Baulig  <martin@ximian.com>
21068
21069         * statement.cs (FlowBranching.MergeChild): A break in a
21070         SWITCH_SECTION does not leave a loop.  Fixes #36155.
21071
21072 2003-01-08  Martin Baulig  <martin@ximian.com>
21073
21074         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
21075         lives in the same number space than `param_map'.  Fixes #36154.
21076
21077 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
21078
21079         * cs-parser.jay (constructor_declaration): Set the
21080         Constructor.ModFlags before probing for it.  This makes the
21081         compiler report 514, 515 and 132 (the code was there, but got
21082         broken). 
21083
21084         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
21085         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
21086         (GotoCase.Resolve): Set `Returns' to ALWAYS.
21087
21088 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
21089
21090         * enum.cs: create the enum static fields using the enum type.
21091
21092 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
21093
21094         * class.cs: don't try to create the ParamBuilder for the return
21095         type if it's not needed (and handle it breaking for the ms runtime
21096         anyway).
21097
21098 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
21099
21100         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
21101
21102 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
21103
21104         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
21105         the command.   This showed up while compiling the JANET source
21106         code, which used \r as its only newline separator.
21107
21108 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
21109
21110         * class.cs (Method.Define): If we are an operator (because it
21111         reuses our code), then set the SpecialName and HideBySig.  #36128
21112
21113 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
21114
21115         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
21116         exception, report error 120 `object reference required'.
21117
21118         * driver.cs: Add --pause option, used during to measure the size
21119         of the process as it goes with --timestamp.
21120
21121         * expression.cs (Invocation.DoResolve): Do not allow methods with
21122         SpecialName to be invoked.
21123
21124 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
21125
21126         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
21127         number before adding it.
21128
21129 2002-12-21  Ravi Pratap  <ravi@ximian.com>
21130
21131         * ecore.cs (StandardImplicitConversion): When in an unsafe
21132         context, we allow conversion between void * to any other pointer
21133         type. This fixes bug #35973.
21134
21135 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
21136
21137         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
21138         is not thrown when extensionless outputs are used 
21139
21140 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21141
21142         * rootcontext.cs: fixed compilation of corlib.
21143
21144 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
21145
21146         * attribute.cs (Attributes.Contains): Add new method.
21147
21148         * class.cs (MethodCore.LabelParameters): if the parameter is an
21149         `out' parameter, check that no attribute `[In]' has been passed.
21150
21151         * enum.cs: Handle the `value__' name in an enumeration.
21152
21153 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
21154
21155         * decl.cs: Added special case to allow overrides on "protected
21156         internal" methods
21157
21158 2002-12-18  Ravi Pratap  <ravi@ximian.com>
21159
21160         * attribute.cs (Attributes.AddAttributeSection): Rename to this
21161         since it makes much more sense.
21162
21163         (Attributes.ctor): Don't require a Location parameter.
21164
21165         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
21166
21167         * attribute.cs (ApplyAttributes): Remove extra Location parameters
21168         since we already have that information per attribute.
21169
21170         * everywhere : make appropriate changes.
21171
21172         * class.cs (LabelParameters): Write the code which actually
21173         applies attributes to the return type. We can't do this on the MS
21174         .NET runtime so we flag a warning in the case an exception is
21175         thrown.
21176
21177 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
21178
21179         * const.cs: Handle implicit null conversions here too.
21180
21181 2002-12-17  Ravi Pratap  <ravi@ximian.com>
21182
21183         * class.cs (MethodCore.LabelParameters): Remove the extra
21184         Type [] parameter since it is completely unnecessary. Instead
21185         pass in the method's attributes so that we can extract
21186         the "return" attribute.
21187
21188 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
21189
21190         * cs-parser.jay (parse): Use Report.Error to flag errors instead
21191         of ignoring it and letting the compile continue.
21192
21193         * typemanager.cs (ChangeType): use an extra argument to return an
21194         error condition instead of throwing an exception.
21195
21196 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
21197
21198         * expression.cs (Unary.TryReduce): mimic the code for the regular
21199         code path.  Perform an implicit cast in the cases where we can
21200         implicitly convert to one of the integral types, and then reduce
21201         based on that constant.   This fixes bug #35483.
21202
21203 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21204
21205         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
21206
21207 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21208
21209         * namespace.cs: fixed bug #35489.
21210
21211 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
21212
21213         * class.cs: Remove some dead code.
21214
21215         * cs-parser.jay: Estimate the number of methods needed
21216         (RootContext.MethodCount);
21217
21218         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
21219         numbers instead of StringBuilders.
21220
21221         * support.cs (PtrHashtable): Add constructor with initial size;
21222         We can now reduce reallocations of the method table.
21223
21224 2002-12-10  Ravi Pratap  <ravi@ximian.com>
21225
21226         * attribute.cs (ApplyAttributes): Keep track of the emitted
21227         attributes on a per-target basis. This fixes bug #35413.
21228
21229 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
21230
21231         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
21232         default to the Windows 1252 encoding.
21233
21234         (UnixParseOption): Support version, thanks to Alp for the missing
21235         pointer. 
21236
21237         * AssemblyInfo.cs: Add nice assembly information.
21238
21239         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
21240         (bug 35169).
21241
21242         * cs-parser.jay: Allow a trailing comma before the close bracked
21243         in the attribute_section production.
21244
21245         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
21246         address of the instance was being taken, I will take this out,
21247         because we take the address of the object immediately here.
21248
21249 2002-12-09  Ravi Pratap  <ravi@ximian.com>
21250
21251         * typemanager.cs (AreMultipleAllowed): Take care of the most
21252         obvious case where attribute type is not in the current assembly -
21253         stupid me ;-)
21254
21255 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
21256
21257         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
21258         definitions, instead of doing that afterwards.  
21259
21260         Also we use a nice little hack, depending on the constructor, we
21261         know if we are a "composed" name or a simple name.  Hence, we
21262         avoid the IndexOf test, and we avoid 
21263
21264         * codegen.cs: Add code to assist in a bug reporter to track down
21265         the source of a compiler crash. 
21266
21267 2002-12-07  Ravi Pratap  <ravi@ximian.com>
21268
21269         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
21270         types have been emitted for a given element and flag an error
21271         if something which does not have AllowMultiple set is used more
21272         than once.
21273
21274         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
21275         attribute types and their corresponding AllowMultiple properties
21276
21277         (AreMultipleAllowed): Check the property for a given type.
21278
21279         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
21280         property in the case we have a TypeContainer.
21281
21282         (Attributes.AddAttribute): Detect duplicates and just skip on
21283         adding them. This trivial fix catches a pretty gross error in our
21284         attribute emission - global attributes were being emitted twice!
21285
21286         Bugzilla bug #33187 is now fixed.
21287
21288 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
21289
21290         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
21291         instead of pp_and).
21292
21293         * expression.cs (Binary.ResolveOperator): I can only use the
21294         Concat (string, string, string) and Concat (string, string,
21295         string, string) if the child is actually a concatenation of
21296         strings. 
21297
21298 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
21299
21300         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
21301         context where we need a 2-character lookahead.
21302
21303         * pending.cs (PendingImplementation): Rework so we can keep track
21304         of interface types all the time, and flag those which were
21305         implemented by parents as optional.
21306
21307 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
21308
21309         * expression.cs (Binary.ResolveOperator): Use
21310         String.Concat(string,string,string) or
21311         String.Concat(string,string,string,string) when possible. 
21312
21313         * typemanager: More helper methods.
21314
21315
21316 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
21317
21318         * pending.cs: remove the bogus return from GetMissingInterfaces()
21319         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
21320
21321 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21322
21323         * namespace.cs: avoid duplicated 'using xxx' being added to
21324         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
21325         when we get more than one 'using' statement for the same namespace.
21326         Report a CS0105 warning for it.
21327
21328 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
21329
21330         * cs-tokenizer.cs (consume_identifier): use read directly, instead
21331         of calling getChar/putback, uses internal knowledge of it.    
21332
21333         (xtoken): Reorder tokenizer so most common patterns are checked
21334         first.  This reduces the compilation time in another 5% (from 8.11s
21335         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
21336
21337         The parsing time is 22% of the compilation in mcs, and from that
21338         64% is spent on the tokenization process.  
21339
21340         I tried using a binary search for keywords, but this is slower
21341         than the hashtable.  Another option would be to do a couple of
21342         things:
21343
21344                 * Not use a StringBuilder, instead use an array of chars,
21345                   with a set value.  Notice that this way we could catch
21346                   the 645 error without having to do it *afterwards*.
21347
21348                 * We could write a hand-parser to avoid the hashtable
21349                   compares altogether.
21350
21351         The identifier consumption process takes 37% of the tokenization
21352         time.  Another 15% is spent on is_number.  56% of the time spent
21353         on is_number is spent on Int64.Parse:
21354
21355                 * We could probably choose based on the string length to
21356                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
21357                   computations. 
21358
21359         Another 3% is spend on wrapping `xtoken' in the `token' function.
21360
21361         Handle 0xa0 as whitespace (#34752)
21362
21363 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
21364
21365         * typemanager.cs (IsCLRType): New routine to tell whether a type
21366         is one of the builtin types.  
21367
21368         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
21369         typecode in more places instead of doing pointer comparissions.
21370         We could leverage some knowledge about the way the typecodes are
21371         laid out.
21372
21373         New code to cache namespaces in assemblies, it is currently not
21374         invoked, to be used soon.
21375
21376         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
21377
21378         * expression.cs (Binary.ResolveOperator): specially handle
21379         strings, and do not perform user-defined operator overloading for
21380         built-in types.
21381
21382 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
21383
21384         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
21385         internalcall as it is a pretty simple operation;  Avoid whenever
21386         possible to call Char.IsLetter.
21387
21388         (consume_identifier): Cut by half the number of
21389         hashtable calls by merging the is_keyword and GetKeyword behavior.
21390
21391         Do not short-circuit, because if we do, we
21392         report errors (ie, #if false && true would produce an invalid
21393         directive error);
21394
21395
21396 2002-11-24  Martin Baulig  <martin@ximian.com>
21397
21398         * expression.cs (Cast.TryReduce): If we're in checked syntax,
21399         check constant ranges and report a CS0221.  Fixes #33186.
21400
21401 2002-11-24  Martin Baulig  <martin@ximian.com>
21402
21403         * cs-parser.jay: Make this work for uninitialized variable
21404         declarations in the `for' initializer.  Fixes #32416.
21405
21406 2002-11-24  Martin Baulig  <martin@ximian.com>
21407
21408         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
21409         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
21410
21411 2002-11-24  Martin Baulig  <martin@ximian.com>
21412
21413         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
21414         argument; if true, we also check for user-defined conversions.
21415         This is only needed if both arguments are of a user-defined type.
21416         Fixes #30443, added test-175.cs.
21417         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
21418
21419         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
21420
21421 2002-11-24  Martin Baulig  <martin@ximian.com>
21422
21423         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
21424         function to get the store opcode.
21425         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
21426         only emit the Ldelema if the store opcode is Stobj.  You must run
21427         both test-34 and test-167 to test this.  Fixes #34529.
21428
21429 2002-11-23  Martin Baulig  <martin@ximian.com>
21430
21431         * ecore.cs (Expression.MemberLookup): Added additional
21432         `qualifier_type' argument which is used when we're being called
21433         from MemberAccess.DoResolve() and null if we're called from a
21434         SimpleName lookup.
21435         (Expression.MemberLookupFailed): New method to report errors; this
21436         does the CS1540 check and reports the correct error message.
21437
21438         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
21439         argument for the CS1540 check and redone the way how we're dealing
21440         with private members.  See the comment in the source code for details.
21441         (FilterWithClosure): Reverted this back to revision 1.197; renamed
21442         `closure_start_type' to `closure_qualifier_type' and check whether
21443         it's not null.  It was not this filter being broken, it was just
21444         being called with the wrong arguments.
21445
21446         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
21447         and pass it the correct `qualifier_type'; this also does the error
21448         handling for us.
21449
21450 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
21451
21452         * expression.cs (Invocation.EmitParams): If the we are dealing
21453         with a non-built-in value type, load its address as well.
21454
21455         (ArrayCreation): Use a a pretty constant instead
21456         of the hardcoded value 2.   Use 6 instead of 2 for the number of
21457         static initializers.  
21458
21459         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
21460         because they are not really value types, just glorified integers. 
21461
21462         * driver.cs: Do not append .exe, the CSC compiler does not do it.
21463
21464         * ecore.cs: Remove redundant code for enumerations, make them use
21465         the same code path as everything else, fixes the casting issue
21466         with enumerations in Windows.Forms.
21467
21468         * attribute.cs: Do only cast to string if it is a string, the
21469         validation happens later.
21470
21471         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
21472         people upgrade their corlibs.
21473
21474         * ecore.cs: Oops, enumerations were not following the entire code path
21475
21476 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
21477
21478         * typemanager.cs (FilterWithClosure): Commented out the test for
21479         1540 in typemanager.cs, as it has problems when accessing
21480         protected methods from a parent class (see test-174.cs). 
21481
21482         * attribute.cs (Attribute.ValidateGuid): new method.
21483         (Attribute.Resolve): Use above.
21484
21485 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
21486
21487         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
21488
21489         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
21490         handling for enumerations, as we only needed the TypeContainer
21491         functionality to begin with (this is required for the fix below to
21492         work for enums that reference constants in a container class for
21493         example). 
21494
21495         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
21496
21497         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
21498         a valid TypeBuilder to perform lookups on.o
21499
21500         * class.cs (InheritableMemberSignatureCompare): Use true in the
21501         call to GetGetMethod and GetSetMethod, because we are comparing
21502         the signature, and we need to get the methods *even* if they are
21503         private. 
21504
21505         (PropertyBase.CheckBase): ditto.
21506
21507         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
21508         GotoCase.Resolve): Use Peel on EmpytCasts.
21509
21510         * ecore.cs (EmptyCast): drop child, add Peel method.
21511
21512 2002-11-17  Martin Baulig  <martin@ximian.com>
21513
21514         * ecore.cs (EmptyCast.Child): New public property.
21515
21516         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
21517         label resolved to an EmptyCast.  Fixes #34162.
21518         (GotoCase.Resolve): Likewise.
21519         (Block.EmitMeta): Likewise.
21520
21521 2002-11-17  Martin Baulig  <martin@ximian.com>
21522
21523         * expression.cs (Invocation.BetterConversion): Prefer int over
21524         uint; short over ushort; long over ulong for integer literals.
21525         Use ImplicitConversionExists instead of StandardConversionExists
21526         since we also need to check for user-defined implicit conversions.
21527         Fixes #34165.  Added test-173.cs.
21528
21529 2002-11-16  Martin Baulig  <martin@ximian.com>
21530
21531         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
21532         with the `true' and `false' literals.  Fixes #33151.
21533
21534 2002-11-16  Martin Baulig  <martin@ximian.com>
21535
21536         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
21537         October 22nd; don't do the cs1540 check for static members.
21538
21539         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
21540         now using our own filter here and doing the cs1540 check again.
21541
21542 2002-11-16  Martin Baulig  <martin@ximian.com>
21543
21544         * support.cs (InternalParameters): Don't crash if we don't have
21545         any fixed parameters.  Fixes #33532.
21546
21547 2002-11-16  Martin Baulig  <martin@ximian.com>
21548
21549         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
21550         when looking up static methods to make this work on Windows.
21551         Fixes #33773.
21552
21553 2002-11-16  Martin Baulig  <martin@ximian.com>
21554
21555         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
21556         a setter rather than using PropertyInfo.CanWrite.
21557
21558 2002-11-15  Nick Drochak  <ndrochak@gol.com>
21559
21560         * class.cs: Allow acces to block member by subclasses. Fixes build
21561         breaker.
21562
21563 2002-11-14  Martin Baulig  <martin@ximian.com>
21564
21565         * class.cs (Constructor.Emit): Added the extern/block check.
21566         Fixes bug #33678.
21567
21568 2002-11-14  Martin Baulig  <martin@ximian.com>
21569
21570         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
21571         iteration while looking for indexers, this is needed because the
21572         indexer may have a different name in our base classes.  Fixed the
21573         error reporting (no indexers at all, not get accessor, no
21574         overloaded match).  Fixes bug #33089.
21575         (IndexerAccess.DoResolveLValue): Likewise.
21576
21577 2002-11-14  Martin Baulig  <martin@ximian.com>
21578
21579         * class.cs (PropertyBase.CheckBase): Make this work for multiple
21580         indexers.  Fixes the first part of bug #33089.
21581         (MethodSignature.InheritableMemberSignatureCompare): Added support
21582         for properties.
21583
21584 2002-11-13  Ravi Pratap  <ravi@ximian.com>
21585
21586         * attribute.cs (Attribute.Resolve): Catch the
21587         NullReferenceException and report it since it isn't supposed to
21588         happen. 
21589
21590 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
21591
21592         * expression.cs (Binary.EmitBranchable): Also handle the cases for
21593         LogicalOr and LogicalAnd that can benefit from recursively
21594         handling EmitBranchable.  The code now should be nice for Paolo.
21595
21596 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
21597
21598         * typemanager.cs (LookupType): Added a negative-hit hashtable for
21599         the Type lookups, as we perform quite a number of lookups on
21600         non-Types.  This can be removed once we can deterministically tell
21601         whether we have a type or a namespace in advance.
21602
21603         But this might require special hacks from our corlib.
21604
21605         * TODO: updated.
21606
21607         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
21608         and double which avoids a conversion from an integer to a double.
21609
21610         * expression.cs: tiny optimization, avoid calling IsConstant,
21611         because it effectively performs the lookup twice.
21612
21613 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
21614
21615         But a bogus return here to keep the semantics of the old code
21616         until the Mono runtime is fixed.
21617
21618         * pending.cs (GetMissingInterfaces): New method used to remove all
21619         the interfaces that are already implemented by our parent
21620         classes from the list of pending methods. 
21621
21622         * interface.cs: Add checks for calls after ResolveTypeExpr.
21623
21624 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
21625
21626         * class.cs (Class.Emit): Report warning 67: event not used if the
21627         warning level is beyond 3.
21628
21629         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
21630         being a NullLiteral.
21631
21632         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
21633         specifiers. 
21634
21635         * class.cs (TypeContainer.GetClassBases): Cover a missing code
21636         path that might fail if a type can not be resolved.
21637
21638         * expression.cs (Binary.Emit): Emit unsigned versions of the
21639         operators. 
21640
21641         * driver.cs: use error 5.
21642
21643 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
21644
21645         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
21646
21647 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
21648
21649         * cs-parser.jay (switch_section): A beautiful patch from Martin
21650         Baulig that fixed 33094.
21651
21652 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
21653
21654         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
21655         Check whether the base is abstract and report an error if so.
21656
21657         * expression.cs (IndexerAccess.DoResolveLValue,
21658         IndexerAccess.DoResolve): ditto. 
21659
21660         (Invocation.DoResolve): ditto.
21661
21662         (Invocation.FullMethodDesc): Improve the report string.
21663
21664         * statement.cs (Block): Eliminate IsVariableDefined as it is
21665         basically just a wrapper for GetVariableInfo.
21666
21667         * ecore.cs (SimpleName): Use new 
21668
21669         * support.cs (ReflectionParamter.ParameterType): We unwrap the
21670         type, as we return the actual parameter ref/unref state on a
21671         different call.
21672
21673 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
21674
21675         * support.cs: Return proper flags REF/OUT fixing the previous
21676         commit.  
21677
21678         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
21679         not used to mean `ref' but `ref or out' in ParameterReference
21680
21681         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
21682         full type signature instead of calling TypeManger.CSharpName
21683         ourselves. 
21684
21685         * support.cs (InternalParameters.ParameterDesc): Do not compare
21686         directly to the modflags, because REF/OUT will actually be bitsets
21687         if set. 
21688
21689         * delegate.cs (VerifyMethod): Check also the modifiers.
21690
21691         * cs-tokenizer.cs: Fix bug where floating point values with an
21692         exponent where a sign was missing was ignored.
21693
21694         * driver.cs: Allow multiple assemblies to be specified in a single
21695         /r: argument
21696
21697 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
21698
21699         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
21700         because identifiers after a parenthesis would end up in this kind
21701         of production, and we needed to desamiguate it for having casts
21702         like:
21703
21704                 (UserDefinedType *) xxx
21705
21706 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
21707
21708         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
21709         we should set on the Bindingflags.NonPublic, but not turn on
21710         private_ok.  private_ok controls whether a Private member is
21711         returned (this is chekced on the filter routine), while the
21712         BindingFlags.NonPublic just controls whether private/protected
21713         will be allowed.   This fixes the problem part of the problem of
21714         private properties being allowed to be used in derived classes.
21715
21716         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
21717         so we can call the children DoResolveLValue method (this will
21718         properly signal errors on lvalue assignments to base properties)
21719
21720         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
21721         getter are null, and we have a property info, we know that this
21722         happened because the lookup failed, so we report an error 122 for
21723         protection level violation.
21724
21725         We also silently return if setter and getter are null in the
21726         resolve functions, this condition only happens if we have flagged
21727         the error before.  This is the other half of the problem. 
21728
21729         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
21730         not have accessibility information, that is why we were returning
21731         true in the filter function in typemanager.cs.
21732
21733         To properly report 122 (property is inaccessible because of its
21734         protection level) correctly, we report this error in ResolveAccess
21735         by failing if both the setter and the getter are lacking (ie, the
21736         lookup failed). 
21737
21738         DoResolve and DoLResolve have been modified to check for both
21739         setter/getter being null and returning silently, the reason being
21740         that I did not want to put the knowledge about this error in upper
21741         layers, like:
21742
21743         int old = Report.Errors;
21744         x = new PropertyExpr (...);
21745         if (old != Report.Errors)
21746                 return null;
21747         else
21748                 return x;
21749
21750         So the property expr is returned, but it is invalid, so the error
21751         will be flagged during the resolve process. 
21752
21753         * class.cs: Remove InheritablePropertySignatureCompare from the
21754         class, as we no longer depend on the property signature to compute
21755         whether it is possible to implement a method or not.
21756
21757         The reason is that calling PropertyInfo.GetGetMethod will return
21758         null (in .NET, in Mono it works, and we should change this), in
21759         cases where the Get Method does not exist in that particular
21760         class.
21761
21762         So this code:
21763
21764         class X { public virtual int A { get { return 1; } } }
21765         class Y : X { }
21766         class Z : Y { public override int A { get { return 2; } } }
21767
21768         Would fail in Z because the parent (Y) would not have the property
21769         defined.  So we avoid this completely now (because the alternative
21770         fix was ugly and slow), and we now depend exclusively on the
21771         method names.
21772
21773         (PropertyBase.CheckBase): Use a method-base mechanism to find our
21774         reference method, instead of using the property.
21775
21776         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
21777         routines are gone now.
21778
21779         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
21780         names, they were incorrectly named.
21781
21782         * cs-tokenizer.cs: Return are more gentle token on failure. 
21783
21784         * pending.cs (PendingImplementation.InterfaceMethod): This routine
21785         had an out-of-sync index variable, which caused it to remove from
21786         the list of pending methods the wrong method sometimes.
21787
21788 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
21789
21790         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
21791         CanWrite, because those refer to this particular instance of the
21792         property, and do not take into account the fact that we can
21793         override single members of a property.
21794
21795         Constructor requires an EmitContext.  The resolution process does
21796         not happen here, but we need to compute the accessors before,
21797         because the resolution does not always happen for properties.
21798
21799         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
21800         subclass, before we did not update this flag, but we did update
21801         bindingflags. 
21802
21803         (GetAccessors): Drop this routine, as it did not work in the
21804         presence of partially overwritten set/get methods. 
21805
21806         Notice that this broke the cs1540 detection, but that will require
21807         more thinking. 
21808
21809 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21810
21811         * class.cs:
21812         * codegen.cs:
21813         * driver.cs: issue a warning instead of an error if we don't support
21814         debugging for the platform. Also ignore a couple of errors that may
21815         arise when trying to write the symbols. Undo my previous patch.
21816
21817 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21818
21819         * driver.cs: ignore /debug switch except for Unix platforms.
21820
21821 2002-10-23  Nick Drochak  <ndrochak@gol.com>
21822
21823         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
21824
21825 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
21826
21827         * driver.cs: Do not make mcs-debug conditional, so we do not break
21828         builds that use it.
21829
21830         * statement.cs (UsageVector.MergeChildren): I would like Martin to
21831         review this patch.  But basically after all the children variables
21832         have been merged, the value of "Breaks" was not being set to
21833         new_breaks for Switch blocks.  I think that it should be set after
21834         it has executed.  Currently I set this to the value of new_breaks,
21835         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
21836         conservative, but I do not understand this code very well.
21837
21838         I did not break anything in the build, so that is good ;-)
21839
21840         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
21841
21842 2002-10-20  Mark Crichton  <crichton@gimp.org>
21843
21844         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
21845
21846 2002-10-20  Nick Drochak  <ndrochak@gol.com>
21847
21848         * cfold.cs: Fixed compile blocker.
21849
21850 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
21851
21852         * driver.cs: I was chekcing the key, not the file.
21853
21854 2002-10-19  Ravi Pratap  <ravi@ximian.com>
21855
21856         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
21857         message that we were generating - we just need to silently return
21858         a null.
21859
21860 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
21861
21862         * class.cs (Event.Define): Change my previous commit, as this
21863         breaks the debugger.  This is a temporary hack, as it seems like
21864         the compiler is generating events incorrectly to begin with.
21865
21866         * expression.cs (Binary.ResolveOperator): Added support for 
21867         "U operator - (E x, E y)"
21868
21869         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
21870         y)".
21871
21872         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
21873         init-only variables, but this path did not take into account that
21874         there might be also instance readonly variables.  Correct this
21875         problem. 
21876
21877         This fixes bug 32253
21878
21879         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
21880         delegates as well.
21881
21882         * driver.cs: Change the extension for modules to `netmodule'
21883
21884         * cs-parser.jay: Improved slightly the location tracking for
21885         the debugger symbols.
21886
21887         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
21888         modifiers that were specified instead of the hardcoded value
21889         (FamAndAssem).  This was basically ignoring the static modifier,
21890         and others.  Fixes 32429.
21891
21892         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
21893         fixed a bug in the process (32476)
21894
21895         * expression.cs (ArrayAccess.EmitAssign): Patch from
21896         hwang_rob@yahoo.ca that fixes bug 31834.3
21897
21898 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
21899
21900         * driver.cs: Make the module extension .netmodule.
21901
21902 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
21903
21904         * driver.cs: Report an error if the resource file is not found
21905         instead of crashing.
21906
21907         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
21908         false, like Emit does.
21909
21910 2002-10-16  Nick Drochak  <ndrochak@gol.com>
21911
21912         * typemanager.cs: Remove unused private member.  Also reported mcs
21913         bug to report this as a warning like csc.
21914
21915 2002-10-15  Martin Baulig  <martin@gnome.org>
21916
21917         * statement.cs (Statement.Emit): Made this a virtual method; emits
21918         the line number info and calls DoEmit().
21919         (Statement.DoEmit): New protected abstract method, formerly knows
21920         as Statement.Emit().
21921
21922         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
21923
21924 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
21925
21926         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
21927         have fixed a remaining problem: not every AddXXXX was adding a
21928         fully qualified name.  
21929
21930         Now everyone registers a fully qualified name in the DeclSpace as
21931         being defined instead of the partial name.  
21932
21933         Downsides: we are slower than we need to be due to the excess
21934         copies and the names being registered this way.  
21935
21936         The reason for this is that we currently depend (on the corlib
21937         bootstrap for instance) that types are fully qualified, because
21938         we dump all the types in the namespace, and we should really have
21939         types inserted into the proper namespace, so we can only store the
21940         basenames in the defined_names array.
21941
21942 2002-10-10  Martin Baulig  <martin@gnome.org>
21943
21944         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
21945         from bug #31834, see the bug report for a testcase which is
21946         miscompiled.
21947
21948 2002-10-10  Martin Baulig  <martin@gnome.org>
21949
21950         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
21951         flow analysis code for this.
21952
21953         * statement.cs (Do, While, For): Tell the flow analysis code about
21954         infinite loops.
21955         (FlowBranching.UsageVector): Added support for infinite loops.
21956         (Block.Resolve): Moved the dead code elimination here and use flow
21957         analysis to do it.
21958
21959 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
21960
21961         * class.cs (Field.Define): Catch cycles on struct type
21962         definitions. 
21963
21964         * typemanager.cs (IsUnmanagedtype): Do not recursively check
21965         fields if the fields are static.  We only need to check instance
21966         fields. 
21967
21968         * expression.cs (As.DoResolve): Test for reference type.
21969
21970         * statement.cs (Using.ResolveExpression): Use
21971         ConvertImplicitRequired, not ConvertImplicit which reports an
21972         error on failture
21973         (Using.ResolveLocalVariableDecls): ditto.
21974
21975         * expression.cs (Binary.ResolveOperator): Report errors in a few
21976         places where we had to.
21977
21978         * typemanager.cs (IsUnmanagedtype): Finish implementation.
21979
21980 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
21981
21982         * expression.cs: Use StoreFromPtr instead of extracting the type
21983         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
21984
21985         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
21986         an enumeration value to a System.Enum, but System.Enum is not a
21987         value type, but an class type, so we need to box.
21988
21989         (Expression.ConvertExplicit): One codepath could return
21990         errors but not flag them.  Fix this.  Fixes #31853
21991
21992         * parameter.cs (Resolve): Do not allow void as a parameter type.
21993
21994 2002-10-06  Martin Baulig  <martin@gnome.org>
21995
21996         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
21997         if it's a class type and not a struct.  Fixes #31815.
21998
21999 2002-10-06  Martin Baulig  <martin@gnome.org>
22000
22001         * statement.cs: Reworked the flow analysis code a bit to make it
22002         usable for dead code elimination.
22003
22004 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22005
22006         * cs-parser.jay: allow empty source files. Fixes bug #31781.
22007
22008 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
22009
22010         * expression.cs (ComposedCast.DoResolveType): A quick workaround
22011         to fix the test 165, will investigate deeper.
22012
22013 2002-10-04  Martin Baulig  <martin@gnome.org>
22014
22015         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
22016         finally blocks actually work.
22017         (Try.Resolve): We don't need to create a sibling for `finally' if
22018         there is no finally block.
22019
22020 2002-10-04  Martin Baulig  <martin@gnome.org>
22021
22022         * class.cs (Constructor.Define): The default accessibility for a
22023         non-default constructor is private, not public.
22024
22025 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
22026
22027         * class.cs (Constructor): Make AllowedModifiers public, add
22028         EXTERN.
22029
22030         * cs-parser.jay: Perform the modifiers test here, as the
22031         constructor for the Constructor class usually receives a zero
22032         because of the way we create it (first we create, later we
22033         customize, and we were never checking the modifiers).
22034
22035         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
22036         is a version of LookupTypeReflection that includes the type-name
22037         cache.  This can be used as a fast path for functions that know
22038         the fully qualified name and are only calling into *.GetType() to
22039         obtain a composed type.
22040
22041         This is also used by TypeManager.LookupType during its type
22042         composition.
22043
22044         (LookupType): We now also track the real type name, as sometimes
22045         we can get a quey for the real type name from things like
22046         ComposedCast.  This fixes bug 31422.
22047
22048         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
22049         complete type fullname, it does not have to go through the type
22050         resolution system to obtain the composed version of the type (for
22051         obtaining arrays or pointers).
22052
22053         (Conditional.Emit): Use the EmitBoolExpression to
22054         generate nicer code, as requested by Paolo.
22055
22056         (ArrayCreation.CheckIndices): Use the patch from
22057         hwang_rob@yahoo.ca to validate the array initializers. 
22058
22059 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
22060
22061         * class.cs (ConstructorInitializer.Emit): simplify code by using
22062         Invocation.EmitCall, and at the same time, fix the bugs in calling
22063         parent constructors that took variable arguments. 
22064
22065         * ecore.cs (Expression.ConvertNumericExplicit,
22066         Expression.ImplicitNumericConversion): Remove the code that
22067         manually wrapped decimal (InternalTypeConstructor call is now gone
22068         as well).
22069
22070         * expression.cs (Cast.TryReduce): Also handle decimal types when
22071         trying to perform a constant fold on the type.
22072
22073         * typemanager.cs (IsUnmanagedtype): Partially implemented.
22074
22075         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
22076         that only turned off an error report, and did nothing else. 
22077
22078 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
22079
22080         * driver.cs: Handle and ignore /fullpaths
22081
22082 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
22083
22084         * expression.cs (Binary.ResolveOperator): Catch the case where
22085         DoNumericPromotions returns true, 
22086
22087         (Binary.DoNumericPromotions): Simplify the code, and the tests.
22088
22089 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
22090
22091         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
22092         report error 70.
22093
22094 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
22095
22096         * ecore.cs (ConvertNumericExplicit): It is not enough that the
22097         conversion exists, but it is also required that the conversion be
22098         performed.  This manifested in "(Type64Enum) 2".  
22099
22100         * class.cs (TypeManager.AddMethod): The fix is not to change
22101         AddEnum, because that one was using a fully qualified name (every
22102         DeclSpace derivative does), but to change the AddMethod routine
22103         that was using an un-namespaced name.  This now correctly reports
22104         the duplicated name.
22105
22106         Revert patch until I can properly fix it.  The issue
22107         is that we have a shared Type space across all namespaces
22108         currently, which is wrong.
22109
22110         Options include making the Namespace a DeclSpace, and merge
22111         current_namespace/current_container in the parser.
22112
22113 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
22114
22115         * cs-parser.jay: Improve error reporting when we get a different
22116         kind of expression in local_variable_type and
22117         local_variable_pointer_type. 
22118
22119         Propagate this to avoid missleading errors being reported.
22120
22121         * ecore.cs (ImplicitReferenceConversion): treat
22122         TypeManager.value_type as a target just like object_type.   As
22123         code like this:
22124
22125         ValueType v = 1;
22126
22127         Is valid, and needs to result in the int 1 being boxed before it
22128         is assigned to the value type v.
22129
22130         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
22131         to validate the enumeration name.
22132
22133         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
22134         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
22135         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
22136
22137         * ecore.cs (TryImplicitIntConversion): When doing an
22138         implicit-enumeration-conversion, check if the type is 64-bits and
22139         perform a conversion before passing to EnumConstant.
22140
22141 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
22142
22143         * decl.cs (Error_AmbiguousTypeReference); New routine used to
22144         report ambiguous type references.  Unlike the MS version, we
22145         report what the ambiguity is.   Innovation at work ;-)
22146
22147         (DeclSpace.FindType): Require a location argument to
22148         display when we display an ambiguous error.
22149
22150         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
22151
22152         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
22153
22154         * expression.cs (EmitDynamicInitializers): Apply patch from
22155         hwang_rob@yahoo.ca that fixes the order in which we emit our
22156         initializers. 
22157
22158 2002-09-21  Martin Baulig  <martin@gnome.org>
22159
22160         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
22161         delegate takes no arguments.
22162
22163 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
22164
22165         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
22166         from integers.
22167
22168         * expression.cs: Extract the underlying type.
22169
22170         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
22171
22172         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
22173
22174 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
22175
22176         * class.cs (TypeContainer.DefineType): We can not use the nice
22177         PackingSize with the size set to 1 DefineType method, because it
22178         will not allow us to define the interfaces that the struct
22179         implements.
22180
22181         This completes the fixing of bug 27287
22182
22183         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
22184         means also structs.  This fixes part of the problem. 
22185         (Expresion.ImplicitReferenceConversionExists): ditto.
22186
22187         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
22188         error if there were no errors reported during the type lookup
22189         process, to avoid duplicates or redundant errors.  Without this
22190         you would get an ambiguous errors plus a type not found.  We have
22191         beaten the user enough with the first error.  
22192
22193         (DeclSparce.FindType): Emit a warning if we have an ambiguous
22194         reference. 
22195
22196         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
22197         during the resolution process, stop the lookup, this avoids
22198         repeated error reports (same error twice).
22199
22200         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
22201
22202         * typemanager.cs (LookupType): Redo the type lookup code to match
22203         the needs of System.Reflection.  
22204
22205         The issue is that System.Reflection requires references to nested
22206         types to begin with a "+" sign instead of a dot.  So toplevel
22207         types look like: "NameSpace.TopLevelClass", and nested ones look
22208         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
22209         levels. 
22210
22211 2002-09-19  Martin Baulig  <martin@gnome.org>
22212
22213         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
22214         says that a method always returns or always throws an exception,
22215         don't report the CS0161.
22216
22217         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
22218         set `Returns = new_returns'.
22219
22220 2002-09-19  Martin Baulig  <martin@gnome.org>
22221
22222         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
22223         to an enum constant, check for a CS0176.
22224
22225 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
22226
22227         * class.cs (TypeContainer.CheckPairedOperators): Now we check
22228         for operators that must be in pairs and report errors.
22229
22230         * ecore.cs (SimpleName.DoResolveType): During the initial type
22231         resolution process, when we define types recursively, we must
22232         check first for types in our current scope before we perform
22233         lookups in the enclosing scopes.
22234
22235         * expression.cs (MakeByteBlob): Handle Decimal blobs.
22236
22237         (Invocation.VerifyArgumentsCompat): Call
22238         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
22239         I thought we were supposed to always call this, but there are a
22240         few places in the code where we dont do it.
22241
22242 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
22243
22244         * driver.cs: Add support in -linkres and -resource to specify the
22245         name of the identifier.
22246
22247 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
22248
22249         * ecore.cs (StandardConversionExists): Sync with the conversion
22250         code: allow anything-* to void* conversions.
22251
22252         (FindMostSpecificSource): Use an Expression argument
22253         instead of a Type, because we might be handed over a Literal which
22254         gets a few more implicit conversions that plain types do not.  So
22255         this information was being lost.
22256
22257         Also, we drop the temporary type-holder expression when not
22258         required.
22259
22260 2002-09-17  Martin Baulig  <martin@gnome.org>
22261
22262         * class.cs (PropertyBase.CheckBase): Don't check the base class if
22263         this is an explicit interface implementation.
22264
22265 2002-09-17  Martin Baulig  <martin@gnome.org>
22266
22267         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
22268         different `IndexerName' attributes.
22269
22270         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
22271         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
22272         virtual CommonResolve().
22273
22274 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
22275
22276         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
22277         and convert that to the UnderlyingType.
22278
22279         * statement.cs (Foreach.Resolve): Indexers are just like variables
22280         or PropertyAccesses.
22281
22282         * cs-tokenizer.cs (consume_string): Track line numbers and columns
22283         inside quoted strings, we were not doing this before.
22284
22285 2002-09-16  Martin Baulig  <martin@gnome.org>
22286
22287         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
22288         resolve it.  This is needed for the definite assignment check of the
22289         instance expression, fixes bug #29846.
22290         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
22291
22292 2002-09-16  Nick Drochak  <ndrochak@gol.com>
22293
22294         * parameter.cs: Fix compile error.  Cannot reference static member
22295         from an instance object.  Is this an mcs bug?
22296
22297 2002-09-14  Martin Baulig  <martin@gnome.org>
22298
22299         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
22300         multiple times.  Fixes bug #30295, added test-166.cs.
22301
22302 2002-09-14  Martin Baulig  <martin@gnome.org>
22303
22304         * statement.cs (Block.Emit): Don't emit unreachable code.
22305         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
22306         `break' statements.
22307         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
22308
22309 2002-09-14  Martin Baulig  <martin@gnome.org>
22310
22311         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
22312         is set.
22313
22314 2002-09-14  Martin Baulig  <martin@gnome.org>
22315
22316         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
22317         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
22318         be false on the ms runtime.
22319
22320 2002-09-13  Martin Baulig  <martin@gnome.org>
22321
22322         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
22323         the CS0038 error message.
22324
22325 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
22326
22327         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
22328         constant inside, return it.
22329
22330 2002-09-12  Martin Baulig  <martin@gnome.org>
22331
22332         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
22333         implicit conversion can be done between enum types.
22334
22335         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
22336         check whether an implicit conversion to the current enum's UnderlyingType
22337         exists and report an error if not.
22338
22339         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
22340         without debugging support.
22341
22342         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
22343         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
22344
22345 2002-09-12  Martin Baulig  <martin@gnome.org>
22346
22347         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
22348
22349         * ecore.cs (IMemberExpr.DeclaringType): New property.
22350         (SimpleName.SimpleNameResolve): Check whether we're accessing a
22351         nonstatic member of an outer type (CS0038).
22352
22353 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
22354
22355         * driver.cs: Activate the using-error detector at warning level
22356         4 (at least for MS-compatible APIs).
22357
22358         * namespace.cs (VerifyUsing): Small buglett fix.
22359
22360         * pending.cs (PendingImplementation): pass the container pointer. 
22361
22362         * interface.cs (GetMethods): Allow for recursive definition.  Long
22363         term, I would like to move every type to support recursive
22364         definitions, not the current ordering mechanism that we have right
22365         now.
22366
22367         The situation is this: Attributes are handled before interfaces,
22368         so we can apply attributes to interfaces.  But some attributes
22369         implement interfaces, we will now handle the simple cases
22370         (recursive definitions will just get an error).  
22371
22372         * parameter.cs: Only invalidate types at the end if we fail to
22373         lookup all types.  
22374
22375 2002-09-09  Martin Baulig  <martin@gnome.org>
22376
22377         * ecore.cs (PropertyExpr.Emit): Also check for
22378         TypeManager.system_int_array_get_length so this'll also work when
22379         compiling corlib.  Fixes #30003.
22380
22381 2002-09-09  Martin Baulig  <martin@gnome.org>
22382
22383         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
22384         and throw an exception if we can't get the type's size.  Fixed #30040,
22385         added test-165.cs.
22386
22387 2002-09-09  Martin Baulig  <martin@gnome.org>
22388
22389         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
22390
22391         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
22392         context.  Fixes bug #30027.
22393
22394         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
22395         virtual functions.  Fixes bug #30043, added test-164.cs.
22396
22397 2002-09-08  Ravi Pratap  <ravi@ximian.com>
22398
22399         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
22400
22401 2002-09-08  Nick Drochak  <ndrochak@gol.com>
22402
22403         * driver.cs: Use an object to get the windows codepage since it's not a
22404         static property.
22405
22406 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
22407
22408         * statement.cs (For.Emit): for infinite loops (test == null)
22409         return whether there is a break inside, not always "true".
22410
22411         * namespace.cs (UsingEntry): New struct to hold the name of the
22412         using definition, the location where it is defined, and whether it
22413         has been used in a successful type lookup.
22414
22415         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
22416         strings.
22417
22418         * decl.cs: ditto.
22419
22420 2002-09-06  Ravi Pratap  <ravi@ximian.com>
22421
22422         * attribute.cs : Fix incorrect code which relied on catching
22423         a NullReferenceException to detect a null being passed in
22424         where an object was expected.
22425
22426 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
22427
22428         * statement.cs (Try): flag the catch variable as assigned
22429
22430         * expression.cs (Cast): Simplified by using ResolveType instead of
22431         manually resolving.
22432
22433         * statement.cs (Catch): Fix bug by using ResolveType.
22434
22435 2002-09-06  Ravi Pratap  <ravi@ximian.com>
22436
22437         * expression.cs (BetterConversion): Special case for when we have
22438         a NullLiteral as the argument and we have to choose between string
22439         and object types - we choose string the way csc does.
22440
22441         * attribute.cs (Attribute.Resolve): Catch the
22442         NullReferenceException and report error #182 since the Mono
22443         runtime no more has the bug and having this exception raised means
22444         we tried to select a constructor which takes an object and is
22445         passed a null.
22446
22447 2002-09-05  Ravi Pratap  <ravi@ximian.com>
22448
22449         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
22450         message (1502, 1503) when we can't locate a method after overload
22451         resolution. This is much more informative and closes the bug
22452         Miguel reported.
22453
22454         * interface.cs (PopulateMethod): Return if there are no argument
22455         types. Fixes a NullReferenceException bug.
22456
22457         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
22458         expressions too. Previously we were checking only in one place for
22459         positional arguments leaving out named arguments.
22460
22461         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
22462         type to the enum type is not allowed. Remove code corresponding to
22463         that.
22464
22465         (ConvertNumericExplicit): Allow explicit conversions from
22466         the underlying type to enum type. This precisely follows the spec
22467         and closes a bug filed by Gonzalo.
22468
22469 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22470
22471         * compiler.csproj:
22472         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
22473
22474 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
22475
22476         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
22477         it was important that we stored the right value after the
22478         reduction in `converted'.
22479
22480 2002-09-04  Martin Baulig  <martin@gnome.org>
22481
22482         * location.cs (Location.SymbolDocument): Use full pathnames for the
22483         source files.
22484
22485 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
22486
22487         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
22488         of the expression resolve mechanism, because that will catch the
22489         SimpleName error failures.
22490
22491         (Conditional): If we can not resolve the
22492         expression, return, do not crash.
22493
22494 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22495
22496         * cs-tokenizer.cs:
22497         (location): display token name instead of its number.
22498
22499 2002-08-28  Martin Baulig  <martin@gnome.org>
22500
22501         * expression.cs (Binary.ResolveOperator): Don't silently return
22502         but return an error if an operator cannot be applied between two
22503         enum types.
22504
22505 2002-08-28  Martin Baulig  <martin@gnome.org>
22506
22507         * class.cs (Constructor.Define): Set the permission attributes
22508         correctly instead of making all constructors public.
22509
22510 2002-08-28  Martin Baulig  <martin@gnome.org>
22511
22512         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
22513         for private members before reporting a CS0103; if we find anything,
22514         it's a CS0122.
22515
22516 2002-08-28  Martin Baulig  <martin@gnome.org>
22517
22518         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
22519         to check whether `closure_start_type == closure_invocation_type',
22520         we also need to check whether `m.DeclaringType == closure_invocation_type'
22521         before bypassing the permission checks.  We might be accessing
22522         protected/private members from the base class.
22523         (TypeManager.RealMemberLookup): Only set private_ok if private
22524         members were requested via BindingFlags.NonPublic.
22525
22526         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
22527
22528         * expression.cs (MemberAccess.ResolveMemberAccess): Set
22529         MethodGroupExpr.IsExplicitImpl if appropriate.
22530         (Invocation.DoResolve): Don't report the CS0120 for explicit
22531         interface implementations.
22532
22533 2002-08-27  Martin Baulig  <martin@gnome.org>
22534
22535         * expression.cs (Invocation.DoResolve): If this is a static
22536         method and we don't have an InstanceExpression, we must report
22537         a CS0120.
22538
22539 2002-08-25  Martin Baulig  <martin@gnome.org>
22540
22541         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
22542         `==' between a valuetype and an object.
22543
22544 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
22545
22546         * ecore.cs (TypeExpr): Provide a ToString method.
22547
22548 2002-08-24  Martin Baulig  <martin@gnome.org>
22549
22550         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
22551         now called proggie.dbg and it's a binary file.
22552
22553 2002-08-23  Martin Baulig  <martin@gnome.org>
22554
22555         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
22556
22557 2002-08-23  Martin Baulig  <martin@gnome.org>
22558
22559         * struct.cs (MyStructInfo.ctor): Make this work with empty
22560         structs; it's not allowed to use foreach() on null.
22561
22562 2002-08-23  Martin Baulig  <martin@gnome.org>
22563
22564         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
22565         writer the full pathname of the generated assembly.
22566
22567 2002-08-23  Martin Baulig  <martin@gnome.org>
22568
22569         * statements.cs (FlowBranching.UsageVector.MergeChildren):
22570         A `finally' block never returns or breaks; improved handling of
22571         unreachable code.
22572
22573 2002-08-23  Martin Baulig  <martin@gnome.org>
22574
22575         * statement.cs (Throw.Resolve): Allow `throw null'.
22576
22577 2002-08-23  Martin Baulig  <martin@gnome.org>
22578
22579         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
22580         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
22581         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
22582         MemberLookup would return a wrong event if this is an explicit
22583         interface implementation and the class has an event with the same
22584         name.
22585
22586 2002-08-23  Martin Baulig  <martin@gnome.org>
22587
22588         * statement.cs (Block.AddChildVariableNames): New public method.
22589         (Block.AddChildVariableName): Likewise.
22590         (Block.IsVariableNameUsedInChildBlock): Likewise.
22591         (Block.AddVariable): Check whether a variable name has already
22592         been used in a child block.
22593
22594         * cs-parser.jay (declare_local_variables): Mark all variable names
22595         from the current block as being used in a child block in the
22596         implicit block.
22597
22598 2002-08-23  Martin Baulig  <martin@gnome.org>
22599
22600         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
22601         find the symbol writer.
22602
22603         * driver.cs: csc also allows the arguments to /define being
22604         separated by commas, not only by semicolons.
22605
22606 2002-08-23  Martin Baulig  <martin@gnome.org>
22607
22608         * interface.cs (Interface.GetMembers): Added static check for events.
22609
22610 2002-08-15  Martin Baulig  <martin@gnome.org>
22611
22612         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
22613         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
22614
22615         * ecore.cs (Expression.MemberLookup): Added documentation and explained
22616         why the MethodData.EmitDestructor() change was necessary.
22617
22618 2002-08-20  Martin Baulig  <martin@gnome.org>
22619
22620         * class.cs (TypeContainer.FindMembers): Added static check for events.
22621
22622         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
22623
22624         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
22625         use Type.GetEvents(), not Type.FindMembers().
22626
22627 2002-08-20  Martin Baulig  <martin@gnome.org>
22628
22629         * decl.cs (MemberCache): Added a special method cache which will
22630         be used for method-only searched.  This ensures that a method
22631         search will return a MethodInfo with the correct ReflectedType for
22632         inherited methods.      
22633
22634 2002-08-20  Martin Baulig  <martin@gnome.org>
22635
22636         * decl.cs (DeclSpace.FindMembers): Made this public.
22637
22638 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22639
22640         * delegate.cs: fixed build on windows.
22641         [FIXME:  Filed as bug #29150: MCS must report these errors.]
22642
22643 2002-08-19  Ravi Pratap  <ravi@ximian.com>
22644
22645         * ecore.cs (StandardConversionExists): Return a false
22646         if we are trying to convert the void type to anything else
22647         since that is not allowed.
22648
22649         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
22650         we flag error 70 in the event an event is trying to be accessed
22651         directly from outside the declaring type.
22652
22653 2002-08-20  Martin Baulig  <martin@gnome.org>
22654
22655         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
22656         MemberCache from typemanager.cs to decl.cs.
22657
22658 2002-08-19  Martin Baulig  <martin@gnome.org>
22659
22660         * class.cs (TypeContainer): Implement IMemberContainer.
22661         (TypeContainer.DefineMembers): Create the MemberCache.
22662         (TypeContainer.FindMembers): Do better BindingFlags checking; only
22663         return public members if BindingFlags.Public was given, check
22664         whether members are static.
22665
22666 2002-08-16  Martin Baulig  <martin@gnome.org>
22667
22668         * decl.cs (DeclSpace.Define): Splitted this in Define and
22669         DefineMembers.  DefineMembers is called first and initializes the
22670         MemberCache.
22671
22672         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
22673         DefineMembers() on all our DeclSpaces.
22674
22675         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
22676         but call DefineMembers() on all nested interfaces.  We call their
22677         Define() in our new Define() function.
22678
22679         * interface.cs (Interface): Implement IMemberContainer.
22680         (Interface.Define): Moved all code except the attribute stuf to
22681         DefineMembers().
22682         (Interface.DefineMembers): Initialize the member cache.
22683
22684         * typemanager.cs (IMemberFinder): Removed this interface, we don't
22685         need this anymore since we can use MemberCache.FindMembers directly.
22686
22687 2002-08-19  Martin Baulig  <martin@gnome.org>
22688
22689         * typemanager.cs (MemberCache): When creating the cache for an
22690         interface type, add all inherited members.
22691         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
22692         to `out bool used_cache' and documented it.
22693         (TypeManager.MemberLookup): If we already used the cache in the first
22694         iteration, we don't need to do the interfaces check.
22695
22696 2002-08-19  Martin Baulig  <martin@gnome.org>
22697
22698         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
22699         here from IMemberFinder and don't implement this interface anymore.
22700         (DeclSpace.MemberCache): Moved here from IMemberFinder.
22701
22702         * typemanager.cs (IMemberFinder): This interface is now only used by
22703         classes which actually support the member cache.
22704         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
22705         since we only put DeclSpaces into this Hashtable.
22706         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
22707         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
22708
22709 2002-08-16  Martin Baulig  <martin@gnome.org>
22710
22711         * typemanager.cs (ICachingMemberFinder): Removed.
22712         (IMemberFinder.MemberCache): New property.
22713         (TypeManager.FindMembers): Merged this with RealFindMembers().
22714         This function will never be called from TypeManager.MemberLookup()
22715         so we can't use the cache here, just the IMemberFinder.
22716         (TypeManager.MemberLookup_FindMembers): Check whether the
22717         IMemberFinder has a MemberCache and call the cache's FindMembers
22718         function.
22719         (MemberCache): Rewrote larger parts of this yet another time and
22720         cleaned it up a bit.
22721
22722 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
22723
22724         * driver.cs (LoadArgs): Support quoting.
22725
22726         (Usage): Show the CSC-like command line arguments.
22727
22728         Improved a few error messages.
22729
22730 2002-08-15  Martin Baulig  <martin@gnome.org>
22731
22732         * typemanager.cs (IMemberContainer.Type): New property.
22733         (IMemberContainer.IsInterface): New property.
22734
22735         The following changes are conditional to BROKEN_RUNTIME, which is
22736         defined at the top of the file.
22737
22738         * typemanager.cs (MemberCache.MemberCache): Don't add the base
22739         class'es members, but add all members from TypeHandle.ObjectType
22740         if we're an interface.
22741         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
22742         is the current type.
22743         (MemberCache.CacheEntry.Container): Removed this field.
22744         (TypeHandle.GetMembers): Include inherited members.
22745
22746 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22747
22748         * typemanager.cs: fixed compilation and added a comment on a field that
22749         is never used.
22750
22751 2002-08-15  Martin Baulig  <martin@gnome.org>
22752
22753         * class.cs (ConstructorInitializer.Resolve): In the
22754         Expression.MemberLookup call, use the queried_type as
22755         invocation_type.
22756
22757         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
22758         declared' attribute, it's always true.
22759         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
22760         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
22761         temporary wrapper for FindMembers which tells MemberLookup whether
22762         members from the base classes are included in the return value.
22763         This will go away soon.
22764         (TypeManager.MemberLookup): Use this temporary hack here; once the
22765         new MemberCache is completed, we don't need to do the DeclaredOnly
22766         looping here anymore since the MemberCache will take care of this.
22767         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
22768         (MemberCache): When creating the MemberCache for a class, get
22769         members from the current class and all its base classes.
22770         (MemberCache.CacheEntry.Container): New field.  This is a
22771         temporary hack until the Mono runtime is fixed to distinguish
22772         between ReflectedType and DeclaringType.  It allows us to use MCS
22773         with both the MS runtime and the unfixed Mono runtime without
22774         problems and without accecting performance.
22775         (MemberCache.SearchMembers): The DeclaredOnly looping from
22776         TypeManager.MemberLookup is now done here.      
22777
22778 2002-08-14  Martin Baulig  <martin@gnome.org>
22779
22780         * statement.cs (MyStructInfo.MyStructInfo): Don't call
22781         Type.GetFields on dynamic types but get the fields from the
22782         corresponding TypeContainer.
22783         (MyStructInfo.GetStructInfo): Added check for enum types.
22784
22785         * typemanager.cs (MemberList.IsSynchronized): Implemented.
22786         (MemberList.SyncRoot): Implemented.
22787         (TypeManager.FilterWithClosure): No need to check permissions if
22788         closure_start_type == closure_invocation_type, don't crash if
22789         closure_invocation_type is null.
22790
22791 2002-08-13  Martin Baulig  <martin@gnome.org>
22792
22793         Rewrote TypeContainer.FindMembers to use a member cache.  This
22794         gives us a speed increase of about 35% for the self-hosting MCS
22795         build and of about 15-20% for the class libs (both on GNU/Linux).
22796
22797         * report.cs (Timer): New class to get enhanced profiling.  This
22798         whole class is "TIMER" conditional since it remarkably slows down
22799         compilation speed.
22800
22801         * class.cs (MemberList): New class.  This is an IList wrapper
22802         which we're now using instead of passing MemberInfo[]'s around to
22803         avoid copying this array unnecessarily.
22804         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
22805         (ICachingMemberFinder, IMemberContainer): New interface.
22806         (TypeManager.FilterWithClosure): If `criteria' is null, the name
22807         has already been checked, otherwise use it for the name comparision.
22808         (TypeManager.FindMembers): Renamed to RealMemberFinder and
22809         provided wrapper which tries to use ICachingMemberFinder.FindMembers
22810         if possible.  Returns a MemberList, not a MemberInfo [].
22811         (TypeHandle): New class, implements IMemberContainer.  We create
22812         one instance of this class per type, it contains a MemberCache
22813         which is used to do the member lookups.
22814         (MemberCache): New class.  Each instance of this class contains
22815         all members of a type and a name-based hash table.
22816         (MemberCache.FindMembers): This is our new member lookup
22817         function.  First, it looks up all members of the requested name in
22818         the hash table.  Then, it walks this list and sorts out all
22819         applicable members and returns them.
22820
22821 2002-08-13  Martin Baulig  <martin@gnome.org>
22822
22823         In addition to a nice code cleanup, this gives us a performance
22824         increase of about 1.4% on GNU/Linux - not much, but it's already
22825         half a second for the self-hosting MCS compilation.
22826
22827         * typemanager.cs (IMemberFinder): New interface.  It is used by
22828         TypeManager.FindMembers to call FindMembers on a TypeContainer,
22829         Enum, Delegate or Interface.
22830         (TypeManager.finder_to_member_finder): New PtrHashtable.
22831         (TypeManager.finder_to_container): Removed.
22832         (TypeManager.finder_to_delegate): Removed.
22833         (TypeManager.finder_to_interface): Removed.
22834         (TypeManager.finder_to_enum): Removed.
22835
22836         * interface.cs (Interface): Implement IMemberFinder.
22837
22838         * delegate.cs (Delegate): Implement IMemberFinder.
22839
22840         * enum.cs (Enum): Implement IMemberFinder.
22841
22842         * class.cs (TypeContainer): Implement IMemberFinder.
22843
22844 2002-08-12  Martin Baulig  <martin@gnome.org>
22845
22846         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
22847
22848 2002-08-12  Martin Baulig  <martin@gnome.org>
22849
22850         * ecore.cs (ITypeExpression): New interface for expressions which
22851         resolve to a type.
22852         (TypeExpression): Renamed to TypeLookupExpression.
22853         (Expression.DoResolve): If we're doing a types-only lookup, the
22854         expression must implement the ITypeExpression interface and we
22855         call DoResolveType() on it.
22856         (SimpleName): Implement the new ITypeExpression interface.
22857         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
22858         hack, the situation that we're only looking up types can't happen
22859         anymore when this method is called.  Moved the type lookup code to
22860         DoResolveType() and call it.
22861         (SimpleName.DoResolveType): This ITypeExpression interface method
22862         is now doing the types-only lookup.
22863         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
22864         (ResolveFlags): Added MaskExprClass.
22865
22866         * expression.cs (MemberAccess): Implement the ITypeExpression
22867         interface.
22868         (MemberAccess.DoResolve): Added support for a types-only lookup
22869         when we're called via ITypeExpression.DoResolveType().
22870         (ComposedCast): Implement the ITypeExpression interface.
22871
22872         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
22873         Expression.Resolve() with ResolveFlags.Type instead.
22874
22875 2002-08-12  Martin Baulig  <martin@gnome.org>
22876
22877         * interface.cs (Interface.Define): Apply attributes.
22878
22879         * attribute.cs (Attribute.ApplyAttributes): Added support for
22880         interface attributes.
22881
22882 2002-08-11  Martin Baulig  <martin@gnome.org>
22883
22884         * statement.cs (Block.Emit): Only check the "this" variable if we
22885         do not always throw an exception.
22886
22887         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
22888         whether the property has a set accessor.
22889
22890 2002-08-11  Martin Baulig  <martin@gnome.org>
22891
22892         Added control flow analysis support for structs.
22893
22894         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
22895         with control flow analysis turned off.
22896         (IVariable): New interface.
22897         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
22898         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
22899         (FieldExpr.DoResolve): Resolve the instance expression with flow
22900         analysis turned off and do the definite assignment check after the
22901         resolving when we know what the expression will resolve to.
22902
22903         * expression.cs (LocalVariableReference, ParameterReference):
22904         Implement the new IVariable interface, only call the flow analysis
22905         code if ec.DoFlowAnalysis is true.
22906         (This): Added constructor which takes a Block argument.  Implement
22907         the new IVariable interface.
22908         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
22909         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
22910         This does the definite assignment checks for struct members.
22911
22912         * class.cs (Constructor.Emit): If this is a non-static `struct'
22913         constructor which doesn't have any initializer, call
22914         Block.AddThisVariable() to tell the flow analysis code that all
22915         struct elements must be initialized before control returns from
22916         the constructor.
22917
22918         * statement.cs (MyStructInfo): New public class.
22919         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
22920         argument to this indexer.  If non-zero, check an individual struct
22921         member, not the whole struct.
22922         (FlowBranching.CheckOutParameters): Check struct members.
22923         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
22924         overloaded versions of these methods which take an additional
22925         `int field_idx' argument to check struct members.
22926         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
22927         overloaded versions of these methods which take an additional
22928         `string field_name' argument to check struct member.s
22929         (VariableInfo): Implement the IVariable interface.
22930         (VariableInfo.StructInfo): New public property.  Returns the
22931         MyStructInfo instance of the variable if it's a struct or null.
22932         (Block.AddThisVariable): New public method.  This is called from
22933         Constructor.Emit() for non-static `struct' constructor which do
22934         not have any initializer.  It creates a special variable for the
22935         "this" instance variable which will be checked by the flow
22936         analysis code to ensure that all of the struct's fields are
22937         initialized before control returns from the constructor.
22938         (UsageVector): Added support for struct members.  If a
22939         variable/parameter is a struct with N members, we reserve a slot
22940         in the usage vector for each member.  A struct is considered fully
22941         initialized if either the struct itself (slot 0) or all its
22942         members are initialized.
22943
22944 2002-08-08  Martin Baulig  <martin@gnome.org>
22945
22946         * driver.cs (Driver.MainDriver): Only report an error CS5001
22947         if there were no compilation errors.
22948
22949         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
22950         `UnsafeContext' property to determine whether the parent is in
22951         unsafe context rather than checking the parent's ModFlags:
22952         classes nested in an unsafe class are unsafe as well.
22953
22954 2002-08-08  Martin Baulig  <martin@gnome.org>
22955
22956         * statement.cs (UsageVector.MergeChildren): Distinguish between
22957         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
22958         we return.  Added test17() and test18() to test-154.cs.
22959
22960 2002-08-08  Martin Baulig  <martin@gnome.org>
22961
22962         * typemanager.cs (TypeManager.FilterWithClosure): If we have
22963         Family access, make sure the invoking type isn't a subclass of the
22964         queried type (that'd be a CS1540).
22965
22966         * ecore.cs (Expression.MemberLookup): Added overloaded version of
22967         this method which takes an additional `Type invocation_type'.
22968
22969         * expression.cs (BaseAccess.DoResolve): Use the base type as
22970         invocation and query type.
22971         (MemberAccess.DoResolve): If the lookup failed and we're about to
22972         report a CS0122, try a lookup with the ec.ContainerType - if this
22973         succeeds, we must report a CS1540.
22974
22975 2002-08-08  Martin Baulig  <martin@gnome.org>
22976
22977         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
22978         (MethodGroupExpr): Implement the IMemberExpr interface.
22979
22980         * expression (MemberAccess.ResolveMemberAccess): No need to have
22981         any special code for MethodGroupExprs anymore, they're now
22982         IMemberExprs.   
22983
22984 2002-08-08  Martin Baulig  <martin@gnome.org>
22985
22986         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
22987         Family, FamANDAssem and FamORAssem permissions.
22988         (TypeManager.IsSubclassOrNestedChildOf): New public method.
22989
22990 2002-08-08  Martin Baulig  <martin@gnome.org>
22991
22992         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
22993         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
22994         or loop block.
22995
22996 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
22997
22998         * driver.cs: implemented /resource option to embed managed resources.
22999
23000 2002-08-07  Martin Baulig  <martin@gnome.org>
23001
23002         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
23003         (FieldBase.HasFieldInitializer): New public property.
23004         (FieldBase.GetInitializerExpression): New public method.  Resolves and
23005         returns the field initializer and makes sure it is only resolved once.
23006         (TypeContainer.EmitFieldInitializers): Call
23007         FieldBase.GetInitializerExpression to get the initializer, this ensures
23008         that it isn't resolved multiple times.
23009
23010         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
23011         the resolving process (SimpleName/MemberLookup) that we're currently
23012         emitting a field initializer (which must not access any instance members,
23013         this is an error CS0236).
23014
23015         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
23016         argument, if the `IsFieldInitializer' flag is set, we must report and
23017         error CS0236 and not an error CS0120.   
23018
23019 2002-08-07  Martin Baulig  <martin@gnome.org>
23020
23021         * ecore.cs (IMemberExpr): New public interface.
23022         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
23023         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
23024         if the expression is an IMemberExpr.
23025
23026         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
23027         to be null, implicitly default to `this' if we're non-static in
23028         this case.  Simplified the code a lot by using the new IMemberExpr
23029         interface.  Also fixed bug #28176 here.
23030
23031 2002-08-06  Martin Baulig  <martin@gnome.org>
23032
23033         * cs-parser.jay (SimpleLookup): Removed.  We need to create
23034         ParameterReferences during semantic analysis so that we can do a
23035         type-only search when resolving Cast, TypeOf and SizeOf.
23036         (block): Pass the `current_local_parameters' to the Block's
23037         constructor.
23038
23039         * class.cs (ConstructorInitializer): Added `Parameters parameters'
23040         argument to the constructor.
23041         (ConstructorInitializer.Resolve): Create a temporary implicit
23042         block with the parameters.
23043
23044         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
23045         references here if we aren't doing a type-only search.
23046
23047         * statement.cs (Block): Added constructor which takes a
23048         `Parameters parameters' argument.
23049         (Block.Parameters): New public property.
23050
23051         * support.cs (InternalParameters.Parameters): Renamed `parameters'
23052         to `Parameters' and made it public readonly.
23053
23054 2002-08-06  Martin Baulig  <martin@gnome.org>
23055
23056         * ecore.cs (Expression.Warning): Made this public as well.
23057
23058         * report.cs (Report.Debug): Print the contents of collections.
23059
23060 2002-08-06  Martin Baulig  <martin@gnome.org>
23061
23062         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
23063         used to tell Resolve() which kinds of expressions it may return.
23064         (Expression.Resolve): Added overloaded version of this method which
23065         takes a `ResolveFlags flags' argument.  This can be used to tell
23066         Resolve() which kinds of expressions it may return.  Reports a
23067         CS0118 on error.
23068         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
23069         ResolveFlags.SimpleName.
23070         (Expression.Error118): Added overloaded version of this method which
23071         takes a `ResolveFlags flags' argument.  It uses the flags to determine
23072         which kinds of expressions are allowed.
23073
23074         * expression.cs (Argument.ResolveMethodGroup): New public method.
23075         Resolves an argument, but allows a MethodGroup to be returned.
23076         This is used when invoking a delegate.
23077
23078         * TODO: Updated a bit.
23079
23080 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23081
23082         Fixed compilation with csc.
23083
23084         * ecore.cs: Expression.Error made public. Is this correct? Should
23085         Warning be made public too?
23086
23087         * expression.cs: use ea.Location instead of ea.loc.
23088         [FIXME:  Filed as bug #28607: MCS must report these errors.]
23089
23090 2002-08-06  Martin Baulig  <martin@gnome.org>
23091
23092         * ecore.cs (Expression.loc): Moved the location here instead of
23093         duplicating it in all derived classes.
23094         (Expression.Location): New public property.
23095         (Expression.Error, Expression.Warning): Made them non-static and
23096         removed the location argument.
23097         (Expression.Warning): Added overloaded version which takes an
23098         `int level' argument.
23099         (Expression.Error118): Make this non-static and removed the
23100         expression and location arguments.
23101         (TypeExpr): Added location argument to the constructor.
23102
23103         * expression.cs (StaticCallExpr): Added location argument to
23104         the constructor.
23105         (Indirection, PointerArithmetic): Likewise.
23106         (CheckedExpr, UnCheckedExpr): Likewise.
23107         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
23108         (StringPtr): Likewise.
23109
23110
23111 2002-08-05  Martin Baulig  <martin@gnome.org>
23112
23113         * expression.cs (BaseAccess.DoResolve): Actually report errors.
23114
23115         * assign.cs (Assign.DoResolve): Check whether the source
23116         expression is a value or variable.
23117
23118         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
23119         while resolving the corresponding blocks.
23120
23121         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
23122         an error, don't silently return null.
23123
23124         * statement.cs (Block.AddVariable): Do the error reporting here
23125         and distinguish between CS0128 and CS0136.
23126         (Block.DoResolve): Report all unused labels (warning CS0164).
23127         (LabeledStatement): Pass the location to the constructor.
23128         (LabeledStatement.HasBeenReferenced): New property.
23129         (LabeledStatement.Resolve): Set it to true here.
23130
23131         * statement.cs (Return.Emit): Return success even after reporting
23132         a type mismatch error (CS0126 or CS0127), this is what csc does and
23133         it avoids confusing the users with any consecutive errors.
23134
23135 2002-08-05  Martin Baulig  <martin@gnome.org>
23136
23137         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
23138
23139         * const.cs (Const.LookupConstantValue): Catch circular definitions.
23140
23141         * expression.cs (MemberAccess.DoResolve): Silently return if an
23142         error has already been reported.
23143
23144         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
23145         error has already been reported.
23146
23147 2002-08-05  Martin Baulig  <martin@gnome.org>
23148
23149         * statement.cs (UsageVector): Only initialize the `parameters'
23150         vector if we actually have any "out" parameters.
23151
23152 2002-08-05  Martin Baulig  <martin@gnome.org>
23153
23154         * expression.cs (Binary.ResolveOperator): When combining delegates,
23155         they must have the same type.
23156
23157 2002-08-05  Martin Baulig  <martin@gnome.org>
23158
23159         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
23160         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
23161         work with the ms runtime and we also don't need it: if we're a
23162         PropertyBuilder and not in the `indexer_arguments' hash, then we
23163         are a property and not an indexer.
23164
23165         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
23166         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
23167         since the latter one doesn't work with the ms runtime.
23168
23169 2002-08-03  Martin Baulig  <martin@gnome.org>
23170
23171         Fixed bugs #27998 and #22735.
23172
23173         * class.cs (Method.IsOperator): New public field.
23174         (Method.CheckBase): Report CS0111 if there's already a method
23175         with the same parameters in the current class.  Report CS0508 when
23176         attempting to change the return type of an inherited method.
23177         (MethodData.Emit): Report CS0179 if a method doesn't have a body
23178         and it's not marked abstract or extern.
23179         (PropertyBase): New abstract base class for Property and Indexer.
23180         (PropertyBase.CheckBase): Moved here from Property and made it work
23181         for indexers.
23182         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
23183         the same so we can reuse it there.
23184         (Property, Indexer): Derive from PropertyBase.
23185         (MethodSignature.inheritable_property_signature_filter): New delegate
23186         to find properties and indexers.
23187
23188         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
23189         argument and improved error reporting.
23190
23191         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
23192         EmptyReadOnlyParameters and made it a property.
23193
23194         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
23195         version of this method which takes a `PropertyInfo indexer'.
23196         (TypeManager.RegisterIndexer): New method.
23197
23198         * class.cs: Added myself as author of this file :-)
23199
23200 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23201
23202         * class.cs: fixed compilation on windoze.
23203
23204 2002-08-03  Martin Baulig  <martin@gnome.org>
23205
23206         * interface.cs (Interface.GetInterfaceBases): Check whether all
23207         base interfaces are at least as accessible than the current one.
23208
23209         * class.cs (TypeContainer.GetClassBases): Check whether base types
23210         are at least as accessible than the current type.
23211         (TypeContainer.AsAccessible): Implemented and made non-static.
23212         (MemberBase.CheckParameters): Report errors if the accessibility
23213         checks fail.
23214
23215         * delegate.cs (Delegate.Delegate): The default visibility is
23216         internal for top-level types and private for nested types.
23217         (Delegate.Define): Report errors if the accessibility checks fail.
23218
23219         * enum.cs (Enum.Enum): The default visibility is internal for
23220         top-level types and private for nested types.
23221         (Enum.DefineType): Compute the correct visibility.
23222
23223         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
23224         function which takes a `bool is_toplevel' instead of a TypeContainer.
23225
23226         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
23227         builtin type.
23228
23229 2002-08-02  Martin Baulig  <martin@gnome.org>
23230
23231         * expression.cs (LocalVariableReferenc): Added constructor which
23232         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
23233         (LocalVariableReference.IsReadOnly): New property.
23234         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
23235         variable is readonly, use our own readonly flag to do this; you can
23236         use the new constructor to get a writable reference to a read-only
23237         variable.
23238
23239         * cs-parser.jay (foreach_statement, using_statement): Get a writable
23240         reference to the local variable.
23241
23242 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
23243
23244         * rootcontext.cs (ResolveCore): Also include System.Exception
23245
23246         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
23247         we reach an EmptyStatement.
23248
23249         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
23250         is also fine.
23251
23252         * expression.cs (Binary.ResolveOperator): Check error result in
23253         two places.
23254
23255         use brtrue/brfalse directly and avoid compares to null.
23256
23257 2002-08-02  Martin Baulig  <martin@gnome.org>
23258
23259         * class.cs (TypeContainer.Define): Define all nested interfaces here.
23260         Fixes bug #28407, added test-155.cs.
23261
23262 2002-08-01  Martin Baulig  <martin@gnome.org>
23263
23264         * class.cs (Event.EmitDefaultMethod): Make this work with static
23265         events.  Fixes #28311, added verify-3.cs.
23266
23267 2002-08-01  Martin Baulig  <martin@gnome.org>
23268
23269         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
23270         `is_disposable' fields.
23271         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
23272         `hm.is_disposable' if we're using the collection pattern.
23273         (Foreach.EmitCollectionForeach): Use the correct type for the
23274         enumerator's local variable, only emit the try/finally block if
23275         necessary (fixes #27713).
23276
23277 2002-08-01  Martin Baulig  <martin@gnome.org>
23278
23279         * ecore.cs (Expression.report118): Renamed to Error118 and made
23280         it public static.
23281
23282         * statement.cs (Throw.Resolve): Check whether the expression is of
23283         the correct type (CS0118) and whether the type derives from
23284         System.Exception (CS0155).
23285         (Catch.Resolve): New method.  Do the type lookup here and check
23286         whether it derives from System.Exception (CS0155).
23287         (Catch.CatchType, Catch.IsGeneral): New public properties.
23288
23289         * typemanager.cs (TypeManager.exception_type): Added.
23290
23291 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
23292
23293         * driver.cs: Updated About function.
23294
23295 2002-07-31  Martin Baulig  <martin@gnome.org>
23296
23297         Implemented Control Flow Analysis.
23298
23299         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
23300         (EmitContext.CurrentBranching): Added.
23301         (EmitContext.StartFlowBranching): Added.
23302         (EmitContext.EndFlowBranching): Added.
23303         (EmitContext.KillFlowBranching): Added.
23304         (EmitContext.IsVariableAssigned): Added.
23305         (EmitContext.SetVariableAssigned): Added.
23306         (EmitContext.IsParameterAssigned): Added.
23307         (EmitContext.SetParameterAssigned): Added.
23308         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
23309         Added control flow analysis stuff here.
23310
23311         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
23312         resolve the expression as lvalue.
23313         (LocalVariableReference.DoResolve): Check whether the variable has
23314         already been assigned.
23315         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
23316         the parameter as assigned here.
23317         (ParameterReference.DoResolve): Check whether the parameter has already
23318         been assigned.
23319         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
23320         expression as lvalue.
23321
23322         * statement.cs (FlowBranching): New class for the flow analysis code.
23323         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
23324         (LabeledStatement.IsDefined): New public property.
23325         (LabeledStatement.AddUsageVector): New public method to tell flow
23326         analyis that the label may be reached via a forward jump.
23327         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
23328         flow analysis.
23329         (VariableInfo.Number): New public field.  This is used by flow analysis
23330         to number all locals of a block.
23331         (Block.CountVariables): New public property.  This is the number of
23332         local variables in this block (including the locals from all parent
23333         blocks).
23334         (Block.EmitMeta): Number all the variables.
23335
23336         * statement.cs: Added flow analysis support to all classes.
23337
23338 2002-07-31  Martin Baulig  <martin@gnome.org>
23339
23340         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
23341         To get debugging messages, compile mcs with /define:MCS_DEBUG and
23342         then use this argument.
23343
23344         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
23345
23346         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
23347         use this to specify /define options.
23348
23349 2002-07-29  Martin Baulig  <martin@gnome.org>
23350
23351         * statement.cs (Fixed): Moved all code that does variable lookups
23352         and resolvings from Emit to Resolve.
23353
23354         * statement.cs (For): Moved all code that does variable lookups
23355         and resolvings from Emit to Resolve.
23356
23357         * statement.cs (Using): Moved all code that does variable lookups
23358         and resolvings from Emit to Resolve.
23359
23360 2002-07-29  Martin Baulig  <martin@gnome.org>
23361
23362         * attribute.cs (Attribute.Resolve): Explicitly catch a
23363         System.NullReferenceException when creating the
23364         CustromAttributeBuilder and report a different warning message.
23365
23366 2002-07-29  Martin Baulig  <martin@gnome.org>
23367
23368         * support.cs (ParameterData.ParameterName): Added method to
23369         get the name of a parameter.
23370
23371         * typemanager.cs (TypeManager.IsValueType): New public method.
23372
23373 2002-07-29  Martin Baulig  <martin@gnome.org>
23374
23375         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
23376         is a flag which specifies that it's either ref or out.
23377         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
23378         the out parameter to `out Parameter.Modifier mod', also set the
23379         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
23380
23381         * support.cs (InternalParameters.ParameterModifier): Distinguish
23382         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23383         Parameter.Modifier.ISBYREF flag if it's either ref or out.
23384
23385         * expression.cs (Argument.GetParameterModifier): Distinguish
23386         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23387         Parameter.Modifier.ISBYREF flag if it's either ref or out.
23388
23389 2002-07-29  Martin Baulig  <martin@gnome.org>
23390
23391         * expression.cs (ParameterReference.ParameterReference): Added
23392         `Location loc' argument to the constructor.
23393
23394         * cs-parser.jay: Pass location to ParameterReference.
23395
23396 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
23397
23398         * statement.cs (Try): Initialize the location.
23399
23400         * cs-parser.jay: pass location to Try.
23401
23402         * expression.cs (Unary.Reduce): Change the prototype to return
23403         whether a constant fold could be performed or not.  The result is
23404         returned in an out parameters.  In the case of Indirection and
23405         AddressOf, we want to perform the full tests.
23406
23407 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
23408
23409         * statement.cs (Statement.Emit): Flag dead code.
23410
23411 2002-07-27  Andrew Birkett  <andy@nobugs.org>
23412
23413         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
23414
23415 2002-07-27  Martin Baulig  <martin@gnome.org>
23416
23417         * class.cs (MethodData.Define): Put back call to
23418         TypeManager.AddMethod(), accidentally commented this out.
23419
23420         * report.cs (Debug): New public method to print debugging information,
23421         this is `[Conditional ("DEBUG")]'.
23422
23423 2002-07-26  Martin Baulig  <martin@gnome.org>
23424
23425         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
23426         (switch_statement): Push the current_block to the switch_stack and
23427         pop it again when we're done with the switch.
23428         (switch_section): The new block is a child of the current_block.
23429         Fixes bug #24007, added test-152.cs.
23430
23431 2002-07-27  Martin Baulig  <martin@gnome.org>
23432
23433         * expression.cs (Invocation.EmitArguments): When calling a varargs
23434         function with only its fixed arguments, we need to pass an empty
23435         array.
23436
23437 2002-07-27  Martin Baulig  <martin@gnome.org>
23438
23439         Mono 0.13 has been released.
23440
23441 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
23442
23443         * driver.cs: Rename --resource to --linkres, because that is what
23444         we do currently, we dont support --resource yet.
23445
23446         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
23447
23448 2002-07-25  Martin Baulig  <martin@gnome.org>
23449
23450         * class.cs (MethodData): New public class.  This is a `method builder'
23451         class for a method or one accessor of a Property/Indexer/Event.
23452         (MethodData.GetMethodFlags): Moved here from MemberBase.
23453         (MethodData.ApplyAttributes): Likewise.
23454         (MethodData.ApplyObsoleteAttribute): Likewise.
23455         (MethodData.ApplyConditionalAttribute): Likewise.
23456         (MethodData.ApplyDllImportAttribute): Likewise.
23457         (MethodData.CheckAbstractAndExternal): Likewise.
23458         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
23459         (MethodData.Emit): Formerly known as Method.Emit().
23460         (MemberBase): Moved everything which was specific to a single
23461         accessor/method to MethodData.
23462         (Method): Create a new MethodData and call Define() and Emit() on it.
23463         (Property, Indexer, Event): Create a new MethodData objects for each
23464         accessor and call Define() and Emit() on them.
23465
23466 2002-07-25  Martin Baulig  <martin@gnome.org>
23467
23468         Made MethodCore derive from MemberBase to reuse the code from there.
23469         MemberBase now also checks for attributes.
23470
23471         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
23472         (MemberBase.GetMethodFlags): Moved here from class Method and marked
23473         as virtual.
23474         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
23475         `CallingConventions cc' and `Attributes opt_attrs' arguments.
23476         (MemberBase.ApplyAttributes): New virtual method; applies the
23477         attributes to a method or accessor.
23478         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
23479         (MemberBase.ApplyConditionalAttribute): Likewise.
23480         (MemberBase.ApplyDllImportAttribute): Likewise.
23481         (MemberBase.CheckAbstractAndExternal): Likewise.
23482         (MethodCore.ParameterTypes): This is now a property instead of a
23483         method, it's initialized from DoDefineParameters().
23484         (MethodCore.ParameterInfo): Removed the set accessor.
23485         (MethodCore.DoDefineParameters): New protected virtual method to
23486         initialize ParameterTypes and ParameterInfo.
23487         (Method.GetReturnType): We can now simply return the MemberType.
23488         (Method.GetMethodFlags): Override the MemberBase version and add
23489         the conditional flags.
23490         (Method.CheckBase): Moved some code from Define() here, call
23491         DoDefineParameters() here.
23492         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
23493         here to avoid some larger code duplication.
23494         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
23495         ensure that abstract and external accessors don't declare a body.
23496
23497         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
23498         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
23499         lookup in the attribute's parent classes, so we need to abort as soon
23500         as we found the first match.
23501         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
23502         the attribute has no arguments.
23503
23504         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
23505         of a Method.
23506
23507 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23508
23509         * cs-parser.jay: reverted previous patch.
23510
23511 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23512
23513         * cs-parser.jay: fixed bug #22119.
23514
23515 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23516
23517         * attribute.cs: fixed compilation. The error was:
23518         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
23519         be assigned to before control leaves the current method."
23520         [FIXME:  Filed as bug #28186: MCS must report this error.]
23521
23522 2002-07-25  Martin Baulig  <martin@gnome.org>
23523
23524         * attribute.cs (Attribute.Conditional_GetConditionName): New static
23525         method to pull the condition name ouf of a Conditional attribute.
23526         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
23527         the obsolete message and error flag out of an Obsolete attribute.
23528
23529         * class.cs (Method.GetMethodFlags): New public method to get the
23530         TypeManager.MethodFlags for this method.
23531         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
23532         private methods.
23533         (Method.Define): Get and apply the Obsolete and Conditional attributes;
23534         if we're overriding a virtual function, set the new private variable
23535         `parent_method'; call the new TypeManager.AddMethod().
23536
23537         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
23538         the MethodBuilder and the Method in a PtrHashtable.
23539         (TypeManager.builder_to_method): Added for this purpose.
23540         (TypeManager.MethodFlags): Added IsObsoleteError.
23541         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
23542         Obsolete and Conditional arguments in MethodBuilders.  If we discover
23543         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
23544         the message from the attribute.
23545
23546 2002-07-24  Martin Baulig  <martin@gnome.org>
23547
23548         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
23549         preprocessor directives, ensure that the argument to #define/#undef is
23550         exactly one identifier and that it's actually an identifier.
23551
23552         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
23553         did not work ....
23554
23555 2002-07-24  Martin Baulig  <martin@gnome.org>
23556
23557         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
23558         initialize it to TypeManager.object_type in the constructor.
23559         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
23560         of the `hm.get_current' method if we're using the collection pattern.
23561         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
23562         for the explicit conversion to make it work when we're using the collection
23563         pattern and the `Current' property has a different return type than `object'.
23564         Fixes #27713.
23565
23566 2002-07-24  Martin Baulig  <martin@gnome.org>
23567
23568         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
23569         does not match, but don't report any errors.  This method is called in
23570         order for all methods in a MethodGroupExpr until a matching method is
23571         found, so we don't want to bail out if the first method doesn't match.
23572         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
23573         matches, report the 123.  Fixes #28070.
23574
23575 2002-07-24  Martin Baulig  <martin@gnome.org>
23576
23577         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
23578         TypeManager.TypeToCoreType() to the top of the method so the
23579         following equality checks will work.  Fixes #28107.
23580
23581 2002-07-24  Martin Baulig  <martin@gnome.org>
23582
23583         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
23584         operand is of type uint, and the other operand is of type sbyte,
23585         short or int, the operands are converted to type long." -
23586         Actually do what this comment already told us.  Fixes bug #28106,
23587         added test-150.cs.
23588
23589 2002-07-24  Martin Baulig  <martin@gnome.org>
23590
23591         * class.cs (MethodBase): New abstract class.  This is now a base
23592         class for Property, Indexer and Event to avoid some code duplication
23593         in their Define() and DefineMethods() methods.
23594         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
23595         generic methods for Define() and DefineMethods().
23596         (FieldBase): Derive from MemberBase, not MemberCore.
23597         (Property): Derive from MemberBase, not MemberCore.
23598         (Property.DefineMethod): Moved all the code from this method to the
23599         new MethodBase.DefineAccessor(), just call it with appropriate
23600         argumetnts.
23601         (Property.Define): Call the new Property.DoDefine(), this does some
23602         sanity checks and we don't need to duplicate the code everywhere.
23603         (Event): Derive from MemberBase, not MemberCore.
23604         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
23605         accessors, this will also make them work with interface events.
23606         (Indexer): Derive from MemberBase, not MemberCore.
23607         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
23608         (Indexer.Define): Use the new MethodBase functions.
23609
23610         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
23611         argument to the constructor.
23612         (Interface.FindMembers): Added support for interface events.
23613         (Interface.PopluateEvent): Implemented.
23614
23615         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
23616
23617 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
23618
23619         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
23620         but this is required to check for a method name being the same as
23621         the containing class.  
23622
23623         Handle this now.
23624
23625 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23626
23627         * interface.cs: initialize variable.
23628
23629 2002-07-23  Martin Baulig  <martin@gnome.org>
23630
23631         Implemented the IndexerName attribute in interfaces.
23632
23633         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
23634         name if this is an explicit interface implementation.
23635         (Indexer.InterfaceIndexerName): New public variable.  If we're
23636         implementing an interface indexer, this is the IndexerName in that
23637         interface.  Otherwise, it's the IndexerName.
23638         (Indexer.DefineMethod): If we're implementing interface indexer,
23639         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
23640         and Pending.ImplementIndexer methods.
23641         (Indexer.Define): Also define the PropertyBuilder if we're
23642         implementing an interface indexer and this is neither an explicit
23643         interface implementation nor do the IndexerName match the one in
23644         the interface.
23645
23646         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
23647         If a method is defined here, then we always need to create a proxy
23648         for it.  This is used when implementing interface indexers.
23649         (Pending.IsInterfaceIndexer): New public method.
23650         (Pending.ImplementIndexer): New public method.
23651         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
23652         This is used when implementing interface indexers to define a proxy
23653         if necessary.
23654         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
23655         define a proxy if necessary.
23656
23657         * interface.cs (Interface.IndexerName): New public variable.
23658         (Interface.PopulateIndexer): Set the IndexerName.
23659         (Interface.DefineIndexers): New private method.  Populate all the
23660         indexers and make sure their IndexerNames match.
23661
23662         * typemanager.cs (IndexerPropertyName): Added support for interface
23663         indexers.
23664
23665 2002-07-22  Martin Baulig  <martin@gnome.org>
23666
23667         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
23668         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
23669         ret if HasReturnLabel.
23670         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
23671         variables.
23672
23673         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
23674         and set the ec.LoopBeginTryCatchLevel.
23675         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
23676         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
23677         the current ec.TryCatchLevel, the branch goes out of an exception
23678         block.  In this case, we need to use Leave and not Br.
23679
23680 2002-07-22  Martin Baulig  <martin@gnome.org>
23681
23682         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
23683         block unless the block does not always return or it is contained in
23684         another try { ... } catch { ... } block.  Fixes bug #26506.
23685         Added verify-1.cs to the test suite.
23686
23687 2002-07-22  Martin Baulig  <martin@gnome.org>
23688
23689         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
23690         then we do not always return.  Fixes bug #24985.
23691
23692 2002-07-22  Martin Baulig  <martin@gnome.org>
23693
23694         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
23695         lookup on a per-class level; ie. walk up the class hierarchy until we
23696         found at least one applicable method, then choose the best among them.
23697         Fixes bug #24463 and test-29.cs.
23698
23699 2002-07-22  Martin Baulig  <martin@gnome.org>
23700
23701         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
23702         return types of the methods.  The return type is not part of the
23703         signature and we must not check it to make the `new' modifier work.
23704         Fixes bug #27999, also added test-147.cs.
23705         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
23706
23707         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
23708         on the method's return type.
23709
23710 2002-07-21  Martin Baulig  <martin@gnome.org>
23711
23712         * assign.cs: Make this work if the rightmost source is a constant and
23713         we need to do an implicit type conversion.  Also adding a few more tests
23714         to test-38.cs which should have caught this.
23715
23716         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
23717         target in the makefile for this.  The makefile.gnu is primarily intended
23718         for end-users who don't want to debug the compiler.
23719
23720 2002-07-21  Martin Baulig  <martin@gnome.org>
23721
23722         * assign.cs: Improved the Assign class so it can now handle embedded
23723         assignments (X = Y = Z = something).  As a side-effect this'll now also
23724         consume less local variables.  test-38.cs now passes with MCS, added
23725         a few new test cases to that test.
23726
23727 2002-07-20  Martin Baulig  <martin@gnome.org>
23728
23729         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
23730         instructions.  Fixes bug #27977, also added test-146.cs.
23731
23732 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23733
23734         * cs-tokenizer.cs: fixed getHex ().
23735
23736 2002-07-19  Martin Baulig  <martin@gnome.org>
23737
23738         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
23739         not Type.GetType() to lookup the array type.  This is needed when
23740         we're constructing an array of a user-defined type.
23741         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
23742         single-dimensional arrays, but also for single-dimensial arrays of
23743         type decimal.
23744
23745 2002-07-19  Martin Baulig  <martin@gnome.org>
23746
23747         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
23748         this function is called, it's not allowed to share LocalBuilders
23749         among ILGenerators.
23750
23751 2002-07-19  Martin Baulig  <martin@gnome.org>
23752
23753         * expression.cs (Argument.Resolve): Report an error 118 when trying
23754         to pass a type as argument.
23755
23756 2002-07-18  Martin Baulig  <martin@gnome.org>
23757
23758         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
23759         Conv_R_Un for the signed `long' type.
23760
23761 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
23762
23763         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
23764         `expr' for the temporary result, as that will fail if we do
23765         multiple resolves on the same expression.
23766
23767 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
23768
23769         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
23770         ec.TypeContainer for looking up aliases. 
23771
23772         * class.cs (TypeContainer): Remove LookupAlias from here.
23773
23774         * decl.cs (DeclSpace); Move here.
23775
23776 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
23777
23778         * class.cs (FindMembers): Only call filter if the constructor
23779         bulider is not null.
23780
23781         Also handle delegates in `NestedTypes' now.  Now we will perform
23782         type lookups using the standard resolution process.  This also
23783         fixes a bug.
23784
23785         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
23786         This uses Expressions (the limited kind that can be parsed by the
23787         tree) instead of strings.
23788
23789         * expression.cs (ComposedCast.ToString): Implement, used to flag
23790         errors since now we have to render expressions.
23791
23792         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
23793         FormArrayType. 
23794
23795         * ecore.cs (SimpleName.ToString): ditto.
23796
23797         * cs-parser.jay: Instead of using strings to assemble types, use
23798         Expressions to assemble the type (using SimpleName, ComposedCast,
23799         MemberAccess).  This should fix the type lookups in declarations,
23800         because we were using a different code path for this.
23801
23802         * statement.cs (Block.Resolve): Continue processing statements
23803         even when there is an error.
23804
23805 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
23806
23807         * class.cs (Event.Define): Also remove the `remove' method from
23808         the list of pending items.
23809
23810         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
23811         generate more compact code. 
23812
23813 2002-07-17  Martin Baulig  <martin@gnome.org>
23814
23815         * const.cs (Const.LookupConstantValue): Add support for constant
23816         `unchecked' and `checked' expressions.
23817         Also adding test case test-140.cs for this.
23818
23819 2002-07-17  Martin Baulig  <martin@gnome.org>
23820
23821         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
23822         check whether mi.ReturnType implements the IEnumerator interface; the
23823         `==' and the IsAssignableFrom() will fail in this situation.
23824
23825 2002-07-16  Ravi Pratap  <ravi@ximian.com>
23826
23827         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
23828         here too.
23829
23830 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23831
23832         * expression.cs: fixed bug #27811.
23833
23834 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
23835
23836         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
23837         Molaro: when we are a ref, the value already contains a pointer
23838         value, do not take the address of it.
23839
23840 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
23841         * removed mb-parser.jay and mb-tokenizer.cs
23842
23843 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23844
23845         * expression.cs: check against the building corlib void type.
23846
23847 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
23848
23849         * ecore.cs: fix for valuetype static readonly fields: when 
23850         initializing them, we need their address, not the address of a copy.
23851
23852 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
23853
23854         * typemanager.cs: register also enum_type in corlib.
23855
23856 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23857
23858         * class.cs: allow calling this (but not base) initializers in structs.
23859
23860 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
23861
23862         * ecore.cs: make sure we compare against the building base types
23863         in GetTypeSize ().
23864
23865 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
23866
23867         * typemanager.cs: fix TypeToCoreType() to handle void and object
23868         (corlib gets no more typerefs after this change).
23869
23870 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
23871
23872         * expression.cs (ArrayCreation.EmitArrayArguments): use
23873         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
23874
23875         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
23876         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
23877         array indexes, the runtime actually forbids them.
23878
23879         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
23880         for array arguments here.
23881
23882         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
23883         instead of the default for ValueTypes.
23884
23885         (New.DoEmit): Use IsValueType instead of
23886         IsSubclassOf (value_type)
23887         (New.DoResolve): ditto.
23888         (Invocation.EmitCall): ditto.
23889
23890         * assign.cs (Assign): ditto.
23891
23892         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
23893         Statements *are* currently doing part of their resolution during
23894         Emit.  
23895
23896         Expressions do always resolve during resolve, but statements are
23897         only required to propagate resolution to their children.
23898
23899 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
23900
23901         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
23902
23903         (LoadAssembly): Do not add the dll if it is already specified
23904
23905         (MainDriver): Add the System directory to the link path at the end,
23906         after all the other -L arguments. 
23907
23908         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
23909         wrong opcode for loading bytes and bools (ldelem.i1 instead of
23910         ldelem.u1) and using the opposite for sbytes.
23911
23912         This fixes Digger, and we can finally run it.
23913
23914         * driver.cs (UnixParseOption): Move the option parsing here.  
23915         (CSCParseOption): Implement CSC-like parsing of options.
23916
23917         We now support both modes of operation, the old Unix way, and the
23918         new CSC-like way.  This should help those who wanted to make cross
23919         platform makefiles.
23920
23921         The only thing broken is that /r:, /reference: and /lib: are not
23922         implemented, because I want to make those have the same semantics
23923         as the CSC compiler has, and kill once and for all the confussion
23924         around this.   Will be doing this tomorrow.
23925
23926         * statement.cs (Unsafe.Resolve): The state is checked during
23927         resolve, not emit, so we have to set the flags for IsUnsfe here.
23928
23929 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
23930
23931         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
23932         not catch the Error_ObjectRefRequired in SimpleName (as it is
23933         possible to have a class/instance variable name that later gets
23934         deambiguated), we have to check this here.      
23935
23936 2002-07-10  Ravi Pratap  <ravi@ximian.com>
23937
23938         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
23939         make static and put into Expression.
23940
23941         (Event.Define): Register the private field of the event with the 
23942         TypeManager so that GetFieldFromEvent can get at it.
23943
23944         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
23945         keep track of the private field associated with an event which
23946         has no accessors.
23947
23948         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
23949         private field.
23950
23951         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
23952
23953 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
23954
23955         * expression.cs (Binary.EmitBranchable): this routine emits the
23956         Binary expression in a branchable context.  This basically means:
23957         we need to branch somewhere, not just get the value on the stack.
23958
23959         This works together with Statement.EmitBoolExpression.
23960
23961         * statement.cs (Statement.EmitBoolExpression): Use
23962         EmitBranchable. 
23963
23964 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
23965
23966         * statement.cs (For): Reduce the number of jumps in loops.
23967
23968         (For): Implement loop inversion for the For statement.
23969
23970         (Break): We can be breaking out of a Try/Catch controlled section
23971         (foreach might have an implicit try/catch clause), so we need to
23972         use Leave instead of Br.
23973
23974         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
23975         now).  If the instace expression supports IMemoryLocation, we use
23976         the AddressOf method from the IMemoryLocation to extract the
23977         address instead of emitting the instance.
23978
23979         This showed up with `This', as we were emitting the instance
23980         always (Emit) instead of the Address of This.  Particularly
23981         interesting when This is a value type, as we dont want the Emit
23982         effect (which was to load the object).
23983
23984 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
23985
23986         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
23987
23988         * statement.cs (Checked): Set the CheckedState during the resolve
23989         process too, as the ConvCast operations track the checked state on
23990         the resolve process, and not emit.
23991
23992         * cs-parser.jay (namespace_member_declaration): Flag that we have
23993         found a declaration when we do.  This is used to flag error 1529
23994
23995         * driver.cs: Report ok when we display the help only.
23996
23997 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
23998
23999         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
24000
24001 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
24002
24003         * cs-tokenizer.cs (define): We also have to track locally the
24004         defines.  AllDefines is just used for the Conditional Attribute,
24005         but we also need the local defines for the current source code. 
24006
24007 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
24008
24009         * statement.cs (While, For, Do): These loops can exit through a
24010         Break statement, use this information to tell whether the
24011         statement is the last piece of code.
24012
24013         (Break): Flag that we break.
24014
24015         * codegen.cs (EmitContexts): New `Breaks' state variable.
24016
24017 2002-07-03  Martin Baulig  <martin@gnome.org>
24018
24019         * class.cs (TypeContainer.MethodModifiersValid): Allow override
24020         modifiers in method declarations in structs.  Otherwise, you won't
24021         be able to override things like Object.Equals().
24022
24023 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
24024
24025         * class.cs (Method, Property, Indexer): Do not allow the public
24026         modifier to be used in explicit interface implementations.
24027
24028         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
24029         override modifiers in method declarations in structs
24030
24031 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
24032
24033         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
24034         integer or real overflow, report an error
24035
24036 2002-07-02  Martin Baulig  <martin@gnome.org>
24037
24038         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
24039         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
24040         to tell the runtime about our newly created System.Object and
24041         System.ValueType types.
24042
24043 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
24044
24045         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
24046         struct instead of Ldarg/Starg.
24047
24048 2002-07-02  Martin Baulig  <martin@gnome.org>
24049
24050         * expression.cs (Indirection.Indirection): Call
24051         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
24052
24053 2002-07-02  Martin Baulig  <martin@gnome.org>
24054
24055         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
24056         ValueType, call TypeManager.TypeToCoreType() on it.
24057         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
24058         the OpCodes.Newarr argument.
24059
24060 2002-07-02  Martin Baulig  <martin@gnome.org>
24061
24062         * expression.cs (Invocation.EmitCall): When compiling corlib,
24063         replace all calls to the system's System.Array type to calls to
24064         the newly created one.
24065
24066         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
24067         System.Array methods.
24068         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
24069         from the system's System.Array type which must be replaced.
24070
24071 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
24072
24073         * typemanager.cs: load unverifiable_code_ctor so we can build
24074         corlib using the correct type. Avoid using GetTypeCode() with
24075         TypeBuilders.
24076         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
24077         TypeManager.object_type to allow building corlib.
24078
24079 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
24080
24081         * ecore.cs: handle System.Enum separately in LoadFromPtr().
24082
24083 2002-07-01  Martin Baulig  <martin@gnome.org>
24084
24085         * class.cs: Make the last change actually work, we need to check
24086         whether `ifaces != null' to avoid a crash.
24087
24088 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24089
24090         * class.cs: when we build structs without fields that implement
24091         interfaces, we need to add the interfaces separately, since there is
24092         no API to both set the size and add the interfaces at type creation
24093         time.
24094
24095 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24096
24097         * expression.cs: the dimension arguments to the array constructors
24098         need to be converted if they are a long.
24099
24100 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
24101
24102         * class.cs: don't emit ldarg.0 if there is no parent constructor
24103         (fixes showstopper for corlib).
24104
24105 2002-06-29  Martin Baulig  <martin@gnome.org>
24106
24107         MCS now compiles corlib on GNU/Linux :-)
24108
24109         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
24110         ie. check for MethodImplOptions.InternalCall.
24111
24112         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
24113         and TypeManager.attribute_type are null, so we must explicitly check
24114         whether parent is not null to find out whether it's an attribute type.
24115         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
24116         and SetBuilder, not only if the property is neither abstract nor external.
24117         This is necessary to set the MethodImplOptions on the accessor methods.
24118         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
24119         SetBuilder, see Property.Emit().
24120
24121         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
24122         populate "System.Object", "System.ValueType" and "System.Attribute" since
24123         they've already been populated from BootCorlib_PopulateCoreTypes().
24124
24125 2002-06-29  Martin Baulig  <martin@gnome.org>
24126
24127         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
24128         is the NullLiteral, we also need to make sure that target_type is not
24129         an enum type.   
24130
24131 2002-06-29  Martin Baulig  <martin@gnome.org>
24132
24133         * rootcontext.cs (RootContext.ResolveCore): We must initialize
24134         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
24135         before calling BootstrapCorlib_ResolveDelegate ().
24136
24137 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24138
24139         * statement.cs: fixed build-breaker. All tests passed ok.
24140
24141 2002-06-27  Martin Baulig  <martin@gnome.org>
24142
24143         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
24144         for System.Decimal when compiling corlib.
24145
24146 2002-06-27  Martin Baulig  <martin@gnome.org>
24147
24148         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
24149         switch blocks which contain nothing but a default clause.
24150
24151 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
24152
24153        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
24154
24155 2002-06-27  Martin Baulig  <martin@gnome.org>
24156
24157         * ecore.cs (PropertyExpr.PropertyExpr): Call
24158         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
24159
24160         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
24161         is already a TypeBuilder.
24162
24163 2002-06-27  Martin Baulig  <martin@gnome.org>
24164
24165         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
24166         `target_type == TypeManager.array_type', not IsAssignableFrom() in
24167         the "from an array-type to System.Array" case.  This makes it work
24168         when compiling corlib.
24169
24170 2002-06-27  Martin Baulig  <martin@gnome.org>
24171
24172         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
24173         non-static PropertyExpr, set its InstanceExpression.  This makes
24174         the `ICollection.Count' property work in System/Array.cs.
24175
24176 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
24177
24178         * driver.cs: Made error handling more consistent.  Errors now
24179         tracked by Report class, so many methods which used to return int
24180         now return void.  Main() now prints success/failure and 
24181         errors/warnings message.
24182
24183         Renamed '--probe' compiler argument to '--expect-error'.  Removed
24184         the magic number return values (123 and 124).  Now, if the
24185         expected error occurs, the compiler exits with success (exit value
24186         0).  If the compilation completes without seeing that particular
24187         error, the compiler exits with failure (exit value 1).  The
24188         makefile in mcs/errors has been changed to handle the new behaviour.
24189
24190         * report.cs: Made 'expected error' number a property and renamed
24191         it from 'Probe' to 'ExpectedError'.
24192
24193         * genericparser.cs: Removed error handling support, since it is
24194         now all done by Report class.
24195
24196         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
24197         class, so parse() no longer returns an int.
24198
24199         * namespace.cs: Use Report.Error instead of GenericParser.error
24200
24201 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
24202
24203         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
24204         TypeContainer.AddOperator): At the front of the list put the
24205         explicit implementations, so they get resolved/defined first. 
24206
24207 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
24208
24209         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
24210         interface type is implemented by this TypeContainer.  Used during
24211         explicit interface implementation.
24212
24213         (Property.Define, Indexer.Define, Method.Define): Validate that
24214         the given interface in the explicit implementation is one of the
24215         base classes for the containing type.
24216
24217         Also if we are explicitly implementing an interface, but there is
24218         no match in the pending implementation table, report an error.
24219
24220         (Property.Define): Only define the property if we are
24221         not explicitly implementing a property from an interface.  Use the
24222         correct name also for those properties (the same CSC uses,
24223         although that is really not needed).
24224
24225         (Property.Emit): Do not emit attributes for explicitly implemented
24226         properties, as there is no TypeBuilder.
24227
24228         (Indexer.Emit): ditto.
24229
24230         Hiding then means that we do not really *implement* a pending
24231         implementation, which makes code fail.
24232
24233 2002-06-22  Martin Baulig  <martin@gnome.org>
24234
24235         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
24236         the return value of Object.GetType().  [FIXME: we need to do this whenever
24237         we get a type back from the reflection library].
24238
24239 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
24240
24241         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
24242
24243 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
24244
24245         * attribute.cs: Return null if we can not look up the type.
24246
24247         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
24248         the interface types found.
24249
24250         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
24251         interface types found.
24252
24253         * typemanager.cs (GetInterfaces): Make this routine returns alll
24254         the interfaces and work around the lame differences between
24255         System.Type and System.Reflection.Emit.TypeBuilder in the results
24256         result for GetInterfaces.
24257
24258         (ExpandInterfaces): Given an array of interface types, expand and
24259         eliminate repeated ocurrences of an interface.  This expands in
24260         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
24261         be IA, IB, IC.
24262
24263 2002-06-21  Martin Baulig  <martin@gnome.org>
24264
24265         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
24266         on System.Enum.
24267
24268 2002-06-21  Martin Baulig  <martin@gnome.org>
24269
24270         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
24271         and called with one of the core types, return the corresponding typebuilder for
24272         that type.
24273
24274         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
24275         element type.
24276
24277 2002-06-21  Martin Baulig  <martin@gnome.org>
24278
24279         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
24280         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
24281         (Expression.ConvertReferenceExplicit): Likewise.
24282
24283         * expression.cs (ElementAccess.DoResolve): Likewise.
24284         (ElementAccess.DoResolveLValue): Likewise.
24285
24286 2002-06-10  Martin Baulig  <martin@gnome.org>
24287
24288         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
24289         add the "value" parameter to the parameter list.
24290
24291         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
24292         to our caller.
24293
24294 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
24295
24296         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
24297         the argument to an int, uint, long or ulong, per the spec.  Also
24298         catch negative constants in array creation.
24299
24300 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
24301
24302         * class.cs: do not allow the same interface to appear twice in
24303         the definition list.
24304
24305 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
24306
24307         * ecore.cs: don't use ldlen with System.Array.
24308
24309 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
24310
24311         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
24312
24313 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
24314
24315         * modifiers.cs: produce correct field attributes for protected
24316         internal. Easy fix so miguel can work on ther harder stuff:-)
24317
24318 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
24319
24320         * pending.cs: New file.  Move the code from class.cs here.
24321         Support clearning the pending flag for all methods (when not doing
24322         explicit interface implementation).
24323
24324 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
24325
24326         * rootcontext.cs: added a couple more types needed to bootstrap.
24327
24328 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
24329
24330         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
24331         constructor in the type, instead of any constructor in the type
24332         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
24333         a bug in the Mono runtime when applying the params attribute). 
24334
24335 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
24336         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
24337
24338 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
24339
24340         * expression.cs (Unary.ResolveOperator): Use TypeManager
24341         to resolve the type.
24342
24343 2002-06-13  Ravi Pratap  <ravi@ximian.com>
24344
24345         * cs-parser.jay (enum_member_declaration): Pass in the attributes
24346         attached.
24347
24348         * enum.cs (AddEnumMember): Add support to store the attributes associated 
24349         with each member too.
24350
24351         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
24352         field builders too - this takes care of the enum member case.
24353
24354 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
24355
24356         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
24357         address-of operator on both value types and pointers.
24358
24359 2002-06-10  Martin Baulig  <martin@gnome.org>
24360
24361         * interface.cs (Interface.PopulateIndexer): Add the indexer's
24362         PropertyBuilder to the `property_builders' list.
24363
24364         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
24365         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
24366         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
24367         find any indexers which are inherited from an interface.
24368
24369 2002-06-09  Martin Baulig  <martin@gnome.org>
24370
24371         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
24372         the same type as the constant if necessary.  There's also a test-130.cs
24373         for this.
24374
24375         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
24376
24377         * typemanager.cs (TypeManager.ChangeType): Previously known as
24378         Enum.ChangeEnumType().
24379
24380 2002-06-09  Martin Baulig  <martin@gnome.org>
24381
24382         * expression.cs (Cast.TryReduce): Added support for consts.
24383
24384 2002-06-08  Ravi Pratap  <ravi@ximian.com>
24385
24386         * class.cs (Accessor): Hold attributes information so we can pass
24387         it along.
24388
24389         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
24390         Modify to pass in attributes attached to the methods.
24391
24392         (add_accessor_declaration, remove_accessor_declaration): Ditto.
24393
24394         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
24395         to handle the Accessor kind :-)
24396
24397         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
24398
24399 2002-06-08  Martin Baulig  <martin@gnome.org>
24400
24401         * expression.cs (Unary.TryReduceNegative): Added support for
24402         ULongConstants.
24403
24404 2002-06-08  Martin Baulig  <martin@gnome.org>
24405
24406         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
24407         name can't be found in the `defined_names' - the caller will do a
24408         MemberLookup in this case and thus find methods in System.Enum
24409         such as Enum.IsDefined().
24410
24411 2002-06-08  Martin Baulig  <martin@gnome.org>
24412
24413         * enum.cs (Enum.ChangeEnumType): This is a custom version of
24414         Convert.ChangeType() which works with TypeBuilder created types.
24415         (Enum.LookupEnumValue, Enum.Define): Use it here.
24416
24417         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
24418         `TypeBuilder.BaseType != null' check.
24419         (TypeContainer.FindMembers): Only lookup parent members if we
24420         actually have a parent.
24421         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
24422         (ConstructorInitializer.Resolve): Likewise.
24423
24424         * interface.cs (Interface.FindMembers): Added
24425         `TypeBuilder.BaseType != null' check.
24426
24427         * rootcontext.cs (RootContext.ResolveCore): Added
24428         "System.Runtime.CompilerServices.IndexerNameAttribute" to
24429         classes_second_stage.
24430
24431         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
24432         debug_type and trace_type when compiling with --nostdlib.       
24433
24434 2002-06-07  Martin Baulig  <martin@gnome.org>
24435
24436         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
24437         (AddField): Set it to true when adding a non-static field.
24438         (DefineType): Use `have_nonstatic_fields' to find out whether we
24439         have non-static fields, not `Fields != null'.
24440
24441 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
24442
24443         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
24444         dereferencing a null on the static-field code path)
24445
24446 2002-05-30  Martin Baulig  <martin@gnome.org>
24447
24448         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
24449         to take command line arguments.  Use reflection to call the new
24450         custom `Initialize' function on the symbol writer and pass it the
24451         command line arguments.
24452
24453         * driver.cs (--debug-args): New command line argument to pass command
24454         line arguments to the symbol writer.
24455
24456 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
24457
24458         * assign.cs (DoResolve): Forgot to do the implicit conversion to
24459         the target type for indexers and properties.  Thanks to Joe for
24460         catching this.
24461
24462 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
24463
24464         * typemanager.cs (MethodFlags): returns the method flags
24465         (Obsolete/ShouldIgnore) that control warning emission and whether
24466         the invocation should be made, or ignored. 
24467
24468         * expression.cs (Invocation.Emit): Remove previous hack, we should
24469         not do this on matching a base type, we should do this based on an attribute
24470
24471         Only emit calls to System.Diagnostics.Debug and
24472         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
24473         on the command line.
24474
24475         * rootcontext.cs: Global settings for tracing and debugging.
24476
24477         * cs-tokenizer.cs (define): New utility function to track
24478         defines.   Set the global settings for TRACE and DEBUG if found.
24479
24480 2002-05-25  Ravi Pratap  <ravi@ximian.com>
24481
24482         * interface.cs (Populate*): Pass in the TypeContainer as well as
24483         the DeclSpace as parameters so that we can create EmitContexts and
24484         then use that to apply attributes etc.
24485
24486         (PopulateMethod, PopulateEvent, PopulateProperty)
24487         (PopulateIndexer): Apply attributes everywhere.
24488
24489         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
24490         etc.
24491
24492         (ApplyAttributes): Update accordingly.
24493
24494         We now apply interface attributes for all members too.
24495
24496 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
24497
24498         * class.cs (Indexer.Define); Correctly check if we are explicit
24499         implementation (instead of checking the Name for a ".", we
24500         directly look up if the InterfaceType was specified).
24501
24502         Delay the creation of the PropertyBuilder.
24503
24504         Only create the PropertyBuilder if we are not an explicit
24505         interface implementation.   This means that explicit interface
24506         implementation members do not participate in regular function
24507         lookups, and hence fixes another major ambiguity problem in
24508         overload resolution (that was the visible effect).
24509
24510         (DefineMethod): Return whether we are doing an interface
24511         implementation. 
24512
24513         * typemanager.cs: Temporary hack until we get attributes in
24514         interfaces (Ravi is working on that) and we get IndexerName
24515         support in interfaces.
24516
24517         * interface.cs: Register the indexers as properties.
24518
24519         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
24520         warning, I have verified that this is a bug in the .NET runtime
24521         (JavaScript suffers of the same problem).
24522
24523         * typemanager.cs (MemberLookup): When looking up members for
24524         interfaces, the parent of an interface is the implicit
24525         System.Object (so we succeed in searches of Object methods in an
24526         interface method invocation.  Example:  IEnumerable x;  x.ToString
24527         ()) 
24528
24529 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
24530
24531         * class.cs (Event): Events should also register if they do
24532         implement the methods that an interface requires.
24533
24534         * typemanager.cs (MemberLookup); use the new GetInterfaces
24535         method. 
24536
24537         (GetInterfaces): The code used to lookup interfaces for a type is
24538         used in more than one place, factor it here. 
24539
24540         * driver.cs: Track the errors at the bottom of the file, we kept
24541         on going.
24542
24543         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
24544         instance if the method we are calling is static!
24545
24546 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
24547
24548         * attribute.cs (ApplyAttributes): Make this function filter out
24549         the IndexerName attribute (as that attribute in reality is never
24550         applied) and return the string constant for the IndexerName
24551         attribute. 
24552
24553         * class.cs (TypeContainer.Emit): Validate that all the indexers
24554         have the same IndexerName attribute, and if so, set the
24555         DefaultName attribute on the class. 
24556
24557         * typemanager.cs: The return value might contain other stuff (not
24558         only methods).  For instance, consider a method with an "Item"
24559         property and an Item method.
24560
24561         * class.cs: If there is a problem with the parameter types,
24562         return. 
24563
24564 2002-05-24  Ravi Pratap  <ravi@ximian.com>
24565
24566         * ecore.cs (ImplicitConversionExists): Wrapper function which also
24567         looks at user defined conversion after making a call to 
24568         StandardConversionExists - we need this for overload resolution.
24569
24570         * expression.cs : Update accordingly the various method calls.
24571
24572         This fixes 2 bugs filed against implicit user defined conversions 
24573
24574 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
24575
24576         * statement.cs: Track the result of the assignment.
24577
24578 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
24579
24580         * expression.cs (MemberAccess): Improved error reporting for
24581         inaccessible members.
24582
24583 2002-05-22  Martin Baulig  <martin@gnome.org>
24584
24585         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
24586         itself with debugging support.
24587
24588 2002-05-22  Martin Baulig  <martin@gnome.org>
24589
24590         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
24591         Removed, this isn't needed anymore.
24592
24593 2002-05-20  Martin Baulig  <martin@gnome.org>
24594
24595         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
24596         be underlying type for an enum.
24597
24598 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
24599
24600         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
24601         that splits out the loading of just the core types.
24602
24603         * rootcontext.cs (ResolveCore): Split the struct resolution in
24604         two, so we can load the enumeration underlying types before any
24605         enums are used.
24606
24607         * expression.cs (Is): Bandaid until we fix properly Switch (see
24608         bug #24985 for details).
24609
24610         * typemanager.cs (ImplementsInterface): The hashtable will contain
24611         a null if there are no interfaces implemented.
24612
24613 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
24614
24615         * cs-parser.jay (indexer_declarator): It is fine to have array
24616         parameters
24617
24618 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
24619
24620         * typemanager.cs: (RegisterBuilder): New function used to register
24621         TypeBuilders that implement interfaces.  Since
24622         TypeBuilder.GetInterfaces (as usual) does not work with lame
24623         Reflection.Emit. 
24624         (AddUserType): register interfaces.
24625
24626         (ImplementsInterface): Use the builder_to_ifaces hash if we are
24627         dealing with TypeBuilder.  Also, arrays are showing up as
24628         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
24629         methods can not be invoked on them!
24630
24631         * ecore.cs (ExplicitReferenceConversionExists): Made public.
24632         (ImplicitReferenceConversionExists): Split out from
24633         StandardConversionExists. 
24634
24635         * expression.cs (As): We were only implementing one of the three
24636         cases for the as operator.  We now implement them all.
24637         (Is): Implement the various other cases for Is as well.
24638
24639         * typemanager.cs (CACHE): New define used to control if we want or
24640         not the FindMembers cache.  Seems to have a negative impact on
24641         performance currently
24642
24643         (MemberLookup): Nested types have full acess to
24644         enclosing type members
24645
24646         Remove code that coped with instance/static returns for events, we
24647         now catch this in RealFindMembers.
24648
24649         (RealFindMembers): only perform static lookup if the instance
24650         lookup did not return a type or an event.  
24651
24652 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
24653
24654         * assign.cs (CompoundAssign): We pass more semantic information
24655         now to Compound Assignments than we did before: now we have all
24656         the information at hand, and now we resolve the target *before* we
24657         do the expression expansion, which allows the "CacheValue" method
24658         to have the effect we intended (before, a [x] += 1 would generate
24659         two differen ArrayAccess expressions from the ElementAccess,
24660         during the resolution process).
24661
24662         (CompoundAssign.DoResolve): Resolve target and original_source here.
24663
24664 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
24665
24666         * expression.cs (ArrayAccess): dropped debugging information. 
24667
24668         * typemanager.cs: Small bug fix: I was always returning i_members,
24669         instead of one of i_members or s_members (depending on which had
24670         the content).
24671
24672         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
24673         method is invoked before any code generation takes place, and it
24674         is a mechanism to inform that the expression will be invoked more
24675         than once, and that the method should use temporary values to
24676         avoid having side effects
24677
24678         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
24679
24680         * ecore.cs (Expression.CacheTemporaries): Provide empty default
24681         implementation.
24682
24683         * expression.cs (Indirection, ArrayAccess): Add support for
24684         CacheTemporaries in these two bad boys. 
24685
24686         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
24687         ldobj or ldind_ref.  
24688         (StoreFromPtr): Handle stobj as well.
24689
24690         * expression.cs (UnaryMutator): Share more code.
24691
24692         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
24693         down: I was not tracking the Filter function as well, which
24694         was affecting the results of the cache.
24695
24696 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
24697
24698         * attribute.cs: Remove the hack to handle the CharSet property on
24699         StructLayouts. 
24700
24701 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
24702
24703         * attribute.cs (DoResolve): More uglyness, we now only try to
24704         resolve the attribute partially, to extract the CharSet
24705         information (only if we are a StructLayout attribute).  Otherwise 
24706
24707         (GetExtraTypeInfo): Add some code to conditionally kill in the
24708         future this.   I am more and more convinced that the .NET
24709         framework has special code to handle the attribute setting on
24710         certain elements.
24711
24712         * expression.cs (IsParamsMethodApplicable): Revert my previous
24713         foreach change here, it was wrong.
24714
24715 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
24716
24717         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
24718         (pp_expr): do not abort on unknown input, just return.
24719         (eval): abort if there are pending chars.
24720
24721         * attribute.cs (Attribute.Resolve): Positional parameters are
24722         optional.  Deal with that case.
24723
24724         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
24725         the Ansi/Unicode/Auto information for the type.
24726
24727         (TypeContainer.DefineType): instantiate the EmitContext here, as
24728         we will be using it during the type definition (to resolve
24729         attributes) and during the emit phase.
24730
24731         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
24732         to pull type information out of the attributes
24733
24734         (Attribute.Resolve): track the constructor builder, and allow for
24735         multiple invocations (structs and classes will use this).
24736
24737         * ecore.cs (MemberLookupFinal): new version with all the
24738         parameters customizable.
24739
24740         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
24741         constructors.  Return if the result value is null (as the error
24742         would have been flagged already by MemberLookupFinal)
24743
24744         Do not allow instances of abstract classes or interfaces to be
24745         created.
24746
24747         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
24748         We have to compare the assembly property here when dealing with
24749         FamANDAssem and Assembly access modifiers, because we might be
24750         creating an assembly from *modules* (that means that we are not
24751         getting TypeBuilders for types defined in other modules that are
24752         part of this assembly).
24753
24754         (Method.Emit): If the method is marked abstract and has a body,
24755         emit an error. 
24756
24757         (TypeContainer.DefineMembers): If both the defined member and the
24758         parent name match are methods, then do not emit any warnings: let
24759         the Method.Define routine take care of flagging warnings.  But if
24760         there is a mismatch (method overrides something else, or method is
24761         overriwritten by something, then emit warning).
24762
24763         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
24764         set to null, this means `do not check for the return type on the
24765         signature'. 
24766
24767         (Method.Define): set the return type for the method signature to
24768         null, so that we get methods with the same name and parameters and
24769         different return types.  This is used to flag warning 114 (you are
24770         hiding a method, and you probably want to use the new/override
24771         keywords instead).
24772
24773         * typemanager.cs (MemberLookup): Implemented proper access
24774         control, closing a long standing set of bug reports.  The problem
24775         was that the Framework only has two bits: Public and NonPublic,
24776         and NonPublic includes private and protected methods, but we need
24777         to enforce the FamANDAssem, FamOrAssem and Family. 
24778
24779 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
24780
24781         * statement.cs (GotoCase): Return true: Ammounts to giving up
24782         knowledge on whether we return or not, and letting the other case
24783         be responsible for it.
24784
24785 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
24786
24787         * driver.cs: Do not load directories for each file processed, only
24788         do it if there is a pattern.
24789
24790         * ecore.cs: Report readonly assigns here as well, as we might have
24791         been resolved only by MemberAccess.
24792
24793         (SimpleName.SimpleNameResolve): Also be useful for LValue
24794         resolution.   We need this to propagate assign to local readonly variables
24795
24796         * typemanager.cs: Use a ptrhashtable for the criteria, because we
24797         do not want to reuse potential criteria memory.
24798
24799         * class.cs (MyEventBuilder): Set reflected_type;
24800
24801         * ecore.cs (Constantify): Added support for constifying bools.
24802
24803         (RootContext.LookupType): Added a cache for values looked up in
24804         the declaration space.
24805
24806         * typemanager.cs (FindMembers): Now is a front-end to
24807         RealFindMembers, and provides a two-level hashtable-based cache to
24808         the request.  
24809
24810         15% performance improvement: from 22.5 to 19.2 seconds.
24811
24812         * expression.cs (IsParamsMethodApplicable): use foreach.
24813         (Invocation.DoResolve): ditto.
24814         (New.DoResolve): ditto.
24815         (ArrayCreation.DoResolve): ditto.
24816
24817         * ecore.cs (FindMostEncompassingType): use foreach.
24818
24819         * delegate.cs (NewDelegate.DoResolve): Use foreach
24820
24821         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
24822         (RemoveMethods): use foreach.
24823
24824         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
24825         nested foreach statements instead of for, and also break out of
24826         the inner loop once a match is found.
24827
24828         (Invocation.OverloadResolve): Use foreach, simplify the code. 
24829
24830 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
24831
24832         * cfold.cs (BinaryFold): During an enumeration evaluation context,
24833         we actually unwrap the expression to allow for extra information
24834         to be extracted. 
24835
24836         * expression.cs: Use Shr_Un on unsigned operations. 
24837
24838 2002-05-08  Ravi Pratap  <ravi@ximian.com>
24839
24840         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
24841         applicable operators was not being considered correctly. This closes
24842         the bug Miguel reported.
24843
24844 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
24845
24846         * attribute.cs: check that the type derives from System.Attribute
24847         and report the correct error in that case (moved the duplicate code to
24848         its own method, too).
24849
24850 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
24851
24852         * attribute.cs: lookup attribute type name as the spec says: first the
24853         bare attribute name and then name + "Attribute" (nant compiles with
24854         mcs after this fix).
24855
24856 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
24857
24858         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
24859         Because of the way we parse things, we should try to see if a
24860         UIntConstant can fit in an integer.
24861
24862 2002-05-07  Ravi Pratap  <ravi@ximian.com>
24863
24864         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
24865         when we are in an explicit context.
24866
24867         (ConvertReferenceExplicit): When converting from Iface type S to Class
24868         T make sure the rules are implemented as an OR.
24869
24870         * parameter.cs (ParameterType): Make it a property for now although the
24871         purpose really isn't anything immediate.
24872
24873         * expression.cs (Is*Applicable): Do better checking on the parameter type
24874         of a ref/out parameter. The ones from the system assemblies are already 
24875         marked with the correct type so we don't need to do any correction.
24876
24877         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
24878         the object type is standard too so include that.
24879
24880 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
24881
24882         * ecore.cs (StandardConversionExists): Augment with missing code:
24883         deal with IntConstant, LongConstants and Enumerations.
24884
24885         * assign.cs: Report the error, instead of failing silently
24886
24887         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
24888         typecontainer that they are declared, because the
24889         typecontainer/namespace will have the list of using clauses that
24890         need to be applied.
24891
24892         Assembly Attributes were escaping the normal registration
24893         mechanism. 
24894
24895         (EmitCode): Apply attributes within an EmitContext that represents
24896         the container they were declared on.
24897
24898         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
24899
24900 2002-05-06  Ravi Pratap  <ravi@ximian.com>
24901
24902         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
24903         Revamp completely - make much cleaner as we now operate only
24904         on a set of Types.
24905
24906         (FindMostSpecificSource, FindMostSpecificTarget): New methods
24907         to implement the logic detailed in the spec more correctly.
24908
24909         (UserDefinedConversion): Update accordingly.
24910
24911 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
24912
24913         * statement.cs: Return flow analysis information up.
24914
24915         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
24916         and the default.
24917
24918         (token): Do not consume an extra character before calling
24919         decimal_digits.
24920
24921 2002-05-06  Piers Haken <piersh@friskit.com>
24922
24923         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
24924
24925 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
24926
24927         * class.cs (Constructor.Emit): Set the IsStatic flag in the
24928         EmitContext during the instance constructor initializer
24929         resolution, to stop access to instance variables.
24930
24931         This is mandated by the spec, last paragraph of the `constructor
24932         initializers' section. 
24933
24934 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
24935
24936         * cs-parser.jay, class.cs (Accessor): new class used to represent
24937         an accessor (get or set).  In the past we used `null' to represent
24938         a missing accessor.  But this is ambiguous because there was no
24939         way to tell in abstract indexers/properties if one of them was
24940         specified.
24941
24942         Now there is a way of addressing that.
24943
24944         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
24945         instead of FindMembers.
24946
24947         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
24948         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
24949
24950         * attribute.cs: Treat indexers and properties as the same in terms
24951         of applying attributes
24952
24953         * ecore.cs (FindMostEncompassedType): Use statically initialized
24954         EmptyExpressions()s like we do elsewhere to avoid creating useless
24955         objects (and we take this out of the tight loop).
24956
24957         (GetConversionOperators): Move the code to extract the actual
24958         operators to a separate routine to clean things up.
24959
24960 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
24961
24962         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
24963         events are always registered FieldBuilders.
24964
24965         * class.cs (FieldBase): New class shared by Fields 
24966
24967         * delegate.cs: If we are a toplevel delegate, use our full name.
24968         If we are a nested delegate, then only use our tail name.
24969
24970 2002-05-02  Ravi Pratap  <ravi@ximian.com>
24971
24972         * expression.cs (IsApplicable): Ensure that we add the "&" to
24973         ref/out types before comparing it with the type of the argument.
24974
24975         (IsParamsMethodApplicable): Ditto.
24976
24977         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
24978         silly me ;-)
24979
24980         * delegate.cs : Handle the case when we have more than one applicable
24981         method. Flag an error only when we finish checking all.
24982
24983 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
24984
24985         * expression.cs: Add support for boolean static initializers.
24986
24987 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
24988
24989         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
24990
24991         * parameter.cs (ComputeParameterTypes,
24992         ComputeAndDefineParameterTypes): Better error handling: now we
24993         clear the `types' cache if we fail during any of the type lookups.
24994         We also return the status code correctly to our caller
24995
24996         * delegate.cs: If we fail to define a delegate, abort the extra
24997         steps. 
24998
24999         * expression.cs (Binary.ResolveOperator): for
25000         operator==(object,object) and operator !=(object, object) we also
25001         have to verify that there is an implicit conversion from one to
25002         the other.
25003
25004         (ArrayAccess.DoResolve): Array Access can operate on
25005         non-variables. 
25006
25007 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
25008
25009         * assign.cs (CompoundAssign): A new class used as a "flag" that
25010         the assignment actually is happening as part of a compound
25011         assignment operator.
25012
25013         During compound assignment, a few new rules exist to enable things
25014         like:
25015
25016         byte b |= 1 + 2
25017
25018         From the spec:
25019
25020         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
25021         to the type of x) if y is implicitly convertible to the type of x,
25022         and the operator is a builtin operator and the return type of the
25023         operator is explicitly convertible to the type of x. 
25024
25025         * rootcontext.cs: Reset warning level to 2.  4 catches various
25026         "interesting" features in mcs, we must clean this up at some
25027         point, but currently am trying to kill other bugs ;-)
25028
25029         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
25030         in container classes as well.  
25031
25032         * expression.cs (Binary.ResolveOperator): Handle string case
25033         before anything else (as operator overloading does emit an error
25034         before doing anything else).
25035
25036         This code could go away when we move to a table driven model, but
25037         i could not come up with a good plan last night.
25038
25039 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
25040
25041         * typemanager.cs (CSharpName): reimplementation using regex.
25042         * class.cs: added null check for fields in Emit
25043         * rootcontext.cs: set warninglevel to 4
25044
25045 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
25046
25047         * typemanager.cs (CSharpName): reimplemented with Lupus
25048         suggestion.
25049
25050 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
25051
25052         * statement.cs (If): correclty implement Resolve, because we were
25053         not catching sem errors in there.  The same process is needed
25054         everywhere else. 
25055         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
25056
25057
25058         (Statement.Warning_DeadCodeFound): Factorize code.
25059         (While): Report dead code here too.
25060
25061         (Statement): Added Resolve virtual method to allow
25062         for resolution split from the emit code.
25063
25064 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
25065
25066         * statement.cs (EmitBoolExpression): No longer try to resolve the
25067         expression here.    
25068         (MakeBoolean): New utility function that resolve, implicitly
25069         converts to boolean and tags the expression. 
25070
25071
25072         (If, Do): Implement dead code elimination.
25073         (While): Implement loop inversion
25074
25075         (Do, While, For, If): Resolve the expression prior to calling our
25076         code generation.
25077
25078 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
25079
25080         * class.cs:
25081           - added method Report28 (warning: program has more than one entry point)
25082           - added method IsEntryPoint, implements paragraph 10.1 of the spec
25083           - modified method Method.Define, the part at the end of the method
25084
25085         * rootcontext.cs: added static public Location EntryPointLocation;
25086           
25087         * ../errors/cs0028.cs : Add test case for the above warning.              
25088
25089         * typemanager.cs:
25090           - modified method CSharpName to allow arrays of primitive type to
25091             be printed nicely (e.g. instead of System.Int32[][] it now prints
25092             int[][])
25093           - added method CSharpSignature: returns the signature of a method
25094             in string format to be used in reporting errors, warnings, etc.
25095
25096         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
25097         with String.Empty.
25098
25099 2002-04-26  Ravi Pratap  <ravi@ximian.com>
25100
25101         * delegate.cs (Define): Fix extremely silly bug where I was
25102         setting the type of the 'object' parameter of the BeginInvoke
25103         method to System.IAsyncResult instead of System.Object ;-)
25104
25105 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
25106
25107         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
25108         here. 
25109
25110         (Constructor.Emit): return if we fail to initialize the
25111         constructor.  Another door closed!  
25112
25113         * expression.cs (New.DoResolve): Improve error message (from -6 to
25114         1501).  Use DeclaredOnly lookup to find the exact constructor.
25115
25116         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
25117         loop.  This is useful.
25118
25119         * cs-parser.jay: Adjust the default parameters so that destructors
25120         have the proper signature.
25121
25122 2002-04-26  Martin Baulig  <martin@gnome.org>
25123
25124         * driver.cs (LoadAssembly): If `assembly' contains any characters
25125         which are only valid in path names and not in assembly names
25126         (currently slash, backslash and point), use Assembly.LoadFrom ()
25127         instead of Assembly.Load () on the `assembly' (before iteration
25128         over the link_paths).
25129
25130 2002-04-26  Martin Baulig  <martin@gnome.org>
25131
25132         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
25133
25134 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
25135
25136         * class.cs (Property): use the new typemanager.MemberLookup
25137
25138         (TypeContainer.MemberLookup): Implement using the
25139         TypeManager.MemberLookup now. 
25140
25141         * typemanager.cs: Make MemberLookup a function of the TypeManager,
25142         and return MemberInfos, so that these can be used without an
25143         EmitContext (what we had before).
25144
25145 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
25146
25147         * expression.cs: Fix the case where the argument to params if the
25148         type of the params.  I omitted handling this before.   Fixed
25149
25150 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
25151
25152         * driver.cs: Call BootCorlib_PopulateCoreType
25153
25154         * class.cs (Property.CheckBase): Check for properties only, not
25155         for all members. 
25156
25157         * interface.cs: Temporary hack: try/catch around the
25158         CustomAttributeBuilder, because I am getting an exception that I
25159         do not understand.
25160
25161         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
25162         types whose definitions are required to be there (attributes are
25163         defined before standard types).
25164
25165         Compute definitions as we boot the various types, as they are used
25166         immediately (value_type class will need object_type, but if we do
25167         not initialize object_type, we will pass a null, which will let
25168         the runtime pick the System.Object from the existing corlib, which
25169         is not what we want).
25170
25171 2002-04-22  Patrik Torstensson <totte@labs2.com>
25172
25173         * cs-tokenizer.cs: fixed a number of trim() issues.
25174
25175 2002-04-22  Ravi Pratap  <ravi@ximian.com>
25176
25177         * expression.cs (Argument.Type): Ensure that we return the correct
25178         type when we have out or ref parameters [in which case we 
25179         append a "&"].
25180
25181 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
25182
25183         * class.cs (Property, Indexer): Allow extern modifier in there. 
25184
25185         * typemanager.cs (InitBaseTypes): Initializes object_type and
25186         value_type, since those will be used early on during the bootstrap
25187         process to compile corlib.
25188
25189         (InitCoreTypes): Move code from here to InitBaseTypes.
25190
25191 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
25192
25193         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
25194         single-dimension arrays as using the ldlen opcode.  
25195
25196         Daniel Lewis discovered this optimization.  
25197
25198         * typemanager.cs: Add signature for System.Array::get_Length
25199
25200 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25201
25202         * statement.cs: report the error when the foreach does not apply to an
25203         array nor a collection.
25204
25205 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
25206
25207         * expression.cs: Add implicit conversions to the operator ~.
25208
25209         * constant.cs (DecimalConstant.Emit): Emit decimal value.
25210
25211         * typemanager.cs: Locate the decimal constructor.
25212
25213 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25214
25215         * attribute.cs: use the new property of TypeOf.
25216         * expression.cs: added 'get' property around typearg.
25217
25218         These changes fix a build breaker reported by NickD. Is this the
25219         correct way to fix?  If not, please, revert my changes and make it
25220         work :-).
25221
25222 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
25223
25224         * attribute.cs: Add support for typeof in attribute invocations.
25225         I am not sure that this is right though.
25226
25227 2002-04-14  Duncan Mak  <duncan@ximian.com>
25228
25229         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
25230         Binary.Operator.Division case.
25231
25232 2002-04-13  Ravi Pratap  <ravi@ximian.com>
25233
25234         * class.cs (DefineType): Ensure that we do a proper check on
25235         attribute types and also register it with the TypeManager.
25236
25237         (TypeContainer.Targets): The default for attribute types is
25238         AttributeTargets.All.
25239
25240         * attribute.cs (ApplyAttributes): Registering the attribute type
25241         is done elsewhere, not when we discover we have a Usage attribute.
25242
25243 2002-04-12  Ravi Pratap  <ravi@ximian.com>
25244
25245         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
25246         and get rid of is_delegate parameter.
25247
25248         * everywhere : update.
25249
25250 2002-04-12  Ravi Pratap  <ravi@ximian.com>
25251
25252         * cs-parser.jay (compilation_unit): Revamp completely to use
25253         some new ideas that I got from Rhys' grammar to solve the problems
25254         with assembly level attributes.
25255
25256         (outer_declaration): New grammar production.
25257
25258         (attribute_sections): Add.
25259
25260         (opt_attributes): Base on attribute_sections
25261
25262         (namespace_declaration): Allow opt_attributes to tackle the case
25263         when we have assembly level attributes - we are clever in this
25264         regard now ;-)
25265
25266         * attribute.cs (ApplyAttributes): Do not worry about assembly 
25267         attributes in the non-global context.
25268
25269         * rootcontext.cs (AddGlobalAttributes): Go back to using this
25270         instead of SetGlobalAttributes.
25271
25272         * class.cs, rootcontext.cs : Ensure we define and generate 
25273         attribute types before anything else.
25274
25275         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
25276         and flag the new error -20 for the case when the attribute type
25277         does not have valid targets specified. csc does not catch this.
25278
25279         * ../errors/errors.txt : update for error # -20
25280
25281 2002-04-11  Ravi Pratap  <ravi@ximian.com>
25282
25283         * support.cs (InternalParameters.ParameterModifier): Do some null
25284         checking and return sane values.
25285
25286         * class.cs (Method.Define): If we are a PInvoke method, ensure
25287         that we are static and extern. Report error # 601
25288
25289         * ../errors/cs0601.cs : Add test case for the above error.
25290
25291 2002-04-07  Ravi Pratap  <ravi@ximian.com>
25292
25293         * rootcontext.cs (attribute_types): We need to keep type of
25294         all attribute types separately and emit code for them first.
25295
25296         (RegisterAttribute) : Implement.
25297
25298         * class.cs (DefineType): Check if the current Type is a custom
25299         attribute type and register it accordingly.
25300
25301         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
25302         adding the first attribute twice and rename to
25303
25304         (SetGlobalAttributes): this.
25305
25306         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
25307         lookups.
25308
25309         * attribute.cs (ApplyAttributes): Take an additional argument telling us
25310         if we are processing global arguments. Hmm, I am unsure of this.
25311
25312 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25313
25314         * expression.cs: added static array of strings to avoid calling
25315         Enum.ToString () for Operator in Binary. Significant recover of
25316         performance.
25317
25318 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
25319
25320         * class.cs (FindMembers): Allow the Builders of the various
25321         members to be null.  If they are skip them.  This only happens
25322         during the PInvoke declaration.
25323
25324 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
25325
25326         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
25327         failure, so we do not keep going afterwards.
25328
25329         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
25330         wanted to pass `false' as the `is_delegate' argument.  If this is
25331         the case, why not use delegate_type == null to mean `is_delegate =
25332         false' and anything else as is_delegate = true.
25333
25334 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
25335
25336         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
25337         code for the section, not the beginning of the tests.
25338
25339 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
25340
25341         * cfold.cs: Handle operator + (Enum x, Underlying x) 
25342
25343         * expression.cs (Binary): same.  Warn about errors where we have
25344         Enum/Enum in operator + as well.
25345
25346 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
25347
25348         * statement.cs:
25349                 - added support for switch(bool)
25350                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
25351                 - add TableSwitchEmit() to handle table-based switch statements
25352
25353 2002-04-05  Ravi Pratap  <ravi@ximian.com>
25354
25355         * expression.cs (Invocation.OverloadResolve): Factor out code which
25356         does parameter compatibility checking with arguments so that we can 
25357         re-use the code even from Delegate.VerifyApplicability
25358
25359         (VerifyArgumentsCompat): Move above code here.
25360
25361         * delegate.cs (VerifyApplicability): Get rid of duplicate code
25362         and instead make a call to the above method.
25363
25364 2002-03-31  Ravi Pratap  <ravi@ximian.com>
25365
25366         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
25367         We use it to keep track of classes which are attribute types.
25368
25369 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
25370
25371         * delegate.cs (Delegate.Define): Correctly define the types in the
25372         presence of fixed and array parameters.
25373
25374         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
25375         doing FindMembers.
25376
25377         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
25378         include NonPublic after the first iteration.
25379
25380         * class.cs (Indexer.CheckBase): Only check if both parents are
25381         non-null. 
25382
25383         * cs-parser.jay (accessor_body): If empty, set to null.
25384
25385         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
25386         same code path here to resolve constants names that we did have in
25387         MemberAccess.DoResolve.  There is too much code duplicated here.
25388
25389 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
25390
25391         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
25392
25393         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
25394         to MakeUnionSet.
25395
25396         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
25397         tokens, numbers and strings.
25398
25399         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
25400         parenthesis.
25401
25402         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
25403         asyncronous parameters and the regular parameters.  
25404
25405         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
25406         specify the target directory.
25407
25408         * expression.cs: (This.DoResolve): Simplify
25409         (As.Emit): Optimize, do not generate IsInst if the expression is
25410         always of the given type.
25411
25412         (Is.DoResolve): Bug fix, we were reporting both always/never for
25413         the is expression.
25414
25415         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
25416         creating too many unnecessary arrays.
25417
25418 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
25419
25420         * class.cs (EmitFieldInitializer): Use Assign expression to assign
25421         fields instead of rolling our own initializer.   Takes care of all
25422         implicit conversions, and drops unnecessary static checks/argument.
25423
25424 2002-03-31  Dick Porter  <dick@ximian.com>
25425
25426         * driver.cs: use the GetDirectories() return values properly, and
25427         use "/" as path separator.
25428
25429 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
25430
25431         * expression.cs (Unary): Optimize - - expr into expr.
25432         (Binary): Optimize a + (-b) into a -b.
25433
25434         * codegen.cs (CodeGen): Made all methods static.
25435
25436 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
25437
25438         * rootcontext.cs: 
25439
25440         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
25441         TypeBuilder property.
25442
25443         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
25444         instead. 
25445
25446         * tree.cs: Removed the various RecordXXXX, and replaced with a
25447         single RecordDecl.  Removed all the accessor methods, and just
25448         left a single access point Type 
25449
25450         * enum.cs: Rename DefineEnum to DefineType.
25451
25452         * decl.cs: New abstract method `DefineType' used to unify the
25453         Defines for Enumerations, Interfaces, TypeContainers and
25454         Delegates.
25455
25456         (FindType): Moved LookupInterfaceOrClass here.  Moved the
25457         LookupBaseClasses method that used to live in class.cs and
25458         interface.cs here, and renamed to FindType.
25459
25460         * delegate.cs: Implement DefineType.  Take advantage of the
25461         refactored pattern for locating the parent builder without taking
25462         the parent_builder argument (which we know does not work if we are
25463         nested, and triggering a toplevel definition).
25464
25465 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
25466
25467         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
25468         accessibility of a member has changed during override and report
25469         an error if so.
25470
25471         * class.cs (Method.Define, Property.Define): Only complain on
25472         overrides if the method is private, any other accessibility is
25473         fine (and since we just checked the permission is the same, we are
25474         good to go).
25475
25476         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
25477         and elif are processed always.  The other pre-processing
25478         directives are only processed if we are "taking" the path
25479
25480 2002-03-29  Martin Baulig  <martin@gnome.org>
25481
25482         * class.cs (Method.Emit): Only emit symbolic debugging info if the
25483         current location is not Null.
25484
25485         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
25486         a separate method so we can profile it.
25487
25488         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
25489         `span.Seconds' are just seconds, but no minutes or hours.
25490         (MainDriver): Profile the CodeGen.SaveSymbols calls.
25491
25492 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
25493
25494         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
25495         Remove the gratuitous set of Final:
25496
25497                                 // If an interface implementation, then we can set Final.
25498                                 if (((flags & MethodAttributes.Abstract) == 0) &&
25499                                     implementing.DeclaringType.IsInterface)
25500                                         flags |= MethodAttributes.Final;
25501
25502         I do not know what I was smoking when I used that.
25503
25504
25505         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
25506         step into fixing the name resolution issues for delegates and
25507         unifying the toplevel name resolution.
25508
25509 2002-03-28  Martin Baulig  <martin@gnome.org>
25510
25511         * class.cs (Method.Emit): If we have a symbol writer, call its
25512         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
25513         tell it about the current method.
25514
25515         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
25516         writer that we're going to emit the first byte of IL code for a new
25517         statement (a new source line).
25518         (EmitContext.EmitTopBlock): If we have a symbol writer, call
25519         EmitContext.Mark() before emitting any code.
25520
25521         * location.cs (SymbolDocument): Return null when we're Null.
25522
25523         * statement.cs (Statement): Moved the `Location loc' variable here.
25524         (Statement.EmitBoolExpression): If we have a symbol writer, call
25525         ec.Mark() before emitting any code to tell it that we're at the
25526         beginning of a new statement.
25527         (StatementExpression): Added `Location' argument to the constructor.
25528         (Block): Added public readonly variable `StartLocation' and public
25529         variable `EndLocation'.  The latter is to be set using SetEndLocation().
25530         (Block): Added constructor which takes a start and end location.
25531         (Block.SetEndLocation): New method. This sets the end location.
25532         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
25533         local variables we create.
25534         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
25535         each statement and do also mark the begin and end of the block.
25536
25537         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
25538         tell it the current lexer.Location, use Location.Null for the end of the
25539         block.
25540         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
25541         current block, set its end location using SetEndLocation().
25542         (statement_expression): StatementExpression constructor now takes the
25543         lexer.Location as additional argument.
25544         (for_statement, declare_local_variables): Likewise.
25545         (declare_local_variables): When creating a new implicit block, use the
25546         new Block constructor and pass it the lexer.Location.
25547
25548 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
25549
25550         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
25551         members also on the parent interfaces recursively.
25552
25553 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
25554
25555         * report.cs: Use new formats, since Gonzalo finished the missing
25556         bits. 
25557
25558         * expression.cs (Binary.ResolveOperator): added missing operator|
25559         operator& and operator^ for bool/bool.
25560
25561         * cs-parser.jay: CheckDef now takes a Location argument that is
25562         used to report errors more precisly (instead of reporting the end
25563         of a definition, we try to track something which is a lot closer
25564         to the source of the problem).
25565
25566         * cs-tokenizer.cs: Track global token use, so we can properly flag
25567         the use of #define/#undef after the first token has been seen.
25568
25569         Also, rename the reportXXXX to Error_DescriptiveName
25570
25571         * decl.cs (DeclSpace.IsTopLevel): Move property here from
25572         TypeContainer, so that Enum and Interface can use this too.
25573
25574         * class.cs (TypeContainer.LookupInterfaceOrClass,
25575         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
25576         `builder' argument.  Typically this was used to pass the parent
25577         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
25578         the definition).  
25579
25580         The problem is that a nested class could trigger the definition of
25581         a toplevel class, and the builder would be obviously wrong in that
25582         case. 
25583
25584         So we drop this argument, and we compute dynamically the
25585         TypeBuilder/ModuleBuilder (the correct information was available
25586         to us anyways from DeclSpace.Parent)
25587
25588         * interface.cs (Interface.DefineInterface): Drop builder
25589         parameter cleanup like class.cs
25590
25591         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
25592         like class.cs
25593
25594         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
25595         values. 
25596
25597         (Try.Emit): Propagate the returns value from the statement.
25598
25599         (Return.Emit): Even if we are leavning 
25600
25601         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
25602
25603         * modifiers.cs: Fix the computation of MethodAttributes flags.
25604
25605 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
25606
25607         * driver.cs: allow compilation of files that start with '/'.
25608         Add a default case when checking the argument of --target.
25609
25610 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
25611
25612         * interface.cs: Implement the same search algorithm for types in
25613         the interface code.
25614
25615         * delegate.cs: Do not allow multiple definition.
25616
25617         * Recovered ChangeLog that got accidentally amputated
25618
25619         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
25620
25621         * rootcontext.cs: Load manually enum to allow core classes to
25622         contain enumerations.
25623
25624         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
25625         Update to new static methods in TypeManager.
25626
25627         * typemanager.cs (GetMethod, GetConstructor): Use our
25628         implementation of FindMembers to find the members, since during
25629         corlib compilation, the types are TypeBuilders and GetMethod and
25630         GetConstructor do not work.
25631
25632         Make all methods in TypeManager static.
25633
25634         (InitCodeHelpers): Split the functionality from
25635         the InitCodeTypes function.
25636
25637         * driver.cs: Call InitCodeHelpers after we have populated the
25638         types. 
25639
25640         * cs-parser.jay (delegate_declaration): we did not used to compute
25641         the delegate name correctly for void delegates.
25642
25643 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
25644
25645         * rootcontext.cs (RootContext): Init the interface_resolve_order
25646         and type_container_resolve_order always.
25647
25648         (ResolveCore, BootstrapCorlib_ResolveClass,
25649         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
25650         compiler when compiling with --nostdlib
25651
25652         * class.cs (TypeContainer.DefineType): Check that our parent is
25653         not null.  This test is most important when we are bootstraping
25654         the core types.
25655
25656         * codegen.cs: Split out the symbol writing code.
25657
25658 2002-03-25  Martin Baulig  <martin@gnome.org>
25659
25660         * driver.cs (-g): Made -g an alias for --debug.
25661
25662 2002-03-24  Martin Baulig  <martin@gnome.org>
25663
25664         * codegen.cs (SymbolWriter): New public variable. Returns the
25665         current symbol writer.
25666         (CodeGen): Added `bool want_debugging_support' argument to the
25667          constructor. If true, tell the ModuleBuild that we want debugging
25668         support and ask it for the ISymbolWriter.
25669         (Save): If we have a symbol writer, call it's Close() method after
25670         saving the assembly.
25671
25672         * driver.c (--debug): New command line argument to create a
25673         debugger information file.
25674
25675         * location.cs (SymbolDocument): New public property. Returns an
25676         ISymbolDocumentWriter object for the current source file or null
25677         if we don't have a symbol writer.
25678
25679 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
25680
25681         * driver.cs (LoadAssembly): Correctly return when all the paths
25682         have been tried and not before.
25683
25684         * statement.cs (Switch.Emit): return the actual coverage for this
25685         statement (returns/not-returns)
25686
25687         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
25688         switch of the statement if we are the last switch section.  That
25689         kills two problems: try/catch problems (we used to emit an empty
25690         nop at the end) and switch statements where all branches would
25691         return. 
25692
25693 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
25694
25695         * driver.cs: Add default assemblies (the equivalent to the
25696         Microsoft CSC.RSP file)
25697
25698         * cs-tokenizer.cs: When updating `cols and setting it to zero,
25699         also update tokens_seen and set it to false.
25700
25701         * driver.cs: Implement --recurse for Mike.
25702
25703         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
25704         correctly splitting out the paths.
25705
25706 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
25707
25708         * interface.cs (Interface.PopulateProperty): Instead of using
25709         `parent' as the declaration space for the set parameters, use
25710         `this' 
25711
25712         * support.cs (InternalParameters): InternalParameters constructor
25713         takes a DeclSpace instead of a TypeContainer.
25714
25715         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
25716         types are being initialized, load the address of it before calling
25717         the function.  
25718
25719         (New): Provide a mechanism to disable the generation of local
25720         value type temporaries when the caller will be providing us with
25721         an address to store it.
25722
25723         (ArrayCreation.EmitDynamicInitializers): Use it.
25724
25725 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
25726
25727         * expression.cs (Invocation.EmitArguments): Only probe for array
25728         property if there is more than one argument.  Sorry about that.
25729
25730         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
25731         empty param arrays.
25732
25733         * class.cs (Method.LabelParameters): Fix incorrect code path that
25734         prevented the `ParamArrayAttribute' from being applied to the
25735         params attribute.
25736
25737 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
25738
25739         * support.cs (ReflectionParameters): Correctly compute whether the
25740         last argument is a params array.  Fixes the problem with
25741         string.Split ('a')
25742
25743         * typemanager.cs: Make the assemblies array always be non-null
25744         (empty, but non-null)
25745
25746         * tree.cs (RecordDecl): New function that abstracts the recording
25747         of names.  This reports error 101, and provides a pointer to the
25748         previous declaration.  Fixes a crash in the compiler.
25749
25750         * cs-parser.jay (constructor_declaration): Update to new grammar,
25751         and provide a constructor_body that can be empty.
25752
25753 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
25754
25755         * driver.cs: Add support for --resources.
25756
25757         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
25758         Make all types for the various array helper methods be integer.
25759
25760         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
25761         CheckState to ConvCast.
25762
25763         (ConvCast): Now it takes a `checked' state argument, to avoid
25764         depending on the emit context for the conversion, and just using
25765         the resolve time setting.
25766
25767         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
25768         instead of Invocation.EmitArguments.  We do not emit the original
25769         arguments, instead we emit those which have been converted to
25770         unsigned int expressions.
25771
25772         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
25773
25774         * codegen.cs: ditto.
25775
25776         * expression.cs (LocalVariableReference): Drop the use of the
25777         Store function that depended on the variable index.
25778
25779         * statement.cs (VariableInfo): Drop the `Idx' property from this
25780         class, as this is not taking into account the indexes for
25781         temporaries tat we generate during the execution, getting the
25782         indexes wrong.
25783
25784         * class.cs: First emit class initializers, then call the parent
25785         constructor. 
25786
25787         * expression.cs (Binary): Fix opcode emision.
25788         (UnaryMutator.EmitCode): Support checked code generation
25789
25790         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
25791         matches for events for both the Static and Instance scans,
25792         pointing to the same element.   Fix that.
25793
25794 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
25795
25796         * rootcontext.cs (ResolveTree): Always set the
25797         interface_resolve_order, because nested interfaces will be calling
25798         into us.
25799
25800         * class.cs (GetInterfaceOrClass): Track the same resolution
25801         process used by TypeManager.LookupType.  This fixes the nested
25802         type lookups in class declarations (separate path from
25803         LookupType). 
25804
25805         (TypeContainer.DefineType): Also define nested interfaces.
25806         (TypeContainer.RegisterOrder): New public function used to
25807         register the order in which child interfaces need to be closed.
25808
25809         Nested interfaces need to be closed after their parents have been
25810         created. 
25811
25812         * interface.cs (InterfaceAttr): Put all the logic for computing
25813         the interface attribute here. 
25814
25815         (DefineInterface): Register our interface order with the
25816         RootContext or with the TypeContainer depending on the case.
25817
25818 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
25819
25820         * cs-parser.jay: rework foreach statement to work with the new
25821         changes to the policy on SimpleNames.
25822
25823         * report.cs: support Stacktrace on warnings as well.
25824
25825         * makefile: drop --unsafe and /unsafe from the compile.
25826
25827 2002-03-13  Ravi Pratap  <ravi@ximian.com>
25828
25829         * ecore.cs (StandardConversionExists): Modify to take an Expression
25830         as the first parameter. Ensure we do null -> reference type conversion
25831         checking.
25832
25833         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
25834         temporary Expression objects.
25835
25836 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
25837
25838         * interface.cs: workaround bug in method overloading resolution
25839         (there is already a bugzilla bug for it).
25840
25841 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
25842
25843         We could also solve this problem by having a separate path for
25844         performing type lookups, instead of DoResolve, we could have a
25845         ResolveType entry point, and only participating pieces of the
25846         production (simplename, deref, array) would implement this. 
25847
25848         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
25849         signal SimpleName to only resolve type names and not attempt to
25850         resolve anything else.
25851
25852         * expression.cs (Cast): Set the flag.
25853
25854         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
25855
25856         * class.cs: Only report 108 if there is no `new' modifier.
25857
25858         * cs-parser.jay: rework foreach statement to work with the new
25859         changes to the policy on SimpleNames.
25860
25861         * report.cs: support Stacktrace on warnings as well.
25862
25863         * makefile: drop --unsafe and /unsafe from the compile.
25864
25865 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
25866
25867         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25868         lookups here, instead of doing that at parse time.  This means
25869         that our grammar will not introduce `LocalVariableReferences' as
25870         expressions at this point.  That solves the problem of code like
25871         this:
25872
25873         class X {
25874            static void Main ()
25875            { int X = 1;
25876             { X x = null }}}
25877
25878         This is only half the fix.  The full fix requires parameters to
25879         also be handled in this way.
25880
25881         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
25882         makes the use more obvious of the DeclSpace.  The
25883         ec.TypeContainer.TypeBuilder is now only used to pull the
25884         TypeBuilder for it.
25885
25886         My theory is that I can get rid of the TypeBuilder completely from
25887         the EmitContext, and have typecasts where it is used (from
25888         DeclSpace to where it matters).  
25889
25890         The only pending problem is that the code that implements Aliases
25891         is on TypeContainer, and probably should go in DeclSpace.
25892
25893         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25894         lookups here, instead of doing that at parse time.  This means
25895         that our grammar will not introduce `LocalVariableReferences' as
25896         expressions at this point.  That solves the problem of code like
25897         this:
25898
25899         class X {
25900            static void Main ()
25901            { int X = 1;
25902             { X x = null }}}
25903
25904         This is only half the fix.  The full fix requires parameters to
25905         also be handled in this way.
25906
25907         * class.cs (Property.DefineMethod): When implementing an interface
25908         method, set newslot, when implementing an abstract method, do not
25909         set the flag (before we tried never setting it, or always setting
25910         it, which is the difference).
25911         (Indexer.DefineMethod): same.
25912         (Method.DefineMethod): same.
25913
25914         * ecore.cs: Only set the status used flag if we get back a Field.
25915
25916         * attribute.cs: Temporary hack, so Paolo can keep working.
25917
25918 2002-03-08  Ravi Pratap  <ravi@ximian.com>
25919
25920         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
25921         the unmanaged type in the case we have a MarshalAs attribute.
25922
25923         (Resolve): Handle the case when we are parsing the special MarshalAs
25924         attribute [we need to store the unmanaged type to use later]
25925
25926         * typemanager.cs (marshal_as_attr_type): Built in type for the 
25927         MarshalAs Attribute.
25928
25929         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
25930         on parameters and accordingly set the marshalling info.
25931
25932 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
25933
25934         * class.cs: Optimizing slightly by removing redundant code after
25935         we switched to the `NoTypes' return value.
25936         (Property.DefineMethod): use NoTypes here too.
25937
25938         This fixes the bug I introduced in my last batch of changes.
25939
25940 2002-03-05  Ravi Pratap  <ravi@ximian.com>
25941
25942         * tree.cs (RecordEnum): Add. We now keep track of enums too.
25943
25944         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
25945         Enums since those are types too. 
25946
25947         * cs-parser.jay (enum_declaration): Record enums as we parse them.
25948
25949         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
25950         thanks to a call during the lookup process.
25951
25952 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
25953
25954         * statement.cs (Foreach): Lots of work to accomodate a particular
25955         kind of foreach statement that I had not kept in mind.  It is
25956         possible to have foreachs on classes that provide a GetEnumerator
25957         method that return objects that implement the "pattern" for using
25958         a foreach, there is no need to support GetEnumerator
25959         specifically. 
25960
25961         This is needed to compile nant.
25962
25963         * decl.cs: Only report 114 if the member is not `Finalize' and if
25964         the warning level is at least 2.
25965
25966         * class.cs: Moved the compare function from Method to
25967         MethodSignature. 
25968
25969         (MethodSignature.InheritableMemberSignatureCompare): Add new
25970         filter function that is used to extract inheritable methods from a
25971         class. 
25972
25973         (Method.Define): Use the new `inheritable_method_signature_filter'
25974         delegate
25975
25976         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
25977         command. 
25978
25979 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
25980
25981         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
25982
25983         * cs-parser.jay: Add opt_semicolon to the interface declaration.
25984
25985         * expression.cs: Pass location information to
25986         ConvertImplicitStandard. 
25987
25988         * class.cs: Added debugging code to track return values from
25989         interfaces. 
25990
25991 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
25992
25993         * expression.cs (Is.DoResolve): If either side of the `is' is an
25994         interface, do not flag the warning.
25995
25996         * ecore.cs (ImplicitReferenceConversion): We need a separate test
25997         for interfaces
25998
25999         * report.cs: Allow for --fatal to be used with --probe.
26000
26001         * typemanager.cs (NoTypes): Move the definition for the empty Type
26002         array here. 
26003
26004         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
26005         properties. 
26006         (TypeContainer.DefineProxy): New function used to proxy to parent
26007         implementations when implementing interfaces.
26008         (TypeContainer.ParentImplements): used to lookup if our parent
26009         implements a public function that is required by an interface.
26010         (TypeContainer.VerifyPendingMethods): Hook this up.
26011
26012         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
26013         `modules' and `assemblies' arraylists into arrays.  We only grow
26014         these are the very early start up of the program, so this improves
26015         the speedof LookupType (nicely measured).
26016
26017         * expression.cs (MakeByteBlob): Replaced unsafe code with
26018         BitConverter, as suggested by Paolo.
26019
26020         * cfold.cs (ConstantFold.Binary): Special case: perform constant
26021         folding of string concatenation, but if either side is a string,
26022         and the other is not, then return null, and let the runtime use
26023         the concatenation on the string plus the object (using
26024         `Object.ToString'). 
26025
26026 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
26027
26028         Constant Folding has been implemented now.
26029
26030         * expression.cs (Unary.Reduce): Do not throw an exception, catch
26031         the error instead on types that are not supported in one's
26032         complement. 
26033
26034         * constant.cs (Constant and all children): New set of functions to
26035         perform implict and explicit conversions.
26036
26037         * ecore.cs (EnumConstant): Implement the new functions to perform
26038         conversion by proxying to the child expression.
26039
26040         * codegen.cs: (ConstantCheckState): Constant evaluation has its
26041         own separate setting that can not be turned off from the command
26042         line using --unchecked or --checked and is only controlled using
26043         the checked/unchecked statements and expressions.  This setting is
26044         used by the constant folder to flag errors.
26045
26046         * expression.cs (CheckedExpr, UncheckedExpr): Set the
26047         ConstantCheckState as well.   
26048
26049         During Resolve, they also have to flag the state, because the
26050         constant folder runs completely in the Resolve phase.
26051
26052         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
26053         well.
26054
26055 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
26056
26057         * cfold.cs: New file, this file contains the constant folder.
26058
26059         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
26060         argument to track whether we are using the resulting address to
26061         load or store a value and provide better error messages. 
26062
26063         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
26064         new AddressOf arguments.
26065
26066         * statement.cs (Foreach.EmitCollectionForeach): Update
26067
26068         * expression.cs (Argument.Emit): Call AddressOf with proper
26069         arguments to track usage.
26070
26071         (New.DoEmit): Call AddressOf with new arguments.
26072
26073         (Unary.Emit): Adjust AddressOf call.
26074
26075 2002-03-01  Ravi Pratap  <ravi@ximian.com>
26076
26077         * cs-parser.jay (member_access): Change the case for pre-defined types
26078         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
26079         this suggestion.
26080
26081         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
26082         a method body.
26083
26084         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
26085         essentially like methods and apply attributes like MethodImplOptions to them too.
26086
26087         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
26088         not being null.
26089
26090         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
26091         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
26092         is the DeclSpace.
26093
26094         * Update code everywhere accordingly.
26095
26096         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
26097
26098         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
26099
26100 2002-02-28  Ravi Pratap  <ravi@ximian.com>
26101
26102         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
26103         try performing lookups against those instead of jumping straight into using
26104         the 'using' clauses.
26105
26106         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
26107
26108         (LookupType): Perform lookups in implicit parents too.
26109
26110         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
26111         sequence as RootContext.LookupType. 
26112
26113         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
26114         the various cases of namespace lookups into this method.
26115
26116 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
26117
26118         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
26119         in positional arguments)
26120
26121         * class.cs (Operator): Update the AllowedModifiers to contain
26122         extern. 
26123
26124         * cs-parser.jay: Update operator declaration to allow for the
26125         operator body to be empty.
26126
26127         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
26128         values. 
26129
26130 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
26131
26132         * class.cs (Method.Emit): Label parameters.
26133
26134         * driver.cs: Return 1 or 0 as the program exit code.
26135
26136 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
26137
26138         * expression.cs: Special case the `null' object when trying to
26139         auto-compute the type, as anything can be explicitly converted to
26140         that. 
26141
26142         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
26143         spotting this Paolo.
26144
26145         (Expression.ImplicitNumericConversion): Perform comparissions of
26146         the type using the underlying type in the case of an enumeration
26147         rather than using the enumeration type for the compare.
26148
26149         Cope with the underlying == type case, which is not possible to
26150         catch before. 
26151
26152         (Expression.ConvertNumericExplicit): Perform comparissions of
26153         the type using the underlying type in the case of an enumeration
26154         rather than using the enumeration type for the compare.
26155
26156         * driver.cs: If the user does not supply an extension, assume .exe
26157
26158         * cs-parser.jay (if_statement): Rewrote so that we can track the
26159         location for the if statement.
26160
26161         * expression.cs (Binary.ConstantFold): Only concat strings when
26162         the operation is "+", not everything ;-)
26163
26164         * statement.cs (Statement.EmitBoolExpression): Take a location
26165         argument. 
26166         (If, While, Do): Track location.
26167
26168         * expression.cs (Binary.ResolveOperator): In the object + string
26169         case, I was missing a call to ConvertImplicit
26170
26171 2002-02-25  Ravi Pratap  <ravi@ximian.com>
26172
26173         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
26174         Location arguments. Ensure we use RootContext.LookupType to do our work
26175         and not try to do a direct Type.GetType and ModuleBuilder.GetType
26176
26177         * interface.cs (PopulateMethod): Handle the type of the parameter being
26178         null gracefully.
26179
26180         * expression.cs (Invocation.BetterFunction): Handle the case when we 
26181         have a params method with no fixed arguments and a call is made with no
26182         arguments.
26183
26184 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
26185
26186         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
26187         the verbatim-string-literal
26188
26189         * support.cs (InternalParameters.ParameterModifier): handle null
26190         fixed parameters.
26191         (InternalParameters.ParameterType): ditto.
26192
26193         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
26194         duplicating the name of the variable parameter.
26195         (GetParameterByName): Fix bug where we were not looking up array
26196         paramters if they were the only present (thanks Paolo!).
26197         (GetParameterInfo): We only have an empty set of types if both
26198         fixed and array are set to null.
26199         (GetParameterInfo-idx): Handle FixedParameter == null
26200
26201         * cs-parser.jay: Handle the case where there is no catch
26202         statements (missing null test).
26203
26204 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
26205
26206         * driver.cs (MainDriver): Be conservative on our command line
26207         handling.
26208
26209         Catch DirectoryNotFoundException when calling GetFiles.
26210
26211         (SplitPathAndPattern): Used to split the input specification into
26212         a path and a pattern that we can feed to Directory.GetFiles.
26213
26214 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
26215
26216         * statement.cs (Fixed): Implement the last case of the Fixed
26217         statement (string handling).
26218
26219         * expression.cs (StringPtr): New class used to return a char * to
26220         a string;  Used by the Fixed statement.
26221
26222         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
26223
26224         * expression.cs (Binary.ResolveOperator): Remove redundant
26225         MemberLookup pn parent type.
26226         Optimize union call, we do not need a union if the types are the same.
26227         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
26228         type.
26229
26230         Specialize the use of MemberLookup everywhere, instead of using
26231         the default settings. 
26232
26233         (StackAlloc): Implement stackalloc keyword.
26234
26235         * cs-parser.jay: Add rule to parse stackalloc.
26236
26237         * driver.cs: Handle /h, /help, /?
26238
26239         * expression.cs (MakeByteBlob): Removed the hacks we had in place
26240         before we supported unsafe code.
26241
26242         * makefile: add --unsafe to the self compilation of mcs.
26243
26244 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
26245
26246         * expression.cs (PointerArithmetic): New class that is used to
26247         perform pointer arithmetic.
26248         (Binary.Resolve): Handle pointer arithmetic
26249         Handle pointer comparission.
26250         (ArrayPtr): Utility expression class that is used to take the
26251         address of an array.
26252
26253         (ElementAccess): Implement array access for pointers
26254
26255         * statement.cs (Fixed): Implement fixed statement for arrays, we
26256         are missing one more case before we are done.
26257
26258         * expression.cs (Indirection): Implement EmitAssign and set the
26259         ExprClass to Variable.  This allows pointer dereferences to be
26260         treated as variables, and to have values assigned to them.
26261
26262         * ecore.cs (Expression.StoreFromPtr): New utility function to
26263         store values dereferencing.
26264
26265 2002-02-20  Ravi Pratap  <ravi@ximian.com>
26266
26267         * expression.cs (Binary.ResolveOperator): Ensure that we are
26268         not trying to operate on a void type - this fixes the reported
26269         bug.
26270
26271         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
26272         the parent implementation is sealed.
26273
26274         * ../errors/cs0239.cs : Add.
26275
26276         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
26277
26278         * typemanager.cs (unverifiable_code_type): Corresponds to 
26279         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
26280         which have unsafe code in them.
26281
26282         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
26283         unsafe context.
26284
26285 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
26286
26287         * cs-tokenizer.cs: Add support for @"litreal strings"
26288
26289         Make tokenizer accept pre-processor directives
26290         on any column (remove the old C-like limitation). 
26291
26292         * rootcontext.cs (EmitCode): Emit any global attributes.
26293         (AddGlobalAttributes): Used to keep track of assembly attributes. 
26294
26295         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
26296
26297         * cs-parser.jay: Add support for global attributes.  
26298
26299 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
26300
26301         * expression.cs (Indirection): New helper class.  Unary will
26302         create Indirection classes to be able to implement the
26303         IMemoryLocation interface on it.
26304
26305 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
26306
26307         * cs-parser.jay (fixed_statement): reference the right statement.
26308
26309         * statement.cs (Fixed.Emit): Finish implementing the fixed
26310         statement for the &x case.
26311
26312 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
26313
26314         * class.cs (Property.Define, Method.Define): Remove newslot when
26315         `implementing'.  
26316
26317         * modifiers.cs: My use of NewSlot when `Abstract' was set was
26318         wrong.  NewSlot should only be used if the `new' keyword is present.
26319
26320         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
26321         locating our system dir.  Sorry about this.
26322
26323 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
26324
26325         * driver.cs (GetSystemDir): Compute correctly the location of our
26326         system assemblies.  I was using the compiler directory instead of
26327         the library directory.
26328
26329 2002-02-13  Ravi Pratap  <ravi@ximian.com>
26330
26331         * expression.cs (BetterFunction): Put back in what Miguel commented out
26332         since it is the correct fix. The problem is elsewhere ;-)
26333
26334         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
26335         parameters of the parms method are themselves compatible or not !
26336
26337         (StandardConversionExists): Fix very dangerous bug where we were forgetting
26338         to check that a class implements an interface before saying that an implicit
26339         conversion was allowed. Use ImplementsInterface to do the checking.
26340
26341 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
26342
26343         * class.cs (Method.Define): Track whether we are an explicit
26344         implementation or not.  And only call DefineMethodOverride if we
26345         are an explicit implementation.
26346
26347         (Property.DefineMethod): Ditto.
26348
26349 2002-02-11  Ravi Pratap  <ravi@ximian.com>
26350
26351         * expression.cs (BetterFunction): Catch hideous bug which was
26352          preventing us from detecting ambiguous calls due to implicit casts i.e
26353         cs0121.
26354
26355 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
26356
26357         * support.cs (Pair): Remove un-needed method.  I figured why I was
26358         getting the error in cs-parser.jay, the variable in a foreach loop
26359         is readonly, and the compiler does not really treat this as a variable.
26360
26361         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
26362         instead of EQUALS in grammar.  
26363
26364         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
26365
26366         * expression.cs (Unary.DoResolve): Check whether the argument is
26367         managed or not.
26368
26369 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
26370
26371         * support.cs: Api for Pair to set a value.  Despite the fact that
26372         the variables are public the MS C# compiler refuses to compile
26373         code that accesses the field if the variable is part of a foreach
26374         statement. 
26375
26376         * statement.cs (Fixed): Begin implementation of the fixed
26377         statement.
26378
26379         (Block.AddVariable): Return the VariableInfo on success and null
26380         on failure instead of true/false. 
26381
26382         * cs-parser.jay (foreach): Catch errors on variables already
26383         defined (we were ignoring this value before) and properly unwind
26384         the block hierarchy
26385
26386         (fixed_statement): grammar for the fixed statement.
26387
26388 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
26389
26390         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
26391         pointer types to be incretemented.
26392
26393         (SizeOf): Implement.
26394
26395         * cs-parser.jay (pointer_member_access): Implement
26396         expr->IDENTIFIER production.
26397
26398         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
26399         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
26400         on safe contexts.
26401
26402         (Unary): Implement indirection.
26403
26404         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
26405         use in non-unsafe context).
26406
26407         (SimpleName.DoResolve): Check for pointers in field access on safe
26408         contexts. 
26409
26410         (Expression.LoadFromPtr): Factor the load-indirect code in this
26411         function.  This was duplicated in UnboxCast and ParameterReference
26412
26413 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
26414
26415         * expression.cs (ComposedCast): report an error if a pointer cast
26416         is used in a safe region.
26417
26418         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
26419         pointer type casts in unsafe context.
26420
26421         * codegen.cs (EmitContext): Set up IsUnsafe.
26422
26423         * cs-parser.jay (non_expression_type): Add productions for pointer
26424         casts. 
26425
26426         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
26427         code.  We should not use force into static mode if the method is
26428         not virtual.  Fixes bug in MIS
26429
26430         * statement.cs (Do.Emit, While.Emit, For.Emit,
26431         Statement.EmitBoolExpression): Add support to Do and While to
26432         propagate infinite loop as `I do return' semantics.
26433
26434         Improve the For case to also test for boolean constants.
26435
26436         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
26437         to the list of attributes we can add.
26438
26439         Remove `EmitContext' argument.
26440
26441         * class.cs (Method.Define): Apply parameter attributes.
26442         (Constructor.Define): Apply parameter attributes.
26443         (MethodCore.LabelParameters): Move here the core of labeling
26444         parameters. 
26445
26446         * support.cs (ReflectionParameters.ParameterModifier,
26447         InternalParameters.ParameterModifier): Use IsByRef on the type and
26448         only return the OUT bit for these parameters instead of in/out/ref
26449         flags.
26450
26451         This is because I miss-understood things.  The ParameterInfo.IsIn
26452         and IsOut represent whether the parameter has the [In] and [Out]
26453         attributes set.  
26454
26455 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
26456
26457         * ecore.cs (FieldExpr.Emit): Release temporaries.
26458
26459         * assign.cs (LocalTemporary.Release): new function.
26460
26461         * codegen.cs (EmitContext.GetTemporaryStorage,
26462         EmitContext.FreeTemporaryStorage): Rework the way we deal with
26463         temporary storage.  Now we can "put back" localbuilders when we
26464         are done with them
26465
26466 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
26467
26468         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
26469         need to make a copy of the variable to generate verifiable code.
26470
26471 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
26472
26473         * driver.cs: Compute dynamically the system directory.
26474
26475         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
26476         Slower, but more generally useful.  Used by the abstract
26477         registering implementation. 
26478
26479         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
26480         the rules for the special rule on Type/instances.  First check if
26481         we have the same name, and if so, try that special static path
26482         rather than the instance path.
26483
26484 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
26485
26486         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
26487         for, while and if.
26488
26489         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
26490         Enum, ValueType, Delegate or Array for non-corlib compiles.
26491
26492         * cs-tokenizer.cs: Catch long identifiers (645)
26493
26494         * typemanager.cs (IndexerPropetyName): Ravi never tested this
26495         piece of code.
26496
26497         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
26498         fix, we were returning too early, so we were not registering
26499         pending methods from abstract classes.
26500
26501         Do not register pending methods if the class is abstract.
26502
26503         * expression.cs (Conditional.DoResolve): Report circular implicit
26504         conversions when we neecd to compute it for conditional
26505         expressions. 
26506
26507         (Is.DoResolve): If the expression is always of the provided type,
26508         flag warning 183.  If the expression can not ever be of the
26509         provided type flag warning 184.
26510
26511         * class.cs: Catch 169 as well.
26512
26513         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
26514         read. 
26515
26516 2002-01-18  Nick Drochak  <ndrochak@gol.com>
26517
26518         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
26519
26520 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
26521
26522         * interface.cs: (PopulateMethod): Check for pointers being defined
26523         only if the unsafe context is active.
26524         (PopulateProperty): ditto.
26525         (PopulateIndexer): ditto.
26526
26527         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
26528         specified.  If pointers are present, make sure that they are
26529         present in an unsafe context.
26530         (Constructor, Constructor.Define): ditto.
26531         (Field, Field.Define): ditto.
26532         (Property, Property.Define): ditto.
26533         (Event, Event.Define): ditto.
26534
26535         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
26536         hashtable if there are classes or structs defined.
26537
26538         * expression.cs (LocalVariableReference.DoResolve): Simplify this
26539         code, as the constant resolution moved.
26540
26541         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
26542         the metadata, so we can flag error 133. 
26543
26544         * decl.cs (MemberCore.UnsafeOK): New function to test that a
26545         pointer is being declared in an unsafe context.
26546
26547 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
26548
26549         * modifiers.cs (Modifiers.Check): Require a Location argument.
26550         Report error 227 for Unsafe use.
26551
26552         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
26553
26554         * statement.cs (For.Emit): If the test is null, then report that
26555         we do `return', as we wont reach anything afterwards.
26556
26557         (Switch.SwitchGoverningType): Track the expression that matched
26558         the conversion.
26559
26560         * driver.cs: Allow negative numbers as an error code to flag.
26561
26562         * cs-parser.jay: Handle 1551.
26563
26564         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
26565
26566 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
26567
26568         * cs-parser.jay: Report 1518 (type declaration can only contain
26569         class, struct, interface, enum or delegate)
26570
26571         (switch_label): Report 1523 (keywords `case' or `default' must
26572         preced code)
26573
26574         (opt_switch_sections): Report 1522 (empty switch)
26575
26576         * driver.cs: Report 1515 (response file specified multiple times)
26577         Report 1516 (Source file specified multiple times).
26578
26579         * expression.cs (Argument.Resolve): Signal 1510
26580
26581         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
26582         access not allowed in static code)
26583
26584 2002-01-11  Ravi Pratap  <ravi@ximian.com>
26585
26586         * typemanager.cs (IsPointerType): Utility method which we are going
26587         to need a lot.
26588
26589         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
26590         the object type, so we take care of that.
26591
26592         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
26593
26594         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
26595         added to non-params parameters :-)
26596
26597         * typemanager.cs (CSharpName): Include 'void' type too. 
26598
26599         (void_ptr_type): Include in the set of core types.
26600
26601         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
26602         duplicating code.
26603
26604         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
26605         an unsafe context.
26606
26607         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
26608         completely forgotten about it.
26609
26610 2002-01-10  Ravi Pratap  <ravi@ximian.com>
26611
26612         * cs-parser.jay (pointer_type): Add. This begins our implementation
26613         of parsing rules for unsafe code.
26614
26615         (unsafe_statement): Implement.
26616
26617         (embedded_statement): Modify to include the above.
26618
26619         * statement.cs (Unsafe): Implement new class for unsafe blocks.
26620
26621         * codegen.cs (EmitContext.InUnsafe): Add. This determines
26622         if the current context is an unsafe one.
26623
26624         * cs-parser.jay (local_variable_pointer_type): Since local variable types
26625         are handled differently, we need separate rules for them.
26626
26627         (local_variable_declaration): Update to use local_variable_pointer_type
26628         to allow variable declarations of unmanaged pointer types.
26629
26630         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
26631         in unsafe contexts.
26632
26633         * ../errors/cs0214.cs : Add.
26634
26635 2002-01-16  Nick Drochak  <ndrochak@gol.com>
26636
26637         * makefile: remove 'response' file when cleaning.
26638
26639 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
26640
26641         * cs-parser.jay: Report 1524.
26642
26643 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
26644
26645         * typemanager.cs (RegisterMethod): drop checking if we have
26646         registered this from here
26647
26648 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
26649
26650         * class.cs (Method.EmitDestructor): Implement calling our base
26651         destructor. 
26652
26653         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
26654         value of InFinally.
26655
26656         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
26657         this routine and will wrap the call in a try/catch block.  Deal
26658         with the case.
26659
26660 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
26661
26662         * ecore.cs (Expression.MemberLookup): instead of taking a
26663         parameter `same_type' that was used to tell whether we could
26664         access private members we compute our containing type from the
26665         EmitContext.
26666
26667         (FieldExpr): Added partial support for volatile fields.  This does
26668         not work for volatile fields exposed from assemblies, as I can not
26669         figure out how to extract the modreq from it.
26670
26671         Updated all the source files to use this.
26672
26673         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
26674         because it is referenced by MemberLookup very often. 
26675
26676 2002-01-09  Ravi Pratap  <ravi@ximian.com>
26677
26678         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
26679         TypeBuilder.GetCustomAttributes to retrieve what we need.
26680
26681         Get rid of redundant default_member_attr_type as this is the same as
26682         default_member_type which already exists.
26683
26684         * interface.cs, attribute.cs : Update accordingly.
26685
26686 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
26687
26688         * typemanager.cs: Enable IndexerPropertyName again.  It does not
26689         work for TYpeBuilders though.  Ravi, can you please fix this?
26690
26691         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
26692
26693         * expression.cs (Argument.Emit): Handle the case of ref objects
26694         being passed to ref functions;  
26695
26696         (ParameterReference.EmitLoad): Loads the content of the pointer
26697         without dereferencing.
26698
26699 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
26700
26701         * cs-tokenizer.cs: Implemented the pre-processing expressions.
26702
26703 2002-01-08  Ravi Pratap  <ravi@ximian.com>
26704
26705         * class.cs (Indexer.DefineMethod): Incorporate the interface
26706         type in the name of the method if we are doing explicit interface
26707         implementation.
26708
26709         * expression.cs (ConversionExists): Remove as it is completely obsolete.
26710
26711         (BetterConversion): Fix extremely trivial bug where we were referring to
26712         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
26713         again !
26714
26715         * ../errors/bug16.cs : Add although we have fixed it.
26716
26717 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
26718
26719         * expression.cs (BaseIndexer): Begin implementation.
26720
26721         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
26722
26723         * cs-parser.jay (indexer_declarator): Use qualified_identifier
26724         production directly to remove a shift/reduce, and implement
26725         explicit interface implementation.
26726
26727         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
26728         after a floating point suffix.
26729
26730         * expression.cs (DoNumericPromotions): Improved the conversion for
26731         uint/uint.  If we have a constant, we avoid doing a typecast to a
26732         larger type.
26733
26734         * class.cs (Indexer): Implement explicit interface implementation
26735         for indexers.
26736
26737 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
26738
26739         * class.cs: make the default instance constructor public and hidebysig.
26740
26741 2001-01-03  Ravi Pratap  <ravi@ximian.com>
26742
26743         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
26744         so we can call it from elsewhere.
26745
26746         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
26747         we emit it internally if the class has a defined indexer; otherwise the user
26748         emits it by decorating the class definition with the DefaultMemberAttribute.
26749
26750         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
26751         attribute is not used on a type which defines an indexer.
26752
26753         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
26754         character when we skip whitespace.
26755
26756         * ../errors/cs0646.cs : Add.
26757
26758 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
26759
26760         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
26761         again. 
26762
26763         * makefile: Add practical target `mcs3.exe' which builds the third
26764         generation compiler. 
26765
26766         * expression.cs (New): Fix structures constructor calling.
26767
26768         * class.cs (Property, Method, Indexer): Emit Final flag on the
26769         method if we are an interface implementation and we are not
26770         abstract. 
26771
26772         * ecore.cs (PropertyExpr): New public field `IsBase', tells
26773         whether this property is referencing a `base' method.
26774
26775         * expression.cs (Invocation.EmitCall): take an extra argument:
26776         is_base, this is used to determine whether the `call' or
26777         `callvirt' opcode should be used.
26778
26779
26780         * delegate.cs: update EmitCall.
26781
26782         * class.cs (Method.Define): Set NewSlot for the cases where we are
26783         not implementing an interface method.
26784
26785         (Property.Define): ditto.
26786
26787 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
26788
26789         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
26790         'r'.  Allows mcs to parse itself fully.
26791
26792 2002-01-02  Ravi Pratap  <ravi@ximian.com>
26793
26794         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
26795         of the number of initializers that require the InitializeArray method.
26796
26797         (CheckIndices): Store the Expression in all cases - not the plain value. Also
26798         update the above field where necessary.
26799
26800         (MakeByteBlob): Update accordingly.
26801
26802         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
26803         greater than 2.
26804
26805         (EmitDynamicInitializers): Update in accordance with the new optimization.
26806
26807         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
26808         same OpCode applies.
26809
26810         * cs-parser.jay : Fix some glaring errors I introduced.
26811
26812 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
26813
26814         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
26815         so that we can check for name clashes there too.
26816
26817         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
26818         for interface indexers.
26819
26820         * interfaces.cs (Define): Emit the default member attribute.
26821
26822         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
26823         variable was being referred to while setting the value ;-)
26824
26825 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
26826
26827         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
26828         byte-by-byte information when we know the data is zero.
26829
26830         Make the block always a multiple of 4, because
26831         DefineInitializedData has a bug.
26832
26833         * assign.cs: Fix, we should assign from the temporary, not from
26834         the source. 
26835
26836         * expression.cs (MakeByteBlob): Fix my incorrect code.
26837
26838 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
26839
26840         * typemanager.cs (EnumToUnderlying): This function is used to get
26841         the underlying type from an enumeration, because it does not
26842         always work. 
26843
26844         * constant.cs: Use the I4_S form for values between -128 and 127.
26845
26846         * statement.cs (Block.LookupLabel): Looks up a label.
26847         (Block): Drop support for labeled blocks.
26848
26849         (LabeledStatement): New kind of statement that represents a label
26850         only.
26851
26852         (Goto): Finally implement this bad boy.
26853
26854         * cs-parser.jay: Update to reflect new mechanism to implement
26855         labels.
26856
26857 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
26858
26859         * codegen.cs (EmitContext.This): a codegen property that keeps the
26860         a single instance of this instead of creating many different this
26861         instances. 
26862
26863         * delegate.cs (Delegate.DoResolve): Update to use the property;
26864
26865         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
26866
26867         * expression.cs (BaseAccess.DoResolve): Ditto.
26868
26869 2001-12-29  Ravi Pratap  <ravi@ximian.com>
26870
26871         * typemanager.cs (methodimpl_attr_type): Add to hold the type
26872         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
26873
26874         (InitCoreTypes): Update accordingly.
26875
26876         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
26877         so we can quickly store the state.
26878
26879         (ApplyAttributes): Set the correct implementation flags
26880         for InternalCall methods.
26881
26882 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
26883
26884         * expression.cs (EmitCall): if a method is not virtual, then do
26885         not use callvirt on it.
26886
26887         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
26888         user defined stuff) requires the use of stobj, which takes an
26889         address on the stack instead of an array and an index.  So emit
26890         the Ldelema operation for it.
26891
26892         (EmitStoreOpcode): Use stobj for valuetypes.
26893
26894         (UnaryMutator.EmitCode): Use the right 1 value depending on
26895         whether we are dealing with int64/uint64, float or doubles.
26896
26897         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
26898         constructors that I implemented last night.
26899
26900         (Constructor.IsDefault): Fix to work properly for static
26901         constructors.
26902
26903         * cs-parser.jay (CheckDef): report method signature errors.
26904         Update error number 103 to be 132.
26905
26906         * decl.cs: New AdditionResult enumeration value: MethodExists.
26907         Although we do this check for methods later on in the semantic
26908         analysis, catching repeated default constructors is so easy that
26909         we catch these here. 
26910
26911         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
26912         promotions code.
26913
26914         (ParameterReference.EmitAssign, Emit): handle
26915         bools as bytes.
26916
26917         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
26918         (ArrayAccess.EmitStoreOpcode): ditto.
26919
26920         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
26921
26922         * expression.cs (MakeByteBlob): Complete all the missing types
26923         (uint, short, ushort, byte, sbyte)
26924
26925         * class.cs: Only init instance field initializers on instance
26926         constructors. 
26927
26928         Rename `constructors' to instance_constructors. 
26929
26930         (TypeContainer.AddConstructor): Only add constructors to the list
26931         if it is not static.
26932
26933         Make sure that we handle default_static_constructor independently
26934         everywhere where we handle instance_constructors
26935
26936 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
26937
26938         * class.cs: Do not lookup or create a base initializer for a
26939         static constructor.
26940
26941         (ConstructorInitializer.Resolve): use the proper type to lookup
26942         for constructors.
26943
26944         * cs-parser.jay: Report error 1585 (modifiers between type and name).
26945
26946         * enum.cs, interface.cs: Remove CloseType, this is taken care by
26947         in DeclSpace. 
26948
26949         * decl.cs: CloseType is now an virtual method, the default
26950         implementation just closes this type.
26951
26952 2001-12-28  Ravi Pratap  <ravi@ximian.com>
26953
26954         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
26955         to PreserveSig by default. Also emit HideBySig on such methods.
26956
26957         Basically, set the defaults to standard values.
26958
26959         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
26960         argument, if candidate is better, it can't be worse than the best !
26961
26962         (Invocation): Re-write bits to differentiate between methods being
26963         applicable in their expanded form and their normal form - for params
26964         methods of course.
26965
26966         Get rid of use_standard everywhere as only standard conversions are allowed
26967         in overload resolution. 
26968
26969         More spec conformance.
26970
26971 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
26972
26973         * driver.cs: Add --timestamp, to see where the compiler spends
26974         most of its time.
26975
26976         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
26977         `this' in static code.
26978
26979         (SimpleName.DoResolve): Implement in terms of a helper function
26980         that allows static-references to be passed upstream to
26981         MemberAccess.
26982
26983         (Expression.ResolveWithSimpleName): Resolve specially simple
26984         names when called by MemberAccess to implement the special
26985         semantics. 
26986
26987         (Expression.ImplicitReferenceConversion): Handle conversions from
26988         Null to reference types before others, as Null's type is
26989         System.Object. 
26990
26991         * expression.cs (Invocation.EmitCall): Handle the special case of
26992         calling methods declared on a reference type from a ValueType
26993         (Base classes System.Object and System.Enum)
26994
26995         (MemberAccess.Resolve): Only perform lookups on Enumerations if
26996         the left hand side is a TypeExpr, not on every enumeration. 
26997
26998         (Binary.Resolve): If types are reference types, then do a cast to
26999         object on operators != and == of both arguments.
27000
27001         * typemanager.cs (FindMembers): Extract instance and static
27002         members if requested.
27003
27004         * interface.cs (PopulateProperty): Use void_type instead of null
27005         as the return type for the setter method.
27006
27007         (PopulateIndexer): ditto.
27008
27009 2001-12-27  Ravi Pratap  <ravi@ximian.com>
27010
27011         * support.cs (ReflectionParameters): Fix minor bug where we
27012         were examining the wrong parameter for the ParamArray attribute.
27013
27014         Cope with requests for the type of the parameter at position
27015         greater than the params parameter's. We now return the element
27016         type of the params array as that makes more sense.
27017
27018         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
27019         accordingly as we no longer have to extract the element type
27020         ourselves.
27021
27022         (Invocation.OverloadResolve): Update.
27023
27024 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
27025
27026         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
27027         against IEnumerator, test whether the return value is a descendant
27028         of the IEnumerator interface.
27029
27030         * class.cs (Indexer.Define): Use an auxiliary method to implement
27031         the other bits of the method definition.  Begin support for
27032         explicit interface implementation.
27033
27034         (Property.DefineMethod): Use TypeManager.void_type instead of null
27035         for an empty return value.
27036
27037 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
27038
27039         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
27040         dealing with a FieldExpr which is composed of a FieldBuilder, in
27041         the code path we did extract the constant, but we should have
27042         obtained the underlying value to be able to cast it (otherwise we
27043         end up in an infinite loop, this is what Ravi was running into).
27044
27045         (ArrayCreation.UpdateIndices): Arrays might be empty.
27046
27047         (MemberAccess.ResolveMemberAccess): Add support for section
27048         14.5.4.1 that deals with the special case of E.I when E is a type
27049         and something else, that I can be a reference to a static member.
27050
27051         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
27052         handle a particular array type to create byte blobs, it is just
27053         something we dont generate byteblobs for.
27054
27055         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
27056         arguments. 
27057
27058         * location.cs (Push): remove the key from the hashtable that we
27059         are about to add.   This happens for empty files.
27060
27061         * driver.cs: Dispose files after we have parsed them.
27062
27063         (tokenize): new function that only runs the tokenizer on its
27064         input, for speed testing.
27065
27066 2001-12-26  Ravi Pratap  <ravi@ximian.com>
27067
27068         * class.cs (Event.Define): Define the private field only if there
27069         are no accessors defined.
27070
27071         * expression.cs (ResolveMemberAccess): If there is no associated
27072         field with the event, that means we have an event defined with its
27073         own accessors and we should flag error cs0070 since transforming
27074         ourselves into a field is not valid in that case.
27075
27076         * ecore.cs (SimpleName.DoResolve): Same as above.
27077
27078         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
27079         and charset to sane values.
27080
27081 2001-12-25  Ravi Pratap  <ravi@ximian.com>
27082
27083         * assign.cs (DoResolve): Perform check on events only if they 
27084         are being accessed outside the declaring type.
27085
27086         * cs-parser.jay (event_declarations): Update rules to correctly
27087         set the type of the implicit parameter etc.
27088
27089         (add_accessor, remove_accessor): Set current local parameters.
27090
27091         * expression.cs (Binary): For delegate addition and subtraction,
27092         cast the return value from the method into the appropriate delegate
27093         type.
27094
27095 2001-12-24  Ravi Pratap  <ravi@ximian.com>
27096
27097         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
27098         of these as the workaround is unnecessary.
27099
27100         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
27101         delegate data - none of that is needed at all.
27102
27103         Re-write bits to extract the instance expression and the delegate method
27104         correctly.
27105
27106         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
27107         on delegates too.
27108
27109         * attribute.cs (ApplyAttributes): New method to take care of common tasks
27110         of attaching attributes instead of duplicating code everywhere.
27111
27112         * everywhere : Update code to do attribute emission using the above method.
27113
27114 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
27115
27116         * expression.cs (IsParamsMethodApplicable): if there are not
27117         parameters, return immediately.
27118
27119         * ecore.cs: The 0 literal can be implicity converted to an enum
27120         type. 
27121
27122         (SimpleName.DoResolve): First lookup the type, then lookup the
27123         members. 
27124
27125         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
27126         want to get its address.  If the InstanceExpression is not
27127         addressable, store the result in a temporary variable, then get
27128         the address of it.
27129
27130         * codegen.cs: Only display 219 errors on warning level or above. 
27131
27132         * expression.cs (ArrayAccess): Make it implement the
27133         IMemoryLocation interface.
27134
27135         (Binary.DoResolve): handle the operator == (object a, object b)
27136         and operator != (object a, object b) without incurring into a
27137         BoxedCast (because 5 != o should never be performed).
27138
27139         Handle binary enumerator operators.
27140
27141         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
27142         value type, otherwise use Ldelem_ref.
27143
27144         Use precomputed names;
27145
27146         (AddressOf): Implement address of
27147
27148         * cs-parser.jay (labeled_statement): Fix recursive block
27149         addition by reworking the production.
27150
27151         * expression.cs (New.DoEmit): New has a special case:
27152                 
27153                  If we are dealing with a ValueType, we have a few
27154                  situations to deal with:
27155                 
27156                     * The target of New is a ValueType variable, that is
27157                       easy, we just pass this as the variable reference
27158                 
27159                     * The target of New is being passed as an argument,
27160                       to a boxing operation or a function that takes a
27161                       ValueType.
27162                 
27163                       In this case, we need to create a temporary variable
27164                       that is the argument of New.
27165
27166
27167 2001-12-23  Ravi Pratap  <ravi@ximian.com>
27168
27169         * rootcontext.cs (LookupType): Check that current_type is not null before
27170         going about looking at nested types.
27171
27172         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
27173         not implement the IAssignMethod interface any more.
27174
27175         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
27176         where we tranform them into FieldExprs if they are being resolved from within
27177         the declaring type.
27178
27179         * ecore.cs (SimpleName.DoResolve): Do the same here.
27180
27181         * assign.cs (DoResolve, Emit): Clean up code considerably. 
27182
27183         * ../errors/bug10.cs : Add.
27184
27185         * ../errors/cs0070.cs : Add.
27186
27187         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
27188
27189         * assign.cs : Get rid of EventIsLocal everywhere.
27190
27191 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
27192
27193         * ecore.cs (ConvertIntLiteral): finished the implementation.
27194
27195         * statement.cs (SwitchLabel): Convert the value we are using as a
27196         key before looking up the table.
27197
27198 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
27199
27200         * codegen.cs (EmitTopBlock): Require a Location argument now.
27201
27202         * cs-parser.jay (constructor_declarator): We need to setup
27203         current_local_parameters before we parse the
27204         opt_constructor_initializer, to allow the variables to be bound
27205         to the constructor arguments.
27206
27207         * rootcontext.cs (LookupType): First lookup nested classes in our
27208         class and our parents before we go looking outside our class.
27209
27210         * expression.cs (ConstantFold): Extract/debox the values at the
27211         beginnning. 
27212
27213         * rootcontext.cs (EmitCode): Resolve the constants first before we
27214         resolve the types.  This is not really needed, but it helps debugging.
27215
27216         * statement.cs: report location.
27217
27218         * cs-parser.jay: pass location to throw statement.
27219
27220         * driver.cs: Small bug fix.
27221
27222         * report.cs: Updated format to be 4-zero filled digits.
27223
27224 2001-12-22  Ravi Pratap  <ravi@ximian.com>
27225
27226         * expression.cs (CheckIndices): Fix minor bug where the wrong
27227         variable was being referred to ;-)
27228
27229         (DoEmit): Do not call EmitStaticInitializers when the 
27230         underlying type is System.Object.
27231
27232 2001-12-21  Ravi Pratap  <ravi@ximian.com>
27233
27234         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
27235         and do the usual workaround for SRE.
27236
27237         * class.cs (MyEventBuilder.EventType): New member to get at the type
27238         of the event, quickly.
27239
27240         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
27241
27242         * assign.cs (Assign.DoResolve): Handle the case when the target
27243         is an EventExpr and perform the necessary checks.
27244
27245         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
27246         interface.
27247
27248         (SimpleName.MemberStaticCheck): Include check for EventExpr.
27249
27250         (EventExpr): Set the type in the constructor itself since we 
27251         are meant to be born fully resolved.
27252
27253         (EventExpr.Define): Revert code I wrote earlier.
27254                 
27255         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
27256         instance expression is null. The instance expression is a This in that case
27257         or a null, depending on whether it is a static method or not.
27258
27259         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
27260         refers to more than one method.
27261
27262         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
27263         and accordingly flag errors.
27264
27265 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
27266
27267         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
27268
27269 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
27270
27271         * location.cs (ToString): Provide useful rutine.
27272
27273 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
27274
27275         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
27276         objects, return the actual integral boxed.
27277
27278         * statement.cs (SwitchLabel): define an ILLabel for each
27279         SwitchLabel. 
27280
27281         (Switch.CheckSwitch): If the value is a Literal, extract
27282         the underlying literal.
27283
27284         Also in the unused hashtable we had, add the SwitchLabel so we can
27285         quickly look this value up.
27286
27287         * constant.cs: Implement a bunch of new constants.  Rewrite
27288         Literal based on this.  Made changes everywhere to adapt to this.
27289
27290         * expression.cs (Expression.MakeByteBlob): Optimize routine by
27291         dereferencing array only once, and also copes with enumrations.
27292
27293         bytes are two bytes wide, not one.
27294
27295         (Cast): Perform constant conversions.
27296
27297         * ecore.cs (TryImplicitIntConversion): Return literals instead of
27298         wrappers to the literals here.
27299
27300         * expression.cs (DoNumericPromotions): long literals can converted
27301         to ulong implicity (this is taken care of elsewhere, but I was
27302         missing this spot).
27303
27304         * ecore.cs (Expression.Literalize): Make the return type Literal,
27305         to improve type checking.
27306
27307         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
27308
27309 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
27310
27311         * literal.cs: Revert code from ravi that checked the bounds.  The
27312         bounds are sane by the definition of the type itself. 
27313
27314         * typemanager.cs: Fix implementation of ImplementsInterface.  We
27315         need to actually look up in our parent hierarchy for interfaces
27316         implemented. 
27317
27318         * const.cs: Use the underlying type for enumerations
27319
27320         * delegate.cs: Compute the basename for the delegate creation,
27321         that should fix the delegate test case, and restore the correct
27322         Type Lookup semantics in rootcontext
27323
27324         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
27325         referencing a nested type with the Reflection API is using the "+"
27326         sign. 
27327
27328         * cs-parser.jay: Do not require EOF token at the end.
27329
27330 2001-12-20  Ravi Pratap  <ravi@ximian.com>
27331
27332         * rootcontext.cs (LookupType): Concatenate type names with
27333         a '.' instead of a '+' The test suite passes again.
27334
27335         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
27336         field of the enumeration.
27337
27338         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
27339         the case when the member is an EventExpr.
27340
27341         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
27342         static has an associated instance expression.
27343
27344         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
27345
27346         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
27347
27348         * class.cs (Event.Define): Register event and perform appropriate checks
27349         for error #111.
27350
27351         We define the Add and Remove methods even if the use provides none because
27352         in that case, we provide default implementations ourselves.
27353
27354         Define a private field of the type of the event. This is done by the CSC compiler
27355         and we should be doing it too ;-)
27356
27357         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
27358         More methods we use in code we generate.
27359
27360         (multicast_delegate_type, delegate_type): Two separate types since the distinction
27361         is important.
27362
27363         (InitCoreTypes): Update accordingly for the above.
27364
27365         * class.cs (Event.Emit): Generate code for default accessors that we provide
27366
27367         (EmitDefaultMethod): Do the job in the above.
27368
27369         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
27370         appropriate place.
27371
27372 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
27373
27374         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
27375         builders even if we were missing one.
27376
27377         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
27378         pass the Basename as our class name instead of the Name.  The
27379         basename will be correctly composed for us.
27380
27381         * parameter.cs (Paramters): Now takes a Location argument.
27382
27383         * decl.cs (DeclSpace.LookupType): Removed convenience function and
27384         make all the code call directly LookupType in RootContext and take
27385         this chance to pass the Location information everywhere.
27386
27387         * Everywhere: pass Location information.
27388
27389 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
27390
27391         * class.cs (Constructor.Define): Updated way of detecting the
27392         length of the parameters.
27393
27394         (TypeContainer.DefineType): Use basename as the type name for
27395         nested types.
27396
27397         (TypeContainer.Define): Do not recursively define types here, as
27398         definition is taken care in order by the RootContext.
27399
27400         * tree.cs: Keep track of namespaces in a per-file basis.
27401
27402         * parameter.cs (Parameter.ComputeSignature): Update to use
27403         DeclSpace. 
27404
27405         (Parameters.GetSignature): ditto.
27406
27407         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
27408         instead of a TypeContainer.
27409
27410         (Interface.SemanticAnalysis): Use `this' instead of our parent to
27411         resolve names.  Because we need to be resolve in our context, not
27412         our parents.
27413
27414         * driver.cs: Implement response files.
27415
27416         * class.cs (TypeContainer.DefineType): If we are defined, do not
27417         redefine ourselves.
27418
27419         (Event.Emit): Emit the code for add/remove handlers.
27420         (Event.Define): Save the MethodBuilders for add/remove.
27421
27422         * typemanager.cs: Use pair here too.
27423
27424         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
27425         DictionaryEntry requires the first argument to be non-null.  
27426
27427         (enum_declaration): Compute full name for registering the
27428         enumeration.
27429
27430         (delegate_declaration): Instead of using
27431         formal_parameter_list, use opt_formal_parameter_list as the list
27432         can be empty.
27433
27434         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
27435         (EventParsing): New property that controls whether `add' and
27436         `remove' are returned as tokens or identifiers (for events);
27437
27438 2001-12-19  Ravi Pratap  <ravi@ximian.com>
27439
27440         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
27441         use MyEventBuilder only and let it wrap the real builder for us.
27442
27443         (MyEventBuilder): Revamp constructor etc.
27444
27445         Implement all operations that we perform on EventBuilder in precisely the same
27446         way here too.
27447
27448         (FindMembers): Update to use the EventBuilder member.
27449
27450         (Event.Emit): Update accordingly.
27451
27452 2001-12-18  Ravi Pratap  <ravi@ximian.com>
27453
27454         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
27455         by calling the appropriate methods.
27456
27457         (GetCustomAttributes): Make stubs as they cannot possibly do anything
27458         useful.
27459
27460         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
27461
27462 2001-12-17  Ravi Pratap  <ravi@ximian.com>
27463
27464         * delegate.cs (Delegate.Populate): Check that the return type
27465         and various parameters types are indeed accessible.
27466
27467         * class.cs (Constructor.Define): Same here.
27468
27469         (Field.Define): Ditto.
27470
27471         (Event.Define): Ditto.
27472
27473         (Operator.Define): Check that the underlying Method defined itself
27474         correctly - so it's MethodBuilder should not be null.
27475
27476         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
27477         expression happens to be null.
27478
27479         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
27480         members but as of now we don't seem to be able to do anything really useful with it.
27481
27482         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
27483         not the EventBuilder.
27484
27485 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
27486
27487         * cs-tokenizer.cs: Add support for defines.
27488         Add support for #if, #elif, #else, #endif
27489
27490         (eval_var): evaluates a variable.
27491         (eval): stubbed for evaluating functions.
27492
27493         * cs-parser.jay: Pass the defines information
27494
27495         * driver.cs: Add --define command line option.
27496
27497         * decl.cs: Move MemberCore here.
27498
27499         Make it the base class for DeclSpace.  This allows us to catch and
27500         report 108 and 109 for everything now.
27501
27502         * class.cs (TypeContainer.Define): Extract all the members
27503         before populating and emit the warning 108 (new keyword required
27504         to override) instead of having each member implement this.
27505
27506         (MemberCore.Define): New abstract method, we will be using this in
27507         the warning reporting engine in Populate.
27508
27509         (Operator.Define): Adjust to new MemberCore protocol. 
27510
27511         * const.cs (Const): This does not derive from Expression, it is a
27512         temporary object we use to create fields, it is a MemberCore. 
27513
27514         * class.cs (Method.Define): Allow the entry point to be in a
27515         specific class.
27516
27517         * driver.cs: Rewrite the argument handler to clean it up a bit.
27518
27519         * rootcontext.cs: Made it just an auxiliary namespace feature by
27520         making everything static.
27521
27522         * driver.cs: Adapt code to use RootContext type name instead of
27523         instance variable.
27524
27525         * delegate.cs: Remove RootContext argument.
27526
27527         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
27528         argument. 
27529
27530         * class.cs (Event.Define): The lookup can fail.
27531
27532         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
27533
27534         * expression.cs: Resolve the this instance before invoking the code.
27535
27536 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
27537
27538         * cs-parser.jay: Add a production in element_access that allows
27539         the thing to become a "type" reference.  This way we can parse
27540         things like "(string [])" as a type.
27541
27542         Note that this still does not handle the more complex rules of
27543         casts. 
27544
27545
27546         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
27547
27548         * ecore.cs: (CopyNewMethods): new utility function used to
27549         assemble the list of methods from running FindMembers.
27550
27551         (MemberLookup): Rework FindMembers so that 
27552
27553 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
27554
27555         * class.cs (TypeContainer): Remove Delegates who fail to be
27556         defined.
27557
27558         * delegate.cs (Populate): Verify that we dont get null return
27559         values.   TODO: Check for AsAccessible.
27560
27561         * cs-parser.jay: Use basename to emit error 574 (destructor should
27562         have the same name as container class), not the full name.
27563
27564         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
27565         possible representation.  
27566
27567         Also implements integer type suffixes U and L.
27568
27569 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
27570
27571         * expression.cs (ArrayCreation.DoResolve): We need to do the
27572         argument resolution *always*.
27573
27574         * decl.cs: Make this hold the namespace.  Hold the root context as
27575         well.
27576         (LookupType): Move here.
27577
27578         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
27579
27580         * location.cs (Row, Name): Fixed the code, it was always returning
27581         references to the first file.
27582
27583         * interface.cs: Register properties defined through interfaces.
27584
27585         * driver.cs: Add support for globbing on the command line
27586
27587         * class.cs (Field): Make it derive from MemberCore as well.
27588         (Event): ditto.
27589
27590 2001-12-15  Ravi Pratap  <ravi@ximian.com>
27591
27592         * class.cs (Event::Define): Check that the type of the event is a delegate
27593         type else flag error #66.
27594
27595         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
27596         same.
27597
27598         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
27599         values of EntryPoint, CharSet etc etc.
27600
27601         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
27602
27603         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
27604         be null and we should ignore this. I am not sure if this is really clean. Apparently,
27605         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
27606         which needs this to do its work.
27607
27608         * ../errors/cs0066.cs : Add.
27609
27610 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
27611
27612         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
27613         helper functions.
27614
27615         * class.cs: (MethodSignature.MethodSignature): Removed hack that
27616         clears out the parameters field.
27617         (MemberSignatureCompare): Cleanup
27618
27619         (MemberCore): New base class used to share code between MethodCore
27620         and Property.
27621
27622         (RegisterRequiredImplementations) BindingFlags.Public requires
27623         either BindingFlags.Instace or Static.  Use instance here.
27624
27625         (Property): Refactored code to cope better with the full spec.
27626
27627         * parameter.cs (GetParameterInfo): Return an empty array instead
27628         of null on error.
27629
27630         * class.cs (Property): Abstract or extern properties have no bodies.
27631
27632         * parameter.cs (GetParameterInfo): return a zero-sized array.
27633
27634         * class.cs (TypeContainer.MethodModifiersValid): Move all the
27635         method modifier validation to the typecontainer so we can reuse
27636         this on properties.
27637
27638         (MethodCore.ParameterTypes): return an empty sized array of types.
27639
27640         (Property.Define): Test property modifier validity.
27641
27642         Add tests for sealed/override too.
27643
27644         (Method.Emit): abstract or extern methods have no bodies.
27645
27646 2001-12-14  Ravi Pratap  <ravi@ximian.com>
27647
27648         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
27649         thing.
27650
27651         (Method::Define, ::Emit): Modify accordingly.
27652
27653         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
27654
27655         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
27656
27657         * makefile: Pass in /unsafe.
27658
27659 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
27660
27661         * class.cs (MakeKey): Kill routine.
27662
27663         * class.cs (TypeContainer.Define): Correctly define explicit
27664         method implementations (they require the full interface name plus
27665         the method name).
27666
27667         * typemanager.cs: Deply the PtrHashtable here and stop using the
27668         lame keys.  Things work so much better.
27669
27670         This of course broke everyone who depended on `RegisterMethod' to
27671         do the `test for existance' test.  This has to be done elsewhere.
27672
27673         * support.cs (PtrHashtable): A hashtable that avoid comparing with
27674         the object stupid Equals method (because, that like fails all over
27675         the place).  We still do not use it.
27676
27677         * class.cs (TypeContainer.SetRequiredInterface,
27678         TypeContainer.RequireMethods): Killed these two routines and moved
27679         all the functionality to RegisterRequiredImplementations.
27680
27681         (TypeContainer.RegisterRequiredImplementations): This routine now
27682         registers all the implementations required in an array for the
27683         interfaces and abstract methods.  We use an array of structures
27684         which can be computed ahead of time to reduce memory usage and we
27685         also assume that lookups are cheap as most classes will not
27686         implement too many interfaces.
27687
27688         We also avoid creating too many MethodSignatures.
27689
27690         (TypeContainer.IsInterfaceMethod): Update and optionally does not
27691         clear the "pending" bit if we find that there are problems with
27692         the declaration.
27693
27694         (TypeContainer.VerifyPendingMethods): Update to report errors of
27695         methods that look like implementations but are not.
27696
27697         (TypeContainer.Define): Add support for explicit interface method
27698         implementation. 
27699
27700 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
27701
27702         * typemanager.cs: Keep track of the parameters here instead of
27703         being a feature of the TypeContainer.
27704
27705         * class.cs: Drop the registration of parameters here, as
27706         InterfaceMethods are also interface declarations.
27707
27708         * delegate.cs: Register methods with the TypeManager not only with
27709         the TypeContainer.  This code was buggy.
27710
27711         * interface.cs: Full registation here.
27712
27713 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
27714
27715         * expression.cs: Remove reducer for binary expressions, it can not
27716         be done this way.
27717
27718         * const.cs: Put here the code that used to go into constant.cs
27719
27720         * constant.cs: Put here the code for constants, this is a new base
27721         class for Literals.
27722
27723         * literal.cs: Make Literal derive from Constant.
27724
27725 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
27726
27727         * statement.cs (Return.Emit): Report error 157 if the user
27728         attempts to return from a finally block.
27729
27730         (Return.Emit): Instead of emitting a return, jump to the end of
27731         the function.
27732
27733         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
27734         LocalBuilder to store the result of the function.  ReturnLabel is
27735         the target where we jump.
27736
27737
27738 2001-12-09  Radek Doulik  <rodo@ximian.com>
27739
27740         * cs-parser.jay: remember alias in current namespace
27741
27742         * ecore.cs (SimpleName::DoResolve): use aliases for types or
27743         namespaces
27744
27745         * class.cs (LookupAlias): lookup alias in my_namespace
27746
27747         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
27748         aliases hashtable
27749         (LookupAlias): lookup alias in this and if needed in parent
27750         namespaces
27751
27752 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
27753
27754         * support.cs: 
27755
27756         * rootcontext.cs: (ModuleBuilder) Made static, first step into
27757         making things static.  I need this to avoid passing the
27758         TypeContainer when calling ParameterType.
27759
27760         * support.cs (InternalParameters.ParameterType): Remove ugly hack
27761         that did string manipulation to compute the type and then call
27762         GetType.  Use Parameter.ParameterType instead.
27763
27764         * cs-tokenizer.cs: Consume the suffix for floating values.
27765
27766         * expression.cs (ParameterReference): figure out whether this is a
27767         reference parameter or not.  Kill an extra variable by computing
27768         the arg_idx during emission.
27769
27770         * parameter.cs (Parameters.GetParameterInfo): New overloaded
27771         function that returns whether a parameter is an out/ref value or not.
27772
27773         (Parameter.ParameterType): The type of the parameter (base,
27774         without ref/out applied).
27775
27776         (Parameter.Resolve): Perform resolution here.
27777         (Parameter.ExternalType): The full type (with ref/out applied).
27778
27779         * statement.cs (Using.Emit, Using.EmitExpression): Implement
27780         support for expressions on the using statement.
27781
27782 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
27783
27784         * statement.cs (Using.EmitLocalVariableDecls): Split the
27785         localvariable handling of the using statement.
27786
27787         (Block.EmitMeta): Keep track of variable count across blocks.  We
27788         were reusing slots on separate branches of blocks.
27789
27790         (Try.Emit): Emit the general code block, we were not emitting it. 
27791
27792         Check the type of the declaration to be an IDisposable or
27793         something that can be implicity converted to it. 
27794
27795         Emit conversions if required.
27796
27797         * ecore.cs (EmptyExpression): New utility class.
27798         (Expression.ImplicitConversionExists): New utility function.
27799
27800 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
27801
27802         * statement.cs (Using): Implement.
27803
27804         * expression.cs (LocalVariableReference): Support read only variables.
27805
27806         * statement.cs: Remove the explicit emit for the Leave opcode.
27807         (VariableInfo): Add a readonly field.
27808
27809 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
27810
27811         * ecore.cs (ConvCast): new class used to encapsulate the various
27812         explicit integer conversions that works in both checked and
27813         unchecked contexts.
27814
27815         (Expression.ConvertNumericExplicit): Use new ConvCast class to
27816         properly generate the overflow opcodes.
27817
27818 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
27819
27820         * statement.cs: The correct type for the EmptyExpression is the
27821         element_type, not the variable type.  Ravi pointed this out.
27822
27823 2001-12-04  Ravi Pratap  <ravi@ximian.com>
27824
27825         * class.cs (Method::Define): Handle PInvoke methods specially
27826         by using DefinePInvokeMethod instead of the usual one.
27827
27828         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
27829         above to do the task of extracting information and defining the method.
27830
27831 2001-12-04  Ravi Pratap  <ravi@ximian.com>
27832
27833         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
27834         of the condition for string type.
27835
27836         (Emit): Move that here. 
27837
27838         (ArrayCreation::CheckIndices): Keep string literals in their expression
27839         form.
27840
27841         (EmitDynamicInitializers): Handle strings appropriately.
27842
27843 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
27844
27845         * codegen.cs (EmitContext): Replace multiple variables with a
27846         single pointer to the current Switch statement.
27847
27848         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
27849         EmitContext.
27850
27851 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
27852
27853         * statement.cs 
27854
27855         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
27856         default'.
27857
27858         (Foreach.Emit): Foreach on arrays was not setting
27859         up the loop variables (for break/continue).
27860
27861         (GotoCase): Semi-implented.
27862
27863 2001-12-03  Ravi Pratap  <ravi@ximian.com>
27864
27865         * attribute.cs (CheckAttribute): Handle system attributes by using
27866         Attribute.GetAttributes to examine information we need.
27867
27868         (GetValidPlaces): Same here.
27869
27870         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
27871
27872         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
27873
27874         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
27875
27876         (Method::Define): Set appropriate flags if we have a DllImport attribute.
27877
27878         (Method::Emit): Handle the case when we are a PInvoke method.
27879
27880 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
27881
27882         * expression.cs: Use ResolveWithSimpleName on compound names.
27883
27884 2001-12-02  Ravi Pratap  <ravi@ximian.com>
27885
27886         * constant.cs (EmitConstant): Make sure we resolve the associated expression
27887         before trying to reduce it.
27888
27889         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
27890
27891         * constant.cs (LookupConstantValue): Implement.
27892
27893         (EmitConstant): Use the above in emitting the constant.
27894
27895         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
27896         that are user-defined by doing a LookupConstantValue on them.
27897
27898         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
27899         too, like above.
27900
27901 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
27902
27903         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
27904
27905         (BaseAccess.DoResolve): Implement.
27906
27907         (MemberAccess.DoResolve): Split this routine into a
27908         ResolveMemberAccess routine that can be used independently
27909
27910 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
27911
27912         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
27913         As that share bits of the implementation.  Is returns a boolean,
27914         while As returns the Type that is being probed.
27915
27916 2001-12-01  Ravi Pratap  <ravi@ximian.com>
27917
27918         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
27919         instead of a Literal - much easier.
27920
27921         (EnumInTransit): Remove - utterly useless :-)
27922
27923         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
27924
27925         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
27926
27927         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
27928         chain when we have no associated expression.
27929
27930 2001-11-30  Ravi Pratap  <ravi@ximian.com>
27931
27932         * constant.cs (Define): Use Location while reporting the errror.
27933
27934         Also emit a warning when 'new' is used and there is no inherited
27935         member to hide.
27936
27937         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
27938         populated.
27939
27940         (LookupEnumValue): Implement to lookup an enum member's value and define it
27941         if necessary.
27942
27943         (Populate): Re-write accordingly to use the above routine.
27944
27945 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
27946
27947         * expression.cs (This): Fix prototype for DoResolveLValue to
27948         override the base class DoResolveLValue.
27949
27950         * cs-parser.cs: Report errors cs574 and cs575 (destructor
27951         declarations) 
27952
27953         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
27954         (we need to load the address of the field here).  This fixes
27955         test-22. 
27956
27957         (FieldExpr.DoResolveLValue): Call the DoResolve
27958         function to initialize the Instance expression.
27959
27960         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
27961         correctly the GetEnumerator operation on a value type.
27962
27963         * cs-parser.jay: Add more simple parsing error catches.
27964
27965         * statement.cs (Switch): Add support for string switches.
27966         Handle null specially.
27967
27968         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
27969
27970 2001-11-28  Ravi Pratap  <ravi@ximian.com>
27971
27972         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
27973
27974         (declare_local_constant): New helper function.
27975
27976         * statement.cs (AddConstant): Keep a separate record of constants
27977
27978         (IsConstant): Implement to determine if a variable is a constant.
27979
27980         (GetConstantExpression): Implement.
27981
27982         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
27983
27984         * statement.cs (IsVariableDefined): Re-write.
27985
27986 2001-11-27  Ravi Pratap  <ravi@ximian.com>
27987
27988         * class.cs (TypeContainer::FindMembers): Look for constants
27989         in the case when we are looking for MemberTypes.Field
27990
27991         * expression.cs (MemberAccess::DoResolve): Check that in the
27992         case we are a FieldExpr and a Literal, we are not being accessed
27993         by an instance reference.
27994
27995         * cs-parser.jay (local_constant_declaration): Implement.
27996
27997         (declaration_statement): Implement for constant declarations.
27998
27999 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
28000
28001         * statement.cs (Switch): Catch double defaults.
28002
28003         (Switch): More work on the switch() statement
28004         implementation.  It works for integral values now, need to finish
28005         string support.
28006
28007
28008 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
28009
28010         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
28011         integer literals into other integer literals.  To be used by
28012         switch. 
28013
28014 2001-11-24  Ravi Pratap  <ravi@ximian.com>
28015
28016         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
28017         some memory.
28018
28019         (EmitDynamicInitializers): Cope with the above since we extract data
28020         directly from ArrayData now.
28021
28022         (ExpectInitializers): Keep track of whether initializers are mandatory
28023         or not.
28024
28025         (Bounds): Make it a hashtable to prevent the same dimension being 
28026         recorded for every element in that dimension.
28027
28028         (EmitDynamicInitializers): Fix bug which prevented the Set array method
28029         from being found.
28030
28031         Also fix bug which was causing the indices to be emitted in the reverse
28032         order.
28033
28034 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
28035
28036         * expression.cs (ArrayCreation): Implement the bits that Ravi left
28037         unfinished.  They do not work, because the underlying code is
28038         sloppy.
28039
28040 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28041
28042         * cs-parser.jay: Remove bogus fixme.
28043
28044         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
28045         on Switch statement.
28046
28047 2001-11-23  Ravi Pratap  <ravi@ximian.com>
28048
28049         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
28050         the same. 
28051
28052         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
28053         parameter. Apparently, any expression is allowed. 
28054
28055         (ValidateInitializers): Update accordingly.
28056
28057         (CheckIndices): Fix some tricky bugs thanks to recursion.
28058
28059         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
28060         I was being completely brain-dead.
28061
28062         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
28063         and re-write acordingly.
28064
28065         (DelegateInvocation): Re-write accordingly.
28066
28067         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
28068
28069         (MakeByteBlob): Handle types more correctly.
28070
28071         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
28072         initialization from expressions but it is incomplete because I am a complete
28073         Dodo :-|
28074
28075 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28076
28077         * statement.cs (If.Emit): Fix a bug that generated incorrect code
28078         on If.  Basically, we have to return `true' (ie, we do return to
28079         our caller) only if both branches of the if return.
28080
28081         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
28082         short-circuit operators, handle them as short circuit operators. 
28083
28084         (Cast.DoResolve): Resolve type.
28085         (Cast.Cast): Take an expression as the target type.
28086
28087         * cs-parser.jay (cast_expression): Remove old hack that only
28088         allowed a limited set of types to be handled.  Now we take a
28089         unary_expression and we resolve to a type during semantic
28090         analysis.
28091
28092         Use the grammar productions from Rhys to handle casts (this is
28093         not complete like Rhys syntax yet, we fail to handle that corner
28094         case that C# has regarding (-x), but we will get there.
28095
28096 2001-11-22  Ravi Pratap  <ravi@ximian.com>
28097
28098         * class.cs (EmitFieldInitializer): Take care of the case when we have a
28099         field which is an array type.
28100
28101         * cs-parser.jay (declare_local_variables): Support array initialization too.
28102
28103         * typemanager.cs (MakeKey): Implement.
28104
28105         (everywhere): Use the above appropriately.
28106
28107         * cs-parser.jay (for_statement): Update for array initialization while
28108         declaring variables.
28109
28110         * ecore.cs : The error message was correct, it's the variable's names that
28111         were misleading ;-) Make the code more readable.
28112
28113         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
28114         the correct type etc.
28115
28116         (ConvertExplicit): Handle Enum types by examining the underlying type.
28117
28118 2001-11-21  Ravi Pratap  <ravi@ximian.com>
28119
28120         * parameter.cs (GetCallingConvention): Always return
28121         CallingConventions.Standard for now.
28122
28123 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28124
28125         * expression.cs (Binary.ResolveOperator): Update the values of `l'
28126         and `r' after calling DoNumericPromotions.
28127
28128         * ecore.cs: Fix error message (the types were in the wrong order).
28129
28130         * statement.cs (Foreach.ProbeCollectionType): Need to pass
28131         BindingFlags.Instance as well 
28132
28133         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
28134         implicit int literal conversion in an empty cast so that we
28135         propagate the right type upstream.
28136
28137         (UnboxCast): new class used to unbox value types.
28138         (Expression.ConvertExplicit): Add explicit type conversions done
28139         by unboxing.
28140
28141         (Expression.ImplicitNumericConversion): Oops, forgot to test for
28142         the target type before applying the implicit LongLiterals to ULong
28143         literal cast.
28144
28145 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
28146
28147         * cs-parser.jay (for_statement): Reworked the way For works: now
28148         we declare manually any variables that are introduced in
28149         for_initializer to solve the problem of having out-of-band code
28150         emition (that is what got for broken).
28151
28152         (declaration_statement): Perform the actual variable declaration
28153         that used to be done in local_variable_declaration here.
28154
28155         (local_variable_declaration): Do not declare anything, just pass
28156         the information on a DictionaryEntry
28157
28158 2001-11-20  Ravi Pratap  <ravi@ximian.com>
28159
28160         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
28161         re-write of the logic to now make it recursive.
28162
28163         (UpdateIndices): Re-write accordingly.
28164
28165         Store element data in a separate ArrayData list in the above methods.
28166
28167         (MakeByteBlob): Implement to dump the array data into a byte array.
28168
28169 2001-11-19  Ravi Pratap  <ravi@ximian.com>
28170
28171         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
28172         into CheckIndices.
28173
28174         * constant.cs (Define): Implement.
28175
28176         (EmitConstant): Re-write fully.
28177
28178         Pass in location info.
28179
28180         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
28181         respectively.
28182
28183         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
28184         DictionaryEntry since we need location info too.
28185
28186         (constant_declaration): Update accordingly.
28187
28188         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
28189         code into another method : UpdateIndices.
28190
28191 2001-11-18  Ravi Pratap  <ravi@ximian.com>
28192
28193         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
28194         some type checking etc.
28195
28196 2001-11-17  Ravi Pratap  <ravi@ximian.com>
28197
28198         * expression.cs (ArrayCreation::ValidateInitializers): Implement
28199         bits to provide dimension info if the user skips doing that.
28200
28201         Update second constructor to store the rank correctly.
28202
28203 2001-11-16  Ravi Pratap  <ravi@ximian.com>
28204
28205         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
28206         and try to implement.
28207
28208         * ../errors/cs0150.cs : Add.
28209
28210         * ../errors/cs0178.cs : Add.
28211
28212 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
28213
28214         * statement.cs: Implement foreach on multi-dimensional arrays. 
28215
28216         * parameter.cs (Parameters.GetParameterByName): Also lookup the
28217         name of the params argument.
28218
28219         * expression.cs: Use EmitStoreOpcode to get the right opcode while
28220         initializing the array.
28221
28222         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
28223         we can use this elsewhere.
28224
28225         * statement.cs: Finish implementation of foreach for single
28226         dimension arrays.
28227
28228         * cs-parser.jay: Use an out-of-band stack to pass information
28229         around, I wonder why I need this.
28230
28231         foreach_block: Make the new foreach_block the current_block.
28232
28233         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
28234         function used to return a static Parameters structure.  Used for
28235         empty parameters, as those are created very frequently.
28236
28237         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
28238
28239 2001-11-15  Ravi Pratap  <ravi@ximian.com>
28240
28241         * interface.cs : Default modifier is private, not public. The
28242         make verify test passes again.
28243
28244 2001-11-15  Ravi Pratap  <ravi@ximian.com>
28245
28246         * support.cs (ReflectionParameters): Fix logic to determine
28247         whether the last parameter is a params one. Test 9 passes again.
28248
28249         * delegate.cs (Populate): Register the builders we define with
28250         RegisterParameterForBuilder. Test 19 passes again.
28251
28252         * cs-parser.jay (property_declaration): Reference $6 instead
28253         of $$ to get at the location.
28254
28255         (indexer_declaration): Similar stuff.
28256
28257         (attribute): Ditto.
28258
28259         * class.cs (Property): Register parameters for the Get and Set methods
28260         if they exist. Test 23 passes again.
28261
28262         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
28263         call to EmitArguments as we are sure there aren't any params arguments. 
28264         Test 32 passes again.
28265
28266         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
28267         IndexOutOfRangeException. 
28268
28269         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
28270         Test 33 now passes again.
28271
28272 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
28273
28274         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
28275         broke a bunch of things.  Will have to come up with a better way
28276         of tracking locations.
28277
28278         * statement.cs: Implemented foreach for single dimension arrays.
28279
28280 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
28281
28282         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
28283         an error.  This removes the lookup from the critical path.
28284
28285         * cs-parser.jay: Removed use of temporary_loc, which is completely
28286         broken. 
28287
28288 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
28289
28290         * support.cs (ReflectionParameters.ParameterModifier): Report
28291         whether the argument is a PARAMS argument or not.
28292
28293         * class.cs: Set the attribute `ParamArrayAttribute' on the
28294         parameter argument.
28295
28296         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
28297         and cons_param_array_attribute (ConstructorInfo for
28298         ParamArrayAttribute)., 
28299
28300         * codegen.cs: Emit the return using the `Return' statement, that
28301         way we can report the error correctly for missing return values. 
28302
28303         * class.cs (Method.Emit): Clean up.
28304
28305         * expression.cs (Argument.Resolve): Take another argument: the
28306         location where this argument is used.  Notice that this is not
28307         part of the "Argument" class as to reduce the size of the
28308         structure (we know the approximate location anyways).
28309
28310         Test if the argument is a variable-reference, if not, then
28311         complain with a 206.
28312
28313         (Argument.Emit): Emit addresses of variables.
28314
28315         (Argument.FullDesc): Simplify.
28316
28317         (Invocation.DoResolve): Update for Argument.Resolve.
28318
28319         (ElementAccess.DoResolve): ditto.
28320
28321         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
28322         method should be virtual, as this method is always virtual.
28323
28324         (NewDelegate.DoResolve): Update for Argument.Resolve.
28325
28326         * class.cs (ConstructorInitializer.DoResolve): ditto.
28327
28328         * attribute.cs (Attribute.Resolve): ditto.
28329
28330 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
28331
28332         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
28333
28334         * expression.cs (ParameterReference): Drop IStackStorage and implement
28335         IAssignMethod instead. 
28336
28337         (LocalVariableReference): ditto.
28338
28339         * ecore.cs (FieldExpr): Drop IStackStorage and implement
28340         IAssignMethod instead. 
28341
28342 2001-11-13  Miguel de Icaza <miguel@ximian.com>
28343
28344         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
28345         enumerations that are used in heavily used structures derive from
28346         byte in a laughable and pathetic attempt to reduce memory usage.
28347         This is the kind of pre-optimzations that you should not do at
28348         home without adult supervision.
28349
28350         * expression.cs (UnaryMutator): New class, used to handle ++ and
28351         -- separatedly from the other unary operators.  Cleans up the
28352         code, and kills the ExpressionStatement dependency in Unary.
28353
28354         (Unary): Removed `method' and `Arguments' from this class, making
28355         it smaller, and moving it all to SimpleCall, so I can reuse this
28356         code in other locations and avoid creating a lot of transient data
28357         strucutres when not required.
28358
28359         * cs-parser.jay: Adjust for new changes.
28360
28361 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
28362
28363         * enum.cs (Enum.Populate): If there is a failure during
28364         definition, return
28365
28366         * cs-parser.jay (opt_enum_base): we used to catch type errors
28367         here, but this is really incorrect.  The type error should be
28368         catched during semantic analysis.
28369
28370 2001-12-11  Ravi Pratap  <ravi@ximian.com>
28371
28372         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
28373         current_local_parameters as expected since I, in my stupidity, had forgotten
28374         to do this :-)
28375
28376         * attribute.cs (GetValidPlaces): Fix stupid bug.
28377
28378         * class.cs (Method::Emit): Perform check on applicability of attributes.
28379
28380         (Constructor::Emit): Ditto.
28381
28382         (Field::Emit): Ditto.
28383
28384         (Field.Location): Store location information.
28385
28386         (Property, Event, Indexer, Operator): Ditto.
28387
28388         * cs-parser.jay (field_declaration): Pass in location for each field.
28389
28390         * ../errors/cs0592.cs : Add.
28391
28392 2001-11-12  Ravi Pratap  <ravi@ximian.com>
28393
28394         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
28395
28396         (InitCoreTypes): Update accordingly.
28397
28398         (RegisterAttrType, LookupAttr): Implement.
28399
28400         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
28401         info about the same.
28402
28403         (Resolve): Update to populate the above as necessary.
28404
28405         (Error592): Helper.
28406
28407         (GetValidPlaces): Helper to the above.
28408
28409         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
28410
28411         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
28412
28413 2001-11-12  Ravi Pratap  <ravi@ximian.com>
28414
28415         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
28416
28417         * ../errors/cs0617.cs : Add.
28418
28419 2001-11-11  Ravi Pratap  <ravi@ximian.com>
28420
28421         * enum.cs (Emit): Rename to Populate to be more consistent with what
28422         we expect it to do and when exactly it is called.
28423
28424         * class.cs, rootcontext.cs : Update accordingly.
28425
28426         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
28427         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
28428
28429         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
28430
28431         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
28432         of a fieldinfo using the above, when dealing with a FieldBuilder.
28433
28434 2001-11-10  Ravi Pratap  <ravi@ximian.com>
28435
28436         * ../errors/cs0031.cs : Add.
28437
28438         * ../errors/cs1008.cs : Add.
28439
28440         * ../errrors/cs0543.cs : Add.
28441
28442         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
28443         enum type.
28444
28445         (FindMembers): Implement.
28446
28447         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
28448         enums and delegates too.
28449
28450         (enum_types): Rename to builder_to_enum.
28451
28452         (delegate_types): Rename to builder_to_delegate.
28453
28454         * delegate.cs (FindMembers): Implement.
28455
28456 2001-11-09  Ravi Pratap  <ravi@ximian.com>
28457
28458         * typemanager.cs (IsEnumType): Implement.
28459
28460         * enum.cs (Emit): Re-write parts to account for the underlying type
28461         better and perform checking etc.
28462
28463         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
28464         of the underlying type.
28465
28466         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
28467         value
28468
28469         * enum.cs (error31): Helper to report error #31.
28470
28471         * cs-parser.jay (enum_declaration): Store location of each member too.
28472
28473         * enum.cs (member_to_location): New hashtable. 
28474
28475         (AddEnumMember): Update location hashtable.
28476
28477         (Emit): Use the location of each member while reporting errors.
28478
28479 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
28480
28481         * cs-parser.jay: A for_initializer if is a
28482         local_variable_declaration really ammount to have an implicit
28483         block with the variable declaration and no initializer for for.
28484
28485         * statement.cs (For.Emit): Cope with null initializers.
28486
28487         This fixes the infinite loop on for initializers.
28488
28489 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
28490
28491         * enum.cs: More cleanup.
28492
28493         * ecore.cs: Remove dead code.
28494
28495         * class.cs (Property.Emit): More simplification.
28496         (Event.Emit): ditto.
28497
28498         Reworked to have less levels of indentation.
28499
28500 2001-11-08  Ravi Pratap  <ravi@ximian.com>
28501
28502         * class.cs (Property): Emit attributes.
28503
28504         (Field): Ditto.
28505
28506         (Event): Ditto.
28507
28508         (Indexer): Ditto.
28509
28510         (Operator): Ditto.
28511
28512         * enum.cs (Emit): Ditto.
28513
28514         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
28515         Enums too.
28516
28517         * class.cs (Field, Event, etc.): Move attribute generation into the
28518         Emit method everywhere.
28519
28520         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
28521         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
28522         as we had no way of defining nested enums !
28523
28524         * rootcontext.cs : Adjust code accordingly.
28525
28526         * typemanager.cs (AddEnumType): To keep track of enum types separately.
28527
28528 2001-11-07  Ravi Pratap  <ravi@ximian.com>
28529
28530         * expression.cs (EvalConstantExpression): Move into ecore.cs
28531
28532         * enum.cs (Enum): Rename some members and make them public and readonly
28533         according to our convention.
28534
28535         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
28536         nothing else.
28537
28538         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
28539
28540         (Enum::Emit): Write a simple version for now which doesn't try to compute
28541         expressions. I shall modify this to be more robust in just a while.
28542
28543         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
28544
28545         (TypeContainer::CloseType): Create the Enum types too.
28546
28547         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
28548
28549         * expression.cs (EvalConstantExpression): Get rid of completely.
28550
28551         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
28552         user-defined values and other cases.
28553
28554         (IsValidEnumLiteral): Helper function.
28555
28556         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
28557         out there in the case we had a literal FieldExpr.
28558
28559         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
28560
28561         (Literalize): Revamp a bit to take two arguments.
28562
28563         (EnumLiteral): New class which derives from Literal to wrap enum literals.
28564
28565 2001-11-06  Ravi Pratap  <ravi@ximian.com>
28566
28567         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
28568
28569         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
28570
28571         (Resolve): Use the above to ensure we have proper initializers.
28572
28573 2001-11-05  Ravi Pratap  <ravi@ximian.com>
28574
28575         * expression.cs (Expression::EvalConstantExpression): New method to 
28576         evaluate constant expressions.
28577
28578         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
28579
28580 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
28581
28582         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
28583         in an array.
28584
28585         (Binary.ResolveOperator): Handle operator != (object a, object b)
28586         and operator == (object a, object b);
28587
28588         (Binary.DoNumericPromotions): Indicate whether the numeric
28589         promotion was possible.
28590
28591         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
28592         Implement.  
28593
28594         Made the ArrayAccess implement interface IAssignMethod instead of
28595         IStackStore as the order in which arguments are passed reflects
28596         this.
28597
28598         * assign.cs: Instead of using expr.ExprClass to select the way of
28599         assinging, probe for the IStackStore/IAssignMethod interfaces.
28600
28601         * typemanager.cs: Load InitializeArray definition.
28602
28603         * rootcontext.cs (RootContext.MakeStaticData): Used to define
28604         static data that can be used to initialize arrays. 
28605
28606 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
28607
28608         * expression.cs: Handle operator== and operator!= for booleans.
28609
28610         (Conditioal.Reduce): Implement reducer for the ?: operator.
28611
28612         (Conditional.Resolve): Implement dead code elimination.
28613
28614         (Binary.Resolve): Catch string literals and return a new
28615         concatenated string.
28616
28617         (Unary.Reduce): Implement reduction of unary expressions.
28618
28619         * ecore.cs: Split out the expression core handling here.
28620
28621         (Expression.Reduce): New method used to perform constant folding
28622         and CSE.  This is needed to support constant-expressions. 
28623
28624         * statement.cs (Statement.EmitBoolExpression): Pass true and false
28625         targets, and optimize for !x.
28626
28627 2001-11-04  Ravi Pratap  <ravi@ximian.com>
28628
28629         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
28630         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
28631         set custom atttributes.
28632
28633         * literal.cs (Literal::GetValue): New abstract method to return the actual
28634         value of the literal, cast as an object.
28635
28636         (*Literal): Implement GetValue method.
28637
28638         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
28639         expressions to the arraylist but objects of type Argument.
28640
28641         * class.cs (TypeContainer::Emit): Emit our attributes too.
28642
28643         (Method::Emit, Constructor::Emit): Ditto.
28644
28645         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
28646         to be ignoring earlier.
28647
28648 2001-11-03  Ravi Pratap  <ravi@ximian.com>
28649
28650         * attribute.cs (AttributeSection::Define): Implement to do the business
28651         of constructing a CustomAttributeBuilder.
28652
28653         (Attribute): New trivial class. Increases readability of code.  
28654
28655         * cs-parser.jay : Update accordingly.
28656
28657         (positional_argument_list, named_argument_list, named_argument): New rules
28658
28659         (attribute_arguments): Use the above so that we are more correct.
28660
28661 2001-11-02  Ravi Pratap  <ravi@ximian.com>
28662
28663         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
28664         to perform all checks for a method with a params parameter.
28665
28666         (Invocation::OverloadResolve): Update to use the above method and therefore
28667         cope correctly with params method invocations.
28668
28669         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
28670         params too.
28671
28672         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
28673         constructors in our parent too because we can't afford to miss out on 
28674         protected ones ;-)
28675
28676         * attribute.cs (AttributeSection): New name for the class Attribute
28677
28678         Other trivial changes to improve readability.
28679
28680         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
28681         use the new class names.
28682
28683 2001-11-01  Ravi Pratap  <ravi@ximian.com>
28684
28685         * class.cs (Method::Define): Complete definition for params types too
28686
28687         (Indexer::Define): Ditto.
28688
28689         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
28690         Cope everywhere with a request for info about the array parameter.
28691
28692 2001-11-01  Ravi Pratap  <ravi@ximian.com>
28693
28694         * tree.cs (RecordNamespace): Fix up to check for the correct key.
28695
28696         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
28697         local_variable_type to extract the string corresponding to the type.
28698
28699         (local_variable_type): Fixup the action to use the new helper method.
28700
28701         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
28702         go.
28703
28704         * expression.cs : Clean out code which uses the above.
28705
28706 2001-10-31  Ravi Pratap  <ravi@ximian.com>
28707
28708         * typemanager.cs (RegisterMethod): Check if we already have an existing key
28709         and bale out if necessary by returning a false.
28710
28711         (RegisterProperty): Ditto.
28712
28713         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
28714         and print out appropriate error messages.
28715
28716         * interface.cs (everywhere): Ditto.
28717
28718         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
28719         location to constructor.
28720
28721         * class.cs (Property, Event, Indexer): Update accordingly.
28722
28723         * ../errors/cs111.cs : Added.
28724
28725         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
28726         of a method, as laid down by the spec.
28727
28728         (Invocation::OverloadResolve): Use the above method.
28729
28730 2001-10-31  Ravi Pratap  <ravi@ximian.com>
28731
28732         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
28733         now take a TypeContainer and a Parameters object.
28734
28735         (ParameterData): Modify return type of ParameterModifier method to be 
28736         Parameter.Modifier and not a string.
28737
28738         (ReflectionParameters, InternalParameters): Update accordingly.
28739
28740         * expression.cs (Argument::GetParameterModifier): Same here.
28741
28742         * support.cs (InternalParameters::ParameterType): Find a better way of determining
28743         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
28744         symbol in it at all so maybe this is only for now.
28745
28746 2001-10-30  Ravi Pratap  <ravi@ximian.com>
28747
28748         * support.cs (InternalParameters): Constructor now takes an extra argument 
28749         which is the actual Parameters class.
28750
28751         (ParameterDesc): Update to provide info on ref/out modifiers.
28752
28753         * class.cs (everywhere): Update call to InternalParameters to pass in
28754         the second argument too.
28755
28756         * support.cs (ParameterData): Add ParameterModifier, which is a method 
28757         to return the modifier info [ref/out etc]
28758
28759         (InternalParameters, ReflectionParameters): Implement the above.
28760
28761         * expression.cs (Argument::ParameterModifier): Similar function to return
28762         info about the argument's modifiers.
28763
28764         (Invocation::OverloadResolve): Update to take into account matching modifiers 
28765         too.
28766
28767         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
28768         a new SetFormalParameters object which we pass to InternalParameters.
28769
28770 2001-10-30  Ravi Pratap  <ravi@ximian.com>
28771
28772         * expression.cs (NewArray): Merge into the ArrayCreation class.
28773
28774 2001-10-29  Ravi Pratap  <ravi@ximian.com>
28775
28776         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
28777         NewUserdefinedArray into one as there wasn't much of a use in having
28778         two separate ones.
28779
28780         * expression.cs (Argument): Change field's name to ArgType from Type.
28781
28782         (Type): New readonly property which returns the proper type, taking into 
28783         account ref/out modifiers.
28784
28785         (everywhere): Adjust code accordingly for the above.
28786
28787         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
28788         whether we are emitting for a ref or out parameter.
28789
28790         * expression.cs (Argument::Emit): Use the above field to set the state.
28791
28792         (LocalVariableReference::Emit): Update to honour the flag and emit the
28793         right stuff.
28794
28795         * parameter.cs (Attributes): Set the correct flags for ref parameters.
28796
28797         * expression.cs (Argument::FullDesc): New function to provide a full desc.
28798
28799         * support.cs (ParameterData): Add method ParameterDesc to the interface.
28800
28801         (ReflectionParameters, InternalParameters): Implement the above method.
28802
28803         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
28804         reporting errors.
28805
28806         (Invocation::FullMethodDesc): Ditto. 
28807
28808 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
28809
28810         * cs-parser.jay: Add extra production for the second form of array
28811         creation. 
28812
28813         * expression.cs (ArrayCreation): Update to reflect the above
28814         change. 
28815
28816         * Small changes to prepare for Array initialization.
28817
28818 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
28819
28820         * typemanager.cs (ImplementsInterface): interface might be null;
28821         Deal with this problem;
28822
28823         Also, we do store negative hits on the cache (null values), so use
28824         this instead of calling t.GetInterfaces on the type everytime.
28825
28826 2001-10-28  Ravi Pratap  <ravi@ximian.com>
28827
28828         * typemanager.cs (IsBuiltinType): New method to help determine the same.
28829
28830         * expression.cs (New::DoResolve): Get rid of array creation code and instead
28831         split functionality out into different classes.
28832
28833         (New::FormArrayType): Move into NewBuiltinArray.
28834
28835         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
28836         quite useless.
28837
28838         (NewBuiltinArray): New class to handle creation of built-in arrays.
28839
28840         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
28841         account creation of one-dimensional arrays.
28842
28843         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
28844
28845         (NewUserdefinedArray::DoResolve): Implement.
28846
28847         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
28848
28849         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
28850         we maintain inside the TypeManager. This is necessary to perform lookups on the
28851         module builder.
28852
28853         (LookupType): Update to perform GetType on the module builders too.     
28854
28855         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
28856
28857         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
28858
28859 2001-10-23  Ravi Pratap  <ravi@ximian.com>
28860
28861         * expression.cs (New::DoResolve): Implement guts of array creation.
28862
28863         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
28864
28865 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
28866
28867         * expression.cs: Fix bug I introduced lsat night that broke
28868         Delegates. 
28869
28870         (Expression.Resolve): Report a 246 error (can not resolve name)
28871         if we find a SimpleName in the stream.
28872
28873         (Expression.ResolveLValue): Ditto.
28874
28875         (Expression.ResolveWithSimpleName): This function is a variant of
28876         ResolveName, this one allows SimpleNames to be returned without a
28877         warning.  The only consumer of SimpleNames is MemberAccess
28878
28879 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
28880
28881         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
28882         might arrive here.  I have my doubts that this is correct.
28883
28884         * statement.cs (Lock): Implement lock statement.
28885
28886         * cs-parser.jay: Small fixes to support `lock' and `using'
28887
28888         * cs-tokenizer.cs: Remove extra space
28889
28890         * driver.cs: New flag --checked, allows to turn on integer math
28891         checking. 
28892
28893         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
28894         Threading.Monitor.Exit 
28895
28896 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
28897
28898         * expression.cs (IndexerAccess::DoResolveLValue): Set the
28899         Expression Class to be IndexerAccess.
28900
28901         Notice that Indexer::DoResolve sets the eclass to Value.
28902
28903 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
28904
28905         * class.cs (TypeContainer::Emit): Emit code for indexers.
28906
28907         * assign.cs (IAssignMethod): New interface implemented by Indexers
28908         and Properties for handling assignment.
28909
28910         (Assign::Emit): Simplify and reuse code. 
28911
28912         * expression.cs (IndexerAccess, PropertyExpr): Implement
28913         IAssignMethod, clean up old code. 
28914
28915 2001-10-22  Ravi Pratap  <ravi@ximian.com>
28916
28917         * typemanager.cs (ImplementsInterface): New method to determine if a type
28918         implements a given interface. Provides a nice cache too.
28919
28920         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
28921         method.
28922
28923         (ConvertReferenceExplicit): Ditto.
28924
28925         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
28926         various methods, with correct names etc.
28927
28928         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
28929         Operator.UnaryNegation.
28930
28931         * cs-parser.jay (operator_declarator): Be a little clever in the case where
28932         we have a unary plus or minus operator.
28933
28934         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
28935         UnaryMinus.
28936
28937         * everywhere : update accordingly.
28938
28939         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
28940         respectively.
28941
28942         * class.cs (Method::Define): For the case where we are implementing a method
28943         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
28944         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
28945
28946 2001-10-21  Ravi Pratap  <ravi@ximian.com>
28947
28948         * interface.cs (FindMembers): Implement to work around S.R.E
28949         lameness.
28950
28951         * typemanager.cs (IsInterfaceType): Implement.
28952
28953         (FindMembers): Update to handle interface types too.
28954
28955         * expression.cs (ImplicitReferenceConversion): Re-write bits which
28956         use IsAssignableFrom as that is not correct - it doesn't work.
28957
28958         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
28959         and accordingly override EmitStatement.
28960
28961         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
28962         using the correct logic :-)
28963
28964 2001-10-19  Ravi Pratap  <ravi@ximian.com>
28965
28966         * ../errors/cs-11.cs : Add to demonstrate error -11 
28967
28968 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
28969
28970         * assign.cs (Assign::Resolve): Resolve right hand side first, and
28971         then pass this as a hint to ResolveLValue.
28972
28973         * expression.cs (FieldExpr): Add Location information
28974
28975         (FieldExpr::LValueResolve): Report assignment to readonly
28976         variable. 
28977
28978         (Expression::ExprClassFromMemberInfo): Pass location information.
28979
28980         (Expression::ResolveLValue): Add new method that resolves an
28981         LValue. 
28982
28983         (Expression::DoResolveLValue): Default invocation calls
28984         DoResolve. 
28985
28986         (Indexers): New class used to keep track of indexers in a given
28987         Type. 
28988
28989         (IStackStore): Renamed from LValue, as it did not really describe
28990         what this did.  Also ResolveLValue is gone from this interface and
28991         now is part of Expression.
28992
28993         (ElementAccess): Depending on the element access type
28994
28995         * typemanager.cs: Add `indexer_name_type' as a Core type
28996         (System.Runtime.CompilerServices.IndexerNameAttribute)
28997
28998         * statement.cs (Goto): Take a location.
28999
29000 2001-10-18  Ravi Pratap  <ravi@ximian.com>
29001
29002         * delegate.cs (Delegate::VerifyDelegate): New method to verify
29003         if two delegates are compatible.
29004
29005         (NewDelegate::DoResolve): Update to take care of the case when
29006         we instantiate a delegate from another delegate.
29007
29008         * typemanager.cs (FindMembers): Don't even try to look up members
29009         of Delegate types for now.
29010
29011 2001-10-18  Ravi Pratap  <ravi@ximian.com>
29012
29013         * delegate.cs (NewDelegate): New class to take care of delegate
29014         instantiation.
29015
29016         * expression.cs (New): Split the delegate related code out into 
29017         the NewDelegate class.
29018
29019         * delegate.cs (DelegateInvocation): New class to handle delegate 
29020         invocation.
29021
29022         * expression.cs (Invocation): Split out delegate related code into
29023         the DelegateInvocation class.
29024
29025 2001-10-17  Ravi Pratap  <ravi@ximian.com>
29026
29027         * expression.cs (New::DoResolve): Implement delegate creation fully
29028         and according to the spec.
29029
29030         (New::DoEmit): Update to handle delegates differently.
29031
29032         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
29033         because of which we were printing out arguments in reverse order !
29034
29035         * delegate.cs (VerifyMethod): Implement to check if the given method
29036         matches the delegate.
29037
29038         (FullDelegateDesc): Implement.
29039
29040         (VerifyApplicability): Implement.
29041
29042         * expression.cs (Invocation::DoResolve): Update to accordingly handle
29043         delegate invocations too.
29044
29045         (Invocation::Emit): Ditto.
29046
29047         * ../errors/cs1593.cs : Added.
29048
29049         * ../errors/cs1594.cs : Added.
29050
29051         * delegate.cs (InstanceExpression, TargetMethod): New properties.
29052
29053 2001-10-16  Ravi Pratap  <ravi@ximian.com>
29054
29055         * typemanager.cs (intptr_type): Core type for System.IntPtr
29056
29057         (InitCoreTypes): Update for the same.
29058
29059         (iasyncresult_type, asynccallback_type): Ditto.
29060
29061         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
29062         correct.
29063
29064         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
29065         too.
29066
29067         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
29068         the builders for the 4 members of a delegate type :-)
29069
29070         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
29071         type.
29072
29073         * expression.cs (New::DoResolve): Implement guts for delegate creation.
29074
29075         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
29076
29077 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
29078
29079         * statement.cs (Break::Emit): Implement.   
29080         (Continue::Emit): Implement.
29081
29082         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29083         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29084         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29085         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
29086         end loop
29087
29088         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
29089         properties that track the label for the current loop (begin of the
29090         loop and end of the loop).
29091
29092 2001-10-15  Ravi Pratap  <ravi@ximian.com>
29093
29094         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
29095         use of emitting anything at all.
29096
29097         * class.cs, rootcontext.cs : Get rid of calls to the same.
29098
29099         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
29100
29101         (Populate): Define the constructor correctly and set the implementation
29102         attributes.
29103
29104         * typemanager.cs (delegate_types): New hashtable to hold delegates that
29105         have been defined.
29106
29107         (AddDelegateType): Implement.
29108
29109         (IsDelegateType): Implement helper method.
29110
29111         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
29112
29113         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
29114         and accordingly handle it.
29115
29116         * delegate.cs (Populate): Take TypeContainer argument.
29117         Implement bits to define the Invoke method. However, I still haven't figured out
29118         how to take care of the native int bit :-(
29119
29120         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
29121         Qualify the name of the delegate, not its return type !
29122
29123         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
29124         conversion.
29125
29126         (StandardConversionExists): Checking for array types turns out to be recursive.
29127
29128         (ConvertReferenceExplicit): Implement array conversion.
29129
29130         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
29131
29132 2001-10-12  Ravi Pratap  <ravi@ximian.com>
29133
29134         * cs-parser.jay (delegate_declaration): Store the fully qualified
29135         name as it is a type declaration.
29136
29137         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
29138         readonly.
29139
29140         (DefineDelegate): Renamed from Define. Does the same thing essentially,
29141         as TypeContainer::DefineType.
29142
29143         (Populate): Method in which all the definition of the various methods (Invoke)
29144         etc is done.
29145
29146         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
29147         see.
29148
29149         (CloseDelegate): Finally creates the delegate.
29150
29151         * class.cs (TypeContainer::DefineType): Update to define delegates.
29152         (Populate, Emit and CloseType): Do the same thing here too.
29153
29154         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
29155         delegates in all these operations.
29156
29157 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
29158
29159         * expression.cs: LocalTemporary: a new expression used to
29160         reference a temporary that has been created.
29161
29162         * assign.cs: Handle PropertyAccess back here, so that we can
29163         provide the proper semantic access to properties.
29164
29165         * expression.cs (Expression::ConvertReferenceExplicit): Implement
29166         a few more explicit conversions. 
29167
29168         * modifiers.cs: `NEW' modifier maps to HideBySig.
29169
29170         * expression.cs (PropertyExpr): Make this into an
29171         ExpressionStatement, and support the EmitStatement code path. 
29172
29173         Perform get/set error checking, clean up the interface.
29174
29175         * assign.cs: recognize PropertyExprs as targets, and if so, turn
29176         them into toplevel access objects.
29177
29178 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
29179
29180         * expression.cs: PropertyExpr::PropertyExpr: use work around the
29181         SRE.
29182
29183         * typemanager.cs: Keep track here of our PropertyBuilders again to
29184         work around lameness in SRE.
29185
29186 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
29187
29188         * expression.cs (LValue::LValueResolve): New method in the
29189         interface, used to perform a second resolution pass for LValues. 
29190
29191         (This::DoResolve): Catch the use of this in static methods.
29192
29193         (This::LValueResolve): Implement.
29194
29195         (This::Store): Remove warning, assigning to `this' in structures
29196         is 
29197
29198         (Invocation::Emit): Deal with invocation of
29199         methods on value types.  We need to pass the address to structure
29200         methods rather than the object itself.  (The equivalent code to
29201         emit "this" for structures leaves the entire structure on the
29202         stack instead of a pointer to it). 
29203
29204         (ParameterReference::DoResolve): Compute the real index for the
29205         argument based on whether the method takes or not a `this' pointer
29206         (ie, the method is static).
29207
29208         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
29209         value types returned from functions when we need to invoke a
29210         method on the sturcture.
29211
29212
29213 2001-10-11  Ravi Pratap  <ravi@ximian.com>
29214
29215         * class.cs (TypeContainer::DefineType): Method to actually do the business of
29216         defining the type in the Modulebuilder or Typebuilder. This is to take
29217         care of nested types which need to be defined on the TypeBuilder using
29218         DefineNestedMethod.
29219
29220         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
29221         methods in RootContext, only ported to be part of TypeContainer.
29222
29223         (TypeContainer::GetInterfaceOrClass): Ditto.
29224
29225         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
29226
29227         * interface.cs (Interface::DefineInterface): New method. Does exactly
29228         what RootContext.CreateInterface did earlier, only it takes care of nested types 
29229         too.
29230
29231         (Interface::GetInterfaces): Move from RootContext here and port.
29232
29233         (Interface::GetInterfaceByName): Same here.
29234
29235         * rootcontext.cs (ResolveTree): Re-write.
29236
29237         (PopulateTypes): Re-write.
29238
29239         * class.cs (TypeContainer::Populate): Populate nested types too.
29240         (TypeContainer::Emit): Emit nested members too.
29241
29242         * typemanager.cs (AddUserType): Do not make use of the FullName property,
29243         instead just use the name argument passed in as it is already fully
29244         qualified.
29245
29246         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
29247         to TypeContainer mapping to see if a type is user-defined.
29248
29249         * class.cs (TypeContainer::CloseType): Implement. 
29250
29251         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
29252         the default constructor.
29253
29254         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
29255         twice.
29256
29257         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
29258
29259         * interface.cs (CloseType): Create the type here.
29260
29261         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
29262         the hierarchy.
29263
29264         Remove all the methods which are now in TypeContainer.
29265
29266 2001-10-10  Ravi Pratap  <ravi@ximian.com>
29267
29268         * delegate.cs (Define): Re-write bits to define the delegate
29269         correctly.
29270
29271 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
29272
29273         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
29274
29275         * expression.cs (ImplicitReferenceConversion): handle null as well
29276         as a source to convert to any reference type.
29277
29278         * statement.cs (Return): Perform any implicit conversions to
29279         expected return type.  
29280
29281         Validate use of return statement.  
29282
29283         * codegen.cs (EmitContext): Pass the expected return type here.
29284
29285         * class.cs (Method, Constructor, Property): Pass expected return
29286         type to EmitContext.
29287
29288 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
29289
29290         * expression.cs: Make DoResolve take an EmitContext instead of a
29291         TypeContainer.
29292
29293         Replaced `l' and `location' for `loc', for consistency.
29294
29295         (Error, Warning): Remove unneeded Tc argument.
29296
29297         * assign.cs, literal.cs, constant.cs: Update to new calling
29298         convention. 
29299
29300         * codegen.cs: EmitContext now contains a flag indicating whether
29301         code is being generated in a static method or not.
29302
29303         * cs-parser.jay: DecomposeQI, new function that replaces the old
29304         QualifiedIdentifier.  Now we always decompose the assembled
29305         strings from qualified_identifier productions into a group of
29306         memberaccesses.
29307
29308 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
29309
29310         * rootcontext.cs: Deal with field-less struct types correctly now
29311         by passing the size option to Define Type.
29312
29313         * class.cs: Removed hack that created one static field. 
29314
29315 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
29316
29317         * statement.cs: Moved most of the code generation here. 
29318
29319 2001-10-09  Ravi Pratap  <ravi@ximian.com>
29320
29321         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
29322         seem very right.
29323
29324         (ElementAccess): Remove useless bits for now - keep checks as the spec
29325         says.
29326
29327 2001-10-08  Ravi Pratap  <ravi@ximian.com>
29328
29329         * expression.cs (ElementAccess::DoResolve): Remove my crap code
29330         and start performing checks according to the spec.
29331
29332 2001-10-07  Ravi Pratap  <ravi@ximian.com>
29333
29334         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
29335         rank_specifiers instead.
29336
29337         (rank_specifiers): Change the order in which the rank specifiers are stored
29338
29339         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
29340
29341         * expression.cs (ElementAccess): Implement the LValue interface too.
29342
29343 2001-10-06  Ravi Pratap  <ravi@ximian.com>
29344
29345         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
29346         except that user defined conversions are not included.
29347
29348         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
29349         perform the conversion of the return type, if necessary.
29350
29351         (New::DoResolve): Check whether we are creating an array or an object
29352         and accordingly do the needful.
29353
29354         (New::Emit): Same here.
29355
29356         (New::DoResolve): Implement guts of array creation.
29357
29358         (New::FormLookupType): Helper function.
29359
29360 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
29361
29362         * codegen.cs: Removed most of the code generation here, and move the
29363         corresponding code generation bits to the statement classes. 
29364
29365         Added support for try/catch/finalize and throw.
29366
29367         * cs-parser.jay: Added support for try/catch/finalize.
29368
29369         * class.cs: Catch static methods having the flags override,
29370         virtual or abstract.
29371
29372         * expression.cs (UserCast): This user cast was not really doing
29373         what it was supposed to do.  Which is to be born in fully resolved
29374         state.  Parts of the resolution were being performed at Emit time! 
29375
29376         Fixed this code.
29377
29378 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
29379
29380         * expression.cs: Implicity convert the result from UserCast.
29381
29382 2001-10-05  Ravi Pratap  <ravi@ximian.com>
29383
29384         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
29385         prevented it from working correctly. 
29386
29387         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
29388         merely ConvertImplicit.
29389
29390 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
29391
29392         * typemanager.cs: Make the LookupTypeContainer function static,
29393         and not per-instance.  
29394
29395         * class.cs: Make static FindMembers (the one that takes a Type
29396         argument). 
29397
29398         * codegen.cs: Add EmitForeach here.
29399
29400         * cs-parser.jay: Make foreach a toplevel object instead of the
29401         inline expansion, as we need to perform semantic analysis on it. 
29402
29403 2001-10-05  Ravi Pratap  <ravi@ximian.com>
29404
29405         * expression.cs (Expression::ImplicitUserConversion): Rename to
29406         UserDefinedConversion.
29407
29408         (Expression::UserDefinedConversion): Take an extra argument specifying 
29409         whether we look for explicit user conversions too.
29410
29411         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
29412
29413         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
29414
29415         (ExplicitUserConversion): Make it a call to UserDefinedConversion
29416         with the appropriate arguments.
29417
29418         * cs-parser.jay (cast_expression): Record location too.
29419
29420         * expression.cs (Cast): Record location info.
29421
29422         (Expression::ConvertExplicit): Take location argument.
29423
29424         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
29425         to determine if we are doing explicit conversions.
29426
29427         (UserCast::Emit): Update accordingly.
29428
29429         (Expression::ConvertExplicit): Report an error if everything fails.
29430
29431         * ../errors/cs0030.cs : Add.
29432
29433 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
29434
29435         * modifiers.cs: If the ABSTRACT keyword is present, also set the
29436         virtual and newslot bits. 
29437
29438         * class.cs (TypeContainer::RegisterRequiredImplementations):
29439         Record methods we need.
29440
29441         (TypeContainer::MakeKey): Helper function to make keys for
29442         MethodBases, since the Methodbase key is useless.
29443
29444         (TypeContainer::Populate): Call RegisterRequiredImplementations
29445         before defining the methods.   
29446
29447         Create a mapping for method_builders_to_methods ahead of time
29448         instead of inside a tight loop.
29449
29450         (::RequireMethods):  Accept an object as the data to set into the
29451         hashtable so we can report interface vs abstract method mismatch.
29452
29453 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
29454
29455         * report.cs: Make all of it static.
29456
29457         * rootcontext.cs: Drop object_type and value_type computations, as
29458         we have those in the TypeManager anyways.
29459
29460         Drop report instance variable too, now it is a global.
29461
29462         * driver.cs: Use try/catch on command line handling.
29463
29464         Add --probe option to debug the error reporting system with a test
29465         suite. 
29466
29467         * report.cs: Add support for exiting program when a probe
29468         condition is reached.
29469
29470 2001-10-03  Ravi Pratap  <ravi@ximian.com>
29471
29472         * expression.cs (Binary::DoNumericPromotions): Fix the case when
29473         we do a forcible conversion regardless of type, to check if 
29474         ForceConversion returns a null.
29475
29476         (Binary::error19): Use location to report error.
29477
29478         (Unary::error23): Use location here too.
29479
29480         * ../errors/cs0019.cs : Check in.
29481
29482         * ../errors/cs0023.cs : Check in.
29483
29484         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
29485         case of a non-null MethodInfo object with a length of 0 !
29486
29487         (Binary::ResolveOperator): Flag error if overload resolution fails to find
29488         an applicable member - according to the spec :-)
29489         Also fix logic to find members in base types.
29490
29491         (Unary::ResolveOperator): Same here.
29492
29493         (Unary::report23): Change name to error23 and make first argument a TypeContainer
29494         as I was getting thoroughly confused between this and error19 :-)
29495
29496         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
29497         (::FindMostEncompassedType): Implement.
29498         (::FindMostEncompassingType): Implement.
29499         (::StandardConversionExists): Implement.
29500
29501         (UserImplicitCast): Re-vamp. We now need info about most specific
29502         source and target types so that we can do the necessary conversions.
29503
29504         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
29505         mathematical union with no duplicates.
29506
29507 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
29508
29509         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
29510         in order from base classes to child classes, so that we can in
29511         child classes look up in our parent for method names and
29512         attributes (required for handling abstract, virtual, new, override
29513         constructs: we need to instrospect our base class, and if we dont
29514         populate the classes in order, the introspection might be
29515         incorrect.  For example, a method could query its parent before
29516         the parent has any methods and would determine that the parent has
29517         no abstract methods (while it could have had them)).
29518
29519         (RootContext::CreateType): Record the order in which we define the
29520         classes.
29521
29522 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
29523
29524         * class.cs (TypeContainer::Populate): Also method definitions can
29525         fail now, keep track of this.
29526
29527         (TypeContainer::FindMembers): Implement support for
29528         DeclaredOnly/noDeclaredOnly flag.
29529
29530         (Constructor::Emit) Return the ConstructorBuilder.
29531
29532         (Method::Emit) Return the MethodBuilder. 
29533         Check for abstract or virtual methods to be public.
29534
29535         * rootcontext.cs (RootContext::CreateType): Register all the
29536         abstract methods required for the class to be complete and the
29537         interface methods that must be implemented. 
29538
29539         * cs-parser.jay: Report error 501 (method requires body if it is
29540         not marked abstract or extern).
29541
29542         * expression.cs (TypeOf::Emit): Implement.
29543
29544         * typemanager.cs: runtime_handle_type, new global type.
29545
29546         * class.cs (Property::Emit): Generate code for properties.
29547
29548 2001-10-02  Ravi Pratap  <ravi@ximian.com>
29549
29550         * expression.cs (Unary::ResolveOperator): Find operators on base type
29551         too - we now conform exactly to the spec.
29552
29553         (Binary::ResolveOperator): Same here.
29554
29555         * class.cs (Operator::Define): Fix minor quirk in the tests.
29556
29557         * ../errors/cs0215.cs : Added.
29558
29559         * ../errors/cs0556.cs : Added.
29560
29561         * ../errors/cs0555.cs : Added.
29562
29563 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
29564
29565         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
29566         single integer which is really efficient
29567
29568 2001-10-01  Ravi Pratap  <ravi@ximian.com>
29569
29570         *  expression.cs (Expression::ImplicitUserConversion): Use location
29571         even in the case when we are examining True operators.
29572  
29573         * class.cs (Operator::Define): Perform extensive checks to conform
29574         with the rules for operator overloading in the spec.
29575
29576         * expression.cs (Expression::ImplicitReferenceConversion): Implement
29577         some of the other conversions mentioned in the spec.
29578
29579         * typemanager.cs (array_type): New static member for the System.Array built-in
29580         type.
29581
29582         (cloneable_interface): For System.ICloneable interface.
29583
29584         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
29585         we start resolving the tree and populating types.
29586
29587         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
29588  
29589 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
29590
29591         * expression.cs (Expression::ExprClassFromMemberInfo,
29592         Expression::Literalize): Create literal expressions from
29593         FieldInfos which are literals.
29594
29595         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
29596         type casts, because they were wrong.  The test suite in tests
29597         caught these ones.
29598
29599         (ImplicitNumericConversion): ushort to ulong requires a widening
29600         cast. 
29601
29602         Int32 constant to long requires widening cast as well.
29603
29604         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
29605         for integers because the type on the stack is not i4.
29606
29607 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
29608
29609         * expression.cs (report118): require location argument. 
29610
29611         * parameter.cs: Do not dereference potential null value.
29612
29613         * class.cs: Catch methods that lack the `new' keyword when
29614         overriding a name.  Report warnings when `new' is used without
29615         anything being there to override.
29616
29617         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
29618
29619         * class.cs: Only add constructor to hashtable if it is non-null
29620         (as now constructors can fail on define).
29621
29622         (TypeManager, Class, Struct): Take location arguments.
29623
29624         Catch field instance initialization in structs as errors.
29625
29626         accepting_filter: a new filter for FindMembers that is static so
29627         that we dont create an instance per invocation.
29628
29629         (Constructor::Define): Catch errors where a struct constructor is
29630         parameterless 
29631
29632         * cs-parser.jay: Pass location information for various new
29633         constructs. 
29634
29635         * delegate.cs (Delegate): take a location argument.
29636
29637         * driver.cs: Do not call EmitCode if there were problesm in the
29638         Definition of the types, as many Builders wont be there. 
29639
29640         * decl.cs (Decl::Decl): Require a location argument.
29641
29642         * cs-tokenizer.cs: Handle properly hex constants that can not fit
29643         into integers, and find the most appropiate integer for it.
29644
29645         * literal.cs: Implement ULongLiteral.
29646
29647         * rootcontext.cs: Provide better information about the location of
29648         failure when CreateType fails.
29649
29650 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
29651
29652         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
29653         as well.
29654
29655         * expression.cs (Binary::CheckShiftArguments): Add missing type
29656         computation.
29657         (Binary::ResolveOperator): Add type to the logical and and logical
29658         or, Bitwise And/Or and Exclusive Or code paths, it was missing
29659         before.
29660
29661         (Binary::DoNumericPromotions): In the case where either argument
29662         is ulong (and most signed types combined with ulong cause an
29663         error) perform implicit integer constant conversions as well.
29664
29665 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
29666
29667         * expression.cs (UserImplicitCast): Method should always be
29668         non-null. 
29669         (Invocation::BetterConversion): Simplified test for IntLiteral.
29670
29671         (Expression::ImplicitNumericConversion): Split this routine out.
29672         Put the code that performs implicit constant integer conversions
29673         here. 
29674
29675         (Expression::Resolve): Become a wrapper around DoResolve so we can
29676         check eclass and type being set after resolve.
29677
29678         (Invocation::Badness): Remove this dead function
29679
29680         (Binary::ResolveOperator): Do not compute the expensive argumnets
29681         unless we have a union for it.
29682
29683         (Probe::Emit): Is needs to do an isinst and then
29684         compare against null.
29685
29686         (::CanConvert): Added Location argument.  If the Location argument
29687         is null (Location.Null), then we do not report errors.  This is
29688         used by the `probe' mechanism of the Explicit conversion.  We do
29689         not want to generate an error for something that the user
29690         explicitly requested to be casted.  But the pipeline for an
29691         explicit cast first tests for potential implicit casts.
29692
29693         So for now, if the Location is null, it means `Probe only' to
29694         avoid adding another argument.   Might have to revise this
29695         strategy later.
29696
29697         (ClassCast): New class used to type cast objects into arbitrary
29698         classes (used in Explicit Reference Conversions).
29699
29700         Implement `as' as well.
29701
29702         Reverted all the patches from Ravi below: they were broken:
29703
29704                 * The use of `level' as a mechanism to stop recursive
29705                   invocations is wrong.  That was there just to catch the
29706                   bug with a strack trace but not as a way of addressing
29707                   the problem.
29708
29709                   To fix the problem we have to *understand* what is going
29710                   on and the interactions and come up with a plan, not
29711                   just get things going.
29712
29713                 * The use of the type conversion cache that I proposed
29714                   last night had an open topic: How does this work across
29715                   protection domains.  A user defined conversion might not
29716                   be public in the location where we are applying the
29717                   conversion, a different conversion might be selected
29718                   (ie, private A->B (better) but public B->A (worse),
29719                   inside A, A->B applies, but outside it, B->A will
29720                   apply).
29721
29722                 * On top of that (ie, even if the above is solved),
29723                   conversions in a cache need to be abstract.  Ie, `To
29724                   convert from an Int to a Short use an OpcodeCast', not
29725                   `To convert from an Int to a Short use the OpcodeCast on
29726                   the variable 5' (which is what this patch was doing).
29727
29728 2001-09-28  Ravi Pratap  <ravi@ximian.com>
29729
29730         * expression.cs (Invocation::ConversionExists): Re-write to use
29731         the conversion cache
29732
29733         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
29734         cache all conversions done, not just user-defined ones.
29735
29736         (Invocation::BetterConversion): The real culprit. Use ConversionExists
29737         to determine if a conversion exists instead of acutually trying to 
29738         perform the conversion. It's faster too.
29739
29740         (Expression::ConvertExplicit): Modify to use ConversionExists to check
29741         and only then attempt the implicit conversion.
29742
29743 2001-09-28  Ravi Pratap  <ravi@ximian.com>
29744
29745         * expression.cs (ConvertImplicit): Use a cache for conversions
29746         already found. Check level of recursion and bail out if necessary.
29747
29748 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
29749
29750         * typemanager.cs (string_concat_string_string, string_concat_object_object):
29751         Export standard methods that we expect for string operations.
29752
29753         * statement.cs (Block::UsageWarning): Track usage of variables and
29754         report the errors for not used variables.
29755
29756         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
29757         operator. 
29758
29759 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
29760
29761         * codegen.cs: remove unnneded code 
29762
29763         * expression.cs: Removed BuiltinTypeAccess class
29764
29765         Fix the order in which implicit conversions are
29766         done.  
29767
29768         The previous fixed dropped support for boxed conversions (adding a
29769         test to the test suite now)
29770
29771         (UserImplicitCast::CanConvert): Remove test for source being null,
29772         that code is broken.  We should not feed a null to begin with, if
29773         we do, then we should track the bug where the problem originates
29774         and not try to cover it up here.
29775
29776         Return a resolved expression of type UserImplicitCast on success
29777         rather than true/false.  Ravi: this is what I was talking about,
29778         the pattern is to use a static method as a "constructor" for
29779         objects. 
29780
29781         Also, do not create arguments until the very last minute,
29782         otherwise we always create the arguments even for lookups that
29783         will never be performed. 
29784
29785         (UserImplicitCast::Resolve): Eliminate, objects of type
29786         UserImplicitCast are born in a fully resolved state. 
29787
29788         * typemanager.cs (InitCoreTypes): Init also value_type
29789         (System.ValueType). 
29790
29791         * expression.cs (Cast::Resolve): First resolve the child expression.
29792
29793         (LValue): Add new method AddressOf to be used by
29794         the `&' operator.  
29795
29796         Change the argument of Store to take an EmitContext instead of an
29797         ILGenerator, because things like FieldExpr need to be able to call
29798         their children expression to generate the instance code. 
29799
29800         (Expression::Error, Expression::Warning): Sugar functions for
29801         reporting errors.
29802
29803         (Expression::MemberLookup): Accept a TypeContainer instead of a
29804         Report as the first argument.
29805
29806         (Expression::ResolvePrimary): Killed.  I still want to improve
29807         this as currently the code is just not right.
29808
29809         (Expression::ResolveMemberAccess): Simplify, but it is still
29810         wrong. 
29811
29812         (Unary::Resolve): Catch errors in AddressOf operators.
29813
29814         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
29815         index to a byte for the short-version, or the compiler will choose
29816         the wrong Emit call, which generates the wrong data.
29817
29818         (ParameterReference::Emit, ::Store): same.
29819
29820         (FieldExpr::AddressOf): Implement.
29821
29822         * typemanager.cs: TypeManager: made public variable instead of
29823         property.
29824
29825         * driver.cs: document --fatal.
29826
29827         * report.cs (ErrorMessage, WarningMessage): new names for the old
29828         Error and Warning classes.
29829
29830         * cs-parser.jay (member_access): Turn built-in access to types
29831         into a normal simplename
29832
29833 2001-09-27  Ravi Pratap  <ravi@ximian.com>
29834
29835         * expression.cs (Invocation::BetterConversion): Fix to cope
29836         with q being null, since this was introducing a bug.
29837
29838         * expression.cs (ConvertImplicit): Do built-in conversions first.
29839
29840 2001-09-27  Ravi Pratap  <ravi@ximian.com>
29841
29842         * expression.cs (UserImplicitCast::Resolve): Fix bug.
29843
29844 2001-09-27  Ravi Pratap  <ravi@ximian.com>
29845
29846         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
29847         I had introduced long ago (what's new ?).
29848
29849         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
29850         the work of all the checking. 
29851         (ConvertImplicit): Call CanConvert and only then create object if necessary.
29852         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
29853
29854         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
29855         that is the right way. 
29856
29857         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
29858         overloading resolution. Use everywhere instead of cutting and pasting code.
29859
29860         (Binary::ResolveOperator): Use MakeUnionSet.
29861
29862         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
29863         we have to convert to bool types. Not complete yet.
29864
29865 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
29866
29867         * typemanager.cs (TypeManager::CSharpName): support ushort.
29868
29869         * expression.cs (Expression::TryImplicitIntConversion): Attempts
29870         to provide an expression that performsn an implicit constant int
29871         conversion (section 6.1.6).
29872         (Expression::ConvertImplicitRequired): Reworked to include
29873         implicit constant expression conversions.
29874
29875         (Expression::ConvertNumericExplicit): Finished.
29876
29877         (Invocation::Emit): If InstanceExpression is null, then it means
29878         that we perform a call on this.
29879
29880 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
29881
29882         * expression.cs (Unary::Emit): Remove some dead code.
29883         (Probe): Implement Resolve and Emit for `is'.
29884         (Expression::ConvertImplicitRequired): Attempt to do constant
29885         expression conversions here.  Maybe should be moved to
29886         ConvertImplicit, but I am not sure.
29887         (Expression::ImplicitLongConstantConversionPossible,
29888         Expression::ImplicitIntConstantConversionPossible): New functions
29889         that tell whether is it possible to apply an implicit constant
29890         expression conversion.
29891
29892         (ConvertNumericExplicit): Started work on explicit numeric
29893         conversions.
29894
29895         * cs-parser.jay: Update operator constants.
29896
29897         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
29898         (Parameters::GetSignature): Hook up VerifyArgs here.
29899         (Parameters::VerifyArgs): Verifies that no two arguments have the
29900         same name. 
29901
29902         * class.cs (Operator): Update the operator names to reflect the
29903         ones that the spec expects (as we are just stringizing the
29904         operator names).
29905
29906         * expression.cs (Unary::ResolveOperator): Fix bug: Use
29907         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
29908         previous usage did only work for our methods.
29909         (Expression::ConvertImplicit): Handle decimal implicit numeric
29910         conversions as well.
29911         (Expression::InternalTypeConstructor): Used to invoke constructors
29912         on internal types for default promotions.
29913
29914         (Unary::Emit): Implement special handling for the pre/post
29915         increment/decrement for overloaded operators, as they need to have
29916         the same semantics as the other operators.
29917
29918         (Binary::ResolveOperator): ditto.
29919         (Invocation::ConversionExists): ditto.
29920         (UserImplicitCast::Resolve): ditto.
29921
29922 2001-09-26  Ravi Pratap  <ravi@ximian.com>
29923
29924         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
29925         operator, return after emitting body. Regression tests pass again !
29926
29927         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
29928         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
29929         (Invocation::OverloadResolve): Ditto.
29930         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
29931
29932         * everywhere : update calls to the above methods accordingly.
29933
29934 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
29935
29936         * assign.cs (Assign): Make it inherit from ExpressionStatement.
29937
29938         * expression.cs (ExpressionStatement): New base class used for
29939         expressions that can appear in statements, so that we can provide
29940         an alternate path to generate expression that do not leave a value
29941         on the stack.
29942
29943         (Expression::Emit, and all the derivatives): We no longer return
29944         whether a value is left on the stack or not.  Every expression
29945         after being emitted leaves a single value on the stack.
29946
29947         * codegen.cs (EmitContext::EmitStatementExpression): Use the
29948         facilties of ExpressionStatement if possible.
29949
29950         * cs-parser.jay: Update statement_expression.
29951
29952 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
29953
29954         * driver.cs: Change the wording of message
29955
29956 2001-09-25  Ravi Pratap  <ravi@ximian.com>
29957
29958         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
29959         the type of the expression to the return type of the method if
29960         we have an overloaded operator match ! The regression tests pass again !
29961         (Unary::ResolveOperator): Ditto.
29962
29963         * expression.cs (Invocation::ConversionExists): Correct the member lookup
29964         to find "op_Implicit", not "implicit" ;-)
29965         (UserImplicitCast): New class to take care of user-defined implicit conversions.
29966         (ConvertImplicit, ForceConversion): Take TypeContainer argument
29967
29968         * everywhere : Correct calls to the above accordingly.
29969
29970         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
29971         (ConvertImplicit): Do user-defined conversion if it exists.
29972
29973 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
29974
29975         * assign.cs: track location.
29976         (Resolve): Use implicit conversions on assignment.
29977
29978         * literal.cs: Oops.  Not good, Emit of short access values should
29979         pass (Bytes) or the wrong argument will be selected.
29980
29981         * expression.cs (Unary::Emit): Emit code for -expr.
29982
29983         (Unary::ResolveOperator): Handle `Substract' for non-constants
29984         (substract from zero from the non-constants).
29985         Deal with Doubles as well. 
29986
29987         (Expression::ConvertImplicitRequired): New routine that reports an
29988         error if no implicit conversion exists. 
29989
29990         (Invocation::OverloadResolve): Store the converted implicit
29991         expressions if we make them
29992
29993 2001-09-24  Ravi Pratap  <ravi@ximian.com>
29994
29995         * class.cs (ConstructorInitializer): Take a Location argument.
29996         (ConstructorBaseInitializer): Same here.
29997         (ConstructorThisInitializer): Same here.
29998
29999         * cs-parser.jay : Update all calls accordingly.
30000
30001         * expression.cs (Unary, Binary, New): Take location argument.
30002         Update accordingly everywhere.
30003
30004         * cs-parser.jay : Update all calls to the above to take a location
30005         argument.
30006
30007         * class.cs : Ditto.
30008
30009 2001-09-24  Ravi Pratap  <ravi@ximian.com>
30010
30011         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
30012         (Invocation::BetterConversion): Same here
30013         (Invocation::ConversionExists): Ditto.
30014
30015         (Invocation::ConversionExists): Implement.
30016
30017 2001-09-22  Ravi Pratap  <ravi@ximian.com>
30018
30019         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
30020         Also take an additional TypeContainer argument.
30021
30022         * All over : Pass in TypeContainer as argument to OverloadResolve.
30023
30024         * typemanager.cs (CSharpName): Update to check for the string type and return
30025         that too.
30026
30027         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
30028         a given method.
30029
30030 2001-09-21  Ravi Pratap  <ravi@ximian.com>
30031
30032         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
30033         (Invocation::BetterFunction): Implement.
30034         (Invocation::BetterConversion): Implement.
30035         (Invocation::ConversionExists): Skeleton, no implementation yet.
30036
30037         Okay, things work fine !
30038
30039 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
30040
30041         * typemanager.cs: declare and load enum_type, delegate_type and
30042         void_type. 
30043
30044         * expression.cs (Expression::Emit): Now emit returns a value that
30045         tells whether a value is left on the stack or not.  This strategy
30046         might be reveted tomorrow with a mechanism that would address
30047         multiple assignments.
30048         (Expression::report118): Utility routine to report mismatches on
30049         the ExprClass.
30050
30051         (Unary::Report23): Report impossible type/operator combination
30052         utility function.
30053
30054         (Unary::IsIncrementableNumber): Whether the type can be
30055         incremented or decremented with add.
30056         (Unary::ResolveOperator): Also allow enumerations to be bitwise
30057         complemented. 
30058         (Unary::ResolveOperator): Implement ++, !, ~,
30059
30060         (Invocation::Emit): Deal with new Emit convetion.
30061
30062         * All Expression derivatives: Updated their Emit method to return
30063         whether they leave values on the stack or not.
30064
30065         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
30066         stack for expressions that are statements. 
30067
30068 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
30069
30070         * expression.cs (LValue): New interface.  Must be implemented by
30071         LValue objects.
30072         (LocalVariableReference, ParameterReference, FieldExpr): Implement
30073         LValue interface.
30074
30075         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
30076         interface for generating code, simplifies the code.
30077
30078 2001-09-20  Ravi Pratap  <ravi@ximian.com>
30079
30080         * expression.cs (everywhere): Comment out return statements in ::Resolve
30081         methods to avoid the warnings.
30082
30083 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
30084
30085         * driver.cs (parse): Report error 2001 if we can not open the
30086         source file.
30087
30088         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
30089         not resolve it.
30090
30091         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
30092         object. 
30093
30094         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
30095         otherwise nested blocks end up with the same index.
30096
30097         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
30098
30099         * expression.cs:  Instead of having FIXMEs in the Resolve
30100         functions, throw exceptions so it is obvious that we are facing a
30101         bug. 
30102
30103         * cs-parser.jay (invocation_expression): Pass Location information.
30104
30105         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
30106         Use a basename for those routines because .NET does not like paths
30107         on them. 
30108
30109         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
30110         already defined.
30111
30112 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
30113
30114         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
30115         are loading the correct data types (throws an exception if not).
30116         (TypeManager::InitCoreTypes): Use CoreLookupType
30117
30118         * expression.cs (Unary::ResolveOperator): return the child
30119         expression for expressions which are just +expr.
30120         (Unary::ResolveOperator): Return negative literals for -LITERAL
30121         expressions (otherwise they are Unary {Literal}).
30122         (Invocation::Badness): Take into account `Implicit constant
30123         expression conversions'.
30124
30125         * literal.cs (LongLiteral): Implement long literal class.
30126         (IntLiteral): export the `Value' of the intliteral. 
30127
30128 2001-09-19  Ravi Pratap  <ravi@ximian.com>
30129
30130         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
30131
30132         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
30133         instead of 'Operator'
30134
30135         * expression.cs (Binary::ResolveOperator): Update accordingly.
30136         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
30137         and 'Minus'
30138
30139         * cs-parser.jay (unary_expression): Update to use the new names.
30140
30141         * gen-treedump.cs (GetUnary): Same here.
30142
30143         * expression.cs (Unary::Resolve): Implement.
30144         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
30145         operators are found instead of making noise ;-)
30146         (Unary::ResolveOperator): New method to do precisely the same thing which
30147         Binary::ResolveOperator does for Binary expressions.
30148         (Unary.method, .Arguments): Add.
30149         (Unary::OperName): Implement.   
30150         (Unary::ForceConversion): Copy and Paste !
30151
30152         * class.cs (Operator::Define): Fix a small bug for the case when we have 
30153         a unary operator.
30154
30155         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
30156         for the inbuilt operators. Only overloading works for now ;-)
30157
30158 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
30159
30160         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
30161         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
30162
30163         * expression.cs (This::Emit): Implement. 
30164         (This::Resolve): Implement.
30165         (TypeOf:Resolve): Implement.
30166         (Expression::ResolveSimpleName): Add an implicit this to instance
30167         field references. 
30168         (MemberAccess::Resolve): Deal with Parameters and Fields. 
30169         Bind instance variable to Field expressions.
30170         (FieldExpr::Instance): New field used to track the expression that
30171         represents the object instance.
30172         (FieldExpr::Resolve): Track potential errors from MemberLookup not
30173         binding 
30174         (FieldExpr::Emit): Implement.
30175
30176         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
30177         the last instruction contains a return opcode to avoid generating
30178         the last `ret' instruction (this generates correct code, and it is
30179         nice to pass the peverify output).
30180
30181         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
30182         initializer for static and instance variables.
30183         (Constructor::Emit): Allow initializer to be null in the case of
30184         static constructors.  Only emit initializer for instance
30185         constructors. 
30186
30187         (TypeContainer::FindMembers): Return a null array if there are no
30188         matches.
30189
30190         Also fix the code for the MemberTypes.Method branch, as it was not
30191         scanning that for operators (or tried to access null variables before).
30192
30193         * assign.cs (Assign::Emit): Handle instance and static fields. 
30194
30195         * TODO: Updated.
30196
30197         * driver.cs: Stop compilation if there are parse errors.
30198
30199         * cs-parser.jay (constructor_declaration): Provide default base
30200         initializer for non-static constructors.
30201         (constructor_declarator): Do not provide a default base
30202         initializers if none was specified.
30203         Catch the fact that constructors should not have parameters.
30204
30205         * class.cs: Do not emit parent class initializers for static
30206         constructors, that should be flagged as an error.
30207
30208 2001-09-18  Ravi Pratap  <ravi@ximian.com>
30209
30210         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
30211         Move back code into TypeContainer::Populate.
30212
30213 2001-09-18  Ravi Pratap  <ravi@ximian.com>
30214
30215         * class.cs (TypeContainer::AddConstructor): Fix the check to
30216         compare against Name, not Basename. 
30217         (Operator::OpType): Change Plus and Minus to Add and Subtract.
30218
30219         * cs-parser.jay : Update accordingly.
30220
30221         * class.cs (TypeContainer::FindMembers): For the case where we are searching
30222         for methods, don't forget to look into the operators too.
30223         (RegisterMethodBuilder): Helper method to take care of this for
30224         methods, constructors and operators.
30225         (Operator::Define): Completely revamp.
30226         (Operator.OperatorMethod, MethodName): New fields.
30227         (TypeContainer::Populate): Move the registering of builders into
30228         RegisterMethodBuilder.
30229         (Operator::Emit): Re-write.
30230
30231         * expression.cs (Binary::Emit): Comment out code path to emit method
30232         invocation stuff for the case when we have a user defined operator. I am
30233         just not able to get it right !
30234
30235 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
30236
30237         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
30238         argument. 
30239
30240         (Expression::MemberLookup): Provide a version that allows to
30241         specify the MemberTypes and BindingFlags. 
30242
30243         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
30244         so it was not fetching variable information from outer blocks.
30245
30246         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
30247         Beforefieldinit as it was buggy.
30248
30249         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
30250         that Ravi put here.  
30251
30252         * class.cs (Constructor::Emit): Only emit if block is not null.
30253         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
30254         deal with this by semantically definining it as if the user had
30255         done it.
30256
30257         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
30258         constructors as we now "emit" them at a higher level.
30259
30260         (TypeContainer::DefineDefaultConstructor): Used to define the
30261         default constructors if none was provided.
30262
30263         (ConstructorInitializer): Add methods Resolve and Emit. 
30264
30265         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
30266
30267 2001-09-17  Ravi Pratap  <ravi@ximian.com>
30268
30269         * class.cs (TypeContainer::EmitDefaultConstructor): Register
30270         the default constructor builder with our hashtable for methodbuilders
30271         to methodcores.
30272
30273         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
30274         and argument_count is 0 in which case we have a match.
30275         (Binary::ResolveOperator): More null checking and miscellaneous coding
30276         style cleanup.
30277
30278 2001-09-17  Ravi Pratap  <ravi@ximian.com>
30279
30280         * rootcontext.cs (IsNameSpace): Compare against null.
30281
30282         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
30283
30284         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
30285         and Unary::Operator.
30286
30287         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
30288         accordingly.
30289
30290         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
30291         we have overloaded operators.
30292         (Binary::ResolveOperator): Implement the part which does the operator overload
30293         resolution.
30294
30295         * class.cs (Operator::Emit): Implement.
30296         (TypeContainer::Emit): Emit the operators we have too.
30297
30298         * expression.cs (Binary::Emit): Update to emit the appropriate code for
30299         the case when we have a user-defined operator.
30300
30301 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
30302
30303         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
30304
30305 2001-09-16  Ravi Pratap  <ravi@ximian.com>
30306
30307         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
30308         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
30309         (Constructor::Emit): Implement.
30310         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
30311         if we have no work to do. 
30312         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
30313         Emit method.
30314
30315         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
30316         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
30317
30318         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
30319         of parent.parent.
30320
30321 2001-09-15  Ravi Pratap  <ravi@ximian.com>
30322
30323         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
30324         in the source.
30325         (Tree::RecordNamespace): Method to do what the name says ;-)
30326         (Tree::Namespaces): Property to get at the namespaces hashtable.
30327
30328         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
30329         keep track.
30330
30331         * rootcontext.cs (IsNamespace): Fixed it :-)
30332
30333 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
30334
30335         * class.cs (TypeContainer::FindMembers): Add support for
30336         constructors. 
30337         (MethodCore): New class that encapsulates both the shared aspects
30338         of a Constructor and a Method.  
30339         (Method, Constructor): Factored pieces into MethodCore.
30340
30341         * driver.cs: Added --fatal which makes errors throw exceptions.
30342         Load System assembly as well as part of the standard library.
30343
30344         * report.cs: Allow throwing exceptions on errors for debugging.
30345
30346         * modifiers.cs: Do not use `parent', instead use the real type
30347         container to evaluate permission settings.
30348
30349         * class.cs: Put Ravi's patch back in.  He is right, and we will
30350         have to cope with the
30351
30352 2001-09-14  Ravi Pratap  <ravi@ximian.com>
30353
30354         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
30355         FamORAssem, not FamANDAssem.
30356
30357 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
30358
30359         * driver.cs: Added --parse option that only parses its input files
30360         and terminates.
30361
30362         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
30363         incorrect.  IsTopLevel is not used to tell whether an object is
30364         root_types or not (that can be achieved by testing this ==
30365         root_types).  But to see if this is a top-level *class* (not
30366         necessarly our "toplevel" container). 
30367
30368 2001-09-14  Ravi Pratap  <ravi@ximian.com>
30369
30370         * enum.cs (Enum::Define): Modify to call the Lookup method on the
30371         parent instead of a direct call to GetType.
30372
30373 2001-09-14  Ravi Pratap  <ravi@ximian.com>
30374
30375         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
30376         Modifiers.TypeAttr. This should just be a call to that method.
30377
30378         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
30379         object so that we can determine if we are top-level or not.
30380
30381         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
30382         TypeContainer too.
30383
30384         * enum.cs (Enum::Define): Ditto.
30385
30386         * modifiers.cs (FieldAttr): Re-write.
30387
30388         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
30389         (TypeContainer::HaveStaticConstructor): New property to provide access
30390         to precisely that info.
30391
30392         * modifiers.cs (MethodAttr): Re-write.
30393         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
30394
30395         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
30396         of top-level types as claimed.
30397
30398 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
30399
30400         * expression.cs (MemberLookup): Fruitless attempt to lookup
30401         constructors.  Maybe I need to emit default constructors?  That
30402         might be it (currently .NET emits this for me automatically).
30403         (Invocation::OverloadResolve): Cope with Arguments == null.
30404         (Invocation::EmitArguments): new function, shared by the new
30405         constructor and us.
30406         (Invocation::Emit): Handle static and instance methods.  Emit
30407         proper call instruction for virtual or non-virtual invocations.
30408         (New::Emit): Implement.
30409         (New::Resolve): Implement.
30410         (MemberAccess:Resolve): Implement.
30411         (MethodGroupExpr::InstanceExpression): used conforming to the spec
30412         to track instances.
30413         (FieldExpr::Resolve): Set type.
30414
30415         * support.cs: Handle empty arguments.
30416                 
30417         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
30418         SimpleLookup): Auxiliary routines to help parse a qualifier
30419         identifier.  
30420
30421         Update qualifier_identifier rule.
30422
30423         * codegen.cs: Removed debugging messages.
30424
30425         * class.cs: Make this a global thing, this acts just as a "key" to
30426         objects that we might have around.
30427
30428         (Populate): Only initialize method_builders_to_methods once.
30429
30430         * expression.cs (PropertyExpr): Initialize type from the
30431         PropertyType. 
30432
30433         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
30434         Resolve pattern.  Attempt to implicitly convert value to boolean.
30435         Emit code.
30436
30437         * expression.cs: Set the type for the int32/int32 argument case.
30438         (Binary::ResolveOperator): Set the return type to boolean for
30439         comparission operators
30440
30441         * typemanager.cs: Remove debugging print code.
30442
30443         (Invocation::Resolve): resolve type.
30444
30445         * class.cs: Allocate a MemberInfo of the correct size, as the code
30446         elsewhere depends on the test to reflect the correct contents.
30447
30448         (Method::) Keep track of parameters, due to System.Reflection holes
30449
30450         (TypeContainer::Populate): Keep track of MethodBuilders to Method
30451         mapping here.
30452
30453         (TypeContainer::FindMembers): Use ArrayList and then copy an array
30454         of the exact size and return that.
30455
30456         (Class::LookupMethodByBuilder): New function that maps
30457         MethodBuilders to its methods.  Required to locate the information
30458         on methods because System.Reflection bit us again.
30459
30460         * support.cs: New file, contains an interface ParameterData and
30461         two implementations: ReflectionParameters and InternalParameters
30462         used to access Parameter information.  We will need to grow this
30463         as required.
30464
30465         * expression.cs (Invocation::GetParameterData): implement a cache
30466         and a wrapper around the ParameterData creation for methods. 
30467         (Invocation::OverloadResolve): Use new code.
30468
30469 2001-09-13  Ravi Pratap  <ravi@ximian.com>
30470
30471         * class.cs (TypeContainer::EmitField): Remove and move into 
30472         (Field::Define): here and modify accordingly.
30473         (Field.FieldBuilder): New member.
30474         (TypeContainer::Populate): Update accordingly.
30475         (TypeContainer::FindMembers): Implement.
30476
30477 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
30478
30479         * statement.cs: (VariableInfo::VariableType): New field to be
30480         initialized with the full type once it is resolved. 
30481
30482 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
30483
30484         * parameter.cs (GetParameterInfo): Use a type cache to compute
30485         things only once, and to reuse this information
30486
30487         * expression.cs (LocalVariableReference::Emit): Implement.
30488         (OpcodeCast::Emit): fix.
30489
30490         (ParameterReference::Resolve): Implement.
30491         (ParameterReference::Emit): Implement.
30492
30493         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
30494         that are expressions need to stay as Expressions.
30495
30496         * typemanager.cs (CSharpName): Returns the C# name of a type if
30497         possible. 
30498
30499         * expression.cs (Expression::ConvertImplicit): New function that
30500         implements implicit type conversions.
30501
30502         (Expression::ImplicitReferenceConversion): Implements implicit
30503         reference conversions.
30504
30505         (EmptyCast): New type for transparent casts.
30506
30507         (OpcodeCast): New type for casts of types that are performed with
30508         a sequence of bytecodes.
30509
30510         (BoxedCast): New type used for casting value types into reference
30511         types.  Emits a box opcode.
30512
30513         (Binary::DoNumericPromotions): Implements numeric promotions of
30514         and computation of the Binary::Type.
30515
30516         (Binary::EmitBranchable): Optimization.
30517
30518         (Binary::Emit): Implement code emission for expressions.
30519
30520         * typemanager.cs (TypeManager): Added two new core types: sbyte
30521         and byte.
30522
30523 2001-09-12  Ravi Pratap  <ravi@ximian.com>
30524
30525         * class.cs (TypeContainer::FindMembers): Method which does exactly
30526         what Type.FindMembers does, only we don't have to use reflection. No
30527         implementation yet.
30528
30529         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
30530         typecontainer objects as we need to get at them.
30531         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
30532
30533         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
30534         typecontainer object.
30535
30536         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
30537         of just a Report object.
30538
30539 2001-09-11  Ravi Pratap  <ravi@ximian.com>
30540
30541         * class.cs (Event::Define): Go back to using the prefixes "add_" and
30542         "remove_"
30543         (TypeContainer::Populate): Now define the delegates of the type too.
30544         (TypeContainer.Delegates): Property to access the list of delegates defined
30545         in the type.
30546
30547         * delegates.cs (Delegate::Define): Implement partially.
30548
30549         * modifiers.cs (TypeAttr): Handle more flags.
30550
30551 2001-09-11  Ravi Pratap  <ravi@ximian.com>
30552
30553         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
30554         and not <=
30555         (Operator::Define): Re-write logic to get types by using the LookupType method
30556         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
30557         (Indexer::Define): Ditto.
30558         (Event::Define): Ditto.
30559         (Property::Define): Ditto.
30560
30561 2001-09-10  Ravi Pratap  <ravi@ximian.com>
30562
30563         * class.cs (TypeContainer::Populate): Now define operators too. 
30564         (TypeContainer.Operators): New property to access the list of operators
30565         in a type.
30566         (Operator.OperatorMethodBuilder): New member to hold the method builder
30567         for the operator we are defining.
30568         (Operator::Define): Implement.
30569
30570 2001-09-10  Ravi Pratap  <ravi@ximian.com>
30571
30572         * class.cs (Event::Define): Make the prefixes of the accessor methods
30573         addOn_ and removeOn_ 
30574
30575         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
30576         of the location being passed in too. Ideally, this should go later since all
30577         error reporting should be done through the Report object.
30578
30579         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
30580         (Populate): Iterate thru the indexers we have and define them too.
30581         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
30582         for the get and set accessors.
30583         (Indexer::Define): Implement.
30584
30585 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
30586
30587         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
30588         my previous implementation, did not work.
30589
30590         * typemanager.cs: Add a couple of missing types (the longs).
30591
30592         * literal.cs: Use TypeManager.bool_type instead of getting it.
30593
30594         * expression.cs (EventExpr): New kind of expressions.
30595         (Expressio::ExprClassFromMemberInfo): finish
30596
30597 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
30598
30599         * assign.cs: Emit stores to static fields differently.
30600
30601 2001-09-08  Ravi Pratap  <ravi@ximian.com>
30602
30603         * Merge in changes and adjust code to tackle conflicts. Backed out my
30604         code in Assign::Resolve ;-) 
30605
30606 2001-09-08  Ravi Pratap  <ravi@ximian.com>
30607
30608         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
30609         instead Report.Error and also pass in the location.
30610         (CSharpParser::Lexer): New readonly property to return the reference
30611         to the Tokenizer object.
30612         (declare_local_variables): Use Report.Error with location instead of plain 
30613         old error.
30614         (CheckDef): Ditto.
30615
30616         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
30617         (Operator.CheckBinaryOperator): Ditto.
30618
30619         * cs-parser.jay (operator_declarator): Update accordingly.
30620
30621         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
30622         (CheckBinaryOperator): Same here.
30623
30624         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
30625         on the name without any prefixes of namespace names etc. This is because we
30626         already might have something already fully qualified like 
30627         'System.Console.WriteLine'
30628
30629         * assign.cs (Resolve): Begin implementation. Stuck ;-)
30630
30631 2001-09-07  Ravi Pratap  <ravi@ximian.com>
30632
30633         * cs-tokenizer.cs (location): Return a string which also contains
30634         the file name.
30635
30636         * expression.cs (ElementAccess): New class for expressions of the
30637         type 'element access.'
30638         (BaseAccess): New class for expressions of the type 'base access.'
30639         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
30640         respectively.
30641
30642         * cs-parser.jay (element_access): Implement action.
30643         (base_access): Implement actions.
30644         (checked_expression, unchecked_expression): Implement.
30645
30646         * cs-parser.jay (local_variable_type): Correct and implement.
30647         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
30648
30649         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
30650
30651         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
30652         name and the specifiers.
30653
30654         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
30655
30656         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
30657         making them all public ;-)
30658
30659         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
30660         class anyways.
30661
30662 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
30663
30664         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
30665         PropertyExprs.
30666         (FieldExpr, PropertyExprs): New resolved expressions.
30667         (SimpleName::MemberStaticCheck): Perform static checks for access
30668         to non-static fields on static methods. Maybe this should be
30669         generalized for MemberAccesses. 
30670         (SimpleName::ResolveSimpleName): More work on simple name
30671         resolution. 
30672
30673         * cs-parser.jay (primary_expression/qualified_identifier): track
30674         the parameter index.
30675
30676         * codegen.cs (CodeGen::Save): Catch save exception, report error.
30677         (EmitContext::EmitBoolExpression): Chain to expression generation
30678         instead of temporary hack.
30679         (::EmitStatementExpression): Put generic expression code generation.
30680
30681         * assign.cs (Assign::Emit): Implement variable assignments to
30682         local variables, parameters and fields.
30683
30684 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
30685
30686         * statement.cs (Block::GetVariableInfo): New method, returns the
30687         VariableInfo for a variable name in a block.
30688         (Block::GetVariableType): Implement in terms of GetVariableInfo
30689
30690         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
30691         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
30692
30693 2001-09-06  Ravi Pratap  <ravi@ximian.com>
30694
30695         * cs-parser.jay (operator_declaration): Continue on my quest : update
30696         to take attributes argument.
30697         (event_declaration): Ditto.
30698         (enum_declaration): Ditto.
30699         (indexer_declaration): Ditto.
30700
30701         * class.cs (Operator::Operator): Update constructor accordingly.
30702         (Event::Event): Ditto.
30703
30704         * delegate.cs (Delegate::Delegate): Same here.
30705
30706         * enum.cs (Enum::Enum): Same here.
30707
30708 2001-09-05  Ravi Pratap  <ravi@ximian.com>
30709
30710         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
30711
30712         * ../tests/cs0658.cs : New file to demonstrate error 0658.
30713
30714         * attribute.cs (Attributes): New class to encapsulate all attributes which were
30715         being passed around as an arraylist.
30716         (Attributes::AddAttribute): Method to add attribute sections.
30717
30718         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
30719         (struct_declaration): Update accordingly.
30720         (constant_declaration): Update.
30721         (field_declaration): Update.
30722         (method_header): Update.
30723         (fixed_parameter): Update.
30724         (parameter_array): Ditto.
30725         (property_declaration): Ditto.
30726         (destructor_declaration): Ditto.
30727
30728         * class.cs (Struct::Struct): Update constructors accordingly.
30729         (Class::Class): Ditto.
30730         (Field::Field): Ditto.
30731         (Method::Method): Ditto.
30732         (Property::Property): Ditto.
30733         (TypeContainer::OptAttribute): update property's return type.
30734
30735         * interface.cs (Interface.opt_attributes): New member.
30736         (Interface::Interface): Update to take the extra Attributes argument.
30737
30738         * parameter.cs (Parameter::Parameter): Ditto.
30739
30740         * constant.cs (Constant::Constant): Ditto.
30741
30742         * interface.cs (InterfaceMemberBase): New OptAttributes field.
30743         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
30744         the attributes as a parameter.
30745         (InterfaceProperty): Update constructor call.
30746         (InterfaceEvent): Ditto.
30747         (InterfaceMethod): Ditto.
30748         (InterfaceIndexer): Ditto.
30749
30750         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
30751         pass the attributes too.
30752         (interface_event_declaration): Ditto.
30753         (interface_property_declaration): Ditto.
30754         (interface_method_declaration): Ditto.
30755         (interface_declaration): Ditto.
30756
30757 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
30758
30759         * class.cs (Method::Define): Track the "static Main" definition to
30760         create an entry point. 
30761
30762         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
30763         EntryPoint if we find it. 
30764
30765         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
30766         (EmitContext::ig): Make this variable public.
30767
30768         * driver.cs: Make the default output file be the first file name
30769         with the .exe extension.  
30770
30771         Detect empty compilations
30772
30773         Handle various kinds of output targets.  Handle --target and
30774         rename -t to --dumper.
30775
30776         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
30777         methods inherited from Expression return now an Expression.  This
30778         will is used during the tree rewriting as we resolve them during
30779         semantic analysis.
30780
30781         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
30782         the spec.  Missing entirely is the information about
30783         accessability of elements of it.
30784
30785         (Expression::ExprClassFromMemberInfo): New constructor for
30786         Expressions that creates a fully initialized Expression based on
30787         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
30788         a Type.
30789
30790         (Invocation::Resolve): Begin implementing resolution of invocations.
30791
30792         * literal.cs (StringLiteral):  Implement Emit.
30793
30794 2001-09-05  Ravi Pratap  <ravi@ximian.com>
30795
30796         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
30797         member.
30798
30799 2001-09-04  Ravi Pratap  <ravi@ximian.com>
30800
30801         * cs-parser.jay (attribute_arguments): Implement actions.
30802         (attribute): Fix bug in production. Implement action.
30803         (attribute_list): Implement.
30804         (attribute_target): Implement.
30805         (attribute_target_specifier, opt_target_specifier): Implement
30806         (CheckAttributeTarget): New method to check if the attribute target
30807         is valid.
30808         (attribute_section): Implement.
30809         (opt_attributes): Implement.
30810
30811         * attribute.cs : New file to handle attributes.
30812         (Attribute): Class to hold attribute info.
30813
30814         * cs-parser.jay (opt_attribute_target_specifier): Remove production
30815         (attribute_section): Modify production to use 2 different rules to 
30816         achieve the same thing. 1 s/r conflict down !
30817         Clean out commented, useless, non-reducing dimension_separator rules.
30818
30819         * class.cs (TypeContainer.attributes): New member to hold list
30820         of attributes for a type.
30821         (Struct::Struct): Modify to take one more argument, the attribute list.
30822         (Class::Class): Ditto.
30823         (Field::Field): Ditto.
30824         (Method::Method): Ditto.
30825         (Property::Property): Ditto.
30826
30827         * cs-parser.jay (struct_declaration): Update constructor call to
30828         pass in the attributes too.
30829         (class_declaration): Ditto.
30830         (constant_declaration): Ditto.
30831         (field_declaration): Ditto.
30832         (method_header): Ditto.
30833         (fixed_parameter): Ditto.
30834         (parameter_array): Ditto.
30835         (property_declaration): Ditto.
30836
30837         * constant.cs (Constant::Constant): Update constructor similarly.
30838         Use System.Collections.
30839
30840         * parameter.cs (Parameter::Parameter): Update as above.
30841
30842 2001-09-02  Ravi Pratap  <ravi@ximian.com>
30843
30844         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
30845         (TypeContainer.delegates): New member to hold list of delegates.
30846
30847         * cs-parser.jay (delegate_declaration): Implement the action correctly 
30848         this time as I seem to be on crack ;-)
30849
30850 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
30851
30852         * rootcontext.cs (RootContext::IsNamespace): new function, used to
30853         tell whether an identifier represents a namespace.
30854
30855         * expression.cs (NamespaceExpr): A namespace expression, used only
30856         temporarly during expression resolution.
30857         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
30858         utility functions to resolve names on expressions.
30859
30860 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
30861
30862         * codegen.cs: Add hook for StatementExpressions. 
30863
30864         * class.cs: Fix inverted test for static flag in methods.
30865
30866 2001-09-02  Ravi Pratap  <ravi@ximian.com>
30867
30868         * class.cs (Operator::CheckUnaryOperator): Correct error number used
30869         to make it coincide with MS' number.
30870         (Operator::CheckBinaryOperator): Ditto.
30871
30872         * ../errors/errors.txt : Remove error numbers added earlier.
30873
30874         * ../errors/cs1019.cs : Test case for error # 1019
30875
30876         * ../errros/cs1020.cs : Test case for error # 1020
30877
30878         * cs-parser.jay : Clean out commented cruft.
30879         (dimension_separators, dimension_separator): Comment out. Ostensibly not
30880         used anywhere - non-reducing rule.
30881         (namespace_declarations): Non-reducing rule - comment out.
30882
30883         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
30884         with TypeContainer::AddEnum.
30885
30886         * delegate.cs : New file for delegate handling classes.
30887         (Delegate): Class for declaring delegates.
30888
30889         * makefile : Update.
30890
30891         * cs-parser.jay (delegate_declaration): Implement.
30892
30893 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
30894
30895         * class.cs (Event::Define): Implement.
30896         (Event.EventBuilder): New member.
30897
30898         * class.cs (TypeContainer::Populate): Update to define all enums and events
30899         we have.
30900         (Events): New property for the events arraylist we hold. Shouldn't we move to using
30901         readonly fields for all these cases ?
30902
30903 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
30904
30905         * class.cs (Property): Revamp to use the convention of making fields readonly.
30906         Accordingly modify code elsewhere.
30907
30908         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
30909         the Define method of the Property class.
30910
30911         * class.cs : Clean up applied patch and update references to variables etc. Fix 
30912         trivial bug.
30913         (TypeContainer::Populate): Update to define all the properties we have. Also
30914         define all enumerations.
30915
30916         * enum.cs (Define): Implement.
30917
30918 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
30919
30920         * cs-parser.jay (overloadable_operator): The semantic value is an
30921         enum of the Operator class.
30922         (operator_declarator): Implement actions.
30923         (operator_declaration): Implement.
30924
30925         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
30926         validity of definitions.
30927         (Operator::CheckBinaryOperator): Static method to check for binary operators
30928         (TypeContainer::AddOperator): New method to add an operator to a type.
30929
30930         * cs-parser.jay (indexer_declaration): Added line to actually call the
30931         AddIndexer method so it gets added ;-)
30932
30933         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
30934         already taken care of by the MS compiler ?  
30935
30936 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
30937
30938         * class.cs (Operator): New class for operator declarations.
30939         (Operator::OpType): Enum for the various operators.
30940
30941 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
30942
30943         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
30944         ostensibly handle this in semantic analysis.
30945
30946         * cs-parser.jay (general_catch_clause): Comment out
30947         (specific_catch_clauses, specific_catch_clause): Ditto.
30948         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
30949         (catch_args, opt_catch_args): New productions.
30950         (catch_clause): Rewrite to use the new productions above
30951         (catch_clauses): Modify accordingly.
30952         (opt_catch_clauses): New production to use in try_statement
30953         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
30954         and re-write the code in the actions to extract the specific and
30955         general catch clauses by being a little smart ;-)
30956
30957         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
30958         Hooray, try and catch statements parse fine !
30959
30960 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
30961
30962         * statement.cs (Block::GetVariableType): Fix logic to extract the type
30963         string from the hashtable of variables.
30964
30965         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
30966         I end up making that mistake ;-)
30967         (catch_clauses): Fixed gross error which made Key and Value of the 
30968         DictionaryEntry the same : $1 !!
30969
30970 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
30971
30972         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
30973
30974         * cs-parser.jay (event_declaration): Correct to remove the semicolon
30975         when the add and remove accessors are specified. 
30976
30977 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
30978
30979         * cs-parser.jay (IndexerDeclaration): New helper class to hold
30980         information about indexer_declarator.
30981         (indexer_declarator): Implement actions.
30982         (parsing_indexer): New local boolean used to keep track of whether
30983         we are parsing indexers or properties. This is necessary because 
30984         implicit_parameters come into picture even for the get accessor in the 
30985         case of an indexer.
30986         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
30987
30988         * class.cs (Indexer): New class for indexer declarations.
30989         (TypeContainer::AddIndexer): New method to add an indexer to a type.
30990         (TypeContainer::indexers): New member to hold list of indexers for the
30991         type.
30992
30993 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
30994
30995         * cs-parser.jay (add_accessor_declaration): Implement action.
30996         (remove_accessor_declaration): Implement action.
30997         (event_accessors_declaration): Implement
30998         (variable_declarators): swap statements for first rule - trivial.
30999
31000         * class.cs (Event): New class to hold information about event
31001         declarations.
31002         (TypeContainer::AddEvent): New method to add an event to a type
31003         (TypeContainer::events): New member to hold list of events.
31004
31005         * cs-parser.jay (event_declaration): Implement actions.
31006
31007 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
31008
31009         * cs-parser.jay (dim_separators): Implement. Make it a string
31010         concatenating all the commas together, just as they appear.
31011         (opt_dim_separators): Modify accordingly
31012         (rank_specifiers): Update accordingly. Basically do the same
31013         thing - instead, collect the brackets here.
31014         (opt_rank_sepcifiers): Modify accordingly.
31015         (array_type): Modify to actually return the complete type string
31016         instead of ignoring the rank_specifiers.
31017         (expression_list): Implement to collect the expressions
31018         (variable_initializer): Implement. We make it a list of expressions
31019         essentially so that we can handle the array_initializer case neatly too.
31020         (variable_initializer_list): Implement.
31021         (array_initializer): Make it a list of variable_initializers
31022         (opt_array_initializer): Modify accordingly.
31023
31024         * expression.cs (New::NType): Add enumeration to help us
31025         keep track of whether we have an object/delegate creation
31026         or an array creation.
31027         (New:NewType, New::Rank, New::Indices, New::Initializers): New
31028         members to hold data about array creation.
31029         (New:New): Modify to update NewType
31030         (New:New): New Overloaded contructor for the array creation
31031         case.
31032
31033         * cs-parser.jay (array_creation_expression): Implement to call
31034         the overloaded New constructor.
31035
31036 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
31037
31038         * class.cs (TypeContainer::Constructors): Return member
31039         constructors instead of returning null.
31040
31041 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
31042
31043         * typemanager.cs (InitCoreTypes): Initialize the various core
31044         types after we have populated the type manager with the user
31045         defined types (this distinction will be important later while
31046         compiling corlib.dll)
31047
31048         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
31049         on Expression Classification.  Now all expressions have a method
31050         `Resolve' and a method `Emit'.
31051
31052         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
31053         generation from working.     Also add some temporary debugging
31054         code. 
31055
31056 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
31057
31058         * codegen.cs: Lots of code generation pieces.  This is only the
31059         beginning, will continue tomorrow with more touches of polish.  We
31060         handle the fundamentals of if, while, do, for, return.  Others are
31061         trickier and I need to start working on invocations soon.
31062
31063         * gen-treedump.cs: Bug fix, use s.Increment here instead of
31064         s.InitStatement. 
31065
31066         * codegen.cs (EmitContext): New struct, used during code
31067         emission to keep a context.   Most of the code generation will be
31068         here. 
31069
31070         * cs-parser.jay: Add embedded blocks to the list of statements of
31071         this block.  So code generation proceeds in a top down fashion.
31072
31073 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
31074
31075         * statement.cs: Add support for multiple child blocks.
31076
31077 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
31078
31079         * codegen.cs (EmitCode): New function, will emit the code for a
31080         Block of code given a TypeContainer and its ILGenerator. 
31081
31082         * statement.cs (Block): Standard public readonly optimization.
31083         (Block::Block constructors): Link children. 
31084         (Block::Child): Child Linker.
31085         (Block::EmitVariables): Emits IL variable declarations.
31086
31087         * class.cs: Drop support for MethodGroups here, delay until
31088         Semantic Analysis.
31089         (Method::): Applied the same simplification that I did before, and
31090         move from Properties to public readonly fields.
31091         (Method::ParameterTypes): Returns the parameter types for the
31092         function, and implements a cache that will be useful later when I
31093         do error checking and the semantic analysis on the methods is
31094         performed.
31095         (Constructor::GetCallingConvention): Renamed from CallingConvetion
31096         and made a method, optional argument tells whether this is a class
31097         or a structure to apply the `has-this' bit.
31098         (Method::GetCallingConvention): Implement, returns the calling
31099         convention. 
31100         (Method::Define): Defines the type, a second pass is performed
31101         later to populate the methods.
31102
31103         (Constructor::ParameterTypes): implement a cache similar to the
31104         one on Method::ParameterTypes, useful later when we do semantic
31105         analysis. 
31106
31107         (TypeContainer::EmitMethod):  New method.  Emits methods.
31108
31109         * expression.cs: Removed MethodGroup class from here.
31110
31111         * parameter.cs (Parameters::GetCallingConvention): new method.
31112
31113 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
31114
31115         * class.cs (TypeContainer::Populate): Drop RootContext from the
31116         argument. 
31117
31118         (Constructor::CallingConvention): Returns the calling convention.
31119         (Constructor::ParameterTypes): Returns the constructor parameter
31120         types. 
31121
31122         (TypeContainer::AddConstructor): Keep track of default constructor
31123         and the default static constructor.
31124
31125         (Constructor::) Another class that starts using `public readonly'
31126         instead of properties. 
31127
31128         (Constructor::IsDefault): Whether this is a default constructor. 
31129
31130         (Field::) use readonly public fields instead of properties also.
31131
31132         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
31133         track of static constructors;  If none is used, turn on
31134         BeforeFieldInit in the TypeAttributes. 
31135
31136         * cs-parser.jay (opt_argument_list): now the return can be null
31137         for the cases where there are no arguments. 
31138
31139         (constructor_declarator): If there is no implicit `base' or
31140         `this', then invoke the default parent constructor. 
31141
31142         * modifiers.cs (MethodAttr): New static function maps a set of
31143         modifiers flags into a MethodAttributes enum
31144         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
31145         MethodAttr, TypeAttr to represent the various mappings where the
31146         modifiers are used.
31147         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
31148
31149 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
31150
31151         * parameter.cs (GetParameterInfo): Fix bug where there would be no
31152         method arguments.
31153
31154         * interface.cs (PopulateIndexer): Implemented the code generator
31155         for interface indexers.
31156
31157 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
31158
31159         * interface.cs (InterfaceMemberBase): Now we track the new status
31160         here.  
31161
31162         (PopulateProperty): Implement property population.  Woohoo!  Got
31163         Methods and Properties going today. 
31164
31165         Removed all the properties for interfaces, and replaced them with
31166         `public readonly' fields. 
31167
31168 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
31169
31170         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
31171         initialize their hashtables/arraylists only when they are needed
31172         instead of doing this always.
31173
31174         * parameter.cs: Handle refs and out parameters.
31175
31176         * cs-parser.jay: Use an ArrayList to construct the arguments
31177         instead of the ParameterCollection, and then cast that to a
31178         Parameter[] array.
31179
31180         * parameter.cs: Drop the use of ParameterCollection and use
31181         instead arrays of Parameters.
31182
31183         (GetParameterInfo): Use the Type, not the Name when resolving
31184         types. 
31185
31186 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
31187
31188         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
31189         and instead use public readonly fields.
31190
31191         * class.cs: Put back walking code for type containers.
31192
31193 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
31194
31195         * class.cs (MakeConstant): Code to define constants.
31196
31197         * rootcontext.cs (LookupType): New function.  Used to locate types 
31198
31199
31200 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
31201
31202         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
31203         this System.Reflection code is.  Kudos to Microsoft
31204
31205         * typemanager.cs: Implement a type cache and avoid loading all
31206         types at boot time.  Wrap in LookupType the internals.  This made
31207         the compiler so much faster.  Wow.  I rule!
31208
31209         * driver.cs: Make sure we always load mscorlib first (for
31210         debugging purposes, nothing really important).
31211
31212         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
31213         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
31214
31215         * rootcontext.cs: Lookup types on their namespace;  Lookup types
31216         on namespaces that have been imported using the `using' keyword.
31217
31218         * class.cs (TypeContainer::TypeAttr): Virtualize.
31219         (Class::TypeAttr): Return attributes suitable for this bad boy.
31220         (Struct::TypeAttr): ditto.
31221         Handle nested classes.
31222         (TypeContainer::) Remove all the type visiting code, it is now
31223         replaced with the rootcontext.cs code
31224
31225         * rootcontext.cs (GetClassBases): Added support for structs. 
31226
31227 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
31228
31229         * interface.cs, statement.cs, class.cs, parameter.cs,
31230         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
31231         Drop use of TypeRefs, and use strings instead.
31232
31233 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
31234
31235         * rootcontext.cs: 
31236
31237         * class.cs (Struct::Struct): set the SEALED flags after
31238         checking the modifiers.
31239         (TypeContainer::TypeAttr): new property, returns the
31240         TypeAttributes for a class.  
31241
31242         * cs-parser.jay (type_list): Oops, list production was creating a
31243         new list of base types.
31244
31245         * rootcontext.cs (StdLib): New property.
31246         (GetInterfaceTypeByName): returns an interface by type name, and
31247         encapsulates error handling here.
31248         (GetInterfaces): simplified.
31249         (ResolveTree): Encapsulated all the tree resolution here.
31250         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
31251         types. 
31252
31253         * driver.cs: Add support for --nostdlib, to avoid loading the
31254         default assemblies.
31255         (Main): Do not put tree resolution here. 
31256
31257         * rootcontext.cs: Beginning of the class resolution.
31258
31259 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
31260
31261         * rootcontext.cs: Provide better error reporting. 
31262
31263         * cs-parser.jay (interface_base): set our $$ to be interfaces.
31264
31265         * rootcontext.cs (CreateInterface): Handle the case where there
31266         are no parent interfaces.
31267
31268         (CloseTypes): Routine to flush types at the end.
31269         (CreateInterface): Track types.
31270         (GetInterfaces): Returns an array of Types from the list of
31271         defined interfaces.
31272
31273         * typemanager.c (AddUserType): Mechanism to track user types (puts
31274         the type on the global type hash, and allows us to close it at the
31275         end). 
31276
31277 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
31278
31279         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
31280         RecordInterface instead.
31281
31282         * cs-parser.jay: Updated to reflect changes above.
31283
31284         * decl.cs (Definition): Keep track of the TypeBuilder type that
31285         represents this type here.  Not sure we will use it in the long
31286         run, but wont hurt for now.
31287
31288         * driver.cs: Smaller changes to accomodate the new code.
31289
31290         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
31291         when done. 
31292
31293         * rootcontext.cs (CreateInterface):  New method, used to create
31294         the System.TypeBuilder type for interfaces.
31295         (ResolveInterfaces): new entry point to resolve the interface
31296         hierarchy. 
31297         (CodeGen): Property, used to keep track of the code generator.
31298
31299 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
31300
31301         * cs-parser.jay: Add a second production for delegate_declaration
31302         with `VOID'.
31303
31304         (enum_body): Put an opt_comma here instead of putting it on
31305         enum_body or enum_member_declarations so we can handle trailing
31306         commas on enumeration members.  Gets rid of a shift/reduce.
31307
31308         (type_list): Need a COMMA in the middle.
31309
31310         (indexer_declaration): Tell tokenizer to recognize get/set
31311
31312         * Remove old targets.
31313
31314         * Re-add the parser target.
31315
31316 2001-07-13  Simon Cozens <simon@simon-cozens.org>
31317
31318         * cs-parser.jay: Add precendence rules for a number of operators
31319         ot reduce the number of shift/reduce conflicts in the grammar.
31320
31321 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
31322
31323         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
31324         and put it here.
31325
31326         Get rid of old crufty code.
31327
31328         * rootcontext.cs: Use this to keep track of the parsed
31329         representation and the defined types available to the program. 
31330
31331         * gen-treedump.cs: adjust for new convention.
31332
31333         * type.cs: Split out the type manager, and the assembly builder
31334         from here. 
31335
31336         * typemanager.cs: the type manager will live here now.
31337
31338         * cil-codegen.cs: And the code generator here. 
31339
31340 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
31341
31342         * makefile: Fixed up for easy making.
31343
31344 2001-07-13  Simon Cozens <simon@simon-cozens.org>
31345
31346         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
31347         the 
31348
31349         (unary_expression): Expand pre_increment_expression and
31350         post_decrement_expression to reduce a shift/reduce.
31351
31352 2001-07-11  Simon Cozens
31353
31354         * cs-tokenizer.cs: Hex numbers should begin with a 0.
31355
31356         Improve allow_keyword_as_indent name.
31357
31358 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
31359
31360         * Adjustments for Beta2. 
31361
31362 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
31363
31364         * decl.cs: Added `Define' abstract method.
31365         (InTransit): new property, used to catch recursive definitions. 
31366
31367         * interface.cs: Implement `Define'. 
31368
31369         * modifiers.cs: Map Modifiers.constants to
31370         System.Reflection.TypeAttribute flags.
31371
31372         * class.cs: Keep track of types and user-defined types.
31373         (BuilderInit): New method for creating an assembly
31374         (ResolveType): New function to launch the resolution process, only
31375         used by interfaces for now.
31376
31377         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
31378         that are inserted into the name space. 
31379
31380 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
31381
31382         * ARGH.  I have screwed up my tree so many times due to the use of
31383         rsync rather than using CVS.  Going to fix this at once. 
31384
31385         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
31386         load types.
31387
31388 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
31389
31390         * Experiment successful: Use System.Type rather that our own
31391         version of Type.  
31392
31393 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
31394
31395         * cs-parser.jay: Removed nsAliases from here.
31396
31397         Use new namespaces, handle `using XXX;' 
31398
31399         * namespace.cs: Reimplemented namespace handling, use a recursive
31400         definition of the class.  Now we can keep track of using clauses
31401         and catch invalid using clauses.
31402
31403 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
31404
31405         * gen-treedump.cs: Adapted for all the renaming.
31406
31407         * expression.cs (Expression): this class now has a Type property
31408         which returns an expression Type.
31409
31410         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
31411         `Type', as this has a different meaning now in the base
31412
31413 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
31414
31415         * interface.cs, class.cs: Removed from all the sources the
31416         references to signature computation, as we can not do method
31417         signature computation during the parsing time, as we are not
31418         trying to solve at that point distinguishing:
31419
31420         class X {
31421                 void a (Blah x) {}
31422                 void a (NS.Blah x) {}
31423         }
31424
31425         Which depending on the context might be valid or not, as we do not
31426         know if Blah is the same thing as NS.Blah at that point.
31427
31428         * Redid everything so the code uses TypeRefs now instead of
31429         Types.  TypeRefs are just temporary type placeholders, that need
31430         to be resolved.  They initially have a pointer to a string and the
31431         current scope in which they are used.  This is used later by the
31432         compiler to resolve the reference to an actual Type. 
31433
31434         * DeclSpace is no longer a CIR.Type, and neither are
31435         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
31436         are all DeclSpaces, but no Types. 
31437
31438         * type.cs (TypeRefManager): This implements the TypeRef manager,
31439         which keeps track of all the types that need to be resolved after
31440         the parsing has finished. 
31441
31442 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
31443
31444         * ARGH.  We are going to have to store `foreach' as a class rather
31445         than resolving it, as we need to verify error 1579 after name
31446         resolution.   *OR* we could keep a flag that says `This request to
31447         IEnumerator comes from a foreach statement' which we can then use
31448         to generate the error.
31449
31450 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
31451
31452         * class.cs (TypeContainer.AddMethod): we now add methods to the
31453         MethodGroup instead of the method hashtable.  
31454
31455         * expression.cs: Add MethodGroup abstraction, which gets us one
31456         step closer to the specification in the way we handle method
31457         declarations.  
31458
31459         * cs-parser.jay (primary_expression): qualified_identifier now
31460         tried to match up an identifier to a local variable reference or
31461         to a parameter reference.
31462
31463         current_local_parameters is now a parser global variable that
31464         points to the current parameters for the block, used during name
31465         lookup.
31466
31467         (property_declaration): Now creates an implicit `value' argument to
31468         the set accessor.
31469
31470 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
31471
31472         * parameter.cs: Do not use `param' arguments as part of the
31473         signature, per the spec.
31474
31475 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
31476
31477         * decl.cs: Base class for classes, structs and interfaces.  This
31478         is the "Declaration Space" 
31479
31480         * cs-parser.jay: Use CheckDef for checking declaration errors
31481         instead of having one on each function.
31482
31483         * class.cs: Factor out some code for handling error handling in
31484         accordance to the "Declarations" section in the "Basic Concepts"
31485         chapter in the ECMA C# spec.
31486
31487         * interface.cs: Make all interface member classes derive from
31488         InterfaceMemberBase.
31489
31490 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
31491
31492         * Many things: all interfaces are parsed and generated in
31493         gen-treedump.  Support for member variables, constructors,
31494         destructors, properties, constants is there.
31495
31496         Beginning of the IL backend, but very little done, just there for
31497         testing purposes. 
31498
31499 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
31500
31501         * cs-parser.jay: Fix labeled statement.
31502
31503         * cs-tokenizer.cs (escape): Escape " and ' always.
31504         ref_line, ref_name: keep track of the line/filename as instructed
31505         by #line by the compiler.
31506         Parse #line.
31507
31508 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
31509
31510         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
31511         to match the values in System.CodeDOM.
31512
31513         Divid renamed to Divide.
31514
31515         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
31516         statements. 
31517         (Statements.set): remove.
31518
31519         * System.CodeDOM/CodeCatchClause.cs: always have a valid
31520         statements. 
31521
31522         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
31523         falseStatements always have valid values. 
31524
31525         * cs-parser.jay: Use System.CodeDOM now.
31526